summary refs log tree commit diff
path: root/Makefile
blob: 5475b97c98f4a3c349fc35c083310ba34f177dc2 (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

CFLAGS += -std=c11 -Wall -Wextra -Wpedantic
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}: imap.h

clean:
	rm -f ${BINS} ${OBJS}

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 ${BINS:%=${DESTDIR}${PREFIX}/bin/%}
	rm -f ${DESTDIR}${MANDIR}/man1/notemap.1
	rm -f ${DESTDIR}${MANDIR}/man1/git-notemap.1