]> git.ipfire.org Git - thirdparty/hostap.git/blame - tests/Makefile
tests: sigma_dut controlled STA and beacon protection
[thirdparty/hostap.git] / tests / Makefile
CommitLineData
896e1b83 1TESTS=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
6all: $(TESTS)
7
f3e67159
JM
8ifdef LIBFUZZER
9CC=clang
10CFLAGS = -MMD -O2 -Wall -g
11CFLAGS += -fsanitize=fuzzer,address,signed-integer-overflow,unsigned-integer-overflow
12CFLAGS += -DTEST_LIBFUZZER
13LDFLAGS += -fsanitize=fuzzer,address,signed-integer-overflow,unsigned-integer-overflow
14TEST_FUZZ=y
15endif
16
1801bd7f
JM
17ifndef CC
18CC=gcc
19endif
20
21ifndef LDO
22LDO=$(CC)
23endif
24
25ifndef CFLAGS
26CFLAGS = -MMD -O2 -Wall -g
27endif
28
1ac9c020
JM
29ifdef TEST_FUZZ
30CFLAGS += -DCONFIG_NO_RANDOM_POOL
31CFLAGS += -DTEST_FUZZ
32endif
33
525923b1 34CFLAGS += -DCONFIG_IEEE80211R_AP
525923b1
JM
35CFLAGS += -DCONFIG_IEEE80211R
36CFLAGS += -DCONFIG_TDLS
37
1801bd7f 38CFLAGS += -I../src
953f8343 39CFLAGS += -I../src/utils
1801bd7f 40
0bc377fa
JM
41SLIBS = ../src/utils/libutils.a
42
43DLIBS = ../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
57LIBS = $(SLIBS) $(DLIBS)
58LLIBS = -Wl,--start-group $(DLIBS) -Wl,--end-group $(SLIBS)
59
6be79541
JM
60# glibc < 2.17 needs -lrt for clock_gettime()
61LLIBS += -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 106test-aes: test-aes.o $(LIBS)
c2372d7c 107 $(LDO) $(LDFLAGS) -o $@ $^ $(LLIBS)
f8cf3ce6 108
ab7ddc74 109test-asn1: test-asn1.o $(LIBS)
6be79541 110 $(LDO) $(LDFLAGS) -o $@ $^ $(LLIBS)
ab7ddc74 111
c7ab5122 112test-base64: test-base64.o $(LIBS)
6be79541 113 $(LDO) $(LDFLAGS) -o $@ $^ $(LLIBS)
1801bd7f 114
525923b1
JM
115test-eapol: test-eapol.o $(LIBS)
116 $(LDO) $(LDFLAGS) -o $@ $< $(LLIBS)
117
d10b1398 118test-https: test-https.o $(LIBS)
b49ec259
JM
119 $(LDO) $(LDFLAGS) -o $@ $< $(LLIBS)
120
121test-https_server: test-https_server.o $(LIBS)
d10b1398
JM
122 $(LDO) $(LDFLAGS) -o $@ $< $(LLIBS)
123
79fa1b45
JM
124test-json: test-json.o $(LIBS)
125 $(LDO) $(LDFLAGS) -o $@ $^ $(LLIBS)
126
dacf4783 127test-list: test-list.o $(LIBS)
6be79541 128 $(LDO) $(LDFLAGS) -o $@ $^ $(LLIBS)
dacf4783 129
668562d5 130test-md4: test-md4.o $(LIBS)
6be79541 131 $(LDO) $(LDFLAGS) -o $@ $^ $(LLIBS)
953f8343 132
c7ab5122 133test-milenage: test-milenage.o $(LIBS)
6be79541 134 $(LDO) $(LDFLAGS) -o $@ $^ $(LLIBS)
953f8343 135
f551fa8d 136test-rc4: test-rc4.o $(LIBS)
6be79541 137 $(LDO) $(LDFLAGS) -o $@ $^ $(LLIBS)
f551fa8d 138
46fcf474
JM
139test-rsa-sig-ver: test-rsa-sig-ver.o $(LIBS)
140 $(LDO) $(LDFLAGS) -o $@ $< $(LLIBS)
141
f8cf3ce6 142test-sha1: test-sha1.o $(LIBS)
6be79541 143 $(LDO) $(LDFLAGS) -o $@ $^ $(LLIBS)
f8cf3ce6
JM
144
145test-sha256: test-sha256.o $(LIBS)
6be79541 146 $(LDO) $(LDFLAGS) -o $@ $^ $(LLIBS)
f8cf3ce6 147
1ac9c020
JM
148test-tls: test-tls.o $(LIBS)
149 $(LDO) $(LDFLAGS) -o $@ $< $(LLIBS)
150
ab7ddc74 151test-x509: test-x509.o $(LIBS)
0bc377fa 152 $(LDO) $(LDFLAGS) -o $@ $< $(LLIBS)
ab7ddc74 153
655702f3
JM
154test-x509v3: test-x509v3.o $(LIBS)
155 $(LDO) $(LDFLAGS) -o $@ $< $(LLIBS)
156
953f8343
JM
157
158run-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
169clean:
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)