[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH 02/13] Config.mk: replace dependency to genpath with actual target



genpath is a detail of buildmakevars2file. Replace the dependency to
genpath with the actual buildmakevars2file target. This change by
itself does not fix any bug. Upcoming changes will add dependencies to
$(target), but no rule exist to create $(target).

No change in behaviour is expected by this patch.

Note: target.tmp ($(1).tmp) is not marked as .PHONY because
move-if-changed in the target rule will remove target.tmp by renaming
it to target. As a result make will always attempt to rebuild it.

Signed-off-by: Olaf Hering <olaf@xxxxxxxxx>
---
 Config.mk                     |  9 +++++----
 stubdom/Makefile              | 16 ++++++++--------
 tools/hotplug/common/Makefile |  2 +-
 tools/libxl/Makefile          |  2 +-
 tools/python/Makefile         |  2 +-
 5 files changed, 16 insertions(+), 15 deletions(-)

diff --git a/Config.mk b/Config.mk
index 2408fa6..28e9930 100644
--- a/Config.mk
+++ b/Config.mk
@@ -172,11 +172,12 @@ BUILD_MAKE_VARS := SBINDIR BINDIR LIBEXEC LIBDIR SHAREDIR 
PRIVATE_BINDIR \
 
 buildmakevars2file = $(eval $(call buildmakevars2file-closure,$(1)))
 define buildmakevars2file-closure
-    .PHONY: genpath
-    genpath:
-       rm -f $(1).tmp; \
+    $(1).tmp:
+       rm -f $(1).newtmp; \
        $(foreach var, $(BUILD_MAKE_VARS), \
-                 echo "$(var)=\"$($(var))\"" >>$(1).tmp;) \
+                 echo "$(var)=\"$($(var))\"" >>$(1).newtmp;) \
+       $(call move-if-changed,$(1).newtmp,$(1).tmp)
+    $(1): $(1).tmp
        $(call move-if-changed,$(1).tmp,$(1))
 endef
 
diff --git a/stubdom/Makefile b/stubdom/Makefile
index 6bea68b..333112c 100644
--- a/stubdom/Makefile
+++ b/stubdom/Makefile
@@ -48,18 +48,18 @@ TARGET_LDFLAGS += -nostdlib 
-L$(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf/lib
 
 TARGETS=$(STUBDOM_TARGETS)
 
+STUBDOMPATH="stubdompath.sh"
+genpath-target = $(call buildmakevars2file,$(STUBDOMPATH))
+$(eval $(genpath-target))
+
 .PHONY: all
 all: build
 ifeq ($(STUBDOM_SUPPORTED),1)
-build: genpath $(STUBDOM_BUILD)
+build: $(STUBDOMPATH) $(STUBDOM_BUILD)
 else
-build: genpath
+build: $(STUBDOMPATH)
 endif
 
-STUBDOMPATH="stubdompath.sh"
-genpath-target = $(call buildmakevars2file,$(STUBDOMPATH))
-$(eval $(genpath-target))
-
 ##############
 # Cross-newlib
 ##############
@@ -449,9 +449,9 @@ xenstore-stubdom: mini-os-$(XEN_TARGET_ARCH)-xenstore libxc 
xenstore
 #########
 
 ifeq ($(STUBDOM_SUPPORTED),1)
-install: genpath install-readme $(STUBDOM_INSTALL)
+install: $(STUBDOMPATH) install-readme $(STUBDOM_INSTALL)
 else
-install: genpath
+install: $(STUBDOMPATH)
 endif
 
 install-readme:
diff --git a/tools/hotplug/common/Makefile b/tools/hotplug/common/Makefile
index 18d87aa..657a8e3 100644
--- a/tools/hotplug/common/Makefile
+++ b/tools/hotplug/common/Makefile
@@ -16,7 +16,7 @@ $(eval $(genpath-target))
 all: build
 
 .PHONY: build
-build: genpath
+build: $(HOTPLUGPATH)
 
 .PHONY: install
 install: all install-scripts
diff --git a/tools/libxl/Makefile b/tools/libxl/Makefile
index bd0db3b..a3a25ac 100644
--- a/tools/libxl/Makefile
+++ b/tools/libxl/Makefile
@@ -159,7 +159,7 @@ _%.api-for-check: %.h $(AUTOINCS)
                >$@.new
        mv -f $@.new $@
 
-_paths.h: genpath
+_paths.h: _paths.h.tmp
        sed -e "s/\([^=]*\)=\(.*\)/#define \1 \2/g" $@.tmp >$@.2.tmp
        rm -f $@.tmp
        $(call move-if-changed,$@.2.tmp,$@)
diff --git a/tools/python/Makefile b/tools/python/Makefile
index c914332..7b25291 100644
--- a/tools/python/Makefile
+++ b/tools/python/Makefile
@@ -10,7 +10,7 @@ genpath-target = $(call buildmakevars2file,$(XENPATH))
 $(eval $(genpath-target))
 
 .PHONY: build
-build: genpath genwrap.py $(XEN_ROOT)/tools/libxl/libxl_types.idl \
+build: $(XENPATH) genwrap.py $(XEN_ROOT)/tools/libxl/libxl_types.idl \
                $(XEN_ROOT)/tools/libxl/idl.py
        PYTHONPATH=$(XEN_ROOT)/tools/libxl $(PYTHON) genwrap.py \
                $(XEN_ROOT)/tools/libxl/libxl_types.idl \

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.