summaryrefslogtreecommitdiff
path: root/Makefile.rules
diff options
context:
space:
mode:
authorVadim Bendebury <vbendeb@chromium.org>2019-02-03 13:47:50 -0800
committerchrome-bot <chrome-bot@chromium.org>2019-02-05 02:49:42 -0800
commit21c470bab4d9f1182ff52f965ed8005c10fe798e (patch)
tree3344a650af5eeec687654671fa580fb0a3886648 /Makefile.rules
parentf00865ed96cbba79e34fa210279eb178ec92e778 (diff)
downloadchrome-ec-21c470bab4d9f1182ff52f965ed8005c10fe798e.tar.gz
Makefile.rules: do not run rm unless necessary
When processing the result of comparison of current and previous ./util/getversion.sh outputs, remove temp file only if it matches the previous version. Otherwise the temp file would be moved to the target file and does not need to be explicitly removed. BRANCH=none BUG=none TEST=observed successful completion of 'make BOARD=cr50' with and without modified files in the tree. Change-Id: I70c848179b5c97bc3ff1e8ec001aedaebce515bd Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1450180 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Diffstat (limited to 'Makefile.rules')
-rw-r--r--Makefile.rules3
1 files changed, 2 insertions, 1 deletions
diff --git a/Makefile.rules b/Makefile.rules
index 98a9e4b37b..62385c4786 100644
--- a/Makefile.rules
+++ b/Makefile.rules
@@ -96,7 +96,8 @@ cmd_host_test = $(MAKE) --no-print-directory BOARD=host PROJECT=$* \
$(TEST_FLAG) build/host/$*/$*.exe
cmd_run_host_test = ./util/run_host_test $* $(silent)
# generate new version.h, compare if it changed and replace if so
-cmd_version = ./util/getversion.sh > $@.tmp && cmp -s $@.tmp $@ || mv $@.tmp $@; rm -f $@.tmp
+cmd_version = ./util/getversion.sh > $@.tmp && \
+ cmp -s $@.tmp $@ && rm -f $@.tmp || mv $@.tmp $@
cmd_vif = $(out)/util/genvif -b $(BOARD) -o $(out)
cmd_mv_from_tmp = mv $(out)/$*.bin.tmp $(out)/$*.bin
cmd_extractrw-y = dd if=$(out)/$(PROJECT).bin.tmp of=$(out)/$(PROJECT).RW.bin \