summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2020-08-17 17:20:02 -0400
committerJune McEnroe <june@causal.agency>2020-08-17 17:22:00 -0400
commit32d048f326485de7af2a864201dca29a35961b31 (patch)
treec7d7af41709f3bf6ed72ef8e5dc66deb2d5941ab
parentUse pledge(2) and unveil(2) on OpenBSD (diff)
downloadcatsit-32d048f326485de7af2a864201dca29a35961b31.tar.gz
catsit-32d048f326485de7af2a864201dca29a35961b31.zip
Use BSD make syntax to configure for OpenBSD
Diffstat (limited to '')
-rw-r--r--Makefile20
1 files changed, 13 insertions, 7 deletions
diff --git a/Makefile b/Makefile
index a37a40f..6454448 100644
--- a/Makefile
+++ b/Makefile
@@ -1,12 +1,18 @@
+UNAME != uname
+
 PREFIX ?= /usr/local
-MANDIR ?= ${PREFIX}/share/man
-ETCDIR ?= ${PREFIX}/etc
+MANDIR ?= ${PREFIX}/man
 RUNDIR ?= /var/run
+.if ${UNAME} == OpenBSD
+ETCDIR ?= /etc
+.else
+ETCDIR ?= ${PREFIX}/etc
+.endif
 
 CFLAGS += -std=c99 -Wall -Wextra -Wpedantic
 CFLAGS += -D'ETCDIR="${ETCDIR}"' -D'RUNDIR="${RUNDIR}"'
 
-RC = FreeBSD/catsitd
+RC_SCRIPT = ${UNAME}/catsitd
 
 -include config.mk
 
@@ -35,13 +41,13 @@ tags: *.c *.h
 	sed -e 's|%%PREFIX%%|${PREFIX}|g' $< > $@
 
 clean:
-	rm -f ${BINS} ${OBJS} ${RC} tags
+	rm -f ${BINS} ${OBJS} ${RC_SCRIPT} tags
 
-install: ${BINS} ${RC} ${MAN5} ${MAN8}
+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
-	install ${RC} ${DESTDIR}${ETCDIR}/rc.d
+	install ${RC_SCRIPT} ${DESTDIR}${ETCDIR}/rc.d
 	install -m 644 ${MAN5} ${DESTDIR}${MANDIR}/man5
 	install -m 644 ${MAN8} ${DESTDIR}${MANDIR}/man8
 
@@ -49,4 +55,4 @@ uninstall:
 	rm -f ${BINS:%=${DESTDIR}${PREFIX}/sbin/%}
 	rm -f ${MAN5:%=${DESTDIR}${MANDIR}/man5/%}
 	rm -f ${MAN8:%=${DESTDIR}${MANDIR}/man8/%}
-	rm -f ${DESTDIR}${ETCDIR}/rc.d/catsitd
+	rm -f ${DESTDIR}${ETCDIR}/rc.d/${RC_SCRIPT:T}