PREFIX = /usr/local MANDIR = ${PREFIX}/share/man LIBRESSL_PREFIX = /usr/local CFLAGS += -std=c11 -Wall -Wextra -Wpedantic CFLAGS += ${LIBRESSL_PREFIX:%=-I%/include} LDFLAGS += ${LIBRESSL_PREFIX:%=-L%/lib} LDLIBS = -ltls BINS = imbox git-fetch-email MANS = ${BINS:=.1} -include config.mk OBJS += imap.o OBJS += imbox.o all: ${BINS} imbox: ${OBJS} ${CC} ${LDFLAGS} ${OBJS} ${LDLIBS} -o $@ ${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 uninstall: rm -f ${BINS:%=${PREFIX}/bin/%} ${MANS:%=${MANDIR}/man1/%.gz}