Paul Bakker | 0049c2f | 2009-07-11 19:15:43 +0000 | [diff] [blame] | 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\ |
Paul Bakker | 7d7f4f4 | 2010-02-18 18:26:04 +0000 | [diff] [blame] | 17 | test_suite_xtea test_suite_debug |
Paul Bakker | 0049c2f | 2009-07-11 19:15:43 +0000 | [diff] [blame] | 18 | |
| 19 | .SILENT: |
| 20 | |
| 21 | all: $(APPS) |
| 22 | |
| 23 | %.c : suites/%.function suites/%.data scripts/generate_code.pl |
| 24 | echo " Generate $@" |
| 25 | scripts/generate_code.pl suites $* |
| 26 | |
| 27 | test_suite_aes: test_suite_aes.c ../library/libpolarssl.a |
| 28 | echo " CC $@.c" |
| 29 | $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@ |
| 30 | |
| 31 | test_suite_arc4: test_suite_arc4.c ../library/libpolarssl.a |
| 32 | echo " CC $@.c" |
| 33 | $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@ |
| 34 | |
| 35 | test_suite_base64: test_suite_base64.c ../library/libpolarssl.a |
| 36 | echo " CC $@.c" |
| 37 | $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@ |
| 38 | |
| 39 | test_suite_camellia: test_suite_camellia.c ../library/libpolarssl.a |
| 40 | echo " CC $@.c" |
| 41 | $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@ |
| 42 | |
| 43 | test_suite_des: test_suite_des.c ../library/libpolarssl.a |
| 44 | echo " CC $@.c" |
| 45 | $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@ |
| 46 | |
| 47 | test_suite_dhm: test_suite_dhm.c ../library/libpolarssl.a |
| 48 | echo " CC $@.c" |
| 49 | $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@ |
| 50 | |
| 51 | test_suite_hmac_shax: test_suite_hmac_shax.c ../library/libpolarssl.a |
| 52 | echo " CC $@.c" |
| 53 | $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@ |
| 54 | |
| 55 | test_suite_mdx: test_suite_mdx.c ../library/libpolarssl.a |
| 56 | echo " CC $@.c" |
| 57 | $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@ |
| 58 | |
| 59 | test_suite_mpi: test_suite_mpi.c ../library/libpolarssl.a |
| 60 | echo " CC $@.c" |
| 61 | $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@ |
| 62 | |
| 63 | test_suite_rsa: test_suite_rsa.c ../library/libpolarssl.a |
| 64 | echo " CC $@.c" |
| 65 | $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@ |
| 66 | |
| 67 | test_suite_shax: test_suite_shax.c ../library/libpolarssl.a |
| 68 | echo " CC $@.c" |
| 69 | $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@ |
| 70 | |
| 71 | test_suite_x509parse: test_suite_x509parse.c ../library/libpolarssl.a |
| 72 | echo " CC $@.c" |
| 73 | $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@ |
| 74 | |
| 75 | test_suite_xtea: test_suite_xtea.c ../library/libpolarssl.a |
| 76 | echo " CC $@.c" |
| 77 | $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@ |
| 78 | |
Paul Bakker | 7d7f4f4 | 2010-02-18 18:26:04 +0000 | [diff] [blame] | 79 | test_suite_debug: test_suite_debug.c ../library/libpolarssl.a |
| 80 | echo " CC $@.c" |
| 81 | $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@ |
| 82 | |
Paul Bakker | 0049c2f | 2009-07-11 19:15:43 +0000 | [diff] [blame] | 83 | clean: |
| 84 | rm -f $(APPS) *.c |
| 85 | |
Paul Bakker | 9794cb4 | 2009-07-28 18:55:00 +0000 | [diff] [blame] | 86 | check: $(APPS) |
Paul Bakker | d947d76 | 2009-07-28 20:16:47 +0000 | [diff] [blame] | 87 | echo "Running checks (Success if all tests PASSED)" |
| 88 | for i in $(APPS); \ |
| 89 | do \ |
| 90 | echo " - $${i}"; \ |
| 91 | ./$${i} | grep -v 'PASS$$' | grep -v -- '-----' | grep -v '^$$'; \ |
| 92 | echo ""; \ |
| 93 | done |