From 32d048f326485de7af2a864201dca29a35961b31 Mon Sep 17 00:00:00 2001 From: "C. McEnroe" Date: Mon, 17 Aug 2020 17:20:02 -0400 Subject: Use BSD make syntax to configure for OpenBSD --- Makefile | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'Makefile') 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} -- cgit 1.4.1