ee64309476aa2d2d30337533b7526f86dc1bcfd8
[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 control Makefile wumpus.c superhack.c wumpus.xml wumpus.png
30
31 install: wumpus superhack wumpus.6
32         mkdir -p $(prefix)/bin
33         mkdir -p $(prefix)/share/man/man6
34         cp wumpus superhack $(prefix)/bin/
35         cp wumpus.6 $(prefix)/share/man/man6/
36
37 uninstall:
38         rm $(prefix)/bin/wumpus $(prefix)/bin/superhack
39         rm $(prefix)/share/man/man6/wumpus.6
40
41 CPPCHECKOPTS =
42 cppcheck:
43         cppcheck -DREVISION=$(VERS) $(CPPCHECKOPTS) wumpus.c
44         cppcheck -DREVISION=$(VERS) $(CPPCHECKOPTS) superhack.c
45
46 wumpus-$(VERS).tar.gz: $(SOURCES) wumpus.6
47         @ls $(SOURCES) wumpus.6 | sed s:^:wumpus-$(VERS)/: >MANIFEST
48         @(cd ..; ln -s wumpus wumpus-$(VERS))
49         (cd ..; tar -czf wumpus/wumpus-$(VERS).tar.gz `cat wumpus/MANIFEST`)
50         @(cd ..; rm wumpus-$(VERS))
51
52 dist: wumpus-$(VERS).tar.gz
53
54 release: wumpus-$(VERS).tar.gz wumpus.html
55         shipper version=$(VERS) | sh -e -x
56
57 refresh: wumpus.html
58         shipper -N -w version=$(VERS) | sh -e -x