summaryrefslogtreecommitdiff
path: root/version_detection.mk
diff options
context:
space:
mode:
authortgrogers <[email protected]>2019-06-18 23:18:15 -0400
committertgrogers <[email protected]>2019-06-18 23:18:15 -0400
commit2d72b15abc09a35103667924adfbeb0744807644 (patch)
treea28640e4eb3e34aaff0003fac45918607bf72421 /version_detection.mk
parentf63324eda157f742d06c889b1be73717771e60a5 (diff)
Fixing really screwy version strings when you have some files modified
Diffstat (limited to 'version_detection.mk')
-rw-r--r--version_detection.mk5
1 files changed, 3 insertions, 2 deletions
diff --git a/version_detection.mk b/version_detection.mk
index 00a86c0..ee71a62 100644
--- a/version_detection.mk
+++ b/version_detection.mk
@@ -33,8 +33,9 @@ GPGPUSIM_VERSION=$(shell cat $(GPGPUSIM_ROOT)/version | awk '/Version/ {print $$
#Detect Git branch and commit #
GIT_COMMIT := $(shell git log -n 1 | head -1 | sed -re 's/commit (.*)/\1/')
-GIT_FILES_CHANGED := $(shell git diff --numstat --cached && git diff --numstat | wc | sed -re 's/^\s+([0-9]+).*/\1/')
-GPGPUSIM_BUILD := "gpgpu-sim_git-commit-$(GIT_COMMIT)_modified_$(GIT_FILES_CHANGED)"
+GIT_FILES_CHANGED_A:=$(shell git diff --numstat | wc | sed -re 's/^\s+([0-9]+).*/\1./')
+GIT_FILES_CHANGED:= $(GIT_FILES_CHANGED_A)$(shell git diff --numstat --cached | wc | sed -re 's/^\s+([0-9]+).*/\1/')
+GPGPUSIM_BUILD := gpgpu-sim_git-commit-$(GIT_COMMIT)_modified_$(GIT_FILES_CHANGED)
endif
# Detect CUDA Runtime Version