1 # Makefile for the open-source release of adventure 2.5
6 UNAME_S := $(shell uname -s)
7 ifeq ($(UNAME_S),Linux)
11 OBJS=main.o init.o actions1.o actions2.o score.o misc.o database.o
12 DOCS=COPYING NEWS README.adoc TODO advent.adoc history.adoc index.adoc hints.adoc
13 SOURCES=$(OBJS:.o=.c) compile.c advent.h database.h funcs.h adventure.text $(DOCS) Makefile control
16 $(CC) $(CCFLAGS) $(DBX) -c $<
18 advent: $(OBJS) database.o
19 $(CC) $(CCFLAGS) $(DBX) -o advent $(OBJS) $(LDFLAGS) $(LIBS)
21 main.o: advent.h funcs.h database.h
23 init.o: advent.h funcs.h database.h
25 actions1.o: advent.h funcs.h database.h
27 actions2.o: advent.h funcs.h
29 score.o: advent.h database.h
31 misc.o: advent.h database.h
33 database.o: database.h
38 $(CC) $(CCFLAGS) -o $@ $<
40 database.c database.h: compile adventure.text
42 $(CC) $(CCFLAGS) $(DBX) -c database.c
44 html: index.html advent.html history.html hints.html
47 rm -f *.o advent *.html advent.6 database.[ch] compile *.gcno *.gcda
48 cd tests; $(MAKE) --quiet clean
51 cd tests; $(MAKE) --quiet
53 .SUFFIXES: .adoc .html
55 # Requires asciidoc and xsltproc/docbook stylesheets.
57 a2x --doctype manpage --format manpage $<
58 .adoc.html: advent.adoc
61 advent-$(VERS).tar.gz: $(SOURCES) advent.6
62 tar --transform='s:^:advent-$(VERS)/:' --show-transformed-names -cvzf advent-$(VERS).tar.gz $(SOURCES) advent.6
64 dist: advent-$(VERS).tar.gz
66 release: advent-$(VERS).tar.gz advent.html
67 shipper version=$(VERS) | sh -e -x
70 shipper -N -w version=$(VERS) | sh -e -x
72 debug: CCFLAGS += -O0 --coverage