-
Notifications
You must be signed in to change notification settings - Fork 45
/
Copy pathMakefile
65 lines (50 loc) · 1.18 KB
/
Makefile
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
VERSION= 1.3.0
YANKCMD= xsel
PREFIX= /usr/local
MANPREFIX= ${PREFIX}/share/man
PROG= yank
OBJS= yank.o
KNFMT+= yank.c
INSTALL_PROGRAM= install -s -m 0755
INSTALL_MAN= install -m 0644
CFLAGS+= -pedantic -Wall -Wextra
CFLAGS+= -DVERSION=\"${VERSION}\" -DYANKCMD=\"${YANKCMD}\"
DISTFILES= CHANGELOG.md \
LICENSE \
Makefile \
README.md \
yank.1 \
yank.c
all: ${PROG}
${PROG}: ${OBJS}
${CC} -o ${PROG} ${OBJS} ${LDFLAGS}
clean:
rm -f ${PROG} ${OBJS}
.PHONY: clean
dist:
set -e; \
d=yank-${VERSION}; \
mkdir $$d; \
for f in ${DISTFILES}; do \
mkdir -p $$d/`dirname $$f`; \
cp -p ${.CURDIR}/$$f $$d/$$f; \
done; \
find $$d -type d -exec touch -r ${.CURDIR}/Makefile {} \;; \
tar czvf ${.CURDIR}/$$d.tar.gz $$d; \
(cd ${.CURDIR}; sha256 $$d.tar.gz >$$d.sha256); \
rm -r $$d
.PHONY: dist
format:
cd ${.CURDIR} && knfmt -is ${KNFMT}
.PHONY: format
install: ${PROG}
@mkdir -p ${DESTDIR}${PREFIX}/bin
@mkdir -p ${DESTDIR}${MANPREFIX}/man1
${INSTALL_PROGRAM} ${PROG} ${DESTDIR}${PREFIX}/bin
${INSTALL_MAN} yank.1 ${DESTDIR}${MANPREFIX}/man1
.PHONY: install
lint:
cd ${.CURDIR} && mandoc -Tlint -Wstyle yank.1
cd ${.CURDIR} && knfmt -ds ${KNFMT}
.PHONY: lint
-include config.mk