blob: 8d5b767437c6090da72a3e94966318318c69c774 [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
Paul Bakker43b7e352011-01-18 15:27:19 +00004# To compile with PKCS11: add "-lpkcs11-helper" to LDFLAGS
Paul Bakker0049c2f2009-07-11 19:15:43 +00005
Paul Bakker46eb1382011-01-30 17:10:13 +00006CFLAGS += -I../include -D_FILE_OFFSET_BITS=64 -Wall -W -Wdeclaration-after-statement \
Paul Bakker0049c2f2009-07-11 19:15:43 +00007 -Wno-unused-function -Wno-unused-value
8
9OFLAGS = -O
Paul Bakkera585beb2011-06-21 08:59:44 +000010LDFLAGS += -L../library -lpolarssl $(SYS_LDFLAGS)
Paul Bakker0049c2f2009-07-11 19:15:43 +000011
Paul Bakker9d781402011-05-09 16:17:09 +000012APPS = test_suite_aes test_suite_arc4 \
13 test_suite_base64 test_suite_camellia \
14 test_suite_cipher test_suite_debug \
15 test_suite_des test_suite_dhm \
16 test_suite_error test_suite_hmac_shax \
17 test_suite_md test_suite_mdx \
18 test_suite_mpi test_suite_pkcs1_v21 \
19 test_suite_rsa test_suite_shax \
20 test_suite_x509parse test_suite_xtea \
21 test_suite_version
Paul Bakker0049c2f2009-07-11 19:15:43 +000022
23.SILENT:
24
25all: $(APPS)
26
Paul Bakker4fa1a762011-03-13 16:56:11 +000027%.c : suites/%.function suites/%.data scripts/generate_code.pl suites/helpers.function
Paul Bakker0049c2f2009-07-11 19:15:43 +000028 echo " Generate $@"
29 scripts/generate_code.pl suites $*
30
31test_suite_aes: test_suite_aes.c ../library/libpolarssl.a
32 echo " CC $@.c"
33 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
34
35test_suite_arc4: test_suite_arc4.c ../library/libpolarssl.a
36 echo " CC $@.c"
37 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
38
39test_suite_base64: test_suite_base64.c ../library/libpolarssl.a
40 echo " CC $@.c"
41 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
42
43test_suite_camellia: test_suite_camellia.c ../library/libpolarssl.a
44 echo " CC $@.c"
45 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
46
Paul Bakker8123e9d2011-01-06 15:37:30 +000047test_suite_cipher: test_suite_cipher.c ../library/libpolarssl.a
48 echo " CC $@.c"
49 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
50
Paul Bakker0049c2f2009-07-11 19:15:43 +000051test_suite_des: test_suite_des.c ../library/libpolarssl.a
52 echo " CC $@.c"
53 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
54
55test_suite_dhm: test_suite_dhm.c ../library/libpolarssl.a
56 echo " CC $@.c"
57 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
58
Paul Bakker9d781402011-05-09 16:17:09 +000059test_suite_error: test_suite_error.c ../library/libpolarssl.a
60 echo " CC $@.c"
61 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
62
Paul Bakker0049c2f2009-07-11 19:15:43 +000063test_suite_hmac_shax: test_suite_hmac_shax.c ../library/libpolarssl.a
64 echo " CC $@.c"
65 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
66
Paul Bakker17373852011-01-06 14:20:01 +000067test_suite_md: test_suite_md.c ../library/libpolarssl.a
68 echo " CC $@.c"
69 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
70
Paul Bakker0049c2f2009-07-11 19:15:43 +000071test_suite_mdx: test_suite_mdx.c ../library/libpolarssl.a
72 echo " CC $@.c"
73 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
74
75test_suite_mpi: test_suite_mpi.c ../library/libpolarssl.a
76 echo " CC $@.c"
77 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
78
Paul Bakker9dcc3222011-03-08 14:16:06 +000079test_suite_pkcs1_v21: test_suite_pkcs1_v21.c ../library/libpolarssl.a
80 echo " CC $@.c"
81 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
82
Paul Bakker0049c2f2009-07-11 19:15:43 +000083test_suite_rsa: test_suite_rsa.c ../library/libpolarssl.a
84 echo " CC $@.c"
85 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
86
87test_suite_shax: test_suite_shax.c ../library/libpolarssl.a
88 echo " CC $@.c"
89 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
90
91test_suite_x509parse: test_suite_x509parse.c ../library/libpolarssl.a
92 echo " CC $@.c"
93 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
94
95test_suite_xtea: test_suite_xtea.c ../library/libpolarssl.a
96 echo " CC $@.c"
97 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
98
Paul Bakker7d7f4f42010-02-18 18:26:04 +000099test_suite_debug: test_suite_debug.c ../library/libpolarssl.a
100 echo " CC $@.c"
101 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
102
Paul Bakker3ac1b2d2010-06-18 22:47:29 +0000103test_suite_version: test_suite_version.c ../library/libpolarssl.a
104 echo " CC $@.c"
105 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
106
Paul Bakker0049c2f2009-07-11 19:15:43 +0000107clean:
108 rm -f $(APPS) *.c
109
Paul Bakker9794cb42009-07-28 18:55:00 +0000110check: $(APPS)
Paul Bakkerd947d762009-07-28 20:16:47 +0000111 echo "Running checks (Success if all tests PASSED)"
112 for i in $(APPS); \
113 do \
114 echo " - $${i}"; \
115 ./$${i} | grep -v 'PASS$$' | grep -v -- '-----' | grep -v '^$$'; \
116 echo ""; \
117 done