f75090c62c42c137043f4e52b9a76b5d9c9c41bc
[wumpus.git] / Makefile
1 #
2 # Makefile for `Hunt the Wumpus' and `Superhack' games
3 #
4 VERS=$(shell sed <wumpus.spec -n -e '/Version: \(.*\)/s//\1/p')
5
6 all: wumpus superhack
7
8 wumpus: wumpus.c
9         $(CC) $(CFLAGS) wumpus.c -o wumpus
10
11 superhack: superhack.c
12         $(CC) $(CFLAGS) superhack.c -o superhack
13
14 clean:
15         rm -f wumpus wumpus.o superhack superhack.o TAGS
16
17 TAGS:
18         etags wumpus.c
19
20 wumpus.6: wumpus.xml
21         xmlto man wumpus.xml 
22
23 SOURCES = README Makefile wumpus.c superhack.c wumpus.xml wumpus.spec
24
25 install: wumpus.6
26         cp wumpus superhack /usr/bin/
27         cp wumpus.6 /usr/share/man/man6/
28
29 uninstall:
30         rm /usr/bin/wumpus /usr/bin/superhack
31         rm /usr/share/man/man6/wumpus.6
32
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))
38
39 dist: wumpus-$(VERS).tar.gz
40