summary refs log tree commit diff
diff options
context:
space:
mode:
-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}
17:43:40 -0400'>2019-07-11Use inline style rather than <b>, <i>, <u>June McEnroe 2019-07-11Factor out clearJune McEnroe 2019-07-11Add bright option to shottyJune McEnroe 2019-07-11Output <b>, <i>, <u> in shottyJune McEnroe 2019-07-10Ignore SM and RMJune McEnroe 2019-07-09Add shotty man page and build itJune McEnroe 2019-07-09Add up -cJune McEnroe 2019-07-09Add options for default colors to shottyJune McEnroe 2019-07-08Use char literals consistentlyJune McEnroe