aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorRyan Kavanagh <rak@debian.org>2013-03-07 16:38:10 -0500
committerRyan Kavanagh <rak@debian.org>2013-03-07 16:38:10 -0500
commitc654eda73fb535db11767f61d3c0791fe6f0fc2b (patch)
tree91d21592e9634ed14ef288efb90adc19b073e97e /Makefile
parentInitial release (diff)
Add install targets to Makefile
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile40
1 files changed, 38 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 1a86f43..f1a4077 100644
--- a/Makefile
+++ b/Makefile
@@ -1,11 +1,47 @@
CFLAGS:=-Wall -Wextra -pedantic -Werror=format-security -fstack-protector-all $(CFLAGS)
+CFLAGS:=-g $(CFLAGS)
-all: nmm
+PREFIX=/usr/local
+MANPATH=$(PREFIX)/man
+MAKEWHATIS=/usr/libexec/makewhatis
+
+all: nmm tmm twmm
nmm: nmm.c
$(CC) $(CFLAGS) -lcurses -o $@ $<
+tmm twmm:
+ ln -s nmm $@
+
+tmm.6 twmm.6:
+ ln -s nmm.6 $@
+
+install: nmm tmm twmm installman
+ -mkdir -p $(PREFIX)/games
+ install -m 555 nmm $(PREFIX)/games/
+ install -m 555 tmm $(PREFIX)/games/
+ install -m 555 twmm $(PREFIX)/games/
+
+installman: nmm.6 tmm.6 twmm.6
+ install -m 444 nmm.6 $(MANPATH)/man6/
+ install -m 444 tmm.6 $(MANPATH)/man6/tmm.6
+ install -m 444 twmm.6 $(MANPATH)/man6/twmm.6
+ -$(MAKEWHATIS) -d $(MANPATH) $(MANPATH)/man6/nmm.6 \
+ $(MANPATH)/man6/tmm.6 \
+ $(MANPATH)/man6/twmm.6
+
+uninstall:
+ -rm -f $(PREFIX)/games/tmm \
+ $(PREFIX)/games/nmm \
+ $(PREFIX)/games/twmm
+ -$(MAKEWHATIS) -u $(MANPATH) $(MANPATH)/man6/nmm.6 \
+ $(MANPATH)/man6/tmm.6 \
+ $(MANPATH)/man6/twmm.6
+ -rm -f $(MANPATH)/man6/nmm.6 \
+ $(MANPATH)/man6/tmm.6 \
+ $(MANPATH)/man6/twmm.6
+
clean:
rm nmm
-.PHONY: clean nmm
+.PHONY: clean install installman