Use BSD make syntax to configure for OpenBSD

This commit is contained in:
C. McEnroe 2020-08-17 17:20:02 -04:00
parent 296e40887b
commit 32d048f326

View File

@ -1,12 +1,18 @@
UNAME != uname
PREFIX ?= /usr/local PREFIX ?= /usr/local
MANDIR ?= ${PREFIX}/share/man MANDIR ?= ${PREFIX}/man
ETCDIR ?= ${PREFIX}/etc
RUNDIR ?= /var/run RUNDIR ?= /var/run
.if ${UNAME} == OpenBSD
ETCDIR ?= /etc
.else
ETCDIR ?= ${PREFIX}/etc
.endif
CFLAGS += -std=c99 -Wall -Wextra -Wpedantic CFLAGS += -std=c99 -Wall -Wextra -Wpedantic
CFLAGS += -D'ETCDIR="${ETCDIR}"' -D'RUNDIR="${RUNDIR}"' CFLAGS += -D'ETCDIR="${ETCDIR}"' -D'RUNDIR="${RUNDIR}"'
RC = FreeBSD/catsitd RC_SCRIPT = ${UNAME}/catsitd
-include config.mk -include config.mk
@ -35,13 +41,13 @@ tags: *.c *.h
sed -e 's|%%PREFIX%%|${PREFIX}|g' $< > $@ sed -e 's|%%PREFIX%%|${PREFIX}|g' $< > $@
clean: 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}${PREFIX}/sbin ${DESTDIR}${ETCDIR}/rc.d
install -d ${DESTDIR}${MANDIR}/man5 ${DESTDIR}${MANDIR}/man8 install -d ${DESTDIR}${MANDIR}/man5 ${DESTDIR}${MANDIR}/man8
install ${BINS} ${DESTDIR}${PREFIX}/sbin 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 ${MAN5} ${DESTDIR}${MANDIR}/man5
install -m 644 ${MAN8} ${DESTDIR}${MANDIR}/man8 install -m 644 ${MAN8} ${DESTDIR}${MANDIR}/man8
@ -49,4 +55,4 @@ uninstall:
rm -f ${BINS:%=${DESTDIR}${PREFIX}/sbin/%} rm -f ${BINS:%=${DESTDIR}${PREFIX}/sbin/%}
rm -f ${MAN5:%=${DESTDIR}${MANDIR}/man5/%} rm -f ${MAN5:%=${DESTDIR}${MANDIR}/man5/%}
rm -f ${MAN8:%=${DESTDIR}${MANDIR}/man8/%} rm -f ${MAN8:%=${DESTDIR}${MANDIR}/man8/%}
rm -f ${DESTDIR}${ETCDIR}/rc.d/catsitd rm -f ${DESTDIR}${ETCDIR}/rc.d/${RC_SCRIPT:T}