[U-Boot,v10,15/30] autoconfig.mk: Make it possible to define configs from other configs

Message ID 1364969093-19504-15-git-send-email-benoit.thebaudeau@advansee.com
State Superseded
Delegated to: Albert ARIBAUD
Headers show

Commit Message

Benoît Thébaudeau April 3, 2013, 6:04 a.m.
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
would have been changed in autoconfig.mk into:

Hence, a make recipe using as an argument to $(OBJCOPY):
would have issued:
which means nothing for $(OBJCOPY) and makes it fail.

Thanks to this change, the config lines above are changed in autoconfig.mk into:

Hence, the make recipe above now issues:
as expected from the defined config.

Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
Reviewed-by: Tom Rini <trini@ti.com>
Changes in v10: None
Changes in v9:
 - Add detailed patch description.

Changes in v8:
 - New patch.

Changes in v7: None
Changes in v6: None
Changes in v5: None
Changes in v4: None
Changes in v3: None
Changes in v2: None

 tools/scripts/define2mk.sed |    2 ++
 1 file changed, 2 insertions(+)


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 @@ 
 	# ... and from hex numbers
+	# ... 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