blob: 2e4f88a1a7803ca95c62bec8474aa02c9823eaeb [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 Bakker17373852011-01-06 14:20:01 +000018 test_suite_version test_suite_md
Paul Bakker0049c2f2009-07-11 19:15:43 +000019
20.SILENT:
21
22all: $(APPS)
23
24%.c : suites/%.function suites/%.data scripts/generate_code.pl
25 echo " Generate $@"
26 scripts/generate_code.pl suites $*
27
28test_suite_aes: test_suite_aes.c ../library/libpolarssl.a
29 echo " CC $@.c"
30 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
31
32test_suite_arc4: test_suite_arc4.c ../library/libpolarssl.a
33 echo " CC $@.c"
34 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
35
36test_suite_base64: test_suite_base64.c ../library/libpolarssl.a
37 echo " CC $@.c"
38 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
39
40test_suite_camellia: test_suite_camellia.c ../library/libpolarssl.a
41 echo " CC $@.c"
42 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
43
44test_suite_des: test_suite_des.c ../library/libpolarssl.a
45 echo " CC $@.c"
46 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
47
48test_suite_dhm: test_suite_dhm.c ../library/libpolarssl.a
49 echo " CC $@.c"
50 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
51
52test_suite_hmac_shax: test_suite_hmac_shax.c ../library/libpolarssl.a
53 echo " CC $@.c"
54 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
55
Paul Bakker17373852011-01-06 14:20:01 +000056test_suite_md: test_suite_md.c ../library/libpolarssl.a
57 echo " CC $@.c"
58 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
59
Paul Bakker0049c2f2009-07-11 19:15:43 +000060test_suite_mdx: test_suite_mdx.c ../library/libpolarssl.a
61 echo " CC $@.c"
62 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
63
64test_suite_mpi: test_suite_mpi.c ../library/libpolarssl.a
65 echo " CC $@.c"
66 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
67
68test_suite_rsa: test_suite_rsa.c ../library/libpolarssl.a
69 echo " CC $@.c"
70 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
71
72test_suite_shax: test_suite_shax.c ../library/libpolarssl.a
73 echo " CC $@.c"
74 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
75
76test_suite_x509parse: test_suite_x509parse.c ../library/libpolarssl.a
77 echo " CC $@.c"
78 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
79
80test_suite_xtea: test_suite_xtea.c ../library/libpolarssl.a
81 echo " CC $@.c"
82 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
83
Paul Bakker7d7f4f42010-02-18 18:26:04 +000084test_suite_debug: test_suite_debug.c ../library/libpolarssl.a
85 echo " CC $@.c"
86 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
87
Paul Bakker3ac1b2d2010-06-18 22:47:29 +000088test_suite_version: test_suite_version.c ../library/libpolarssl.a
89 echo " CC $@.c"
90 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
91
Paul Bakker0049c2f2009-07-11 19:15:43 +000092clean:
93 rm -f $(APPS) *.c
94
Paul Bakker9794cb42009-07-28 18:55:00 +000095check: $(APPS)
Paul Bakkerd947d762009-07-28 20:16:47 +000096 echo "Running checks (Success if all tests PASSED)"
97 for i in $(APPS); \
98 do \
99 echo " - $${i}"; \
100 ./$${i} | grep -v 'PASS$$' | grep -v -- '-----' | grep -v '^$$'; \
101 echo ""; \
102 done