Paul Bakker | 5121ce5 | 2009-01-03 21:22:43 +0000 | [diff] [blame] | 1 | DESTDIR=/usr/local |
Manuel Pégourié-Gonnard | 5285970 | 2015-01-27 14:05:16 +0100 | [diff] [blame] | 2 | PREFIX=mbedtls_ |
Gilles Peskine | 687d1ab | 2021-04-22 01:01:56 +0200 | [diff] [blame] | 3 | PERL ?= perl |
Paul Bakker | 5121ce5 | 2009-01-03 21:22:43 +0000 | [diff] [blame] | 4 | |
Gilles Peskine | 48230e8 | 2024-03-04 16:42:54 +0100 | [diff] [blame] | 5 | ifneq (,$(filter-out lib library/%,$(or $(MAKECMDGOALS),all))) |
| 6 | ifeq (,$(wildcard framework/exported.make)) |
| 7 | # Use the define keyword to get a multi-line message. |
| 8 | # GNU make appends ". Stop.", so tweak the ending of our message accordingly. |
Harry Ramsey | 5d5f471 | 2024-12-10 09:58:23 +0000 | [diff] [blame] | 9 | ifneq (,$(wildcard .git)) |
Harry Ramsey | 6d9c389 | 2024-10-28 14:05:23 +0000 | [diff] [blame] | 10 | define error_message |
Harry Ramsey | 0f07e76 | 2024-11-04 12:16:50 +0000 | [diff] [blame] | 11 | ${MBEDTLS_PATH}/framework/exported.make not found (and does appear to be a git checkout). Run `git submodule update --init` from the source tree to fetch the submodule contents. |
Harry Ramsey | e05cf2e | 2024-09-17 15:12:11 +0100 | [diff] [blame] | 12 | This is a fatal error |
Harry Ramsey | 66ce986 | 2024-11-04 11:37:05 +0000 | [diff] [blame] | 13 | endef |
Harry Ramsey | e05cf2e | 2024-09-17 15:12:11 +0100 | [diff] [blame] | 14 | else |
Harry Ramsey | 66ce986 | 2024-11-04 11:37:05 +0000 | [diff] [blame] | 15 | define error_message |
Harry Ramsey | 0f07e76 | 2024-11-04 12:16:50 +0000 | [diff] [blame] | 16 | ${MBEDTLS_PATH}/framework/exported.make not found (and does not appear to be a git checkout). Please ensure you have downloaded the right archive from the release page on GitHub. |
Harry Ramsey | 66ce986 | 2024-11-04 11:37:05 +0000 | [diff] [blame] | 17 | endef |
Harry Ramsey | e05cf2e | 2024-09-17 15:12:11 +0100 | [diff] [blame] | 18 | endif |
Gilles Peskine | 48230e8 | 2024-03-04 16:42:54 +0100 | [diff] [blame] | 19 | $(error $(error_message)) |
| 20 | endif |
| 21 | include framework/exported.make |
| 22 | endif |
Gilles Peskine | 469f781 | 2024-02-29 18:19:56 +0100 | [diff] [blame] | 23 | |
Paul Bakker | 5121ce5 | 2009-01-03 21:22:43 +0000 | [diff] [blame] | 24 | .SILENT: |
| 25 | |
Gilles Peskine | 0ab6c8a | 2022-12-08 22:18:31 +0100 | [diff] [blame] | 26 | .PHONY: all no_test programs lib tests install uninstall clean test check lcov apidoc apidoc_clean |
Paul Bakker | 5121ce5 | 2009-01-03 21:22:43 +0000 | [diff] [blame] | 27 | |
Andres AG | 7aa5fa1 | 2016-08-25 16:36:16 +0100 | [diff] [blame] | 28 | all: programs tests |
| 29 | $(MAKE) post_build |
Alon Bar-Lev | 06f0d26 | 2015-02-18 17:18:28 +0200 | [diff] [blame] | 30 | |
Manuel Pégourié-Gonnard | 5c59a4f | 2015-06-24 13:06:24 +0200 | [diff] [blame] | 31 | no_test: programs |
| 32 | |
Ronald Cron | ddaf99c | 2020-06-19 11:27:26 +0200 | [diff] [blame] | 33 | programs: lib mbedtls_test |
Alon Bar-Lev | 06f0d26 | 2015-02-18 17:18:28 +0200 | [diff] [blame] | 34 | $(MAKE) -C programs |
Paul Bakker | f9964ab | 2012-04-05 12:07:50 +0000 | [diff] [blame] | 35 | |
Gilles Peskine | d001f58 | 2024-09-14 13:05:51 +0200 | [diff] [blame] | 36 | ssl-opt: lib mbedtls_test |
| 37 | $(MAKE) -C programs ssl-opt |
Gilles Peskine | 870ed2a | 2024-09-25 10:27:47 +0200 | [diff] [blame] | 38 | $(MAKE) -C tests ssl-opt |
Gilles Peskine | d001f58 | 2024-09-14 13:05:51 +0200 | [diff] [blame] | 39 | |
Paul Bakker | f9964ab | 2012-04-05 12:07:50 +0000 | [diff] [blame] | 40 | lib: |
Alon Bar-Lev | 06f0d26 | 2015-02-18 17:18:28 +0200 | [diff] [blame] | 41 | $(MAKE) -C library |
| 42 | |
Valerio Setti | 0917265 | 2024-06-27 08:00:54 +0200 | [diff] [blame] | 43 | ifndef PSASIM |
| 44 | tests: lib |
| 45 | endif |
| 46 | tests: mbedtls_test |
Alon Bar-Lev | 06f0d26 | 2015-02-18 17:18:28 +0200 | [diff] [blame] | 47 | $(MAKE) -C tests |
Paul Bakker | f9964ab | 2012-04-05 12:07:50 +0000 | [diff] [blame] | 48 | |
Ronald Cron | ddaf99c | 2020-06-19 11:27:26 +0200 | [diff] [blame] | 49 | mbedtls_test: |
| 50 | $(MAKE) -C tests mbedtls_test |
| 51 | |
Gilles Peskine | 1701c34 | 2024-11-21 22:06:39 +0100 | [diff] [blame] | 52 | .PHONY: FORCE |
| 53 | FORCE: |
| 54 | |
| 55 | library/%: FORCE |
Gilles Peskine | 687d1ab | 2021-04-22 01:01:56 +0200 | [diff] [blame] | 56 | $(MAKE) -C library $* |
Gilles Peskine | 1701c34 | 2024-11-21 22:06:39 +0100 | [diff] [blame] | 57 | programs/%: FORCE |
Gilles Peskine | 687d1ab | 2021-04-22 01:01:56 +0200 | [diff] [blame] | 58 | $(MAKE) -C programs $* |
Gilles Peskine | 1701c34 | 2024-11-21 22:06:39 +0100 | [diff] [blame] | 59 | tests/%: FORCE |
Gilles Peskine | 687d1ab | 2021-04-22 01:01:56 +0200 | [diff] [blame] | 60 | $(MAKE) -C tests $* |
| 61 | |
| 62 | .PHONY: generated_files |
| 63 | generated_files: library/generated_files |
| 64 | generated_files: programs/generated_files |
| 65 | generated_files: tests/generated_files |
| 66 | generated_files: visualc_files |
| 67 | |
Gilles Peskine | 0b62b7a | 2023-09-08 16:19:13 +0200 | [diff] [blame] | 68 | # Set GEN_FILES to the empty string to disable dependencies on generated |
| 69 | # source files. Then `make generated_files` will only build files that |
| 70 | # are missing, it will not rebuilt files that are present but out of date. |
| 71 | # This is useful, for example, if you have a source tree where |
| 72 | # `make generated_files` has already run and file timestamps reflect the |
| 73 | # time the files were copied or extracted, and you are now in an environment |
| 74 | # that lacks some of the necessary tools to re-generate the files. |
| 75 | # If $(GEN_FILES) is non-empty, the generated source files' dependencies |
| 76 | # are treated ordinarily, based on file timestamps. |
| 77 | GEN_FILES ?= yes |
| 78 | |
| 79 | # In dependencies where the target is a configuration-independent generated |
| 80 | # file, use `TARGET: $(gen_file_dep) DEPENDENCY1 DEPENDENCY2 ...` |
| 81 | # rather than directly `TARGET: DEPENDENCY1 DEPENDENCY2 ...`. This |
| 82 | # enables the re-generation to be turned off when GEN_FILES is disabled. |
| 83 | ifdef GEN_FILES |
| 84 | gen_file_dep = |
| 85 | else |
Gilles Peskine | 1bfc09b | 2023-09-09 21:26:05 +0200 | [diff] [blame] | 86 | # Order-only dependency: generate the target if it's absent, but don't |
| 87 | # re-generate it if it's present but older than its dependencies. |
Gilles Peskine | 0b62b7a | 2023-09-08 16:19:13 +0200 | [diff] [blame] | 88 | gen_file_dep = | |
| 89 | endif |
| 90 | |
Gilles Peskine | 687d1ab | 2021-04-22 01:01:56 +0200 | [diff] [blame] | 91 | .PHONY: visualc_files |
Bence Szépkúti | fac1122 | 2024-03-12 16:38:23 +0100 | [diff] [blame] | 92 | VISUALC_FILES = visualc/VS2017/mbedTLS.sln visualc/VS2017/mbedTLS.vcxproj |
Gilles Peskine | 687d1ab | 2021-04-22 01:01:56 +0200 | [diff] [blame] | 93 | # TODO: $(app).vcxproj for each $(app) in programs/ |
| 94 | visualc_files: $(VISUALC_FILES) |
Gilles Peskine | 94230ea | 2021-05-18 15:48:56 +0200 | [diff] [blame] | 95 | |
| 96 | # Ensure that the .c files that generate_visualc_files.pl enumerates are |
Gilles Peskine | a13deaf | 2021-05-19 14:26:37 +0200 | [diff] [blame] | 97 | # present before it runs. It doesn't matter if the files aren't up-to-date, |
| 98 | # they just need to be present. |
| 99 | $(VISUALC_FILES): | library/generated_files |
Ronald Cron | 8a09a41 | 2024-12-10 16:23:55 +0100 | [diff] [blame] | 100 | $(VISUALC_FILES): | programs/generated_files |
| 101 | $(VISUALC_FILES): | tests/generated_files |
Gilles Peskine | 0b62b7a | 2023-09-08 16:19:13 +0200 | [diff] [blame] | 102 | $(VISUALC_FILES): $(gen_file_dep) scripts/generate_visualc_files.pl |
Bence Szépkúti | fac1122 | 2024-03-12 16:38:23 +0100 | [diff] [blame] | 103 | $(VISUALC_FILES): $(gen_file_dep) scripts/data_files/vs2017-app-template.vcxproj |
| 104 | $(VISUALC_FILES): $(gen_file_dep) scripts/data_files/vs2017-main-template.vcxproj |
| 105 | $(VISUALC_FILES): $(gen_file_dep) scripts/data_files/vs2017-sln-template.sln |
Gilles Peskine | 687d1ab | 2021-04-22 01:01:56 +0200 | [diff] [blame] | 106 | # TODO: also the list of .c and .h source files, but not their content |
| 107 | $(VISUALC_FILES): |
| 108 | echo " Gen $@ ..." |
| 109 | $(PERL) scripts/generate_visualc_files.pl |
| 110 | |
Manuel Pégourié-Gonnard | 5c59a4f | 2015-06-24 13:06:24 +0200 | [diff] [blame] | 111 | ifndef WINDOWS |
Manuel Pégourié-Gonnard | 9983993 | 2015-08-03 10:34:09 +0200 | [diff] [blame] | 112 | install: no_test |
Manuel Pégourié-Gonnard | 7f80997 | 2015-03-09 17:05:11 +0000 | [diff] [blame] | 113 | mkdir -p $(DESTDIR)/include/mbedtls |
Ruini Xue | 5a9cb61 | 2018-06-28 23:21:26 +0800 | [diff] [blame] | 114 | cp -rp include/mbedtls $(DESTDIR)/include |
Ronald Cron | 05ba912 | 2024-06-17 14:25:26 +0200 | [diff] [blame] | 115 | cp -rp tf-psa-crypto/drivers/builtin/include/mbedtls $(DESTDIR)/include |
Jaeden Amero | 3c7cc5e | 2018-11-15 17:38:58 +0000 | [diff] [blame] | 116 | mkdir -p $(DESTDIR)/include/psa |
Ronald Cron | 2581d91 | 2024-06-10 16:05:53 +0200 | [diff] [blame] | 117 | cp -rp tf-psa-crypto/include/psa $(DESTDIR)/include |
Darryl Green | 11999bb | 2018-03-13 15:22:58 +0000 | [diff] [blame] | 118 | |
Paul Bakker | 5121ce5 | 2009-01-03 21:22:43 +0000 | [diff] [blame] | 119 | mkdir -p $(DESTDIR)/lib |
Gilles Peskine | 722a7e6 | 2020-02-26 19:05:19 +0100 | [diff] [blame] | 120 | cp -RP library/libmbedtls.* $(DESTDIR)/lib |
| 121 | cp -RP library/libmbedx509.* $(DESTDIR)/lib |
Manuel Pégourié-Gonnard | 52a5079 | 2015-07-27 10:36:12 +0200 | [diff] [blame] | 122 | cp -RP library/libmbedcrypto.* $(DESTDIR)/lib |
Darryl Green | 11999bb | 2018-03-13 15:22:58 +0000 | [diff] [blame] | 123 | |
Paul Bakker | 5121ce5 | 2009-01-03 21:22:43 +0000 | [diff] [blame] | 124 | mkdir -p $(DESTDIR)/bin |
| 125 | for p in programs/*/* ; do \ |
| 126 | if [ -x $$p ] && [ ! -d $$p ] ; \ |
| 127 | then \ |
| 128 | f=$(PREFIX)`basename $$p` ; \ |
| 129 | cp $$p $(DESTDIR)/bin/$$f ; \ |
| 130 | fi \ |
| 131 | done |
| 132 | |
Paul Bakker | 9a73632 | 2012-11-14 12:39:52 +0000 | [diff] [blame] | 133 | uninstall: |
Manuel Pégourié-Gonnard | 7f80997 | 2015-03-09 17:05:11 +0000 | [diff] [blame] | 134 | rm -rf $(DESTDIR)/include/mbedtls |
Wu, Jheng-Jhong | 89b9814 | 2020-11-26 09:27:17 +0800 | [diff] [blame] | 135 | rm -rf $(DESTDIR)/include/psa |
Gilles Peskine | 722a7e6 | 2020-02-26 19:05:19 +0100 | [diff] [blame] | 136 | rm -f $(DESTDIR)/lib/libmbedtls.* |
| 137 | rm -f $(DESTDIR)/lib/libmbedx509.* |
Manuel Pégourié-Gonnard | 52a5079 | 2015-07-27 10:36:12 +0200 | [diff] [blame] | 138 | rm -f $(DESTDIR)/lib/libmbedcrypto.* |
Darryl Green | 11999bb | 2018-03-13 15:22:58 +0000 | [diff] [blame] | 139 | |
Paul Bakker | 9a73632 | 2012-11-14 12:39:52 +0000 | [diff] [blame] | 140 | for p in programs/*/* ; do \ |
| 141 | if [ -x $$p ] && [ ! -d $$p ] ; \ |
| 142 | then \ |
| 143 | f=$(PREFIX)`basename $$p` ; \ |
| 144 | rm -f $(DESTDIR)/bin/$$f ; \ |
| 145 | fi \ |
| 146 | done |
Manuel Pégourié-Gonnard | 5c59a4f | 2015-06-24 13:06:24 +0200 | [diff] [blame] | 147 | endif |
Paul Bakker | 9a73632 | 2012-11-14 12:39:52 +0000 | [diff] [blame] | 148 | |
Simon Butcher | 1ceab6e | 2016-06-21 10:14:00 +0100 | [diff] [blame] | 149 | |
Nir Sonnenschein | b7ebbca | 2018-08-29 10:20:12 +0300 | [diff] [blame] | 150 | WARNING_BORDER_LONG =**********************************************************************************\n |
| 151 | CTR_DRBG_128_BIT_KEY_WARN_L1=**** WARNING! MBEDTLS_CTR_DRBG_USE_128_BIT_KEY defined! ****\n |
| 152 | CTR_DRBG_128_BIT_KEY_WARN_L2=**** Using 128-bit keys for CTR_DRBG limits the security of generated ****\n |
| 153 | CTR_DRBG_128_BIT_KEY_WARN_L3=**** keys and operations that use random values generated to 128-bit security ****\n |
| 154 | |
| 155 | CTR_DRBG_128_BIT_KEY_WARNING=\n$(WARNING_BORDER_LONG)$(CTR_DRBG_128_BIT_KEY_WARN_L1)$(CTR_DRBG_128_BIT_KEY_WARN_L2)$(CTR_DRBG_128_BIT_KEY_WARN_L3)$(WARNING_BORDER_LONG) |
| 156 | |
Simon Butcher | 1ceab6e | 2016-06-21 10:14:00 +0100 | [diff] [blame] | 157 | # Post build steps |
| 158 | post_build: |
Simon Butcher | cff625f | 2016-06-27 15:15:11 +0100 | [diff] [blame] | 159 | ifndef WINDOWS |
Nir Sonnenschein | b7ebbca | 2018-08-29 10:20:12 +0300 | [diff] [blame] | 160 | |
| 161 | # If 128-bit keys are configured for CTR_DRBG, display an appropriate warning |
Gilles Peskine | 3bdd412 | 2019-07-27 23:52:53 +0200 | [diff] [blame] | 162 | -scripts/config.py get MBEDTLS_CTR_DRBG_USE_128_BIT_KEY && ([ $$? -eq 0 ]) && \ |
Nir Sonnenschein | b7ebbca | 2018-08-29 10:20:12 +0300 | [diff] [blame] | 163 | echo '$(CTR_DRBG_128_BIT_KEY_WARNING)' |
| 164 | |
Simon Butcher | cff625f | 2016-06-27 15:15:11 +0100 | [diff] [blame] | 165 | endif |
Simon Butcher | 1ceab6e | 2016-06-21 10:14:00 +0100 | [diff] [blame] | 166 | |
Gilles Peskine | 687d1ab | 2021-04-22 01:01:56 +0200 | [diff] [blame] | 167 | clean: clean_more_on_top |
Alon Bar-Lev | 06f0d26 | 2015-02-18 17:18:28 +0200 | [diff] [blame] | 168 | $(MAKE) -C library clean |
| 169 | $(MAKE) -C programs clean |
| 170 | $(MAKE) -C tests clean |
Gilles Peskine | 687d1ab | 2021-04-22 01:01:56 +0200 | [diff] [blame] | 171 | |
| 172 | clean_more_on_top: |
Manuel Pégourié-Gonnard | 5c59a4f | 2015-06-24 13:06:24 +0200 | [diff] [blame] | 173 | ifndef WINDOWS |
Paul Bakker | bd3b359 | 2016-07-13 16:37:32 +0100 | [diff] [blame] | 174 | find . \( -name \*.gcno -o -name \*.gcda -o -name \*.info \) -exec rm {} + |
Manuel Pégourié-Gonnard | 5c59a4f | 2015-06-24 13:06:24 +0200 | [diff] [blame] | 175 | endif |
Paul Bakker | 5121ce5 | 2009-01-03 21:22:43 +0000 | [diff] [blame] | 176 | |
Gilles Peskine | 687d1ab | 2021-04-22 01:01:56 +0200 | [diff] [blame] | 177 | neat: clean_more_on_top |
| 178 | $(MAKE) -C library neat |
| 179 | $(MAKE) -C programs neat |
| 180 | $(MAKE) -C tests neat |
| 181 | ifndef WINDOWS |
Bence Szépkúti | fac1122 | 2024-03-12 16:38:23 +0100 | [diff] [blame] | 182 | rm -f visualc/VS2017/*.vcxproj visualc/VS2017/mbedTLS.sln |
Gilles Peskine | 687d1ab | 2021-04-22 01:01:56 +0200 | [diff] [blame] | 183 | else |
Bence Szépkúti | fac1122 | 2024-03-12 16:38:23 +0100 | [diff] [blame] | 184 | if exist visualc\VS2017\*.vcxproj del /Q /F visualc\VS2017\*.vcxproj |
| 185 | if exist visualc\VS2017\mbedTLS.sln del /Q /F visualc\VS2017\mbedTLS.sln |
Gilles Peskine | 687d1ab | 2021-04-22 01:01:56 +0200 | [diff] [blame] | 186 | endif |
| 187 | |
Valerio Setti | 0917265 | 2024-06-27 08:00:54 +0200 | [diff] [blame] | 188 | ifndef PSASIM |
| 189 | check: lib |
| 190 | endif |
| 191 | check: tests |
Alon Bar-Lev | 06f0d26 | 2015-02-18 17:18:28 +0200 | [diff] [blame] | 192 | $(MAKE) -C tests check |
Paul Bakker | 37ca75d | 2011-01-06 12:28:03 +0000 | [diff] [blame] | 193 | |
Manuel Pégourié-Gonnard | 5c59a4f | 2015-06-24 13:06:24 +0200 | [diff] [blame] | 194 | test: check |
Manuel Pégourié-Gonnard | 6529ff0 | 2014-01-31 13:41:07 +0100 | [diff] [blame] | 195 | |
Manuel Pégourié-Gonnard | 8511384 | 2015-07-08 21:20:03 +0100 | [diff] [blame] | 196 | ifndef WINDOWS |
Gilles Peskine | 0ab6c8a | 2022-12-08 22:18:31 +0100 | [diff] [blame] | 197 | # For coverage testing: |
| 198 | # 1. Build with: |
| 199 | # make CFLAGS='--coverage -g3 -O0' LDFLAGS='--coverage' |
| 200 | # 2. Run the relevant tests for the part of the code you're interested in. |
| 201 | # For the reference coverage measurement, see |
| 202 | # tests/scripts/basic-build-test.sh |
| 203 | # 3. Run scripts/lcov.sh to generate an HTML report. |
Manuel Pégourié-Gonnard | 546d86c | 2014-01-31 16:19:43 +0100 | [diff] [blame] | 204 | lcov: |
Gilles Peskine | 3d4ea54 | 2022-11-30 17:35:44 +0100 | [diff] [blame] | 205 | scripts/lcov.sh |
Manuel Pégourié-Gonnard | 546d86c | 2014-01-31 16:19:43 +0100 | [diff] [blame] | 206 | |
Paul Bakker | 37ca75d | 2011-01-06 12:28:03 +0000 | [diff] [blame] | 207 | apidoc: |
| 208 | mkdir -p apidoc |
Krzysztof Stachowiak | 744a4ac | 2018-01-22 13:38:31 +0100 | [diff] [blame] | 209 | cd doxygen && doxygen mbedtls.doxyfile |
Paul Bakker | 37ca75d | 2011-01-06 12:28:03 +0000 | [diff] [blame] | 210 | |
| 211 | apidoc_clean: |
Manuel Pégourié-Gonnard | 5c59a4f | 2015-06-24 13:06:24 +0200 | [diff] [blame] | 212 | rm -rf apidoc |
| 213 | endif |
Gilles Peskine | 66c1e2c | 2018-01-16 14:04:05 +0100 | [diff] [blame] | 214 | |
| 215 | ## Editor navigation files |
Gilles Peskine | 646ad22 | 2020-11-09 21:20:16 +0100 | [diff] [blame] | 216 | C_SOURCE_FILES = $(wildcard \ |
Gilles Peskine | 646ad22 | 2020-11-09 21:20:16 +0100 | [diff] [blame] | 217 | include/*/*.h \ |
| 218 | library/*.[hc] \ |
Ronald Cron | 52cd108 | 2024-07-02 07:55:03 +0200 | [diff] [blame] | 219 | tf-psa-crypto/core/*.[hc] \ |
Ronald Cron | db9d518 | 2024-06-10 15:58:23 +0200 | [diff] [blame] | 220 | tf-psa-crypto/include/*/*.h \ |
Ronald Cron | 691f67f | 2024-07-02 08:50:56 +0200 | [diff] [blame] | 221 | tf-psa-crypto/drivers/*/include/*/*.h \ |
| 222 | tf-psa-crypto/drivers/*/include/*/*/*.h \ |
| 223 | tf-psa-crypto/drivers/*/include/*/*/*/*.h \ |
Ronald Cron | 52cd108 | 2024-07-02 07:55:03 +0200 | [diff] [blame] | 224 | tf-psa-crypto/drivers/builtin/src/*.[hc] \ |
Ronald Cron | 691f67f | 2024-07-02 08:50:56 +0200 | [diff] [blame] | 225 | tf-psa-crypto/drivers/*/*.c \ |
| 226 | tf-psa-crypto/drivers/*/*/*.c \ |
| 227 | tf-psa-crypto/drivers/*/*/*/*.c \ |
| 228 | tf-psa-crypto/drivers/*/*/*/*/*.c \ |
Gilles Peskine | 646ad22 | 2020-11-09 21:20:16 +0100 | [diff] [blame] | 229 | programs/*/*.[hc] \ |
David Horstmann | 5b93d97 | 2024-10-31 15:36:05 +0000 | [diff] [blame] | 230 | framework/tests/include/*/*.h framework/tests/include/*/*/*.h \ |
| 231 | framework/tests/src/*.c framework/tests/src/*/*.c \ |
Gilles Peskine | 646ad22 | 2020-11-09 21:20:16 +0100 | [diff] [blame] | 232 | tests/suites/*.function \ |
Ronald Cron | f352279 | 2024-07-11 12:03:51 +0200 | [diff] [blame] | 233 | tf-psa-crypto/tests/suites/*.function \ |
Gilles Peskine | 646ad22 | 2020-11-09 21:20:16 +0100 | [diff] [blame] | 234 | ) |
Manuel Pégourié-Gonnard | c9f8956 | 2020-04-02 12:10:45 +0200 | [diff] [blame] | 235 | # Exuberant-ctags invocation. Other ctags implementations may require different options. |
Gilles Peskine | b305b00 | 2021-01-13 13:45:30 +0100 | [diff] [blame] | 236 | CTAGS = ctags --langmap=c:+.h.function --line-directives=no -o |
Gilles Peskine | 66c1e2c | 2018-01-16 14:04:05 +0100 | [diff] [blame] | 237 | tags: $(C_SOURCE_FILES) |
Manuel Pégourié-Gonnard | c9f8956 | 2020-04-02 12:10:45 +0200 | [diff] [blame] | 238 | $(CTAGS) $@ $(C_SOURCE_FILES) |
Gilles Peskine | 66c1e2c | 2018-01-16 14:04:05 +0100 | [diff] [blame] | 239 | TAGS: $(C_SOURCE_FILES) |
Gilles Peskine | b305b00 | 2021-01-13 13:45:30 +0100 | [diff] [blame] | 240 | etags --no-line-directive -o $@ $(C_SOURCE_FILES) |
Gilles Peskine | 8346c7a | 2020-11-20 11:50:08 +0100 | [diff] [blame] | 241 | global: GPATH GRTAGS GSYMS GTAGS |
Gilles Peskine | 66c1e2c | 2018-01-16 14:04:05 +0100 | [diff] [blame] | 242 | GPATH GRTAGS GSYMS GTAGS: $(C_SOURCE_FILES) |
| 243 | ls $(C_SOURCE_FILES) | gtags -f - --gtagsconf .globalrc |
Gilles Peskine | 8346c7a | 2020-11-20 11:50:08 +0100 | [diff] [blame] | 244 | cscope: cscope.in.out cscope.po.out cscope.out |
Gilles Peskine | d0c7801 | 2020-11-09 21:21:31 +0100 | [diff] [blame] | 245 | cscope.in.out cscope.po.out cscope.out: $(C_SOURCE_FILES) |
Ronald Cron | 52cd108 | 2024-07-02 07:55:03 +0200 | [diff] [blame] | 246 | cscope -bq -u -Iinclude -Ilibrary -Itf-psa-crypto/core \ |
| 247 | -Itf-psa-crypto/include \ |
Ronald Cron | 52cd108 | 2024-07-02 07:55:03 +0200 | [diff] [blame] | 248 | -Itf-psa-crypto/drivers/builtin/src \ |
David Horstmann | 5b93d97 | 2024-10-31 15:36:05 +0000 | [diff] [blame] | 249 | $(patsubst %,-I%,$(wildcard tf-psa-crypto/drivers/*/include)) -Iframework/tests/include $(C_SOURCE_FILES) |
Gilles Peskine | 8346c7a | 2020-11-20 11:50:08 +0100 | [diff] [blame] | 250 | .PHONY: cscope global |