about summary refs log tree commit diff
path: root/Makefile
diff options
context:
space:
mode:
authorChristian Neukirchen <chneukirchen@gmail.com>2015-08-27 13:49:38 +0200
committerChristian Neukirchen <chneukirchen@gmail.com>2015-08-27 13:49:38 +0200
commit5295909e45d8fdc172d9495367c056ff4bb6df60 (patch)
tree63234245b5fc8e1c9ae300d341cf53a0cae865fc /Makefile
parent62323ca1073df961ad875e3ef7cf79db8b688919 (diff)
downloadnq-5295909e45d8fdc172d9495367c056ff4bb6df60.tar.gz
nq-5295909e45d8fdc172d9495367c056ff4bb6df60.tar.xz
nq-5295909e45d8fdc172d9495367c056ff4bb6df60.zip
Makefile: add make install rule
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile25
1 files changed, 20 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index 431b504..99bb31e 100644
--- a/Makefile
+++ b/Makefile
@@ -1,8 +1,23 @@
+ALL=nq fq tq
+
 CFLAGS=-g -Wall -O2
-all: nq fq
-nq: nq.c
-fq: fq.c
-clean:
+
+DESTDIR=
+PREFIX=/usr/local
+BINDIR=$(PREFIX)/bin
+MANDIR=$(PREFIX)/share/man
+
+all: $(ALL)
+
+clean: FRC
 	rm -f nq fq
-check:
+
+check: FRC
 	prove -v ./tests
+
+install: FRC all
+	mkdir -p $(DESTDIR)$(BINDIR) $(DESTDIR)$(MANDIR)/man1
+	install -m0755 $(ALL) $(DESTDIR)$(BINDIR)
+	install -m0644 $(ALL:=.1) $(DESTDIR)$(MANDIR)/man1
+
+FRC: