blob: ee6507af8de75c53f549200344969dd2aa84dd15 [file] [log] [blame]
Paul Bakker0049c2f2009-07-11 19:15:43 +00001
2# To compile on SunOS: add "-lsocket -lnsl" to LDFLAGS
3# To compile on MinGW: add "-lws2_32" to LDFLAGS
4
5CFLAGS = -I../include -D_FILE_OFFSET_BITS=64 -Wall -Wdeclaration-after-statement \
6 -Wno-unused-function -Wno-unused-value
7
8OFLAGS = -O
9LDFLAGS = -L../library -lpolarssl
10
11APPS = test_suite_aes test_suite_arc4 \
12 test_suite_base64 test_suite_camellia \
13 test_suite_des test_suite_dhm \
14 test_suite_hmac_shax test_suite_mdx \
15 test_suite_mpi test_suite_rsa \
16 test_suite_shax test_suite_x509parse\
Paul Bakker7d7f4f42010-02-18 18:26:04 +000017 test_suite_xtea test_suite_debug
Paul Bakker0049c2f2009-07-11 19:15:43 +000018
19.SILENT:
20
21all: $(APPS)
22
23%.c : suites/%.function suites/%.data scripts/generate_code.pl
24 echo " Generate $@"
25 scripts/generate_code.pl suites $*
26
27test_suite_aes: test_suite_aes.c ../library/libpolarssl.a
28 echo " CC $@.c"
29 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
30
31test_suite_arc4: test_suite_arc4.c ../library/libpolarssl.a
32 echo " CC $@.c"
33 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
34
35test_suite_base64: test_suite_base64.c ../library/libpolarssl.a
36 echo " CC $@.c"
37 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
38
39test_suite_camellia: test_suite_camellia.c ../library/libpolarssl.a
40 echo " CC $@.c"
41 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
42
43test_suite_des: test_suite_des.c ../library/libpolarssl.a
44 echo " CC $@.c"
45 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
46
47test_suite_dhm: test_suite_dhm.c ../library/libpolarssl.a
48 echo " CC $@.c"
49 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
50
51test_suite_hmac_shax: test_suite_hmac_shax.c ../library/libpolarssl.a
52 echo " CC $@.c"
53 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
54
55test_suite_mdx: test_suite_mdx.c ../library/libpolarssl.a
56 echo " CC $@.c"
57 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
58
59test_suite_mpi: test_suite_mpi.c ../library/libpolarssl.a
60 echo " CC $@.c"
61 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
62
63test_suite_rsa: test_suite_rsa.c ../library/libpolarssl.a
64 echo " CC $@.c"
65 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
66
67test_suite_shax: test_suite_shax.c ../library/libpolarssl.a
68 echo " CC $@.c"
69 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
70
71test_suite_x509parse: test_suite_x509parse.c ../library/libpolarssl.a
72 echo " CC $@.c"
73 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
74
75test_suite_xtea: test_suite_xtea.c ../library/libpolarssl.a
76 echo " CC $@.c"
77 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
78
Paul Bakker7d7f4f42010-02-18 18:26:04 +000079test_suite_debug: test_suite_debug.c ../library/libpolarssl.a
80 echo " CC $@.c"
81 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
82
Paul Bakker0049c2f2009-07-11 19:15:43 +000083clean:
84 rm -f $(APPS) *.c
85
Paul Bakker9794cb42009-07-28 18:55:00 +000086check: $(APPS)
Paul Bakkerd947d762009-07-28 20:16:47 +000087 echo "Running checks (Success if all tests PASSED)"
88 for i in $(APPS); \
89 do \
90 echo " - $${i}"; \
91 ./$${i} | grep -v 'PASS$$' | grep -v -- '-----' | grep -v '^$$'; \
92 echo ""; \
93 done