summary refs log tree commit diff
diff options
context:
space:
mode:
-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: