From f17f882b5e748c71d9365d8769711d8ff8af015f Mon Sep 17 00:00:00 2001 From: "C. McEnroe" Date: Thu, 29 Oct 2020 11:34:56 -0400 Subject: Rewrite compat and add configure script --- Makefile | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'Makefile') 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/%} -- cgit 1.4.1