path: root/Makefile
diff options
authorVadim Bendebury <vbendeb@chromium.org>2015-04-25 11:34:35 -0700
committerVadim Bendebury <vbendeb@chromium.org>2015-04-28 03:12:38 +0200
commite46960246139fbf53e34de9288e654da900db63b (patch)
treea67a8f5ec29b4a7180b31ac38db39c0b6d3a5897 /Makefile
parent13e4182119bcfcf09bdd9fa2b0cc5d09cd3550c2 (diff)
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>
Diffstat (limited to 'Makefile')
1 files changed, 2 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 14e159898..2ff4ebe04 100644
--- a/Makefile
+++ b/Makefile
@@ -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