diff --git a/runtime/Makefile.am b/runtime/Makefile.am index d14bf03e2..ca458ab19 100644 --- a/runtime/Makefile.am +++ b/runtime/Makefile.am @@ -39,7 +39,7 @@ lib_LIBRARIES = libcsmith.a libcsmith_a_SOURCES = \ volatile_runtime.c -GIT_HASH := $(shell git show -s --format=%h . 2>/dev/null || echo exported) +GIT_HASH := $(shell (cd "$(top_srcdir)" && git show -s --format=%h . 2>/dev/null) || echo exported) GIT_FLAG = -DGIT_VERSION=\"$(GIT_HASH)\" ## ENE: The idea of stuffing the target CPU name (a string) into a CPP symbol diff --git a/runtime/Makefile.in b/runtime/Makefile.in index b65769c22..23da5414f 100644 --- a/runtime/Makefile.in +++ b/runtime/Makefile.in @@ -204,7 +204,7 @@ lib_LIBRARIES = libcsmith.a libcsmith_a_SOURCES = \ volatile_runtime.c -GIT_HASH := $(shell git show -s --format=%h . 2>/dev/null || echo exported) +GIT_HASH := $(shell (cd "$(top_srcdir)" && git show -s --format=%h . 2>/dev/null) || echo exported) GIT_FLAG = -DGIT_VERSION=\"$(GIT_HASH)\" libcsmith_a_CPPFLAGS = \ -DTARGET_CPU_$(target_cpu)=1 \ diff --git a/src/Makefile.am b/src/Makefile.am index 039fcefd6..7f07e2c05 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -191,7 +191,7 @@ EXTRA_DIST = \ csmith.vcproj \ csmith.vcxproj -GIT_HASH := $(shell git show -s --format=%h . 2>/dev/null || echo exported) +GIT_HASH := $(shell (cd "$(top_srcdir)" && git show -s --format=%h . 2>/dev/null) || echo exported) GIT_FLAG = -DGIT_VERSION=\"$(GIT_HASH)\" ## ENE: The idea of stuffing the target CPU name (a string) into a CPP symbol diff --git a/src/Makefile.in b/src/Makefile.in index 56802e53b..3e691d408 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -384,7 +384,7 @@ EXTRA_DIST = \ csmith.vcproj \ csmith.vcxproj -GIT_HASH := $(shell git show -s --format=%h . 2>/dev/null || echo exported) +GIT_HASH := $(shell (cd "$(top_srcdir)" && git show -s --format=%h . 2>/dev/null) || echo exported) GIT_FLAG = -DGIT_VERSION=\"$(GIT_HASH)\" csmith_CPPFLAGS = \ -DTARGET_CPU_$(target_cpu)=1 \