]>
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 | ||
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 | |
953f8343 | 21 | CFLAGS += -I../src/utils |
1801bd7f | 22 | |
0bc377fa JM |
23 | SLIBS = ../src/utils/libutils.a |
24 | ||
25 | DLIBS = ../src/crypto/libcrypto.a \ | |
ab7ddc74 | 26 | ../src/tls/libtls.a |
1801bd7f | 27 | |
0bc377fa JM |
28 | LIBS = $(SLIBS) $(DLIBS) |
29 | LLIBS = -Wl,--start-group $(DLIBS) -Wl,--end-group $(SLIBS) | |
30 | ||
6be79541 JM |
31 | # glibc < 2.17 needs -lrt for clock_gettime() |
32 | LLIBS += -lrt | |
33 | ||
6a230ba2 JM |
34 | ../src/utils/libutils.a: |
35 | $(MAKE) -C ../src/utils | |
953f8343 | 36 | |
631afd99 JM |
37 | ../src/crypto/libcrypto.a: |
38 | $(MAKE) -C ../src/crypto | |
39 | ||
ab7ddc74 JM |
40 | ../src/tls/libtls.a: |
41 | $(MAKE) -C ../src/tls | |
42 | ||
1801bd7f | 43 | |
f8cf3ce6 | 44 | test-aes: test-aes.o $(LIBS) |
c2372d7c | 45 | $(LDO) $(LDFLAGS) -o $@ $^ $(LLIBS) |
f8cf3ce6 | 46 | |
ab7ddc74 | 47 | test-asn1: test-asn1.o $(LIBS) |
6be79541 | 48 | $(LDO) $(LDFLAGS) -o $@ $^ $(LLIBS) |
ab7ddc74 | 49 | |
c7ab5122 | 50 | test-base64: test-base64.o $(LIBS) |
6be79541 | 51 | $(LDO) $(LDFLAGS) -o $@ $^ $(LLIBS) |
1801bd7f | 52 | |
d10b1398 JM |
53 | test-https: test-https.o $(LIBS) |
54 | $(LDO) $(LDFLAGS) -o $@ $< $(LLIBS) | |
55 | ||
dacf4783 | 56 | test-list: test-list.o $(LIBS) |
6be79541 | 57 | $(LDO) $(LDFLAGS) -o $@ $^ $(LLIBS) |
dacf4783 | 58 | |
668562d5 | 59 | test-md4: test-md4.o $(LIBS) |
6be79541 | 60 | $(LDO) $(LDFLAGS) -o $@ $^ $(LLIBS) |
953f8343 | 61 | |
c7ab5122 | 62 | test-milenage: test-milenage.o $(LIBS) |
6be79541 | 63 | $(LDO) $(LDFLAGS) -o $@ $^ $(LLIBS) |
953f8343 | 64 | |
f551fa8d | 65 | test-rc4: test-rc4.o $(LIBS) |
6be79541 | 66 | $(LDO) $(LDFLAGS) -o $@ $^ $(LLIBS) |
f551fa8d | 67 | |
46fcf474 JM |
68 | test-rsa-sig-ver: test-rsa-sig-ver.o $(LIBS) |
69 | $(LDO) $(LDFLAGS) -o $@ $< $(LLIBS) | |
70 | ||
f8cf3ce6 | 71 | test-sha1: test-sha1.o $(LIBS) |
6be79541 | 72 | $(LDO) $(LDFLAGS) -o $@ $^ $(LLIBS) |
f8cf3ce6 JM |
73 | |
74 | test-sha256: test-sha256.o $(LIBS) | |
6be79541 | 75 | $(LDO) $(LDFLAGS) -o $@ $^ $(LLIBS) |
f8cf3ce6 | 76 | |
ab7ddc74 | 77 | test-x509: test-x509.o $(LIBS) |
0bc377fa | 78 | $(LDO) $(LDFLAGS) -o $@ $< $(LLIBS) |
ab7ddc74 | 79 | |
655702f3 JM |
80 | test-x509v3: test-x509v3.o $(LIBS) |
81 | $(LDO) $(LDFLAGS) -o $@ $< $(LLIBS) | |
82 | ||
953f8343 JM |
83 | |
84 | run-tests: $(TESTS) | |
f8cf3ce6 | 85 | ./test-aes |
dacf4783 | 86 | ./test-list |
668562d5 | 87 | ./test-md4 |
953f8343 | 88 | ./test-milenage |
46fcf474 | 89 | ./test-rsa-sig-ver |
f8cf3ce6 JM |
90 | ./test-sha1 |
91 | ./test-sha256 | |
92 | @echo | |
93 | @echo All tests completed successfully. | |
953f8343 | 94 | |
1801bd7f JM |
95 | clean: |
96 | $(MAKE) -C ../src clean | |
8ad733d5 | 97 | rm -f $(TESTS) *~ *.o *.d |
b87346c4 | 98 | rm -f test-https |
655702f3 JM |
99 | rm -f test_x509v3_nist.out.* |
100 | rm -f test_x509v3_nist2.out.* | |
8ad733d5 JM |
101 | |
102 | -include $(OBJS:%.o=%.d) |