From 4c41ac91582828cd3f5635d57bfca5b31c1ba260 Mon Sep 17 00:00:00 2001 From: "C. McEnroe" Date: Wed, 1 Jan 2020 19:14:34 -0500 Subject: Add install and uninstall targets --- Makefile | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'Makefile') 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} -- cgit 1.4.1