summary refs log tree commit diff
path: root/Makefile
blob: b9b2152a4229c9c06539a54b05b8e7c341aeddc7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
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}