add changelog and NEWS entry
[gnuk/gnuk.git] / polarssl-0.14.0 / tests / Makefile
1
2 # To compile on SunOS: add "-lsocket -lnsl" to LDFLAGS
3 # To compile on MinGW: add "-lws2_32" to LDFLAGS
4
5 CFLAGS  = -I../include -D_FILE_OFFSET_BITS=64 -Wall -Wdeclaration-after-statement \
6                         -Wno-unused-function -Wno-unused-value
7
8 OFLAGS  = -O
9 LDFLAGS = -L../library -lpolarssl
10
11 APPS =  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\
17                 test_suite_xtea                 test_suite_debug        \
18                 test_suite_version
19
20 .SILENT:
21
22 all: $(APPS)
23
24 %.c : suites/%.function suites/%.data scripts/generate_code.pl
25         echo   "  Generate      $@"
26         scripts/generate_code.pl suites $*
27
28 test_suite_aes: test_suite_aes.c ../library/libpolarssl.a
29         echo   "  CC            $@.c"
30         $(CC) $(CFLAGS) $(OFLAGS) $@.c  $(LDFLAGS) -o $@
31
32 test_suite_arc4: test_suite_arc4.c ../library/libpolarssl.a
33         echo   "  CC            $@.c"
34         $(CC) $(CFLAGS) $(OFLAGS) $@.c  $(LDFLAGS) -o $@
35
36 test_suite_base64: test_suite_base64.c ../library/libpolarssl.a
37         echo   "  CC            $@.c"
38         $(CC) $(CFLAGS) $(OFLAGS) $@.c  $(LDFLAGS) -o $@
39
40 test_suite_camellia: test_suite_camellia.c ../library/libpolarssl.a
41         echo   "  CC            $@.c"
42         $(CC) $(CFLAGS) $(OFLAGS) $@.c  $(LDFLAGS) -o $@
43
44 test_suite_des: test_suite_des.c ../library/libpolarssl.a
45         echo   "  CC            $@.c"
46         $(CC) $(CFLAGS) $(OFLAGS) $@.c  $(LDFLAGS) -o $@
47
48 test_suite_dhm: test_suite_dhm.c ../library/libpolarssl.a
49         echo   "  CC            $@.c"
50         $(CC) $(CFLAGS) $(OFLAGS) $@.c  $(LDFLAGS) -o $@
51
52 test_suite_hmac_shax: test_suite_hmac_shax.c ../library/libpolarssl.a
53         echo   "  CC            $@.c"
54         $(CC) $(CFLAGS) $(OFLAGS) $@.c  $(LDFLAGS) -o $@
55
56 test_suite_mdx: test_suite_mdx.c ../library/libpolarssl.a
57         echo   "  CC            $@.c"
58         $(CC) $(CFLAGS) $(OFLAGS) $@.c  $(LDFLAGS) -o $@
59
60 test_suite_mpi: test_suite_mpi.c ../library/libpolarssl.a
61         echo   "  CC            $@.c"
62         $(CC) $(CFLAGS) $(OFLAGS) $@.c  $(LDFLAGS) -o $@
63
64 test_suite_rsa: test_suite_rsa.c ../library/libpolarssl.a
65         echo   "  CC            $@.c"
66         $(CC) $(CFLAGS) $(OFLAGS) $@.c  $(LDFLAGS) -o $@
67
68 test_suite_shax: test_suite_shax.c ../library/libpolarssl.a
69         echo   "  CC            $@.c"
70         $(CC) $(CFLAGS) $(OFLAGS) $@.c  $(LDFLAGS) -o $@
71
72 test_suite_x509parse: test_suite_x509parse.c ../library/libpolarssl.a
73         echo   "  CC            $@.c"
74         $(CC) $(CFLAGS) $(OFLAGS) $@.c  $(LDFLAGS) -o $@
75
76 test_suite_xtea: test_suite_xtea.c ../library/libpolarssl.a
77         echo   "  CC            $@.c"
78         $(CC) $(CFLAGS) $(OFLAGS) $@.c  $(LDFLAGS) -o $@
79
80 test_suite_debug: test_suite_debug.c ../library/libpolarssl.a
81         echo   "  CC            $@.c"
82         $(CC) $(CFLAGS) $(OFLAGS) $@.c  $(LDFLAGS) -o $@
83
84 test_suite_version: test_suite_version.c ../library/libpolarssl.a
85         echo   "  CC            $@.c"
86         $(CC) $(CFLAGS) $(OFLAGS) $@.c  $(LDFLAGS) -o $@
87
88 clean:
89         rm -f $(APPS) *.c
90
91 check: $(APPS)
92         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