]>
Commit | Line | Data |
---|---|---|
0d7773b6 | 1 | TESTS=test-base64 test-md4 test-md5 test-milenage test-ms_funcs \ |
bdb112d3 | 2 | test-bitfield \ |
0d7773b6 JM |
3 | test-printf \ |
4 | test-sha1 \ | |
f551fa8d | 5 | test-sha256 test-aes test-asn1 test-x509 test-x509v3 test-list test-rc4 |
1801bd7f JM |
6 | |
7 | all: $(TESTS) | |
8 | ||
9 | ifndef CC | |
10 | CC=gcc | |
11 | endif | |
12 | ||
13 | ifndef LDO | |
14 | LDO=$(CC) | |
15 | endif | |
16 | ||
17 | ifndef CFLAGS | |
18 | CFLAGS = -MMD -O2 -Wall -g | |
19 | endif | |
20 | ||
21 | CFLAGS += -I../src | |
953f8343 | 22 | CFLAGS += -I../src/utils |
1801bd7f | 23 | |
0bc377fa JM |
24 | SLIBS = ../src/utils/libutils.a |
25 | ||
26 | DLIBS = ../src/crypto/libcrypto.a \ | |
ab7ddc74 | 27 | ../src/tls/libtls.a |
1801bd7f | 28 | |
0bc377fa JM |
29 | LIBS = $(SLIBS) $(DLIBS) |
30 | LLIBS = -Wl,--start-group $(DLIBS) -Wl,--end-group $(SLIBS) | |
31 | ||
6be79541 JM |
32 | # glibc < 2.17 needs -lrt for clock_gettime() |
33 | LLIBS += -lrt | |
34 | ||
6a230ba2 JM |
35 | ../src/utils/libutils.a: |
36 | $(MAKE) -C ../src/utils | |
953f8343 | 37 | |
631afd99 JM |
38 | ../src/crypto/libcrypto.a: |
39 | $(MAKE) -C ../src/crypto | |
40 | ||
ab7ddc74 JM |
41 | ../src/tls/libtls.a: |
42 | $(MAKE) -C ../src/tls | |
43 | ||
1801bd7f | 44 | |
f8cf3ce6 | 45 | test-aes: test-aes.o $(LIBS) |
c2372d7c | 46 | $(LDO) $(LDFLAGS) -o $@ $^ $(LLIBS) |
f8cf3ce6 | 47 | |
ab7ddc74 | 48 | test-asn1: test-asn1.o $(LIBS) |
6be79541 | 49 | $(LDO) $(LDFLAGS) -o $@ $^ $(LLIBS) |
ab7ddc74 | 50 | |
c7ab5122 | 51 | test-base64: test-base64.o $(LIBS) |
6be79541 | 52 | $(LDO) $(LDFLAGS) -o $@ $^ $(LLIBS) |
1801bd7f | 53 | |
bdb112d3 | 54 | test-bitfield: test-bitfield.o $(LIBS) |
6be79541 | 55 | $(LDO) $(LDFLAGS) -o $@ $^ $(LLIBS) |
bdb112d3 | 56 | |
d10b1398 JM |
57 | test-https: test-https.o $(LIBS) |
58 | $(LDO) $(LDFLAGS) -o $@ $< $(LLIBS) | |
59 | ||
dacf4783 | 60 | test-list: test-list.o $(LIBS) |
6be79541 | 61 | $(LDO) $(LDFLAGS) -o $@ $^ $(LLIBS) |
dacf4783 | 62 | |
668562d5 | 63 | test-md4: test-md4.o $(LIBS) |
6be79541 | 64 | $(LDO) $(LDFLAGS) -o $@ $^ $(LLIBS) |
953f8343 | 65 | |
f8cf3ce6 | 66 | test-md5: test-md5.o $(LIBS) |
6be79541 | 67 | $(LDO) $(LDFLAGS) -o $@ $^ $(LLIBS) |
f8cf3ce6 | 68 | |
c7ab5122 | 69 | test-milenage: test-milenage.o $(LIBS) |
6be79541 | 70 | $(LDO) $(LDFLAGS) -o $@ $^ $(LLIBS) |
953f8343 | 71 | |
f8cf3ce6 | 72 | test-ms_funcs: test-ms_funcs.o $(LIBS) |
6be79541 | 73 | $(LDO) $(LDFLAGS) -o $@ $^ $(LLIBS) |
f8cf3ce6 | 74 | |
0d7773b6 | 75 | test-printf: test-printf.o $(LIBS) |
6be79541 | 76 | $(LDO) $(LDFLAGS) -o $@ $^ $(LLIBS) |
0d7773b6 | 77 | |
f551fa8d | 78 | test-rc4: test-rc4.o $(LIBS) |
6be79541 | 79 | $(LDO) $(LDFLAGS) -o $@ $^ $(LLIBS) |
f551fa8d | 80 | |
f8cf3ce6 | 81 | test-sha1: test-sha1.o $(LIBS) |
6be79541 | 82 | $(LDO) $(LDFLAGS) -o $@ $^ $(LLIBS) |
f8cf3ce6 JM |
83 | |
84 | test-sha256: test-sha256.o $(LIBS) | |
6be79541 | 85 | $(LDO) $(LDFLAGS) -o $@ $^ $(LLIBS) |
f8cf3ce6 | 86 | |
ab7ddc74 | 87 | test-x509: test-x509.o $(LIBS) |
0bc377fa | 88 | $(LDO) $(LDFLAGS) -o $@ $< $(LLIBS) |
ab7ddc74 | 89 | |
655702f3 JM |
90 | test-x509v3: test-x509v3.o $(LIBS) |
91 | $(LDO) $(LDFLAGS) -o $@ $< $(LLIBS) | |
92 | ||
953f8343 JM |
93 | |
94 | run-tests: $(TESTS) | |
f8cf3ce6 | 95 | ./test-aes |
bdb112d3 | 96 | ./test-bitfield |
dacf4783 | 97 | ./test-list |
668562d5 | 98 | ./test-md4 |
f8cf3ce6 | 99 | ./test-md5 |
953f8343 | 100 | ./test-milenage |
0d7773b6 | 101 | ./test-printf |
f8cf3ce6 JM |
102 | ./test-sha1 |
103 | ./test-sha256 | |
104 | @echo | |
105 | @echo All tests completed successfully. | |
953f8343 | 106 | |
1801bd7f JM |
107 | clean: |
108 | $(MAKE) -C ../src clean | |
8ad733d5 | 109 | rm -f $(TESTS) *~ *.o *.d |
b87346c4 | 110 | rm -f test-https |
655702f3 JM |
111 | rm -f test_x509v3_nist.out.* |
112 | rm -f test_x509v3_nist2.out.* | |
8ad733d5 JM |
113 | |
114 | -include $(OBJS:%.o=%.d) |