Create website iindex and hints pages.
[open-adventure.git] / Makefile
1 # Makefile for the open-source release of adventure 2.5
2
3 CC?=gcc
4 CCFLAGS=-std=c99 -O0 --coverage
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 TODO advent.adoc history.adoc index.adoc hints.adoc
13 SOURCES=$(OBJS:.o=.c) advent.h funcs.h adventure.text $(DOCS) 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 clean:
45         rm -f *.o advent *.html advent.6 database.[ch] compile *.gcno *.gcda
46         cd tests; $(MAKE) --quiet clean
47
48 check: advent
49         cd tests; $(MAKE) --quiet
50
51 # Requires asciidoc and xsltproc/docbook stylesheets.
52 .asc.6: advent.adoc
53         a2x --doctype manpage --format manpage $<
54 .asc.html: advent.adoc
55         a2x --doctype manpage --format xhtml -D . $<
56         rm -f docbook-xsl.css
57
58 advent-$(VERS).tar.gz: $(SOURCES) advent.6
59         tar --transform='s:^:advent-$(VERS)/:' --show-transformed-names -cvzf advent-$(VERS).tar.gz $(SOURCES) advent.6
60
61 dist: advent-$(VERS).tar.gz
62
63 release: advent-$(VERS).tar.gz advent.html
64         shipper version=$(VERS) | sh -e -x
65
66 refresh: advent.html
67         shipper -N -w version=$(VERS) | sh -e -x