# set ARCH in your environment if you want to do a multible architecture # build. This means you Mac users. # ARCH= -arch x386 -arch x86_64 LDFLAGS= $(ARCH) -lm CFLAGS= -Wall -Wno-parentheses $(ARCH) -I. -I.. OBJS= hexagon.o astar.o SRC=$(OBJS:.o=.c) TESTS= t/cantor.t t/distance.t t/adjacency.t t/range.t t/hexbin.t \ t/gridsize.t t/center.t t/astar.t PREFIX=/usr/local all: libhexagon.a docs clean: rm -f $(OBJS) libhexagon.a $(TESTS) t/%.t: t/%.o t/tap.o $(OBJS) $(CC) -I.. -I. -o $@ $+ $(LDFLAGS) test: libhexagon.a $(TESTS) @prove --exec '' 2>/dev/null libhexagon.a: $(OBJS) ar r $@ $+ ranlib $@ install: libhexagon.a hexagon.h doc/hexagon.3 cp libhexagon.a $(PREFIX)/lib cp hexagon.h $(PREFIX)/include cp doc/hexagon.3 $(PREFIX)/share/man/man3 docs: make -C doc .c.o: $(CC) $(CFLAGS) -c -o $@ $< .SUFFIXES: .c .h