1 # Makefile for the open-source release of adventure 2.5
4 CCFLAGS=-O2 -std=c99 -Wall -Wextra -Wpedantic -fstack-protector -fstack-protector-all -pipe -mtune=native
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 SOURCES=$(OBJS:.o=.c) COPYING NEWS README TODO adventure.text advent.text control misc.h main.h share.h funcs.h
15 $(CC) $(CCFLAGS) -O $(DBX) -c $<
17 advent: $(OBJS) database.o
18 $(CC) $(CCFLAGS) -O $(DBX) -o advent $(OBJS) $(LIBS)
20 main.o: main.h misc.h funcs.h database.h
22 init.o: misc.h main.h share.h funcs.h database.h
24 actions1.o: misc.h main.h share.h funcs.h database.h
26 actions2.o: misc.h main.h share.h funcs.h
28 score.o: misc.h main.h share.h database.h
30 misc.o: misc.h main.h database.h
32 database.o: database.h
37 $(CC) $(CCFLAGS) -o $@ $<
39 database.c database.h: compile adventure.text
41 $(CC) $(CCFLAGS) -O $(DBX) -c database.c
44 rm -f *.o advent advent.html advent.6 database.[ch] compile
45 cd tests; $(MAKE) --quiet clean
48 cd tests; $(MAKE) --quiet
50 # Requires asciidoc and xsltproc/docbook stylesheets.
52 a2x --doctype manpage --format manpage $<
54 a2x --doctype manpage --format xhtml -D . $<
57 advent-$(VERS).tar.gz: $(SOURCES) advent.6
58 tar --transform='s:^:advent-$(VERS)/:' --show-transformed-names -cvzf advent-$(VERS).tar.gz $(SOURCES) advent.6
60 dist: advent-$(VERS).tar.gz
62 release: advent-$(VERS).tar.gz advent.html
63 shipper version=$(VERS) | sh -e -x
66 shipper -N -w version=$(VERS) | sh -e -x