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
23 SOURCES = README Makefile wumpus.c superhack.c wumpus.xml wumpus.spec
26 cp wumpus superhack /usr/bin/
27 cp wumpus.6 /usr/share/man/man6/
30 rm /usr/bin/wumpus /usr/bin/superhack
31 rm /usr/share/man/man6/wumpus.6
33 wumpus-$(VERS).tar.gz: $(SOURCES) wumpus.6
34 @ls $(SOURCES) wumpus.6 | sed s:^:wumpus-$(VERS)/: >MANIFEST
35 @(cd ..; ln -s wumpus wumpus-$(VERS))
36 (cd ..; tar -czvf wumpus/wumpus-$(VERS).tar.gz `cat wumpus/MANIFEST`)
37 @(cd ..; rm wumpus-$(VERS))
39 dist: wumpus-$(VERS).tar.gz