about summary refs log tree commit diff
path: root/Makefile
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2021-02-25 15:42:24 -0500
committerJune McEnroe <june@causal.agency>2021-02-25 15:49:37 -0500
commitfd25c666d57fb9a7c0da58620a7cc768c7aa743e (patch)
treeca1c99ceb09e3a590635f799f552f9aebda0e4d2 /Makefile
parentDrop pledge privileges after daemonization (diff)
downloadcatsit-fd25c666d57fb9a7c0da58620a7cc768c7aa743e.tar.gz
catsit-fd25c666d57fb9a7c0da58620a7cc768c7aa743e.zip
Add catsit-watch utility
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile48
1 files changed, 34 insertions, 14 deletions
diff --git a/Makefile b/Makefile
index 392aacc..573c1f3 100644
--- a/Makefile
+++ b/Makefile
@@ -16,16 +16,18 @@ RC_SCRIPT = ${UNAME}/catsitd
 
 -include config.mk
 
-BINS = catsit catsitd
-MAN8 = ${BINS:=.8}
+BINS = catsit-watch
+SBINS = catsit catsitd
+MAN1 = ${BINS:=.1}
 MAN5 = catsit.conf.5
+MAN8 = ${SBINS:=.8}
 
 OBJS += daemon.o
 OBJS += service.o
 
 dev: tags all
 
-all: ${BINS}
+all: ${BINS} ${SBINS}
 
 catsitd: ${OBJS}
 	${CC} ${LDFLAGS} ${OBJS} ${LDLIBS} -o $@
@@ -38,22 +40,40 @@ ${OBJS}: daemon.h
 	sed -e 's|%%PREFIX%%|${PREFIX}|g' -e 's|%%RUNDIR%%|${RUNDIR}|g' $< > $@
 	chmod a+x $@
 
-tags: *.c *.h
-	ctags -w *.c *.h
+tags: *.[ch]
+	ctags -w *.[ch]
 
 clean:
-	rm -f ${BINS} ${OBJS} ${RC_SCRIPT} tags
-
-install: ${BINS} ${RC_SCRIPT} ${MAN5} ${MAN8}
-	install -d ${DESTDIR}${PREFIX}/sbin ${DESTDIR}${ETCDIR}/rc.d
-	install -d ${DESTDIR}${MANDIR}/man5 ${DESTDIR}${MANDIR}/man8
-	install ${BINS} ${DESTDIR}${PREFIX}/sbin
+	rm -f ${BINS} ${SBINS} ${OBJS} ${RC_SCRIPT} tags
+
+install: ${BINS} ${SBINS} ${RC_SCRIPT} ${MAN1} ${MAN5} ${MAN8}
+	install -d ${DESTDIR}${PREFIX}/bin
+	install -d ${DESTDIR}${PREFIX}/sbin
+	install -d ${DESTDIR}${MANDIR}/man1
+	install -d ${DESTDIR}${MANDIR}/man5
+	install -d ${DESTDIR}${MANDIR}/man8
+	install -d ${DESTDIR}${ETCDIR}/rc.d
+	install ${BINS} ${DESTDIR}${PREFIX}/bin
+	install ${SBINS} ${DESTDIR}${PREFIX}/sbin
 	install ${RC_SCRIPT} ${DESTDIR}${ETCDIR}/rc.d
+	install -m 644 ${MAN1} ${DESTDIR}${MANDIR}/man1
 	install -m 644 ${MAN5} ${DESTDIR}${MANDIR}/man5
 	install -m 644 ${MAN8} ${DESTDIR}${MANDIR}/man8
 
 uninstall:
-	rm -f ${BINS:%=${DESTDIR}${PREFIX}/sbin/%}
-	rm -f ${MAN5:%=${DESTDIR}${MANDIR}/man5/%}
-	rm -f ${MAN8:%=${DESTDIR}${MANDIR}/man8/%}
+.for BIN in ${BINS}
+	rm -f ${DESTDIR}${PREFIX}/bin/${BIN}
+.endfor
+.for SBIN in ${SBINS}
+	rm -f ${DESTDIR}${PREFIX}/sbin/${SBIN}
+.endfor
 	rm -f ${DESTDIR}${ETCDIR}/rc.d/${RC_SCRIPT:T}
+.for MAN in ${MAN1}
+	rm -f ${DESTDIR}${MANDIR}/man1/${MAN}
+.endfor
+.for MAN in ${MAN5}
+	rm -f ${DESTDIR}${MANDIR}/man5/${MAN}
+.endfor
+.for MAN in ${MAN8}
+	rm -f ${DESTDIR}${MANDIR}/man8/${MAN}
+.endfor