diff options
author | June McEnroe <june@causal.agency> | 2021-05-02 19:51:54 -0400 |
---|---|---|
committer | June McEnroe <june@causal.agency> | 2021-05-02 19:51:54 -0400 |
commit | fd936a428cf8022c54d31e1c593a86d254836c99 (patch) | |
tree | 44cd557af0ae2185a0bf35e1a4ec4d76fd55e1e7 | |
parent | Only link litterbox with -ltls (diff) | |
download | litterbox-fd936a428cf8022c54d31e1c593a86d254836c99.tar.gz litterbox-fd936a428cf8022c54d31e1c593a86d254836c99.zip |
Default to MANDIR=${PREFIX}/man, support BINDIR
I originally avoided defaulting MANDIR to /usr/local/man because I thought that might not work on GNU/Linux, but I checked and it turns out man-db not only defaults to including /usr/local/man (if /usr/local/bin is in PATH), it also includes /usr/man. So more reason to default to ${PREFIX}/man.
-rw-r--r-- | Makefile | 12 | ||||
-rwxr-xr-x | configure | 1 |
2 files changed, 7 insertions, 6 deletions
diff --git a/Makefile b/Makefile index bea16f6..9062bef 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ PREFIX ?= /usr/local -MANDIR ?= ${PREFIX}/share/man -ETCDIR ?= ${PREFIX}/etc +BINDIR ?= ${PREFIX}/bin +MANDIR ?= ${PREFIX}/man CFLAGS += -std=c11 -Wall -Wextra -Wpedantic LDADD.sqlite3 = -lsqlite3 @@ -40,7 +40,7 @@ ${OBJS}: database.h test: .test .test: unscoop - set -e; for format in ${FORMATS}; do ./unscoop -! -f $$format; done + for f in ${FORMATS}; do ./unscoop -! -f $$f || exit 1; done touch .test tags: *.[ch] @@ -50,10 +50,10 @@ clean: rm -f ${BINS} ${OBJS} .test tags install: ${BINS} ${MANS} - install -d ${DESTDIR}${PREFIX}/bin ${DESTDIR}${MANDIR}/man1 - install ${BINS} ${DESTDIR}${PREFIX}/bin + install -d ${DESTDIR}${BINDIR} ${DESTDIR}${MANDIR}/man1 + install ${BINS} ${DESTDIR}${BINDIR} install -m 644 ${MANS} ${DESTDIR}${MANDIR}/man1 uninstall: - rm -f ${BINS:%=${DESTDIR}${PREFIX}/bin/%} + rm -f ${BINS:%=${DESTDIR}${BINDIR}/%} rm -f ${MANS:%=${DESTDIR}${MANDIR}/man1/%} diff --git a/configure b/configure index 1811b56..3314f75 100755 --- a/configure +++ b/configure @@ -25,6 +25,7 @@ exec >config.mk for opt; do case "${opt}" in (--prefix=*) echo "PREFIX = ${opt#*=}" ;; + (--bindir=*) echo "BINDIR = ${opt#*=}" ;; (--mandir=*) echo "MANDIR = ${opt#*=}" ;; (*) echo "warning: unsupported option ${opt}" >&2 ;; esac |