]> pd.if.org Git - hexagon/blob - Makefile
renamed library to hexagon
[hexagon] / Makefile
1 # set ARCH in your environment if you want to do a multible architecture
2 # build.  This means you Mac users.
3 # ARCH= -arch x386 -arch x86_64
4
5 LDFLAGS= $(ARCH) -lm
6 CFLAGS= -Wall -Wno-parentheses $(ARCH) -I. -I..
7 OBJS= hexagon.o astar.o
8 SRC=$(OBJS:.o=.c)
9 TESTS= t/cantor.t t/distance.t t/adjacency.t t/range.t t/hexbin.t \
10        t/gridsize.t t/center.t t/astar.t
11
12 all:    test libhexagon.a docs
13
14 clean:
15         rm -f $(OBJS) libhexagon.a $(TESTS)
16
17 t/%.t:  t/%.o t/tap.o $(OBJS)
18         $(CC) -I.. -I. -o $@ $+ $(LDFLAGS)
19
20 test:   $(TESTS)
21         @prove --exec '' 2>/dev/null
22
23 libhexagon.a:   $(OBJS)
24         ar r $@ $+
25         ranlib $@
26
27 docs:
28         make -C doc
29
30 .c.o:
31         $(CC) $(CFLAGS) -c -o $@ $<
32
33 .SUFFIXES:      .c .h