make: avoid problems with mv aliases

Make fails to update .xcompile in case there is an mv alias preventing
silent overwrites of existing files. To avoid ambiguity, invoke mv
from standard location.

While we are at it, drop the code creating a unique .xcompile instance
before copying it into destination: this was done for the case of
running multiple independent make processes in parallel, but there is
a problem with this approach with multiple processes copying their
unique copies into the same destination file.

The tool running multiple make invocations in parallel should
explicitly invoke xcompile first.

Change-Id: Iedc5e288fbcc5dfc18ce39de5c067bb869a13275
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: http://review.coreboot.org/9994
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
This commit is contained in:
Vadim Bendebury 2015-04-25 11:34:35 -07:00
parent 13e4182119
commit e469602461
1 changed files with 2 additions and 1 deletions

View File

@ -35,7 +35,8 @@
$(if $(wildcard .xcompile),,$(eval $(shell util/xcompile/xcompile $(XGCCPATH) > .xcompile)))
.xcompile: util/xcompile/xcompile
A=`mktemp $@.XXXXXX`; $< $(XGCCPATH) > $$A && mv $$A $@ 2> /dev/null
$< $(XGCCPATH) > $@.tmp
\mv -f $@.tmp $@ 2> /dev/null
include .xcompile