X-Git-Url: https://pd.if.org/git/?p=hexagon;a=blobdiff_plain;f=Makefile;h=0ae921c540ddc748e989189455ec4ea0954ee5d6;hp=545d6f4d44d2f652fcae10d8d3769ad8d2add25f;hb=ce4fd67e5bfd07192ca5cb357798aaa3588512e4;hpb=5c48a06bc8649958e69013c53e925b83398ebc74 diff --git a/Makefile b/Makefile index 545d6f4..0ae921c 100644 --- a/Makefile +++ b/Makefile @@ -4,29 +4,37 @@ LDFLAGS= $(ARCH) -lm CFLAGS= -Wall -Wno-parentheses $(ARCH) -I. -I.. -OBJS= hexmap.o astar.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 testfiles clean: - rm -f $(OBJS) libhexmap.a $(TESTS) + rm -f $(OBJS) libhexagon.a $(TESTS) -t/%.t: t/%.o t/tap.o $(OBJS) +t/%.t: t/%.o t/ctap.o $(OBJS) $(CC) -I.. -I. -o $@ $+ $(LDFLAGS) -test: $(TESTS) - @prove --exec '' 2>/dev/null +testfiles: $(TESTS) -hextest: hextest.c libhexmap.a - $(CC) $(CFLAGS) -o $@ hextest.c -L. -lhexmap +test: libhexagon.a $(TESTS) + @prove --exec $(TESTS) '' 2>/dev/null -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 $@ $<