summaryrefslogtreecommitdiff
path: root/Makefile.rules
diff options
context:
space:
mode:
authorPatrick Georgi <pgeorgi@google.com>2018-07-04 17:02:24 +0200
committerchrome-bot <chrome-bot@chromium.org>2018-07-13 05:09:33 -0700
commit72b83f6b6c89da81248d76c25d2f7ba3066b6acf (patch)
treea28cae126aef4a73b753c1632ab4a1d1f9349ae3 /Makefile.rules
parent63f9c7791e874732526f1f5d0d55ab45173c48b9 (diff)
downloadchrome-ec-72b83f6b6c89da81248d76c25d2f7ba3066b6acf.tar.gz
Makefile.rules: only update version.h timestamp if it changed
BUG=none BRANCH=none TEST=buildall with no change is much faster now (no relinking of ec.*.elf) Change-Id: I844b5f6836462efaa98a1d26edcaf8f8a3c47567 Signed-off-by: Patrick Georgi <pgeorgi@google.com> Reviewed-on: https://chromium-review.googlesource.com/1126316 Commit-Ready: Patrick Georgi <pgeorgi@chromium.org> Tested-by: Patrick Georgi <pgeorgi@chromium.org> Reviewed-by: Jett Rink <jettrink@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 29a1a27b85..cf7abab0c4 100644
--- a/Makefile.rules
+++ b/Makefile.rules
@@ -84,7 +84,8 @@ cmd_c_to_host = $(HOSTCC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -MMD -MF $@.d -o $@ \
cmd_cxx_to_host = $(HOSTCXX) -std=c++0x $(COMMON_WARN) $(HOST_CXXFLAGS)\
-I ./$($(notdir $@)_ROOT) -o $@ $(filter %.cc,$^) $($(notdir $@)_LIBS)
cmd_host_test = ./util/run_host_test $* $(silent)
-cmd_version = ./util/getversion.sh > $@
+# generate new version.h, compare if it changed and replace if so
+cmd_version = ./util/getversion.sh > $@.tmp && cmp $@.tmp $@ >/dev/null || mv $@.tmp $@; rm -f $@.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 \