Skip to content

Commit

Permalink
Make GIT_HASH work when one uses a separate build directory.
Browse files Browse the repository at this point in the history
My previous definition of GIT_HASH only worked when one built Csmith
in the source tree.  The new definition works when one builds in a
separate directory, too.
(cherry picked from commit ddbef56)
  • Loading branch information
eeide committed May 20, 2011
1 parent 127c74e commit 5f57679
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion runtime/Makefile.am
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion runtime/Makefile.in
Expand Up @@ -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 \
Expand Down
2 changes: 1 addition & 1 deletion src/Makefile.am
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/Makefile.in
Expand Up @@ -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 \
Expand Down

0 comments on commit 5f57679

Please sign in to comment.