b40ff1cb6c8849a433cae564d53dad249a7b3985
[libeap.git] / tests / Makefile
1 TESTS=test-base64 test-md4 test-md5 test-milenage test-ms_funcs test-sha1 \
2         test-sha256 test-aes test-asn1 test-x509
3
4 all: $(TESTS)
5
6 ifndef CC
7 CC=gcc
8 endif
9
10 ifndef LDO
11 LDO=$(CC)
12 endif
13
14 ifndef CFLAGS
15 CFLAGS = -MMD -O2 -Wall -g
16 endif
17
18 CFLAGS += -I../src
19 CFLAGS += -I../src/utils
20
21 LIBS = ../src/utils/libutils.a \
22         ../src/crypto/libcrypto.a \
23         ../src/tls/libtls.a
24
25 ../src/utils/libutils.a:
26         $(MAKE) -C ../src/utils
27
28 ../src/crypto/libcrypto.a:
29         $(MAKE) -C ../src/crypto
30
31 ../src/tls/libtls.a:
32         $(MAKE) -C ../src/tls
33
34
35 test-aes: test-aes.o $(LIBS)
36         $(LDO) $(LDFLAGS) -o $@ $^
37
38 test-asn1: test-asn1.o $(LIBS)
39         $(LDO) $(LDFLAGS) -o $@ $^
40
41 test-base64: test-base64.o $(LIBS)
42         $(LDO) $(LDFLAGS) -o $@ $^
43
44 test-md4: test-md4.o $(LIBS)
45         $(LDO) $(LDFLAGS) -o $@ $^
46
47 test-md5: test-md5.o $(LIBS)
48         $(LDO) $(LDFLAGS) -o $@ $^
49
50 test-milenage: test-milenage.o $(LIBS)
51         $(LDO) $(LDFLAGS) -o $@ $^
52
53 test-ms_funcs: test-ms_funcs.o $(LIBS)
54         $(LDO) $(LDFLAGS) -o $@ $^
55
56 test-sha1: test-sha1.o $(LIBS)
57         $(LDO) $(LDFLAGS) -o $@ $^
58
59 test-sha256: test-sha256.o $(LIBS)
60         $(LDO) $(LDFLAGS) -o $@ $^
61
62 test-x509: test-x509.o $(LIBS)
63         $(LDO) $(LDFLAGS) -o $@ $^
64
65
66 run-tests: $(TESTS)
67         ./test-aes
68         ./test-md4
69         ./test-md5
70         ./test-milenage
71         ./test-sha1
72         ./test-sha256
73         @echo
74         @echo All tests completed successfully.
75
76 clean:
77         $(MAKE) -C ../src clean
78         rm -f $(TESTS) *~ *.o *.d
79
80 -include $(OBJS:%.o=%.d)