Add a missing dependency.
[open-adventure.git] / Makefile
1 # Makefile for the open-source release of adventure 2.5
2
3 CCFLAGS=-std=c99
4 LIBS=-lrt
5 UNAME_S := $(shell uname -s)
6 GCCVERSIONGTEQ4 := $(shell expr `gcc -dumpversion | cut -f1 -d.` \>= 4)
7 ifeq ($(UNAME_S),Darwin)
8         LIBS=
9 else ifeq "$(GCCVERSIONGTEQ4)" "1"
10         CC=c99
11 endif
12
13 OBJS=main.o init.o actions1.o actions2.o score.o misc.o
14 SOURCES=$(OBJS:.o=.c) COPYING NEWS README TODO adventure.text advent.text control misc.h main.h share.h funcs.h
15
16 .c.o:
17         $(CC) $(CCFLAGS) -O $(DBX) -c $<
18
19 advent: $(OBJS) database.o
20         $(CC) $(CCFLAGS) -O $(DBX) -o advent $(OBJS) database.o $(LIBS)
21
22 main.o:         main.h misc.h funcs.h database.h
23
24 init.o:         misc.h main.h share.h funcs.h database.h
25
26 actions1.o:     misc.h main.h share.h funcs.h database.h
27
28 actions2.o:     misc.h main.h share.h funcs.h
29
30 score.o:        misc.h main.h share.h database.h
31
32 misc.o:         misc.h main.h database.h
33
34 database.c database.h: compile adventure.text
35         ./compile
36         $(CC) $(CCFLAGS) -O $(DBX) -c database.c
37
38 clean:
39         rm -f *.o advent advent.html advent.6 database.[ch] compile
40         cd tests; $(MAKE) --quiet clean
41
42 check: advent
43         cd tests; $(MAKE) --quiet
44
45 # Requires asciidoc and xsltproc/docbook stylesheets.
46 .asc.6:
47         a2x --doctype manpage --format manpage $<
48 .asc.html:
49         a2x --doctype manpage --format xhtml -D . $<
50         rm -f docbook-xsl.css
51
52 advent-$(VERS).tar.gz: $(SOURCES) advent.6
53         tar --transform='s:^:advent-$(VERS)/:' --show-transformed-names -cvzf advent-$(VERS).tar.gz $(SOURCES) advent.6
54
55 dist: advent-$(VERS).tar.gz
56
57 release: advent-$(VERS).tar.gz advent.html
58         shipper version=$(VERS) | sh -e -x
59
60 refresh: advent.html
61         shipper -N -w version=$(VERS) | sh -e -x