about summary refs log tree commit diff
path: root/Makefile
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2020-01-11 02:40:55 -0500
committerJune McEnroe <june@causal.agency>2020-01-11 02:40:55 -0500
commit1bd0ae76ff08271010512309394b1be17e06d64d (patch)
tree5dc20af5615d1d4be8109595a0b26d7f90226753 /Makefile
parentSearch for config files in XDG base directories (diff)
downloadlitterbox-1bd0ae76ff08271010512309394b1be17e06d64d.tar.gz
litterbox-1bd0ae76ff08271010512309394b1be17e06d64d.zip
Add FreeBSD rc script
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile5
1 files changed, 5 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 309dd8f..b358a82 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,6 @@
 PREFIX = /usr/local
 MANDIR = ${PREFIX}/share/man
+ETCDIR = ${PREFIX}/etc
 LIBS_PREFIX = /usr/local
 
 CFLAGS += -std=c11 -Wall -Wextra -Wpedantic
@@ -10,6 +11,7 @@ LDLIBS_litterbox = -ltls
 
 BINS = litterbox scoop unscoop
 MANS = ${BINS:=.1}
+RCS  = rc.d/litterbox
 
 -include config.mk
 
@@ -37,6 +39,9 @@ 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
+	if [ -n '${RCS}' ]; then install -d ${ETCDIR}/rc.d; fi
+	if [ -n '${RCS}' ]; then install ${RCS} ${ETCDIR}/rc.d; fi
 
 uninstall:
 	rm -f ${BINS:%=${PREFIX}/bin/%} ${MANS:%=${MANDIR}/man1/%.gz}
+	if [ -n '${RCS}' ]; then rm -f ${RCS:%=${ETCDIR}/%}; fi