Skip to contentSkip to conversation

Makefile: fix dependency problem with parallel builds

PATCH New Wolfgang Denk 1 participant 2 messages Dec 16, 2008 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Makefile: fix dependency problem with parallel builds

Parallel builds (using "make -jN") would occasionally fail with error messages like
include/autoconf.mk:212: *** missing separator. Stop.
Line numbers and affected boards were changing. Obviously some Makefiles included autoconf.mk while it was still being written to. As a fix, we now write to a temporary file first and then rename it, so that it is really ready to use as soon as it appears.

---
 Makefile |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
Makefile +2 -1
index d6cd91a..1fd03a0 100644
@@ -463,7 +463,8 @@ $(obj)include/autoconf.mk: $(obj)include/config.h
 	set -e ; \
 	: Extract the config macros ; \
 	$(CPP) $(CFLAGS) -DDO_DEPS_ONLY -dM include/common.h | \
-		sed -n -f tools/scripts/define2mk.sed > $@
+		sed -n -f tools/scripts/define2mk.sed > [email protected] && \
+	mv [email protected] $@
 
 sinclude $(obj)include/autoconf.mk.dep
 
Signature · 1 line
1.6.0.4
#1 lore raw

PATCH 1/1 post/Makefile: fix dependency problem with parallel builds

Parallel builds (using "make -jN") would occasionally fail with error
messages like
ppc_4xxFP-objdump: string.o: File format not recognized
or
post/libpost.a(cpu.o): In function `cpu_post_test':
/home/wd/git/u-boot/work/post/lib_ppc/cpu.c:130: undefined reference to `cpu_post_test_string'
or similar. We now make sure to run the 'postdeps" step before
attempting to build the specific POST libraries.

---
 post/Makefile |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
post/Makefile +2 -2
index 666a896..769e9c6 100644
@@ -45,7 +45,7 @@ SRCS	:= $(SOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS	:= $(addprefix $(obj),$(COBJS))
 LIB	:= $(obj)$(LIB)
 
-all:	postdeps $(LIB)
+all:	$(LIB)
 
 postdeps:
 	@for lib in $(SPLIB-y) ; do \
@@ -57,7 +57,7 @@ $(GPLIB): $(obj).depend $(OBJS)
 	$(AR) $(ARFLAGS) $@ $(OBJS)
 
 # specific POST libraries
-$(SPLIB): $(obj).depend
+$(SPLIB): $(obj).depend postdeps
 	$(MAKE) -C $(dir $(subst $(obj),,$@))
 
 # the POST lib archive
Signature · 1 line
1.6.0.4