[coreboot] [v2] r4047 - trunk/coreboot-v2/util/newconfig

svn at coreboot.org svn at coreboot.org
Fri Apr 3 01:08:17 CEST 2009


Author: stepan
Date: 2009-04-03 01:08:16 +0200 (Fri, 03 Apr 2009)
New Revision: 4047

Modified:
   trunk/coreboot-v2/util/newconfig/config.g
Log:
Ronald Hoogenboom writes:
I've attached a patch that removes the 3-mile-long compiler
commandlines, which vim's quickfix doesn't like so much. Instead of
putting all those -DXYZ='bla' on the compiler commandline, they are put
in a file called settings.h (as #define XYZ bla) and only a
--include=settings.h is put on the commandline.
This file is created unconditionally at the same time as when the
CPUFLAGS simply expanded make variable used to be created (not via a
target rule and dependency), so it shouldn't change anything.

Signed-off-by: Ronald Hoogenboom <hoogenboom30 at zonnet.nl>
Acked-by: Ronald G. Minnich <rminnich at gmail.com>
Acked-by: Stefan Reinauer <stepan at coresystems.de>




Modified: trunk/coreboot-v2/util/newconfig/config.g
===================================================================
--- trunk/coreboot-v2/util/newconfig/config.g	2009-04-01 22:07:53 UTC (rev 4046)
+++ trunk/coreboot-v2/util/newconfig/config.g	2009-04-02 23:08:16 UTC (rev 4047)
@@ -2049,9 +2049,9 @@
 	file.write("# Get the value of TOP, VARIABLES, and several other variables.\n")
 	file.write("include Makefile.settings\n\n")
 	file.write("# Function to create an item like -Di586 or -DCONFIG_MAX_CPUS='1' or -Ui686\n")
-	file.write("D_item = $(if $(subst undefined,,$(origin $1)),-D$1$(if $($1),='$($1)',),-U$1)\n\n")
+	file.write("D_item = $(shell echo '$(if $(subst undefined,,$(origin $1)),\\#define $1$(if $($1), $($1),),\\#undef $1)' >> settings.h)\n\n")
 	file.write("# Compute the value of CPUFLAGS here during make's first pass.\n")
-	file.write("CPUFLAGS := $(foreach _var_,$(VARIABLES),$(call D_item,$(_var_)))\n\n")
+	file.write("CPUFLAGS := $(strip $(shell echo '/* autogenerated */' > settings.h)$(foreach _var_,$(VARIABLES),$(call D_item,$(_var_)))--include=settings.h)\n\n")
 
 	for i in image.getuserdefines():
 		file.write("%s\n" %i)





More information about the coreboot mailing list