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.
Signed-off-by: Wolfgang Denk <wd@denx.de>
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 > $@.tmp && \
+ mv $@.tmp $@
sinclude $(obj)include/autoconf.mk.dep