summaryrefslogtreecommitdiff
path: root/tools/scripts
diff options
context:
space:
mode:
authorBenoît Thébaudeau <benoit.thebaudeau@advansee.com>2013-04-11 09:35:48 +0000
committerAlbert ARIBAUD <albert.u.boot@aribaud.net>2013-04-12 07:55:06 +0200
commit2979b263239b37ce1fddd0ad1b1c2ad096dbd120 (patch)
tree68227abc287af2d693a2941ac164ec1aef0561ad /tools/scripts
parent9c5feab76fe15332193fe3f1ba183021fb84c203 (diff)
downloadu-boot-imx-2979b263239b37ce1fddd0ad1b1c2ad096dbd120.zip
u-boot-imx-2979b263239b37ce1fddd0ad1b1c2ad096dbd120.tar.gz
u-boot-imx-2979b263239b37ce1fddd0ad1b1c2ad096dbd120.tar.bz2
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>
Diffstat (limited to 'tools/scripts')
-rw-r--r--tools/scripts/define2mk.sed2
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/scripts/define2mk.sed b/tools/scripts/define2mk.sed
index 13e2845..c641edf 100644
--- a/tools/scripts/define2mk.sed
+++ b/tools/scripts/define2mk.sed
@@ -24,6 +24,8 @@
s/="\([0-9][0-9]*\)"/=\1/;
# ... and from hex numbers
s/="\(0[Xx][0-9a-fA-F][0-9a-fA-F]*\)"/=\1/;
+ # ... and from configs defined from other configs
+ s/="\(CONFIG_[A-Za-z0-9_][A-Za-z0-9_]*\)"/=$(\1)/;
# Change '1' and empty values to "y" (not perfect, but
# supports conditional compilation in the makefiles
s/=$/=y/;