diff --git a/library/Makefile b/library/Makefile index aff814d00..90a477d43 100644 --- a/library/Makefile +++ b/library/Makefile @@ -279,14 +279,19 @@ generated_files: $(GENERATED_FILES) error.c: ../scripts/generate_errors.pl error.c: ../scripts/data_files/error.fmt -error.c: $(wildcard ../include/mbedtls/*.h) +error.c: $(filter-out %config%,$(wildcard ../include/mbedtls/*.h)) error.c: echo " Gen $@" $(PERL) ../scripts/generate_errors.pl version_features.c: ../scripts/generate_features.pl version_features.c: ../scripts/data_files/version_features.fmt -version_features.c: ../include/mbedtls/config.h +## The generated file only depends on the options that are present in config.h, +## not on which options are set. To avoid regenerating this file all the time +## when switching between configurations, don't declare config.h as a +## dependency. Remove this file from your working tree if you've just added or +## removed an option in config.h. +#version_features.c: ../include/mbedtls/config.h version_features.c: echo " Gen $@" $(PERL) ../scripts/generate_features.pl diff --git a/programs/Makefile b/programs/Makefile index b2ba08e13..5795cd6da 100644 --- a/programs/Makefile +++ b/programs/Makefile @@ -146,7 +146,12 @@ psa/psa_constant_names_generated.c: $(PYTHON) ../scripts/generate_psa_constants.py test/query_config.c: ../scripts/generate_query_config.pl -test/query_config.c: ../include/mbedtls/config.h +## The generated file only depends on the options that are present in config.h, +## not on which options are set. To avoid regenerating this file all the time +## when switching between configurations, don't declare config.h as a +## dependency. Remove this file from your working tree if you've just added or +## removed an option in config.h. +#test/query_config.c: ../include/mbedtls/config.h test/query_config.c: ../scripts/data_files/query_config.fmt test/query_config.c: echo " Gen $@" diff --git a/tests/Makefile b/tests/Makefile index ef571698c..c1620d6e7 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -64,7 +64,12 @@ GENERATED_FILES := $(GENERATED_DATA_FILES) generated_files: $(GENERATED_FILES) $(GENERATED_DATA_FILES): scripts/generate_psa_tests.py -$(GENERATED_DATA_FILES): ../include/psa/crypto_config.h +## The generated file only depends on the options that are present in +## crypto_config.h, not on which options are set. To avoid regenerating this +## file all the time when switching between configurations, don't declare +## crypto_config.h as a dependency. Remove this file from your working tree +## if you've just added or removed an option in crypto_config.h. +#$(GENERATED_DATA_FILES): ../include/psa/crypto_config.h $(GENERATED_DATA_FILES): ../include/psa/crypto_values.h $(GENERATED_DATA_FILES): ../include/psa/crypto_extra.h $(GENERATED_DATA_FILES): suites/test_suite_psa_crypto_metadata.data