2 # Makefile for `Hunt the Wumpus' and `Superhack' games
5 # SPDX-FileCopyrightText: (C) Eric S. Raymond <esr@thyrsus.com>
6 # SPDX-License-Identifier: BSD-2-Clause
16 $(CC) $(CFLAGS) wumpus.c -o wumpus
18 superhack: superhack.c
19 $(CC) $(CFLAGS) superhack.c -o superhack
22 rm -f wumpus wumpus.o superhack superhack.o TAGS *.6
23 rm -f *~ *.1 *.html *.tar.gz MANIFEST
31 wumpus.html: wumpus.xml
32 xmlto html-nochunks wumpus.xml
34 SOURCES = README COPYING NEWS control Makefile wumpus.c superhack.c wumpus.xml wumpus.png wumpus.desktop superhack.desktop
36 install: wumpus superhack wumpus.6
37 mkdir -p $(prefix)/bin
38 mkdir -p $(prefix)/share/man/man6
39 cp wumpus superhack $(prefix)/bin/
40 cp wumpus.6 $(prefix)/share/man/man6/
43 rm $(prefix)/bin/wumpus $(prefix)/bin/superhack
44 rm $(prefix)/share/man/man6/wumpus.6
47 @clang-format --style="{IndentWidth: 8, UseTab: ForIndentation}" -i $$(find . -name "*.[ch]")
51 cppcheck -DREVISION=$(VERS) $(CPPCHECKOPTS) wumpus.c
52 cppcheck -DREVISION=$(VERS) $(CPPCHECKOPTS) superhack.c
54 wumpus-$(VERS).tar.gz: $(SOURCES) wumpus.6
55 @ls $(SOURCES) wumpus.6 | sed s:^:wumpus-$(VERS)/: >MANIFEST
56 @(cd ..; ln -s wumpus wumpus-$(VERS))
57 (cd ..; tar -czf wumpus/wumpus-$(VERS).tar.gz `cat wumpus/MANIFEST`)
58 @(cd ..; rm wumpus-$(VERS))
60 dist: wumpus-$(VERS).tar.gz
62 release: wumpus-$(VERS).tar.gz wumpus.html wumpus.6
63 shipper version=$(VERS) | sh -e -x
66 shipper -N -w version=$(VERS) | sh -e -x