Patchwork [01/35] build: enable using $(CONFIG_FOO) on the rhs of config files

login
register
mail settings
Submitter Paolo Bonzini
Date April 4, 2013, 7:22 p.m.
Message ID <1365103395-11547-2-git-send-email-pbonzini@redhat.com>
Download mbox | patch
Permalink /patch/233901/
State New
Headers show

Comments

Paolo Bonzini - April 4, 2013, 7:22 p.m.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 Makefile | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Patch

diff --git a/Makefile b/Makefile
index 80344d9..0b6e6a1 100644
--- a/Makefile
+++ b/Makefile
@@ -76,7 +76,10 @@  config-all-devices.mak:
 	$(call quiet-command,echo '# no devices' > $@,"  GEN   $@")
 else
 config-all-devices.mak: $(SUBDIR_DEVICES_MAK)
-	$(call quiet-command,cat $(SUBDIR_DEVICES_MAK) | grep =y | sort -u > $@,"  GEN   $@")
+	$(call quiet-command, sed -n \
+             's|^\([^=]*\)=\(.*\)$$|\1:=$$(findstring y,$$(\1)\2)|p' \
+             $(SUBDIR_DEVICES_MAK) | sort -u > $@, \
+             "  GEN   $@")
 endif
 
 -include $(SUBDIR_DEVICES_MAK_DEP)