2 # Makefile for `Hunt the Wumpus' and `Superhack' games
4 VERS=$(shell sed <wumpus.spec -n -e '/Version: \(.*\)/s//\1/p')
9 $(CC) $(CFLAGS) wumpus.c -o wumpus
11 superhack: superhack.c
12 $(CC) $(CFLAGS) superhack.c -o superhack
15 rm -f wumpus wumpus.o superhack superhack.o TAGS
16 rm -f *~ *.1 *.html *.tar.gz MANIFEST
24 wumpus.html: wumpus.xml
25 xmlto html-nochunks wumpus.xml
27 SOURCES = README COPYING Makefile wumpus.c superhack.c wumpus.xml wumpus.spec
30 cp wumpus superhack /usr/bin/
31 cp wumpus.6 /usr/share/man/man6/
34 rm /usr/bin/wumpus /usr/bin/superhack
35 rm /usr/share/man/man6/wumpus.6
39 cppcheck -DREVISION=$(VERS) $(CPPCHECKOPTS) wumpus.c
40 cppcheck -DREVISION=$(VERS) $(CPPCHECKOPTS) superhack.c
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))
48 dist: wumpus-$(VERS).tar.gz
50 release: wumpus-$(VERS).tar.gz wumpus.html
51 shipper version=$(VERS) | sh -e -x