-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
112 lines (97 loc) · 2.61 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
include ${.CURDIR}/Makefile.inc
VERSION= 3.0.0
PROG= pick
SRCS+= compat-pledge.c
SRCS+= compat-reallocarray.c
SRCS+= compat-strtonum.c
SRCS+= pick.c
OBJS= ${SRCS:.c=.o}
DEPS= ${SRCS:.c=.d}
CFLAGS+= ${DEBUG}
CFLAGS+= -DVERSION=\"${VERSION}\"
DISTFILES+= CHANGELOG.md
DISTFILES+= CODE_OF_CONDUCT.md
DISTFILES+= CONTRIBUTING.md
DISTFILES+= GNUmakefile
DISTFILES+= LICENSE
DISTFILES+= Makefile
DISTFILES+= README.md
DISTFILES+= compat-pledge.c
DISTFILES+= compat-reallocarray.c
DISTFILES+= compat-strtonum.c
DISTFILES+= configure
DISTFILES+= pick.1
DISTFILES+= pick.c
DISTFILES+= tests/GNUmakefile
DISTFILES+= tests/Makefile
DISTFILES+= tests/README.md
DISTFILES+= tests/key-alt-enter.t
DISTFILES+= tests/key-backspace.t
DISTFILES+= tests/key-ctrl-a.t
DISTFILES+= tests/key-ctrl-c.t
DISTFILES+= tests/key-ctrl-e.t
DISTFILES+= tests/key-ctrl-k.t
DISTFILES+= tests/key-ctrl-l.t
DISTFILES+= tests/key-ctrl-o.t
DISTFILES+= tests/key-ctrl-u.t
DISTFILES+= tests/key-ctrl-w.t
DISTFILES+= tests/key-del.t
DISTFILES+= tests/key-end.t
DISTFILES+= tests/key-enter.t
DISTFILES+= tests/key-home.t
DISTFILES+= tests/key-left.t
DISTFILES+= tests/key-line-down.t
DISTFILES+= tests/key-line-up.t
DISTFILES+= tests/key-page-down.t
DISTFILES+= tests/key-page-up.t
DISTFILES+= tests/key-printable.t
DISTFILES+= tests/key-right.t
DISTFILES+= tests/key-unknown.t
DISTFILES+= tests/misc-match.t
DISTFILES+= tests/misc-realloc.t
DISTFILES+= tests/opt-d.t
DISTFILES+= tests/opt-h.t
DISTFILES+= tests/opt-k.t
DISTFILES+= tests/opt-o.t
DISTFILES+= tests/opt-q.t
DISTFILES+= tests/opt-s.t
DISTFILES+= tests/opt-unknown.t
DISTFILES+= tests/opt-v.t
DISTFILES+= tests/opt-x.t
DISTFILES+= tests/pick-test.c
DISTFILES+= tests/pick-test.sh
PREFIX= /usr/local
all: ${PROG}
${PROG}: ${OBJS}
${CC} ${DEBUG} -o ${PROG} ${OBJS} ${LDFLAGS}
clean:
rm -f ${DEPS} ${OBJS} ${PROG}
.PHONY: clean
dist:
set -e; \
d=${PROG}-${VERSION}; \
mkdir $$d; \
for f in ${DISTFILES}; do \
mkdir -p $$d/`dirname $$f`; \
cp ${.CURDIR}/$$f $$d/$$f; \
done; \
tar czvf ${.CURDIR}/$$d.tar.gz $$d; \
(cd ${.CURDIR}; sha256 $$d.tar.gz >$$d.sha256); \
rm -r $$d
.PHONY: dist
distclean: clean
rm -f ${.CURDIR}/Makefile.inc ${.CURDIR}/config.h \
${.CURDIR}/config.log ${.CURDIR}/${PROG}-${VERSION}.tar.gz \
${.CURDIR}/${PROG}-${VERSION}.sha256
.PHONY: distclean
install: ${PROG}
@mkdir -p ${DESTDIR}${PREFIX}/bin
${INSTALL} ${PROG} ${DESTDIR}${PREFIX}/bin
@mkdir -p ${DESTDIR}${PREFIX}/man/man1
${INSTALL} ${.CURDIR}/pick.1 ${DESTDIR}${PREFIX}/man/man1
.PHONY: install
test: ${PROG}
${MAKE} -C ${.CURDIR}/tests \
"MALLOC_OPTIONS=${MALLOC_OPTIONS}" "PICK=${.OBJDIR}/${PROG}"
.PHONY: test
-include ${DEPS}