Browse code

makefile: minor makecfg.lst fix

- better escaping when saving the current DEFS and INCLUDES

Andrei Pelinescu-Onciul authored on 10/10/2009 00:21:59
Showing 1 changed files
... ...
@@ -40,7 +40,7 @@ LIB_NOREBUILD_DEFS=
40 40
 # NOREBUILD_INCLUDES
41 41
 ifneq ($(strip $(filter-out $(NOREBUILD_DEFS),\
42 42
 		$(C_DEFS) $(DEFS))),$(strip $(CFG_DEFS)))
43
-#$(warning different defs: <$(strip $(DEFS))> != )
43
+#$(warning different defs: <$(strip $(C_DEFS) $(DEFS))> != )
44 44
 #$(warning               : <$(strip $(CFG_DEFS))>)
45 45
 $(shell rm -f makecfg.lst)
46 46
 endif
... ...
@@ -77,7 +77,7 @@ oecho=echo $(1)
77 77
 endif
78 78
 
79 79
 quote:= "
80
-escall= $(subst $$,$$$$,$(subst $(quote),\$(quote),$1))
80
+escall= $(subst $$,\$$,$(subst $(quote),\$(quote),$1))
81 81
 exec_cmd= $(if $($(quiet)_cmd_$(1)),\
82 82
 			@echo "$(call escall,$($(quiet)_cmd_$(1)))" ;) $(cmd_$(1))
83 83
 
... ...
@@ -185,11 +185,11 @@ librpath.lst: $(ALLDEP)
185 185
 	@echo LIB_RPATH_LST:=$(SER_RPATH_LST) >librpath.lst
186 186
 
187 187
 makecfg.lst:
188
-	@echo CFG_DEFS:=$(subst ',\', $(subst ",\",$(strip \
189
-			$(filter-out $(NOREBUILD_DEFS), $(C_DEFS) $(DEFS))))) >>$@
190
-	@echo CFG_INCLUDES:=$(subst ',\', $(subst ",\",$(strip \
188
+	@echo "CFG_DEFS:=$(call escall,$(strip \
189
+			$(filter-out $(NOREBUILD_DEFS), $(C_DEFS) $(DEFS))))" >>$@
190
+	@echo "CFG_INCLUDES:=$(call escall,$(strip \
191 191
 			$(filter-out $(NOREBUILD_INCLUDES),\
192
-				$(C_INCLUDES) $(INCLUDES))))) >>$@
192
+				$(C_INCLUDES) $(INCLUDES))))" >>$@
193 193
 .PHONY: all
194 194
 all: $(NAME) every-module
195 195