]> xenbits.xensource.com Git - xen.git/commitdiff
Config.mk: add new macro buildmakevars2header
authorOlaf Hering <olaf@aepfle.de>
Mon, 22 Sep 2014 13:00:03 +0000 (15:00 +0200)
committerIan Campbell <ian.campbell@citrix.com>
Tue, 23 Sep 2014 09:15:17 +0000 (10:15 +0100)
This macro is similar to buildmakevars2file, it just creates a C header
file instead of shell style syntax. Upcoming changes will use this macro
in libxl and libxc.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Config.mk

index 64982c6bff672d9270fcb684743d0fc2781c9af4..4c3a2a7b4b58fddd82ef04d0c5c4bc47ec05c9dd 100644 (file)
--- a/Config.mk
+++ b/Config.mk
@@ -179,6 +179,15 @@ define buildmakevars2file-closure
        $(call move-if-changed,$(1).tmp,$(1))
 endef
 
+buildmakevars2header = $(eval $(call buildmakevars2header-closure,$(1)))
+define buildmakevars2header-closure
+    $(1): .phony
+       rm -f $(1).tmp; \
+       $(foreach var, $(BUILD_MAKE_VARS), \
+                 echo "#define $(var) \"$($(var))\"" >>$(1).tmp;) \
+       $(call move-if-changed,$(1).tmp,$(1))
+endef
+
 ifeq ($(debug_symbols),y)
 CFLAGS += -g
 endif