-
Notifications
You must be signed in to change notification settings - Fork 6
/
Makefile
120 lines (105 loc) · 2.8 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
113
114
115
116
117
118
119
120
.PHONY: distcheck regress distclean
include Makefile.configure
OBJS = compats.o
REGRESS_MD5 = regress/md5
REGRESS_SHA2 = regress/sha2
REGRESS_CRYPT = regress/crypt
REGRESS_B64 = regress/b64_ntop
REGRESS_LIB_SOCKET = regress/SOCK_NONBLOCK
REGRESS_SCAN_SCALED = regress/scan_scaled
REGRESS_NODEP = regress/arc4random \
regress/blowfish \
regress/capsicum \
regress/crypt_newhash \
regress/endian \
regress/err \
regress/explicit_bzero \
regress/fts \
regress/getprogname \
regress/INFTIM \
regress/memmem \
regress/memrchr \
regress/minor \
regress/mkfifoat \
regress/mknodat \
regress/PASSWORD_LEN \
regress/PATH_MAX \
regress/pledge \
regress/reallocarray \
regress/recallocarray \
regress/setresgid \
regress/setresuid \
regress/strndup \
regress/strnlen \
regress/strlcpy \
regress/strlcat \
regress/strtonum \
regress/sys_queue \
regress/systrace \
regress/termios \
regress/timingsafe_bcmp \
regress/unveil \
regress/WAIT_ANY
REGRESS = $(REGRESS_B64) \
$(REGRESS_CRYPT) \
$(REGRESS_LIB_SOCKET) \
$(REGRESS_MD5) \
$(REGRESS_NODEP) \
$(REGRESS_SCAN_SCALED) \
$(REGRESS_SHA2)
all: $(REGRESS)
distcheck:
$(MAKE) -f Makefile.regen distcheck
.for r in $(REGRESS_NODEP)
${r}: ${r}.c compats.o config.h
$(CC) $(CFLAGS) $(CPPFLAGS) -o $@ ${r}.c compats.o $(LDFLAGS)
.endfor
.for r in $(REGRESS_LIB_SOCKET)
${r}: ${r}.c compats.o config.h
$(CC) $(CFLAGS) $(CPPFLAGS) -o $@ ${r}.c compats.o $(LDADD_LIB_SOCKET) $(LDFLAGS)
.endfor
.for r in $(REGRESS_MD5)
${r}: ${r}.c compats.o config.h
$(CC) $(CFLAGS) $(CPPFLAGS) -o $@ ${r}.c compats.o $(LDADD_MD5) $(LDFLAGS)
.endfor
.for r in $(REGRESS_SHA2)
${r}: ${r}.c compats.o config.h
$(CC) $(CFLAGS) $(CPPFLAGS) -o $@ ${r}.c compats.o $(LDADD_SHA2) $(LDFLAGS)
.endfor
.for r in $(REGRESS_SCAN_SCALED)
${r}: ${r}.c compats.o config.h
$(CC) $(CFLAGS) $(CPPFLAGS) -o $@ ${r}.c compats.o $(LDADD_SCAN_SCALED) $(LDFLAGS)
.endfor
.for r in $(REGRESS_B64)
${r}: ${r}.c compats.o config.h
$(CC) $(CFLAGS) $(CPPFLAGS) -o $@ ${r}.c compats.o $(LDADD_B64_NTOP) $(LDFLAGS)
.endfor
.for r in $(REGRESS_CRYPT)
${r}: ${r}.c compats.o config.h
$(CC) $(CFLAGS) $(CPPFLAGS) -o $@ ${r}.c compats.o $(LDADD_CRYPT) $(LDFLAGS)
.endfor
install:
# Do nothing.
regress: $(REGRESS)
rm -rf .regress
mkdir .regress
cp configure tests.c .regress
( cd .regress ; printf "all:\\n\\t./configure\n" | make -sf - )
rm -rf .regress
@for f in $(REGRESS) ; \
do \
printf "%s... " "$$f" ; \
set +e ; \
./$$f 2>/dev/null ; \
if [ $$? -ne 0 ]; then \
echo "FAIL"; \
exit 1 ; \
else \
echo "ok" ; \
fi ; \
set -e ; \
done
clean:
rm -f compats.o $(REGRESS)
distclean:
rm -f Makefile.configure config.log config.h