diff options
Diffstat (limited to '')
-rw-r--r-- | Makefile | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/Makefile b/Makefile index a22cd7c..925b713 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,7 @@ -PREFIX = /usr/local -MANDIR = ${PREFIX}/share/man -LIBRESSL_PREFIX = /usr/local +PREFIX ?= /usr/local +MANDIR ?= ${PREFIX}/share/man CFLAGS += -std=c11 -Wall -Wextra -Wpedantic -CFLAGS += ${LIBRESSL_PREFIX:%=-I%/include} -LDFLAGS += ${LIBRESSL_PREFIX:%=-L%/lib} LDLIBS = -ltls BINS = imbox git-fetch-email @@ -20,15 +17,15 @@ all: ${BINS} imbox: ${OBJS} ${CC} ${LDFLAGS} ${OBJS} ${LDLIBS} -o $@ -${OBJS}: compat.h imap.h +${OBJS}: imap.h clean: rm -f ${BINS} ${OBJS} install: ${BINS} ${MANS} - install -d ${PREFIX}/bin ${MANDIR}/man1 - install ${BINS} ${PREFIX}/bin - for man in ${MANS}; do gzip -c $$man > ${MANDIR}/man1/$$man.gz; done + install -d ${DESTDIR}${PREFIX}/bin ${DESTDIR}${MANDIR}/man1 + install ${BINS} ${DESTDIR}${PREFIX}/bin + install -m 644 ${MANS} ${DESTDIR}${MANDIR}/man1 uninstall: - rm -f ${BINS:%=${PREFIX}/bin/%} ${MANS:%=${MANDIR}/man1/%.gz} + rm -f ${BINS:%=${PREFIX}/bin/%} ${MANS:%=${MANDIR}/man1/%} |