blob: 063245b537e5ef26cf8d648a690b00d4824e039d [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 Bakker3ac1b2d2010-06-18 22:47:29 +000017 test_suite_xtea test_suite_debug \
Paul Bakker8123e9d2011-01-06 15:37:30 +000018 test_suite_version test_suite_md \
19 test_suite_cipher
Paul Bakker0049c2f2009-07-11 19:15:43 +000020
21.SILENT:
22
23all: $(APPS)
24
25%.c : suites/%.function suites/%.data scripts/generate_code.pl
26 echo " Generate $@"
27 scripts/generate_code.pl suites $*
28
29test_suite_aes: test_suite_aes.c ../library/libpolarssl.a
30 echo " CC $@.c"
31 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
32
33test_suite_arc4: test_suite_arc4.c ../library/libpolarssl.a
34 echo " CC $@.c"
35 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
36
37test_suite_base64: test_suite_base64.c ../library/libpolarssl.a
38 echo " CC $@.c"
39 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
40
41test_suite_camellia: test_suite_camellia.c ../library/libpolarssl.a
42 echo " CC $@.c"
43 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
44
Paul Bakker8123e9d2011-01-06 15:37:30 +000045test_suite_cipher: test_suite_cipher.c ../library/libpolarssl.a
46 echo " CC $@.c"
47 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
48
Paul Bakker0049c2f2009-07-11 19:15:43 +000049test_suite_des: test_suite_des.c ../library/libpolarssl.a
50 echo " CC $@.c"
51 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
52
53test_suite_dhm: test_suite_dhm.c ../library/libpolarssl.a
54 echo " CC $@.c"
55 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
56
57test_suite_hmac_shax: test_suite_hmac_shax.c ../library/libpolarssl.a
58 echo " CC $@.c"
59 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
60
Paul Bakker17373852011-01-06 14:20:01 +000061test_suite_md: test_suite_md.c ../library/libpolarssl.a
62 echo " CC $@.c"
63 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
64
Paul Bakker0049c2f2009-07-11 19:15:43 +000065test_suite_mdx: test_suite_mdx.c ../library/libpolarssl.a
66 echo " CC $@.c"
67 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
68
69test_suite_mpi: test_suite_mpi.c ../library/libpolarssl.a
70 echo " CC $@.c"
71 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
72
73test_suite_rsa: test_suite_rsa.c ../library/libpolarssl.a
74 echo " CC $@.c"
75 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
76
77test_suite_shax: test_suite_shax.c ../library/libpolarssl.a
78 echo " CC $@.c"
79 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
80
81test_suite_x509parse: test_suite_x509parse.c ../library/libpolarssl.a
82 echo " CC $@.c"
83 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
84
85test_suite_xtea: test_suite_xtea.c ../library/libpolarssl.a
86 echo " CC $@.c"
87 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
88
Paul Bakker7d7f4f42010-02-18 18:26:04 +000089test_suite_debug: test_suite_debug.c ../library/libpolarssl.a
90 echo " CC $@.c"
91 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
92
Paul Bakker3ac1b2d2010-06-18 22:47:29 +000093test_suite_version: test_suite_version.c ../library/libpolarssl.a
94 echo " CC $@.c"
95 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
96
Paul Bakker0049c2f2009-07-11 19:15:43 +000097clean:
98 rm -f $(APPS) *.c
99
Paul Bakker9794cb42009-07-28 18:55:00 +0000100check: $(APPS)
Paul Bakkerd947d762009-07-28 20:16:47 +0000101 echo "Running checks (Success if all tests PASSED)"
102 for i in $(APPS); \
103 do \
104 echo " - $${i}"; \
105 ./$${i} | grep -v 'PASS$$' | grep -v -- '-----' | grep -v '^$$'; \
106 echo ""; \
107 done