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 database.o
14 SOURCES=$(OBJS:.o=.c) compile.c advent.h funcs.h adventure.text Makefile control
17 $(CC) $(CCFLAGS) $(DBX) -c $<
19 advent: $(OBJS) database.o
20 $(CC) $(CCFLAGS) $(DBX) -o advent $(OBJS) $(LDFLAGS) $(LIBS)
22 main.o: advent.h funcs.h database.h
24 init.o: advent.h funcs.h database.h
26 actions1.o: advent.h funcs.h database.h
28 actions2.o: advent.h funcs.h
30 score.o: advent.h database.h
32 misc.o: advent.h database.h
34 database.o: database.h
39 $(CC) $(CCFLAGS) -o $@ $<
41 database.c database.h: compile adventure.text
43 $(CC) $(CCFLAGS) $(DBX) -c database.c
45 html: index.html advent.html history.html hints.html
48 rm -f *.o advent *.html database.[ch] compile *.gcno *.gcda
50 cd tests; $(MAKE) --quiet clean
53 cd tests; $(MAKE) --quiet
55 .SUFFIXES: .adoc .html .6
57 # Requires asciidoc and xsltproc/docbook stylesheets.
59 a2x --doctype manpage --format manpage $<
65 # README.adoc exists because that filename is magic on GitLab.
66 DOCS=COPYING NEWS README.adoc TODO \
67 advent.adoc history.adoc index.adoc hints.adoc advent.6
69 advent-$(VERS).tar.gz: $(SOURCES) $(DOCS)
70 tar --transform='s:^:advent-$(VERS)/:' --show-transformed-names -cvzf advent-$(VERS).tar.gz $(SOURCES) $(DOCS)
72 dist: advent-$(VERS).tar.gz
74 debug: CCFLAGS += -O0 --coverage