OSDN Git Service

Subzero: Fix SUBZERO_REVISION in production builds.
authorJim Stichnoth <stichnot@chromium.org>
Wed, 14 Sep 2016 18:07:30 +0000 (11:07 -0700)
committerJim Stichnoth <stichnot@chromium.org>
Wed, 14 Sep 2016 18:07:30 +0000 (11:07 -0700)
In production autoconf builds (which are the builds that matter), the SUBZERO_REVISION was being calculated based on git history of the top-level native_client repo, rather than the pnacl-subzero repo.

BUG= none
R=jpp@chromium.org, kschimpf@google.com

Review URL: https://codereview.chromium.org/2338943003 .

Makefile

index ca1d4e3..65e459a 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -31,6 +31,8 @@ else
 endif
 
 CPP.Defines += -DPNACL_LLVM
-SZ_COMMIT_COUNT := $(shell git rev-list --count HEAD)
-SZ_GIT_HASH := $(shell git rev-parse HEAD)
+# SUBZERO_SRC_ROOT should already be set, but if not, set to cwd.
+SUBZERO_SRC_ROOT ?= .
+SZ_COMMIT_COUNT := $(shell git -C $(SUBZERO_SRC_ROOT) rev-list --count HEAD)
+SZ_GIT_HASH := $(shell git -C $(SUBZERO_SRC_ROOT) rev-parse HEAD)
 CPP.Defines += -DSUBZERO_REVISION=$(SZ_COMMIT_COUNT)_$(SZ_GIT_HASH)