summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2020-01-01 19:14:34 -0500
committerJune McEnroe <june@causal.agency>2020-01-01 19:14:34 -0500
commit4c41ac91582828cd3f5635d57bfca5b31c1ba260 (patch)
tree34858962ec63e1418cd64ba2d7e03f23b9825db1
parentAssert that SQL query fits in buffer (diff)
downloadlitterbox-4c41ac91582828cd3f5635d57bfca5b31c1ba260.tar.gz
litterbox-4c41ac91582828cd3f5635d57bfca5b31c1ba260.zip
Add install and uninstall targets
-rw-r--r--Makefile11
1 files changed, 11 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index a7ba555..eae91ce 100644
--- a/Makefile
+++ b/Makefile
@@ -1,3 +1,5 @@
+PREFIX = /usr/local
+MANDIR = ${PREFIX}/share/man
 LIBS_PREFIX = /usr/local
 
 CFLAGS += -std=c11 -Wall -Wextra -Wpedantic
@@ -7,6 +9,7 @@ LDLIBS = -lsqlite3
 LDLIBS_litterbox = -ltls
 
 BINS = litterbox scoop unscoop
+MANS = ${BINS:=.1}
 
 -include config.mk
 
@@ -24,3 +27,11 @@ tags: *.c *.h
 
 clean:
 	rm -f tags ${BINS} ${BINS:=.o}
+
+install: ${BINS} ${MANS}
+	install -d ${PREFIX}/bin ${MANDIR}/man1
+	install ${BINS} ${PREFIX}/bin
+	for man in ${MANS}; do gzip -c $$man > ${MANDIR}/man1/$$man.gz; done
+
+uninstall:
+	rm -f ${BINS:%=${PREFIX}/bin/%} ${MANS:%=${MANDIR}/man1/%.gz}