about summary refs log tree commit diff
path: root/Makefile
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2020-10-29 11:34:56 -0400
committerJune McEnroe <june@causal.agency>2020-10-29 11:35:34 -0400
commitf17f882b5e748c71d9365d8769711d8ff8af015f (patch)
tree9eadef4e8d2cf8eb2bc010b0edd2a506e4f12286 /Makefile
parentRefactor IMAP struct (diff)
downloadimbox-f17f882b5e748c71d9365d8769711d8ff8af015f.tar.gz
imbox-f17f882b5e748c71d9365d8769711d8ff8af015f.zip
Rewrite compat and add configure script
Diffstat (limited to '')
-rw-r--r--Makefile17
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/%}