Paul Bakker | 0049c2f | 2009-07-11 19:15:43 +0000 | [diff] [blame] | 1 | |
| 2 | # To compile on SunOS: add "-lsocket -lnsl" to LDFLAGS |
Paul Bakker | 62f88dc | 2012-05-10 21:26:28 +0000 | [diff] [blame] | 3 | # To compile on MinGW: add "-lws2_32" to LDFLAGS or define WINDOWS in your env |
Paul Bakker | 43b7e35 | 2011-01-18 15:27:19 +0000 | [diff] [blame] | 4 | # To compile with PKCS11: add "-lpkcs11-helper" to LDFLAGS |
Paul Bakker | 0049c2f | 2009-07-11 19:15:43 +0000 | [diff] [blame] | 5 | |
Paul Bakker | 46eb138 | 2011-01-30 17:10:13 +0000 | [diff] [blame] | 6 | CFLAGS += -I../include -D_FILE_OFFSET_BITS=64 -Wall -W -Wdeclaration-after-statement \ |
Paul Bakker | 0049c2f | 2009-07-11 19:15:43 +0000 | [diff] [blame] | 7 | -Wno-unused-function -Wno-unused-value |
| 8 | |
Paul Bakker | f1ab0ec | 2012-10-23 12:12:53 +0000 | [diff] [blame] | 9 | OFLAGS = -O2 |
Paul Bakker | a585beb | 2011-06-21 08:59:44 +0000 | [diff] [blame] | 10 | LDFLAGS += -L../library -lpolarssl $(SYS_LDFLAGS) |
Paul Bakker | 0049c2f | 2009-07-11 19:15:43 +0000 | [diff] [blame] | 11 | |
Paul Bakker | c7ffd36 | 2012-04-05 12:08:29 +0000 | [diff] [blame] | 12 | ifdef DEBUG |
| 13 | CFLAGS += -g3 |
| 14 | endif |
| 15 | |
Paul Bakker | cd5b529 | 2012-05-10 20:49:10 +0000 | [diff] [blame] | 16 | ifdef WINDOWS |
| 17 | LDFLAGS += -lws2_32 |
| 18 | endif |
| 19 | |
Paul Bakker | 2770fbd | 2012-07-03 13:30:23 +0000 | [diff] [blame] | 20 | # Zlib shared library extensions: |
| 21 | ifdef ZLIB |
| 22 | LDFLAGS += -lz |
| 23 | endif |
| 24 | |
Paul Bakker | 286bf3c | 2013-04-08 18:09:51 +0200 | [diff] [blame] | 25 | APPS = test_suite_aes.ecb test_suite_aes.cbc \ |
| 26 | test_suite_aes.cfb test_suite_aes.rest \ |
| 27 | test_suite_arc4 \ |
Paul Bakker | a9379c0 | 2012-07-04 11:02:11 +0000 | [diff] [blame] | 28 | test_suite_base64 test_suite_blowfish \ |
Paul Bakker | 6132d0a | 2012-07-04 17:10:40 +0000 | [diff] [blame] | 29 | test_suite_camellia test_suite_cipher.aes \ |
| 30 | test_suite_cipher.blowfish \ |
| 31 | test_suite_cipher.camellia \ |
Paul Bakker | fab5c82 | 2012-02-06 16:45:10 +0000 | [diff] [blame] | 32 | test_suite_cipher.des test_suite_cipher.null \ |
Manuel Pégourié-Gonnard | d5fdcaf | 2013-07-24 18:05:00 +0200 | [diff] [blame] | 33 | test_suite_cipher.padding \ |
Paul Bakker | fab5c82 | 2012-02-06 16:45:10 +0000 | [diff] [blame] | 34 | test_suite_ctr_drbg test_suite_debug \ |
Paul Bakker | 9d78140 | 2011-05-09 16:17:09 +0000 | [diff] [blame] | 35 | test_suite_des test_suite_dhm \ |
Paul Bakker | d589a0d | 2013-03-13 16:30:17 +0100 | [diff] [blame] | 36 | test_suite_ecdh test_suite_ecdsa \ |
Paul Bakker | a95919b | 2013-01-16 17:00:05 +0100 | [diff] [blame] | 37 | test_suite_ecp \ |
Paul Bakker | 286bf3c | 2013-04-08 18:09:51 +0200 | [diff] [blame] | 38 | test_suite_error \ |
| 39 | test_suite_gcm.decrypt_128 \ |
| 40 | test_suite_gcm.decrypt_192 \ |
| 41 | test_suite_gcm.decrypt_256 \ |
| 42 | test_suite_gcm.encrypt_128 \ |
| 43 | test_suite_gcm.encrypt_192 \ |
| 44 | test_suite_gcm.encrypt_256 \ |
| 45 | test_suite_hmac_shax \ |
Paul Bakker | 9d78140 | 2011-05-09 16:17:09 +0000 | [diff] [blame] | 46 | test_suite_md test_suite_mdx \ |
Paul Bakker | f518b16 | 2012-08-23 13:03:18 +0000 | [diff] [blame] | 47 | test_suite_mpi test_suite_pbkdf2 \ |
Paul Bakker | b0c19a4 | 2013-06-24 19:26:38 +0200 | [diff] [blame] | 48 | test_suite_pkcs1_v21 test_suite_pkcs5 \ |
Paul Bakker | 9d78140 | 2011-05-09 16:17:09 +0000 | [diff] [blame] | 49 | test_suite_rsa test_suite_shax \ |
Paul Bakker | 6d62050 | 2012-02-16 14:09:13 +0000 | [diff] [blame] | 50 | test_suite_x509parse test_suite_x509write \ |
| 51 | test_suite_xtea test_suite_version |
Paul Bakker | 0049c2f | 2009-07-11 19:15:43 +0000 | [diff] [blame] | 52 | |
| 53 | .SILENT: |
| 54 | |
| 55 | all: $(APPS) |
| 56 | |
Paul Bakker | 1934318 | 2013-08-16 13:31:10 +0200 | [diff] [blame^] | 57 | test_suite_aes.ecb.c : suites/test_suite_aes.function suites/test_suite_aes.ecb.data scripts/generate_code.pl suites/helpers.function suites/main_test.function |
Paul Bakker | 286bf3c | 2013-04-08 18:09:51 +0200 | [diff] [blame] | 58 | echo " Generate $@" |
| 59 | scripts/generate_code.pl suites test_suite_aes test_suite_aes.ecb |
| 60 | |
Paul Bakker | 1934318 | 2013-08-16 13:31:10 +0200 | [diff] [blame^] | 61 | test_suite_aes.cbc.c : suites/test_suite_aes.function suites/test_suite_aes.cbc.data scripts/generate_code.pl suites/helpers.function suites/main_test.function |
Paul Bakker | 286bf3c | 2013-04-08 18:09:51 +0200 | [diff] [blame] | 62 | echo " Generate $@" |
| 63 | scripts/generate_code.pl suites test_suite_aes test_suite_aes.cbc |
| 64 | |
Paul Bakker | 1934318 | 2013-08-16 13:31:10 +0200 | [diff] [blame^] | 65 | test_suite_aes.cfb.c : suites/test_suite_aes.function suites/test_suite_aes.cfb.data scripts/generate_code.pl suites/helpers.function suites/main_test.function |
Paul Bakker | 286bf3c | 2013-04-08 18:09:51 +0200 | [diff] [blame] | 66 | echo " Generate $@" |
| 67 | scripts/generate_code.pl suites test_suite_aes test_suite_aes.cfb |
| 68 | |
Paul Bakker | 1934318 | 2013-08-16 13:31:10 +0200 | [diff] [blame^] | 69 | test_suite_aes.rest.c : suites/test_suite_aes.function suites/test_suite_aes.rest.data scripts/generate_code.pl suites/helpers.function suites/main_test.function |
Paul Bakker | 286bf3c | 2013-04-08 18:09:51 +0200 | [diff] [blame] | 70 | echo " Generate $@" |
| 71 | scripts/generate_code.pl suites test_suite_aes test_suite_aes.rest |
| 72 | |
Paul Bakker | 1934318 | 2013-08-16 13:31:10 +0200 | [diff] [blame^] | 73 | test_suite_cipher.aes.c : suites/test_suite_cipher.function suites/test_suite_cipher.aes.data scripts/generate_code.pl suites/helpers.function suites/main_test.function |
Paul Bakker | 46c1794 | 2011-07-13 14:54:54 +0000 | [diff] [blame] | 74 | echo " Generate $@" |
| 75 | scripts/generate_code.pl suites test_suite_cipher test_suite_cipher.aes |
| 76 | |
Paul Bakker | 1934318 | 2013-08-16 13:31:10 +0200 | [diff] [blame^] | 77 | test_suite_cipher.blowfish.c : suites/test_suite_cipher.function suites/test_suite_cipher.blowfish.data scripts/generate_code.pl suites/helpers.function suites/main_test.function |
Paul Bakker | 6132d0a | 2012-07-04 17:10:40 +0000 | [diff] [blame] | 78 | echo " Generate $@" |
| 79 | scripts/generate_code.pl suites test_suite_cipher test_suite_cipher.blowfish |
| 80 | |
Paul Bakker | 1934318 | 2013-08-16 13:31:10 +0200 | [diff] [blame^] | 81 | test_suite_cipher.camellia.c : suites/test_suite_cipher.function suites/test_suite_cipher.camellia.data scripts/generate_code.pl suites/helpers.function suites/main_test.function |
Paul Bakker | 46c1794 | 2011-07-13 14:54:54 +0000 | [diff] [blame] | 82 | echo " Generate $@" |
| 83 | scripts/generate_code.pl suites test_suite_cipher test_suite_cipher.camellia |
| 84 | |
Paul Bakker | 1934318 | 2013-08-16 13:31:10 +0200 | [diff] [blame^] | 85 | test_suite_cipher.des.c : suites/test_suite_cipher.function suites/test_suite_cipher.des.data scripts/generate_code.pl suites/helpers.function suites/main_test.function |
Paul Bakker | 46c1794 | 2011-07-13 14:54:54 +0000 | [diff] [blame] | 86 | echo " Generate $@" |
| 87 | scripts/generate_code.pl suites test_suite_cipher test_suite_cipher.des |
| 88 | |
Paul Bakker | 1934318 | 2013-08-16 13:31:10 +0200 | [diff] [blame^] | 89 | test_suite_cipher.null.c : suites/test_suite_cipher.function suites/test_suite_cipher.null.data scripts/generate_code.pl suites/helpers.function suites/main_test.function |
Paul Bakker | fab5c82 | 2012-02-06 16:45:10 +0000 | [diff] [blame] | 90 | echo " Generate $@" |
| 91 | scripts/generate_code.pl suites test_suite_cipher test_suite_cipher.null |
| 92 | |
Paul Bakker | 1934318 | 2013-08-16 13:31:10 +0200 | [diff] [blame^] | 93 | test_suite_cipher.padding.c : suites/test_suite_cipher.function suites/test_suite_cipher.padding.data scripts/generate_code.pl suites/helpers.function suites/main_test.function |
Manuel Pégourié-Gonnard | d5fdcaf | 2013-07-24 18:05:00 +0200 | [diff] [blame] | 94 | echo " Generate $@" |
| 95 | scripts/generate_code.pl suites test_suite_cipher test_suite_cipher.padding |
| 96 | |
Paul Bakker | 1934318 | 2013-08-16 13:31:10 +0200 | [diff] [blame^] | 97 | test_suite_gcm.decrypt_128.c : suites/test_suite_gcm.function suites/test_suite_gcm.decrypt_128.data scripts/generate_code.pl suites/helpers.function suites/main_test.function |
Paul Bakker | 89e80c9 | 2012-03-20 13:50:09 +0000 | [diff] [blame] | 98 | echo " Generate $@" |
Paul Bakker | 286bf3c | 2013-04-08 18:09:51 +0200 | [diff] [blame] | 99 | scripts/generate_code.pl suites test_suite_gcm test_suite_gcm.decrypt_128 |
Paul Bakker | 89e80c9 | 2012-03-20 13:50:09 +0000 | [diff] [blame] | 100 | |
Paul Bakker | 1934318 | 2013-08-16 13:31:10 +0200 | [diff] [blame^] | 101 | test_suite_gcm.decrypt_192.c : suites/test_suite_gcm.function suites/test_suite_gcm.decrypt_192.data scripts/generate_code.pl suites/helpers.function suites/main_test.function |
Paul Bakker | 89e80c9 | 2012-03-20 13:50:09 +0000 | [diff] [blame] | 102 | echo " Generate $@" |
Paul Bakker | 286bf3c | 2013-04-08 18:09:51 +0200 | [diff] [blame] | 103 | scripts/generate_code.pl suites test_suite_gcm test_suite_gcm.decrypt_192 |
| 104 | |
Paul Bakker | 1934318 | 2013-08-16 13:31:10 +0200 | [diff] [blame^] | 105 | test_suite_gcm.decrypt_256.c : suites/test_suite_gcm.function suites/test_suite_gcm.decrypt_256.data scripts/generate_code.pl suites/helpers.function suites/main_test.function |
Paul Bakker | 286bf3c | 2013-04-08 18:09:51 +0200 | [diff] [blame] | 106 | echo " Generate $@" |
| 107 | scripts/generate_code.pl suites test_suite_gcm test_suite_gcm.decrypt_256 |
| 108 | |
Paul Bakker | 1934318 | 2013-08-16 13:31:10 +0200 | [diff] [blame^] | 109 | test_suite_gcm.encrypt_128.c : suites/test_suite_gcm.function suites/test_suite_gcm.encrypt_128.data scripts/generate_code.pl suites/helpers.function suites/main_test.function |
Paul Bakker | 286bf3c | 2013-04-08 18:09:51 +0200 | [diff] [blame] | 110 | echo " Generate $@" |
| 111 | scripts/generate_code.pl suites test_suite_gcm test_suite_gcm.encrypt_128 |
| 112 | |
Paul Bakker | 1934318 | 2013-08-16 13:31:10 +0200 | [diff] [blame^] | 113 | test_suite_gcm.encrypt_192.c : suites/test_suite_gcm.function suites/test_suite_gcm.encrypt_192.data scripts/generate_code.pl suites/helpers.function suites/main_test.function |
Paul Bakker | 286bf3c | 2013-04-08 18:09:51 +0200 | [diff] [blame] | 114 | echo " Generate $@" |
| 115 | scripts/generate_code.pl suites test_suite_gcm test_suite_gcm.encrypt_192 |
| 116 | |
Paul Bakker | 1934318 | 2013-08-16 13:31:10 +0200 | [diff] [blame^] | 117 | test_suite_gcm.encrypt_256.c : suites/test_suite_gcm.function suites/test_suite_gcm.encrypt_256.data scripts/generate_code.pl suites/helpers.function suites/main_test.function |
Paul Bakker | 286bf3c | 2013-04-08 18:09:51 +0200 | [diff] [blame] | 118 | echo " Generate $@" |
| 119 | scripts/generate_code.pl suites test_suite_gcm test_suite_gcm.encrypt_256 |
Paul Bakker | 89e80c9 | 2012-03-20 13:50:09 +0000 | [diff] [blame] | 120 | |
Paul Bakker | 1934318 | 2013-08-16 13:31:10 +0200 | [diff] [blame^] | 121 | %.c : suites/%.function suites/%.data scripts/generate_code.pl suites/helpers.function suites/main_test.function |
Paul Bakker | 0049c2f | 2009-07-11 19:15:43 +0000 | [diff] [blame] | 122 | echo " Generate $@" |
Paul Bakker | 46c1794 | 2011-07-13 14:54:54 +0000 | [diff] [blame] | 123 | scripts/generate_code.pl suites $* $* |
Paul Bakker | 0049c2f | 2009-07-11 19:15:43 +0000 | [diff] [blame] | 124 | |
Paul Bakker | 286bf3c | 2013-04-08 18:09:51 +0200 | [diff] [blame] | 125 | test_suite_aes.ecb: test_suite_aes.ecb.c ../library/libpolarssl.a |
| 126 | echo " CC $@.c" |
| 127 | $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@ |
| 128 | |
| 129 | test_suite_aes.cbc: test_suite_aes.cbc.c ../library/libpolarssl.a |
| 130 | echo " CC $@.c" |
| 131 | $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@ |
| 132 | |
| 133 | test_suite_aes.cfb: test_suite_aes.cfb.c ../library/libpolarssl.a |
| 134 | echo " CC $@.c" |
| 135 | $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@ |
| 136 | |
| 137 | test_suite_aes.rest: test_suite_aes.rest.c ../library/libpolarssl.a |
Paul Bakker | 0049c2f | 2009-07-11 19:15:43 +0000 | [diff] [blame] | 138 | echo " CC $@.c" |
| 139 | $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@ |
| 140 | |
| 141 | test_suite_arc4: test_suite_arc4.c ../library/libpolarssl.a |
| 142 | echo " CC $@.c" |
| 143 | $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@ |
| 144 | |
| 145 | test_suite_base64: test_suite_base64.c ../library/libpolarssl.a |
| 146 | echo " CC $@.c" |
| 147 | $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@ |
| 148 | |
Paul Bakker | a9379c0 | 2012-07-04 11:02:11 +0000 | [diff] [blame] | 149 | test_suite_blowfish: test_suite_blowfish.c ../library/libpolarssl.a |
| 150 | echo " CC $@.c" |
| 151 | $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@ |
| 152 | |
Paul Bakker | 0049c2f | 2009-07-11 19:15:43 +0000 | [diff] [blame] | 153 | test_suite_camellia: test_suite_camellia.c ../library/libpolarssl.a |
| 154 | echo " CC $@.c" |
| 155 | $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@ |
| 156 | |
Paul Bakker | 46c1794 | 2011-07-13 14:54:54 +0000 | [diff] [blame] | 157 | test_suite_cipher.aes: test_suite_cipher.aes.c ../library/libpolarssl.a |
| 158 | echo " CC $@.c" |
| 159 | $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@ |
| 160 | |
Paul Bakker | 6132d0a | 2012-07-04 17:10:40 +0000 | [diff] [blame] | 161 | test_suite_cipher.blowfish: test_suite_cipher.blowfish.c ../library/libpolarssl.a |
| 162 | echo " CC $@.c" |
| 163 | $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@ |
| 164 | |
Paul Bakker | 46c1794 | 2011-07-13 14:54:54 +0000 | [diff] [blame] | 165 | test_suite_cipher.camellia: test_suite_cipher.camellia.c ../library/libpolarssl.a |
| 166 | echo " CC $@.c" |
| 167 | $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@ |
| 168 | |
Paul Bakker | fab5c82 | 2012-02-06 16:45:10 +0000 | [diff] [blame] | 169 | test_suite_cipher.des: test_suite_cipher.des.c ../library/libpolarssl.a |
Paul Bakker | 0e04d0e | 2011-11-27 14:46:59 +0000 | [diff] [blame] | 170 | echo " CC $@.c" |
| 171 | $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@ |
| 172 | |
Paul Bakker | fab5c82 | 2012-02-06 16:45:10 +0000 | [diff] [blame] | 173 | test_suite_cipher.null: test_suite_cipher.null.c ../library/libpolarssl.a |
| 174 | echo " CC $@.c" |
| 175 | $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@ |
| 176 | |
Manuel Pégourié-Gonnard | d5fdcaf | 2013-07-24 18:05:00 +0200 | [diff] [blame] | 177 | test_suite_cipher.padding: test_suite_cipher.padding.c ../library/libpolarssl.a |
| 178 | echo " CC $@.c" |
| 179 | $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@ |
| 180 | |
Paul Bakker | fab5c82 | 2012-02-06 16:45:10 +0000 | [diff] [blame] | 181 | test_suite_ctr_drbg: test_suite_ctr_drbg.c ../library/libpolarssl.a |
Paul Bakker | 8123e9d | 2011-01-06 15:37:30 +0000 | [diff] [blame] | 182 | echo " CC $@.c" |
| 183 | $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@ |
| 184 | |
Paul Bakker | 0049c2f | 2009-07-11 19:15:43 +0000 | [diff] [blame] | 185 | test_suite_des: test_suite_des.c ../library/libpolarssl.a |
| 186 | echo " CC $@.c" |
| 187 | $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@ |
| 188 | |
| 189 | test_suite_dhm: test_suite_dhm.c ../library/libpolarssl.a |
| 190 | echo " CC $@.c" |
| 191 | $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@ |
| 192 | |
Paul Bakker | d589a0d | 2013-03-13 16:30:17 +0100 | [diff] [blame] | 193 | test_suite_ecdh: test_suite_ecdh.c ../library/libpolarssl.a |
| 194 | echo " CC $@.c" |
| 195 | $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@ |
| 196 | |
| 197 | test_suite_ecdsa: test_suite_ecdsa.c ../library/libpolarssl.a |
| 198 | echo " CC $@.c" |
| 199 | $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@ |
| 200 | |
Paul Bakker | a95919b | 2013-01-16 17:00:05 +0100 | [diff] [blame] | 201 | test_suite_ecp: test_suite_ecp.c ../library/libpolarssl.a |
| 202 | echo " CC $@.c" |
| 203 | $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@ |
| 204 | |
Paul Bakker | 9d78140 | 2011-05-09 16:17:09 +0000 | [diff] [blame] | 205 | test_suite_error: test_suite_error.c ../library/libpolarssl.a |
| 206 | echo " CC $@.c" |
| 207 | $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@ |
| 208 | |
Paul Bakker | 286bf3c | 2013-04-08 18:09:51 +0200 | [diff] [blame] | 209 | test_suite_gcm.decrypt_128: test_suite_gcm.decrypt_128.c ../library/libpolarssl.a |
Paul Bakker | 89e80c9 | 2012-03-20 13:50:09 +0000 | [diff] [blame] | 210 | echo " CC $@.c" |
| 211 | $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@ |
| 212 | |
Paul Bakker | 286bf3c | 2013-04-08 18:09:51 +0200 | [diff] [blame] | 213 | test_suite_gcm.decrypt_192: test_suite_gcm.decrypt_192.c ../library/libpolarssl.a |
| 214 | echo " CC $@.c" |
| 215 | $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@ |
| 216 | |
| 217 | test_suite_gcm.decrypt_256: test_suite_gcm.decrypt_256.c ../library/libpolarssl.a |
| 218 | echo " CC $@.c" |
| 219 | $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@ |
| 220 | |
| 221 | test_suite_gcm.encrypt_128: test_suite_gcm.encrypt_128.c ../library/libpolarssl.a |
| 222 | echo " CC $@.c" |
| 223 | $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@ |
| 224 | |
| 225 | test_suite_gcm.encrypt_192: test_suite_gcm.encrypt_192.c ../library/libpolarssl.a |
| 226 | echo " CC $@.c" |
| 227 | $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@ |
| 228 | |
| 229 | test_suite_gcm.encrypt_256: test_suite_gcm.encrypt_256.c ../library/libpolarssl.a |
Paul Bakker | 89e80c9 | 2012-03-20 13:50:09 +0000 | [diff] [blame] | 230 | echo " CC $@.c" |
| 231 | $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@ |
| 232 | |
Paul Bakker | 0049c2f | 2009-07-11 19:15:43 +0000 | [diff] [blame] | 233 | test_suite_hmac_shax: test_suite_hmac_shax.c ../library/libpolarssl.a |
| 234 | echo " CC $@.c" |
| 235 | $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@ |
| 236 | |
Paul Bakker | 1737385 | 2011-01-06 14:20:01 +0000 | [diff] [blame] | 237 | test_suite_md: test_suite_md.c ../library/libpolarssl.a |
| 238 | echo " CC $@.c" |
| 239 | $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@ |
| 240 | |
Paul Bakker | 0049c2f | 2009-07-11 19:15:43 +0000 | [diff] [blame] | 241 | test_suite_mdx: test_suite_mdx.c ../library/libpolarssl.a |
| 242 | echo " CC $@.c" |
| 243 | $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@ |
| 244 | |
| 245 | test_suite_mpi: test_suite_mpi.c ../library/libpolarssl.a |
| 246 | echo " CC $@.c" |
| 247 | $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@ |
| 248 | |
Paul Bakker | f518b16 | 2012-08-23 13:03:18 +0000 | [diff] [blame] | 249 | test_suite_pbkdf2: test_suite_pbkdf2.c ../library/libpolarssl.a |
| 250 | echo " CC $@.c" |
| 251 | $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@ |
| 252 | |
Paul Bakker | 9dcc322 | 2011-03-08 14:16:06 +0000 | [diff] [blame] | 253 | test_suite_pkcs1_v21: test_suite_pkcs1_v21.c ../library/libpolarssl.a |
| 254 | echo " CC $@.c" |
| 255 | $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@ |
| 256 | |
Paul Bakker | b0c19a4 | 2013-06-24 19:26:38 +0200 | [diff] [blame] | 257 | test_suite_pkcs5: test_suite_pkcs5.c ../library/libpolarssl.a |
| 258 | echo " CC $@.c" |
| 259 | $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@ |
| 260 | |
Paul Bakker | 0049c2f | 2009-07-11 19:15:43 +0000 | [diff] [blame] | 261 | test_suite_rsa: test_suite_rsa.c ../library/libpolarssl.a |
| 262 | echo " CC $@.c" |
| 263 | $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@ |
| 264 | |
| 265 | test_suite_shax: test_suite_shax.c ../library/libpolarssl.a |
| 266 | echo " CC $@.c" |
| 267 | $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@ |
| 268 | |
| 269 | test_suite_x509parse: test_suite_x509parse.c ../library/libpolarssl.a |
| 270 | echo " CC $@.c" |
| 271 | $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@ |
| 272 | |
Paul Bakker | 6d62050 | 2012-02-16 14:09:13 +0000 | [diff] [blame] | 273 | test_suite_x509write: test_suite_x509write.c ../library/libpolarssl.a |
| 274 | echo " CC $@.c" |
| 275 | $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@ |
| 276 | |
Paul Bakker | 0049c2f | 2009-07-11 19:15:43 +0000 | [diff] [blame] | 277 | test_suite_xtea: test_suite_xtea.c ../library/libpolarssl.a |
| 278 | echo " CC $@.c" |
| 279 | $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@ |
| 280 | |
Paul Bakker | 7d7f4f4 | 2010-02-18 18:26:04 +0000 | [diff] [blame] | 281 | test_suite_debug: test_suite_debug.c ../library/libpolarssl.a |
| 282 | echo " CC $@.c" |
| 283 | $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@ |
| 284 | |
Paul Bakker | 3ac1b2d | 2010-06-18 22:47:29 +0000 | [diff] [blame] | 285 | test_suite_version: test_suite_version.c ../library/libpolarssl.a |
| 286 | echo " CC $@.c" |
| 287 | $(CC) $(CFLAGS) $(OFLAGS) $@.c $(LDFLAGS) -o $@ |
| 288 | |
Paul Bakker | 0049c2f | 2009-07-11 19:15:43 +0000 | [diff] [blame] | 289 | clean: |
Paul Bakker | 62f88dc | 2012-05-10 21:26:28 +0000 | [diff] [blame] | 290 | ifndef WINDOWS |
Paul Bakker | 0049c2f | 2009-07-11 19:15:43 +0000 | [diff] [blame] | 291 | rm -f $(APPS) *.c |
Paul Bakker | 62f88dc | 2012-05-10 21:26:28 +0000 | [diff] [blame] | 292 | endif |
| 293 | ifdef WINDOWS |
| 294 | del /Q /F *.c *.exe |
| 295 | endif |
Paul Bakker | 0049c2f | 2009-07-11 19:15:43 +0000 | [diff] [blame] | 296 | |
Paul Bakker | 9794cb4 | 2009-07-28 18:55:00 +0000 | [diff] [blame] | 297 | check: $(APPS) |
Paul Bakker | 62f88dc | 2012-05-10 21:26:28 +0000 | [diff] [blame] | 298 | ifndef WINDOWS |
Paul Bakker | d14cd35 | 2012-05-08 15:39:50 +0000 | [diff] [blame] | 299 | echo "Running checks (Success if all tests PASSED)" |
| 300 | RETURN=0; \ |
Paul Bakker | d947d76 | 2009-07-28 20:16:47 +0000 | [diff] [blame] | 301 | for i in $(APPS); \ |
| 302 | do \ |
| 303 | echo " - $${i}"; \ |
Paul Bakker | d14cd35 | 2012-05-08 15:39:50 +0000 | [diff] [blame] | 304 | RESULT=`./$${i} | grep -v 'PASS$$' | grep -v -- '-----' | grep -v '^$$'`; \ |
| 305 | FAILED=`echo $$RESULT |grep FAILED`; \ |
| 306 | echo " $$RESULT"; \ |
| 307 | if [ "$$FAILED" != "" ]; \ |
| 308 | then \ |
| 309 | echo "**** Failed ***************"; \ |
| 310 | RETURN=1; \ |
| 311 | fi; \ |
Paul Bakker | d947d76 | 2009-07-28 20:16:47 +0000 | [diff] [blame] | 312 | echo ""; \ |
Paul Bakker | d14cd35 | 2012-05-08 15:39:50 +0000 | [diff] [blame] | 313 | done; \ |
| 314 | if [ "$$RETURN" -eq 1 ]; then exit 1; fi |
Paul Bakker | 62f88dc | 2012-05-10 21:26:28 +0000 | [diff] [blame] | 315 | endif |