Updated through tag hostap_2_5 from git://w1.fi/hostap.git
[mech_eap.git] / libeap / tests / Makefile
1 TESTS=test-base64 test-md4 test-milenage \
2         test-rsa-sig-ver \
3         test-sha1 \
4         test-sha256 test-aes test-asn1 test-x509 test-x509v3 test-list test-rc4
5
6 all: $(TESTS)
7
8 ifndef CC
9 CC=gcc
10 endif
11
12 ifndef LDO
13 LDO=$(CC)
14 endif
15
16 ifndef CFLAGS
17 CFLAGS = -MMD -O2 -Wall -g
18 endif
19
20 CFLAGS += -I../src
21 CFLAGS += -I../src/utils
22
23 SLIBS = ../src/utils/libutils.a
24
25 DLIBS = ../src/crypto/libcrypto.a \
26         ../src/tls/libtls.a
27
28 LIBS = $(SLIBS) $(DLIBS)
29 LLIBS = -Wl,--start-group $(DLIBS) -Wl,--end-group $(SLIBS)
30
31 # glibc < 2.17 needs -lrt for clock_gettime()
32 LLIBS += -lrt
33
34 ../src/utils/libutils.a:
35         $(MAKE) -C ../src/utils
36
37 ../src/crypto/libcrypto.a:
38         $(MAKE) -C ../src/crypto
39
40 ../src/tls/libtls.a:
41         $(MAKE) -C ../src/tls
42
43
44 test-aes: test-aes.o $(LIBS)
45         $(LDO) $(LDFLAGS) -o $@ $^ $(LLIBS)
46
47 test-asn1: test-asn1.o $(LIBS)
48         $(LDO) $(LDFLAGS) -o $@ $^ $(LLIBS)
49
50 test-base64: test-base64.o $(LIBS)
51         $(LDO) $(LDFLAGS) -o $@ $^ $(LLIBS)
52
53 test-https: test-https.o $(LIBS)
54         $(LDO) $(LDFLAGS) -o $@ $< $(LLIBS)
55
56 test-list: test-list.o $(LIBS)
57         $(LDO) $(LDFLAGS) -o $@ $^ $(LLIBS)
58
59 test-md4: test-md4.o $(LIBS)
60         $(LDO) $(LDFLAGS) -o $@ $^ $(LLIBS)
61
62 test-milenage: test-milenage.o $(LIBS)
63         $(LDO) $(LDFLAGS) -o $@ $^ $(LLIBS)
64
65 test-rc4: test-rc4.o $(LIBS)
66         $(LDO) $(LDFLAGS) -o $@ $^ $(LLIBS)
67
68 test-rsa-sig-ver: test-rsa-sig-ver.o $(LIBS)
69         $(LDO) $(LDFLAGS) -o $@ $< $(LLIBS)
70
71 test-sha1: test-sha1.o $(LIBS)
72         $(LDO) $(LDFLAGS) -o $@ $^ $(LLIBS)
73
74 test-sha256: test-sha256.o $(LIBS)
75         $(LDO) $(LDFLAGS) -o $@ $^ $(LLIBS)
76
77 test-x509: test-x509.o $(LIBS)
78         $(LDO) $(LDFLAGS) -o $@ $< $(LLIBS)
79
80 test-x509v3: test-x509v3.o $(LIBS)
81         $(LDO) $(LDFLAGS) -o $@ $< $(LLIBS)
82
83
84 run-tests: $(TESTS)
85         ./test-aes
86         ./test-list
87         ./test-md4
88         ./test-milenage
89         ./test-rsa-sig-ver
90         ./test-sha1
91         ./test-sha256
92         @echo
93         @echo All tests completed successfully.
94
95 clean:
96         $(MAKE) -C ../src clean
97         rm -f $(TESTS) *~ *.o *.d
98         rm -f test-https
99         rm -f test_x509v3_nist.out.*
100         rm -f test_x509v3_nist2.out.*
101
102 -include $(OBJS:%.o=%.d)