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 SHIPPER.*
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
37 wumpus-$(VERS).tar.gz: $(SOURCES) wumpus.6
38 @ls $(SOURCES) wumpus.6 | sed s:^:wumpus-$(VERS)/: >MANIFEST
39 @(cd ..; ln -s wumpus wumpus-$(VERS))
40 (cd ..; tar -czf wumpus/wumpus-$(VERS).tar.gz `cat wumpus/MANIFEST`)
41 @(cd ..; rm wumpus-$(VERS))
43 dist: wumpus-$(VERS).tar.gz
45 release: wumpus-$(VERS).tar.gz wumpus.html
46 shipper -u -m -t; make clean