Template a web page.
[wumpus.git] / Makefile
1 #
2 # Makefile for `Hunt the Wumpus' and `Superhack' games
3 #
4 VERS=$(shell sed <wumpus.spec -n -e '/Version: \(.*\)/s//\1/p')
5
6 all: wumpus superhack
7
8 wumpus: wumpus.c
9         $(CC) $(CFLAGS) wumpus.c -o wumpus
10
11 superhack: superhack.c
12         $(CC) $(CFLAGS) superhack.c -o superhack
13
14 clean:
15         rm -f wumpus wumpus.o superhack superhack.o TAGS 
16         rm -f *~ *.1 *.html *.tar.gz MANIFEST
17
18 TAGS:
19         etags wumpus.c
20
21 wumpus.6: wumpus.xml
22         xmlto man wumpus.xml 
23
24 wumpus.html: wumpus.xml
25         xmlto html-nochunks wumpus.xml 
26
27 SOURCES = README COPYING Makefile wumpus.c superhack.c wumpus.xml wumpus.spec
28
29 install: wumpus.6
30         cp wumpus superhack /usr/bin/
31         cp wumpus.6 /usr/share/man/man6/
32
33 uninstall:
34         rm /usr/bin/wumpus /usr/bin/superhack
35         rm /usr/share/man/man6/wumpus.6
36
37 CPPCHECKOPTS =
38 cppcheck:
39         cppcheck -DREVISION=$(VERS) $(CPPCHECKOPTS) wumpus.c
40         cppcheck -DREVISION=$(VERS) $(CPPCHECKOPTS) superhack.c
41
42 wumpus-$(VERS).tar.gz: $(SOURCES) wumpus.6
43         @ls $(SOURCES) wumpus.6 | sed s:^:wumpus-$(VERS)/: >MANIFEST
44         @(cd ..; ln -s wumpus wumpus-$(VERS))
45         (cd ..; tar -czf wumpus/wumpus-$(VERS).tar.gz `cat wumpus/MANIFEST`)
46         @(cd ..; rm wumpus-$(VERS))
47
48 dist: wumpus-$(VERS).tar.gz
49
50 release: wumpus-$(VERS).tar.gz wumpus.html
51         shipper version=$(VERS) | sh -e -x