]>
Commit | Line | Data |
---|---|---|
896e1b83 | 1 | TESTS=test-base64 test-md4 test-milenage \ |
46fcf474 | 2 | test-rsa-sig-ver \ |
0d7773b6 | 3 | test-sha1 \ |
f551fa8d | 4 | test-sha256 test-aes test-asn1 test-x509 test-x509v3 test-list test-rc4 |
1801bd7f JM |
5 | |
6 | all: $(TESTS) | |
7 | ||
f3e67159 JM |
8 | ifdef LIBFUZZER |
9 | CC=clang | |
10 | CFLAGS = -MMD -O2 -Wall -g | |
11 | CFLAGS += -fsanitize=fuzzer,address,signed-integer-overflow,unsigned-integer-overflow | |
12 | CFLAGS += -DTEST_LIBFUZZER | |
13 | LDFLAGS += -fsanitize=fuzzer,address,signed-integer-overflow,unsigned-integer-overflow | |
14 | TEST_FUZZ=y | |
15 | endif | |
16 | ||
1801bd7f JM |
17 | ifndef CC |
18 | CC=gcc | |
19 | endif | |
20 | ||
21 | ifndef LDO | |
22 | LDO=$(CC) | |
23 | endif | |
24 | ||
25 | ifndef CFLAGS | |
26 | CFLAGS = -MMD -O2 -Wall -g | |
27 | endif | |
28 | ||
1ac9c020 JM |
29 | ifdef TEST_FUZZ |
30 | CFLAGS += -DCONFIG_NO_RANDOM_POOL | |
31 | CFLAGS += -DTEST_FUZZ | |
32 | endif | |
33 | ||
525923b1 | 34 | CFLAGS += -DCONFIG_IEEE80211R_AP |
525923b1 JM |
35 | CFLAGS += -DCONFIG_IEEE80211R |
36 | CFLAGS += -DCONFIG_TDLS | |
37 | ||
1801bd7f | 38 | CFLAGS += -I../src |
953f8343 | 39 | CFLAGS += -I../src/utils |
1801bd7f | 40 | |
0bc377fa JM |
41 | SLIBS = ../src/utils/libutils.a |
42 | ||
43 | DLIBS = ../src/crypto/libcrypto.a \ | |
525923b1 JM |
44 | ../src/common/libcommon.a \ |
45 | ../src/ap/libap.a \ | |
46 | ../src/eapol_auth/libeapol_auth.a \ | |
47 | ../src/eapol_supp/libeapol_supp.a \ | |
48 | ../src/eap_peer/libeap_peer.a \ | |
49 | ../src/eap_server/libeap_server.a \ | |
50 | ../src/eap_common/libeap_common.a \ | |
51 | ../src/radius/libradius.a \ | |
52 | ../src/l2_packet/libl2_packet.a \ | |
53 | ../src/wps/libwps.a \ | |
54 | ../src/rsn_supp/librsn_supp.a \ | |
ab7ddc74 | 55 | ../src/tls/libtls.a |
1801bd7f | 56 | |
0bc377fa JM |
57 | LIBS = $(SLIBS) $(DLIBS) |
58 | LLIBS = -Wl,--start-group $(DLIBS) -Wl,--end-group $(SLIBS) | |
59 | ||
6be79541 JM |
60 | # glibc < 2.17 needs -lrt for clock_gettime() |
61 | LLIBS += -lrt | |
62 | ||
6a230ba2 JM |
63 | ../src/utils/libutils.a: |
64 | $(MAKE) -C ../src/utils | |
953f8343 | 65 | |
525923b1 JM |
66 | ../src/common/libcommon.a: |
67 | $(MAKE) -C ../src/common | |
68 | ||
631afd99 JM |
69 | ../src/crypto/libcrypto.a: |
70 | $(MAKE) -C ../src/crypto | |
71 | ||
ab7ddc74 JM |
72 | ../src/tls/libtls.a: |
73 | $(MAKE) -C ../src/tls | |
74 | ||
525923b1 JM |
75 | ../src/ap/libap.a: |
76 | $(MAKE) -C ../src/ap | |
77 | ||
78 | ../src/radius/libradius.a: | |
79 | $(MAKE) -C ../src/radius | |
80 | ||
81 | ../src/l2_packet/libl2_packet.a: | |
82 | $(MAKE) -C ../src/l2_packet | |
83 | ||
84 | ../src/wps/libwps.a: | |
85 | $(MAKE) -C ../src/wps | |
86 | ||
87 | ../src/eap_peer/libeap_peer.a: | |
88 | $(MAKE) -C ../src/eap_peer | |
89 | ||
90 | ../src/eap_server/libeap_server.a: | |
91 | $(MAKE) -C ../src/eap_server | |
92 | ||
93 | ../src/eap_common/libeap_common.a: | |
94 | $(MAKE) -C ../src/eap_common | |
95 | ||
96 | ../src/eapol_auth/libeapol_auth.a: | |
97 | $(MAKE) -C ../src/eapol_auth | |
98 | ||
99 | ../src/eapol_supp/libeapol_supp.a: | |
100 | $(MAKE) -C ../src/eapol_supp | |
101 | ||
102 | ../src/rsn_supp/librsn_supp.a: | |
103 | $(MAKE) -C ../src/rsn_supp | |
104 | ||
1801bd7f | 105 | |
f8cf3ce6 | 106 | test-aes: test-aes.o $(LIBS) |
c2372d7c | 107 | $(LDO) $(LDFLAGS) -o $@ $^ $(LLIBS) |
f8cf3ce6 | 108 | |
ab7ddc74 | 109 | test-asn1: test-asn1.o $(LIBS) |
6be79541 | 110 | $(LDO) $(LDFLAGS) -o $@ $^ $(LLIBS) |
ab7ddc74 | 111 | |
c7ab5122 | 112 | test-base64: test-base64.o $(LIBS) |
6be79541 | 113 | $(LDO) $(LDFLAGS) -o $@ $^ $(LLIBS) |
1801bd7f | 114 | |
525923b1 JM |
115 | test-eapol: test-eapol.o $(LIBS) |
116 | $(LDO) $(LDFLAGS) -o $@ $< $(LLIBS) | |
117 | ||
d10b1398 | 118 | test-https: test-https.o $(LIBS) |
b49ec259 JM |
119 | $(LDO) $(LDFLAGS) -o $@ $< $(LLIBS) |
120 | ||
121 | test-https_server: test-https_server.o $(LIBS) | |
d10b1398 JM |
122 | $(LDO) $(LDFLAGS) -o $@ $< $(LLIBS) |
123 | ||
79fa1b45 JM |
124 | test-json: test-json.o $(LIBS) |
125 | $(LDO) $(LDFLAGS) -o $@ $^ $(LLIBS) | |
126 | ||
dacf4783 | 127 | test-list: test-list.o $(LIBS) |
6be79541 | 128 | $(LDO) $(LDFLAGS) -o $@ $^ $(LLIBS) |
dacf4783 | 129 | |
668562d5 | 130 | test-md4: test-md4.o $(LIBS) |
6be79541 | 131 | $(LDO) $(LDFLAGS) -o $@ $^ $(LLIBS) |
953f8343 | 132 | |
c7ab5122 | 133 | test-milenage: test-milenage.o $(LIBS) |
6be79541 | 134 | $(LDO) $(LDFLAGS) -o $@ $^ $(LLIBS) |
953f8343 | 135 | |
f551fa8d | 136 | test-rc4: test-rc4.o $(LIBS) |
6be79541 | 137 | $(LDO) $(LDFLAGS) -o $@ $^ $(LLIBS) |
f551fa8d | 138 | |
46fcf474 JM |
139 | test-rsa-sig-ver: test-rsa-sig-ver.o $(LIBS) |
140 | $(LDO) $(LDFLAGS) -o $@ $< $(LLIBS) | |
141 | ||
f8cf3ce6 | 142 | test-sha1: test-sha1.o $(LIBS) |
6be79541 | 143 | $(LDO) $(LDFLAGS) -o $@ $^ $(LLIBS) |
f8cf3ce6 JM |
144 | |
145 | test-sha256: test-sha256.o $(LIBS) | |
6be79541 | 146 | $(LDO) $(LDFLAGS) -o $@ $^ $(LLIBS) |
f8cf3ce6 | 147 | |
1ac9c020 JM |
148 | test-tls: test-tls.o $(LIBS) |
149 | $(LDO) $(LDFLAGS) -o $@ $< $(LLIBS) | |
150 | ||
ab7ddc74 | 151 | test-x509: test-x509.o $(LIBS) |
0bc377fa | 152 | $(LDO) $(LDFLAGS) -o $@ $< $(LLIBS) |
ab7ddc74 | 153 | |
655702f3 JM |
154 | test-x509v3: test-x509v3.o $(LIBS) |
155 | $(LDO) $(LDFLAGS) -o $@ $< $(LLIBS) | |
156 | ||
953f8343 JM |
157 | |
158 | run-tests: $(TESTS) | |
f8cf3ce6 | 159 | ./test-aes |
dacf4783 | 160 | ./test-list |
668562d5 | 161 | ./test-md4 |
953f8343 | 162 | ./test-milenage |
46fcf474 | 163 | ./test-rsa-sig-ver |
f8cf3ce6 JM |
164 | ./test-sha1 |
165 | ./test-sha256 | |
166 | @echo | |
167 | @echo All tests completed successfully. | |
953f8343 | 168 | |
1801bd7f JM |
169 | clean: |
170 | $(MAKE) -C ../src clean | |
8ad733d5 | 171 | rm -f $(TESTS) *~ *.o *.d |
525923b1 | 172 | rm -f test-eapol |
b87346c4 | 173 | rm -f test-https |
79fa1b45 | 174 | rm -f test-json |
1ac9c020 | 175 | rm -f test-tls |
655702f3 JM |
176 | rm -f test_x509v3_nist.out.* |
177 | rm -f test_x509v3_nist2.out.* | |
8ad733d5 JM |
178 | |
179 | -include $(OBJS:%.o=%.d) |