Skip to contentSkip to conversation

Makefile: Force regeneration of env.txt

PATCH In review Andrew Davis 3 participants 3 messages Sep 15, 2023 – Oct 10, 2023 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 Makefile: Force regeneration of env.txt

If the source .env file changes to one that is also older than the generated env.txt file then the .env file is not regenerated. This means when switching board configs we do not regenerate the env.

This can be tested with:

$ make j721e_evm_a72_defconfig
$ make # this may fail to complete but that is okay for this test
$ make am64x_evm_a53_defconfig
$ make
$ vim include/generated/env.txt

Note this is still the J721e env not the AM64 config as expected.

As ENV_FILE is set based on configuration, regenerate anytime autoconf.h changes.

---

Changes for v2:
- Depend on autoconf.h as suggested by Simon

 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Makefile +1 -1
index 9be24c4ec61..dba3c145368 100644
@@ -1830,7 +1830,7 @@ quiet_cmd_envc = ENVC    $@
 		touch $@ ; \
 	fi
 
-include/generated/env.txt: $(wildcard $(ENV_FILE))
+include/generated/env.txt: $(wildcard $(ENV_FILE)) include/generated/autoconf.h
 	$(call cmd,envc)
 
 # Write out the resulting environment, converted to a C string
Signature · 1 line
2.39.2
Reviewed-by on v2 1/1
#1 lore raw
Quoted 18 lines · Andrew Davis

If the source .env file changes to one that is also older than the generated env.txt file then the .env file is not regenerated. This means when switching board configs we do not regenerate the env.

This can be tested with:

$ make j721e_evm_a72_defconfig
$ make # this may fail to complete but that is okay for this test
$ make am64x_evm_a53_defconfig
$ make
$ vim include/generated/env.txt

Note this is still the J721e env not the AM64 config as expected.

As ENV_FILE is set based on configuration, regenerate anytime autoconf.h changes.

Quoted 8 lines

---

Changes for v2:
- Depend on autoconf.h as suggested by Simon

 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
#2 lore raw
In reply to Andrew Davis
Quoted 12 lines · Andrew Davis

If the source .env file changes to one that is also older than the generated env.txt file then the .env file is not regenerated. This means when switching board configs we do not regenerate the env.

This can be tested with:

$ make j721e_evm_a72_defconfig
$ make # this may fail to complete but that is okay for this test
$ make am64x_evm_a53_defconfig
$ make
$ vim include/generated/env.txt
Quoted 7 lines

Note this is still the J721e env not the AM64 config as expected.

As ENV_FILE is set based on configuration, regenerate anytime autoconf.h changes.

Applied to u-boot/master, thanks!

Signature · 1 line
Tom