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