Skip to content

Commit 4b61057

Browse files
sjaeckeljubalh
authored andcommitted
Fix Git version strings for out-of-tree builds.
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
1 parent 0ad4e38 commit 4b61057

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

Makefile.am

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -323,15 +323,16 @@ EXTRA_DIST += \
323323
apidocs/python/src/prof.py
324324

325325
if INCLUDE_GIT_VERSION
326-
EXTRA_DIST += .git/HEAD .git/index
326+
GIT_FILES = $(top_srcdir)/.git/HEAD $(top_srcdir)/.git/index
327+
EXTRA_DIST += $(GIT_FILES)
327328

328-
$(git_include).in: .git/HEAD .git/index
329+
$(git_include).in: $(GIT_FILES)
329330
rm -f $@
330331
echo "#ifndef PROF_GIT_BRANCH" >> $@
331-
echo "#define PROF_GIT_BRANCH \"$(shell git rev-parse --symbolic-full-name --abbrev-ref HEAD)\"" >> $@
332+
echo "#define PROF_GIT_BRANCH \"$(shell git -C $(top_srcdir) rev-parse --symbolic-full-name --abbrev-ref HEAD)\"" >> $@
332333
echo "#endif" >> $@
333334
echo "#ifndef PROF_GIT_REVISION" >> $@
334-
echo "#define PROF_GIT_REVISION \"$(shell git log --pretty=format:'%h' -n 1)\"" >> $@
335+
echo "#define PROF_GIT_REVISION \"$(shell git -C $(top_srcdir) log --pretty=format:'%h' -n 1)\"" >> $@
335336
echo "#endif" >> $@
336337

337338
#

0 commit comments

Comments
 (0)