]> git.ipfire.org Git - people/ms/u-boot.git/commitdiff
Makefile: fix parallel build
authorDaniel Hobi <daniel.hobi@schmid-telecom.ch>
Mon, 18 Jan 2010 17:13:39 +0000 (18:13 +0100)
committerWolfgang Denk <wd@denx.de>
Mon, 18 Jan 2010 21:25:16 +0000 (22:25 +0100)
During parallel build, the top Makefile spawns multiple sub-makes for
targets in cpu/$(CPU) and $(dir $(LDSCRIPT)). If the .depend files are
not present in these directories, the sub-makes may end up generating
these files simultaneously which leads to corrupted content.

A typical error message is:

.depend:39: *** multiple target patterns.  Stop.

This patch serializes the creation of .depend in cpu/$(CPU) and
$(dir $(LDSCRIPT)) by adding these directories to the depend target
in the top Makefile.

Other directories in $(LIBS) are not affected since they contain only
one Make target and thus only one sub-make is spawned per directory.

Signed-off-by: Daniel Hobi <daniel.hobi@schmid-telecom.ch>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Makefile

index 793fcec1dc0d449cbf16962a71773881b0158f8a..1ab197b4df8c0f4372d83b286cd4ee304e0ff9c7 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -398,8 +398,11 @@ updater:
 env:
                $(MAKE) -C tools/env all MTD_VERSION=${MTD_VERSION} || exit 1
 
+# Explicitly make _depend in subdirs containing multiple targets to prevent
+# parallel sub-makes creating .depend files simultaneously.
 depend dep:    $(TIMESTAMP_FILE) $(VERSION_FILE) $(obj)include/autoconf.mk
-               for dir in $(SUBDIRS) ; do $(MAKE) -C $$dir _depend ; done
+               for dir in $(SUBDIRS) cpu/$(CPU) $(dir $(LDSCRIPT)) ; do \
+                       $(MAKE) -C $$dir _depend ; done
 
 TAG_SUBDIRS = $(SUBDIRS)
 TAG_SUBDIRS += $(dir $(__LIBS))