PREFIX ?= /usr/local MANDIR ?= ${PREFIX}/share/man CFLAGS += -std=c11 -Wall -Wextra -Wpedantic 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 ${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/%}