Repair dist slightly broken by previous commit.
[open-adventure.git] / Makefile
1 # Makefile for the open-source release of adventure 2.5
2
3 CC?=gcc
4 CCFLAGS=-std=c99
5 LIBS=
6 UNAME_S := $(shell uname -s)
7 ifeq ($(UNAME_S),Linux)
8         LIBS=-lrt
9 endif
10
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
14
15 .c.o:
16         $(CC) $(CCFLAGS) $(DBX) -c $<
17
18 advent: $(OBJS) database.o
19         $(CC) $(CCFLAGS) $(DBX) -o advent $(OBJS) $(LIBS)
20
21 main.o:         advent.h funcs.h database.h
22
23 init.o:         advent.h funcs.h database.h
24
25 actions1.o:     advent.h funcs.h database.h
26
27 actions2.o:     advent.h funcs.h
28
29 score.o:        advent.h database.h
30
31 misc.o:         advent.h database.h
32
33 database.o:     database.h
34
35 funcs.h:        database.h
36
37 compile: compile.c
38         $(CC) $(CCFLAGS) -o $@ $<
39
40 database.c database.h: compile adventure.text
41         ./compile
42         $(CC) $(CCFLAGS) $(DBX) -c database.c
43
44 html: index.html advent.html history.html hints.html
45
46 clean:
47         rm -f *.o advent *.html advent.6 database.[ch] compile *.gcno *.gcda
48         cd tests; $(MAKE) --quiet clean
49
50 check: advent
51         cd tests; $(MAKE) --quiet
52
53 .SUFFIXES: .adoc .html
54
55 # Requires asciidoc and xsltproc/docbook stylesheets.
56 .adoc.6: advent.adoc
57         a2x --doctype manpage --format manpage $<
58 .adoc.html: advent.adoc
59         asciidoc $<
60
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
63
64 dist: advent-$(VERS).tar.gz
65
66 release: advent-$(VERS).tar.gz advent.html
67         shipper version=$(VERS) | sh -e -x
68
69 refresh: advent.html
70         shipper -N -w version=$(VERS) | sh -e -x
71
72 debug: CCFLAGS += -O0 --coverage
73 debug: advent