1 # Makefile for the open-source release of adventure 2.5
8 UNAME_S := $(shell uname -s)
9 ifeq ($(UNAME_S),Linux)
13 OBJS=main.o init.o actions1.o actions2.o score.o misc.o
14 SOURCES=$(OBJS:.o=.c) dungeon.c advent.h funcs.h sizes.h adventure.text Makefile control
17 $(CC) $(CCFLAGS) $(DBX) -c $<
19 advent: $(OBJS) database.o
20 $(CC) $(CCFLAGS) $(DBX) -o advent $(OBJS) database.o $(LDFLAGS) $(LIBS)
22 main.o: advent.h funcs.h database.h sizes.h
24 init.o: advent.h funcs.h database.h sizes.h
26 actions1.o: advent.h funcs.h database.h sizes.h
28 actions2.o: advent.h funcs.h database.h sizes.h
30 score.o: advent.h database.h sizes.h
32 misc.o: advent.h database.h sizes.h
34 database.o: database.h sizes.h
37 $(CC) $(CCFLAGS) -o $@ $<
39 database.c database.h: dungeon adventure.text
41 $(CC) $(CCFLAGS) $(DBX) -c database.c
44 rm -f *.o advent *.html database.[ch] dungeon *.gcno *.gcda
45 rm -f README advent.6 MANIFEST *.tar.gz
46 cd tests; $(MAKE) --quiet clean
49 cd tests; $(MAKE) --quiet
51 .SUFFIXES: .adoc .html .6
53 # Requires asciidoc and xsltproc/docbook stylesheets.
55 a2x --doctype manpage --format manpage $<
61 html: advent.html history.html hints.html
63 # README.adoc exists because that filename is magic on GitLab.
64 DOCS=COPYING NEWS README.adoc TODO advent.adoc history.adoc hints.adoc advent.6
66 # Can't use GNU tar's --transform, needs to build under Alpine Linux.
67 # This is a requirement for testing dist in GitLab's CI pipeline
68 advent-$(VERS).tar.gz: $(SOURCES) $(DOCS)
69 @find $(SOURCES) $(DOCS) tests -print | sed s:^:advent-$(VERS)/: >MANIFEST
70 @(ln -s . advent-$(VERS))
71 (tar -T MANIFEST -czvf advent-$(VERS).tar.gz)
74 release: advent-$(VERS).tar.gz advent.html history.html hints.html
75 shipper version=$(VERS) | sh -e -x
78 shipper -N -w version=$(VERS) | sh -e -x
80 dist: advent-$(VERS).tar.gz
82 debug: CCFLAGS += -O0 --coverage