On Wed, 1 Apr 2009, Ward Vandewege wrote:
On Wed, Apr 01, 2009 at 04:45:44PM -0700, ron minnich wrote:
On Wed, Apr 1, 2009 at 4:42 PM, Corey Osgood corey.osgood@gmail.com wrote:
I think you're missing part of the patch, there should be a settings.h included, right?
no,that is generated by the >> in the patch.
I kind of like this. But, if the python is run twice, do you get the file twice as large? There's no "zero out the file" step from what i can see.
Hmm. Seems like replacing the >> by > should fix that.
I suspect the patch should look something like:
+ file.write('/* autogenerated */' > settings.h)\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("CPUFLAGS := $(strip $(foreach _var_,$(VARIABLES),$(call D_item,$(_var_)))--include=settings.h)\n\n")
Now the first line forces a new copy and (if I didn't goof it up) the 2nd and 3rd lines can add multiple lines to settings.h
Perhaps the nest step would be to combine the 2nd & 3rd lines.
Russ