blob: c90d8b3ae84166d07653a6b1cd5512c3d716bc59 [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 \
18 test_suite_version
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
56test_suite_mdx: test_suite_mdx.c ../library/libpolarssl.a
57 echo " CC $@.c"
58 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
59
60test_suite_mpi: test_suite_mpi.c ../library/libpolarssl.a
61 echo " CC $@.c"
62 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
63
64test_suite_rsa: test_suite_rsa.c ../library/libpolarssl.a
65 echo " CC $@.c"
66 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
67
68test_suite_shax: test_suite_shax.c ../library/libpolarssl.a
69 echo " CC $@.c"
70 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
71
72test_suite_x509parse: test_suite_x509parse.c ../library/libpolarssl.a
73 echo " CC $@.c"
74 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
75
76test_suite_xtea: test_suite_xtea.c ../library/libpolarssl.a
77 echo " CC $@.c"
78 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
79
Paul Bakker7d7f4f42010-02-18 18:26:04 +000080test_suite_debug: test_suite_debug.c ../library/libpolarssl.a
81 echo " CC $@.c"
82 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
83
Paul Bakker3ac1b2d2010-06-18 22:47:29 +000084test_suite_version: test_suite_version.c ../library/libpolarssl.a
85 echo " CC $@.c"
86 $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@
87
Paul Bakker0049c2f2009-07-11 19:15:43 +000088clean:
89 rm -f $(APPS) *.c
90
Paul Bakker9794cb42009-07-28 18:55:00 +000091check: $(APPS)
Paul Bakkerd947d762009-07-28 20:16:47 +000092 echo "Running checks (Success if all tests PASSED)"
93 for i in $(APPS); \
94 do \
95 echo " - $${i}"; \
96 ./$${i} | grep -v 'PASS$$' | grep -v -- '-----' | grep -v '^$$'; \
97 echo ""; \
98 done