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