]> xenbits.xensource.com Git - people/liuw/stubdom.git/commitdiff
Fix Makefile targets that generate several files at once
authorKeir Fraser <keir.fraser@citrix.com>
Fri, 5 Mar 2010 14:40:19 +0000 (14:40 +0000)
committerKeir Fraser <keir.fraser@citrix.com>
Fri, 5 Mar 2010 14:40:19 +0000 (14:40 +0000)
In a few places in the tree the Makefiles have constructs like this:
   one_file another_file:
       $(COMMAND_WHICH_GENERATES_BOTH_AT_ONCE)
This is wrong, because make will run _two copies_ of the same command
at once.  This generally causes races and hard-to-reproduce build
failures.

Notably, `make -j4' at the top level will build stubdom libxc twice
simultaneously!

In this patch we replace the occurrences of this construct with the
correct idiom:
   one_file: another_file
   another_file:
       $(COMMAND_WHICH_GENERATES_BOTH_AT_ONCE)

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Makefile

index 15048f08a18023f91ebde4f549600cc29d89e7f5..43e8e9217bd5738e9e0376922883522725fd0407 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -265,9 +265,11 @@ $(TARGETS_MINIOS): mini-os-%:
 
 .PHONY: libxc
 libxc: libxc-$(XEN_TARGET_ARCH)/libxenctrl.a libxc-$(XEN_TARGET_ARCH)/libxenguest.a
-libxc-$(XEN_TARGET_ARCH)/libxenctrl.a libxc-$(XEN_TARGET_ARCH)/libxenguest.a:: cross-zlib
+libxc-$(XEN_TARGET_ARCH)/libxenctrl.a: cross-zlib
        CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" $(MAKE) -C libxc-$(XEN_TARGET_ARCH)
 
+ libxc-$(XEN_TARGET_ARCH)/libxenguest.a: libxc-$(XEN_TARGET_ARCH)/libxenctrl.a
+
 #######
 # ioemu
 #######