Skip to content

Commit 2979b26

Browse files
bthebaudeaualbert-aribaud-u-boot
authored andcommitted
autoconfig.mk: Make it possible to define configs from other configs
Give more flexibility to define configs that can be interpreted by make, e.g. to define fallback values of configs like in the example below. Before this change, the config lines: #define CONFIG_SPL_MAX_SIZE 2048 #define CONFIG_SPL_PAD_TO CONFIG_SPL_MAX_SIZE would have been changed in autoconfig.mk into: CONFIG_SPL_MAX_SIZE=2048 CONFIG_SPL_PAD_TO="CONFIG_SPL_MAX_SIZE" Hence, a make recipe using as an argument to $(OBJCOPY): --pad-to=$(CONFIG_SPL_PAD_TO) would have issued: --pad-to="CONFIG_SPL_MAX_SIZE" which means nothing for $(OBJCOPY) and makes it fail. Thanks to this change, the config lines above are changed in autoconfig.mk into: CONFIG_SPL_MAX_SIZE=2048 CONFIG_SPL_PAD_TO=$(CONFIG_SPL_MAX_SIZE) Hence, the make recipe above now issues: --pad-to=2048 as expected from the defined config. Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com> Reviewed-by: Tom Rini <trini@ti.com>
1 parent 9c5feab commit 2979b26

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

tools/scripts/define2mk.sed

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
s/="\([0-9][0-9]*\)"/=\1/;
2525
# ... and from hex numbers
2626
s/="\(0[Xx][0-9a-fA-F][0-9a-fA-F]*\)"/=\1/;
27+
# ... and from configs defined from other configs
28+
s/="\(CONFIG_[A-Za-z0-9_][A-Za-z0-9_]*\)"/=$(\1)/;
2729
# Change '1' and empty values to "y" (not perfect, but
2830
# supports conditional compilation in the makefiles
2931
s/=$/=y/;

0 commit comments

Comments
 (0)