about summary refs log tree commit diff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile31
1 files changed, 18 insertions, 13 deletions
diff --git a/Makefile b/Makefile
index caaa9ac..5475b97 100644
--- a/Makefile
+++ b/Makefile
@@ -1,29 +1,34 @@
-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 = -lcrypto -ltls
+LDLIBS = -ltls
 
 -include config.mk
 
+BINS = notemap git-notemap
+
+OBJS += getservinfo.o
 OBJS += imap.o
 OBJS += notemap.o
 
+all: ${BINS}
+
 notemap: ${OBJS}
 	${CC} ${LDFLAGS} ${OBJS} ${LDLIBS} -o $@
 
-${OBJS}: compat.h imap.h
+${OBJS}: imap.h
 
 clean:
-	rm -f notemap ${OBJS}
+	rm -f ${BINS} ${OBJS}
 
-install: notemap notemap.1
-	install -d ${PREFIX}/bin ${MANDIR}/man1
-	install notemap ${PREFIX}/bin
-	gzip -c notemap.1 > ${MANDIR}/man1/notemap.1.gz
+install: ${BINS} notemap.1
+	install -d ${DESTDIR}${PREFIX}/bin ${DESTDIR}${MANDIR}/man1
+	install ${BINS} ${DESTDIR}${PREFIX}/bin
+	install -m 644 notemap.1 ${DESTDIR}${MANDIR}/man1
+	ln -fs notemap.1 ${DESTDIR}${MANDIR}/man1/git-notemap.1
 
 uninstall:
-	rm -f ${PREFIX}/bin/notemap ${MANDIR}/man1/notemap.1.gz
+	rm -f ${BINS:%=${DESTDIR}${PREFIX}/bin/%}
+	rm -f ${DESTDIR}${MANDIR}/man1/notemap.1
+	rm -f ${DESTDIR}${MANDIR}/man1/git-notemap.1