diff options
author | Bill Richardson <wfrichar@chromium.org> | 2015-09-23 13:49:56 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2015-09-24 12:46:28 -0700 |
commit | 5d138b379db251f27bd741e97119a30ba16acee1 (patch) | |
tree | e3da9d08c3f3a353f92236c2f20f19d6ce8ae1d7 /Makefile.rules | |
parent | 6190e15597ba0f842040abf7dbb615e0ceeefa2e (diff) | |
download | chrome-ec-5d138b379db251f27bd741e97119a30ba16acee1.tar.gz |
Make builds repeatable.
We have been using the time of compilation to determine the
version string. This CL will keep doing that if the git repo has
uncommitted changes, but if the repo is clean we'll just use the
author date of the last commit. This ensures that the same source
will produce bitwise-identical builds (assuming no toolchain
changes, of course).
BUG=chrome-os-partner:45616
BRANCH=none
TEST=manual
cd src/platform/ec
make buildall
mv build build.one
make buildall
md5sum build{,.one}/*/ec.bin | sort
Observe that successive builds produce identical binaries.
Change-Id: Ie2ef44b216586097589c9c15f12e05c87a53f991
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/302140
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Reviewed-by: Shawn N <shawnn@chromium.org>
Diffstat (limited to 'Makefile.rules')
-rw-r--r-- | Makefile.rules | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/Makefile.rules b/Makefile.rules index 3c51caafd8..65500f317b 100644 --- a/Makefile.rules +++ b/Makefile.rules @@ -60,7 +60,6 @@ cmd_c_to_host = $(HOSTCC) $(HOST_CFLAGS) -MMD -MF $@.d -o $@ \ cmd_cxx_to_host = $(HOSTCXX) -std=c++0x $(COMMON_WARN) \ -I ./$($(notdir $@)_ROOT) -o $@ $(filter %.cc,$^) $($(notdir $@)_LIBS) cmd_host_test = ./util/run_host_test $* $(silent) -cmd_date = $(if $(USE_GIT_DATE),cat /dev/null,./util/getdate.sh) > $@ cmd_version = ./util/getversion.sh > $@ cmd_mv_from_tmp = mv $(out)/$*.bin.tmp $(out)/$*.bin cmd_extractrw-y = dd if=$(out)/$(PROJECT).bin.tmp of=$(out)/$(PROJECT).RW.bin \ @@ -260,7 +259,7 @@ ifneq ($(old_version_hash),$(new_version_hash)) endif # All of the objects have an order only dependency on the ec_version header. -# This ensures that if ec_version.h needs to be build (because it was marked +# This ensures that if ec_version.h needs to be built (because it was marked # PHONY above) then it will be rebuilt before any objects. This is important # because some source files will include ec_version.h and fail to compile if # it doesn't already exist. This dependency shouldn't be a normal dependency @@ -275,12 +274,6 @@ $(sharedlib-objs): | $(out)/ec_version.h $(out)/ec_version.h: $(call quiet,version,VERSION) -$(out)/RO/common/version.o: $(out)/ec_date.h -$(out)/RW/common/version.o: $(out)/ec_date.h - -$(out)/ec_date.h: $(filter-out $(out)/%/common/version.o,$(ro-objs) $(rw-objs)) - $(call quiet,date,DATE ) - $(out)/gen_pub_key.h: $(PEM) $(call quiet,pubkey,PUBKEY ) |