X-Git-Url: https://pd.if.org/git/?p=hexagon;a=blobdiff_plain;f=Makefile;h=e0789e5ba9888d6286f8dec34dfd107911e8f0f1;hp=20f36fcc9bef418facf5aa03cc2cec85fee79fb1;hb=31d02c77ec523a535baa29086f5ed7ff67f3002f;hpb=8f632e5a3428101590e8cbe94025060c5c3b5ecf diff --git a/Makefile b/Makefile index 20f36fc..e0789e5 100644 --- a/Makefile +++ b/Makefile @@ -4,29 +4,35 @@ LDFLAGS= $(ARCH) -lm CFLAGS= -Wall -Wno-parentheses $(ARCH) -I. -I.. -OBJS= hexmap.o +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/gridsize.t t/center.t t/astar.t +PREFIX=/usr/local -all: test libhexmap.a +all: libhexagon.a docs clean: - rm -f $(OBJS) libhexmap.a $(TESTS) + rm -f $(OBJS) libhexagon.a $(TESTS) t/%.t: t/%.o t/tap.o $(OBJS) $(CC) -I.. -I. -o $@ $+ $(LDFLAGS) -test: $(TESTS) +test: libhexagon.a $(TESTS) @prove --exec '' 2>/dev/null -hextest: hextest.c libhexmap.a - $(CC) $(CFLAGS) -o $@ hextest.c -L. -lhexmap - -libhexmap.a: $(OBJS) +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 $@ $<