diff options
author | Tim Gore <tim.gore@intel.com> | 2014-07-24 17:38:22 +0100 |
---|---|---|
committer | Thomas Wood <thomas.wood@intel.com> | 2014-07-25 14:46:51 +0100 |
commit | 57bd86068a319b218796d0bea92258b44ee143a0 (patch) | |
tree | c37f9322d2f0432671f1556271bcf51fc4eacad0 /lib/Makefile.sources | |
parent | 8408e00e623b52f18ad0795122593741197fa2f4 (diff) |
intel-gpu-tools: fix version.h creation in android
commit 743dc7997aa9f5210055896940d87c88983dcda6
breaks the build under Android because version.h
is not created. This happens because the android
make executes from the ANDROID_BUILD_TOP directory
rather than from the directory containing the source
files, so we need to differentiate between Android
and linux builds. This is V2 of this patch based on
Thomas Wood's suggestion.
Signed-off-by: Tim Gore <tim.gore@intel.com>
[Thomas: Fix distcheck issues]
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
Diffstat (limited to 'lib/Makefile.sources')
-rw-r--r-- | lib/Makefile.sources | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/lib/Makefile.sources b/lib/Makefile.sources index 2d971c5a..aa9a130e 100644 --- a/lib/Makefile.sources +++ b/lib/Makefile.sources @@ -48,12 +48,14 @@ libintel_tools_la_SOURCES = \ $(NULL) .PHONY: version.h.tmp -version.h.tmp: + +$(IGT_LIB_PATH)/version.h.tmp: @touch $@ - @if test -d $(top_srcdir)/.git; then \ - if which git > /dev/null 2>&1; then git log -n 1 --oneline | \ + @if test -d $(GPU_TOOLS_PATH)/.git; then \ + if which git > /dev/null 2>&1; then cd $(@D); \ + git log -n 1 --oneline | \ sed 's/^\([^ ]*\) .*/#define IGT_GIT_SHA1 "g\1"/' \ - >> $@ ; \ + >> $(@F) ; \ else \ echo '#define IGT_GIT_SHA1 "NO-GIT"' >> $@ ; \ fi \ @@ -61,14 +63,14 @@ version.h.tmp: echo '#define IGT_GIT_SHA1 "NOT-GIT"' >> $@ ; \ fi -version.h: version.h.tmp - @if ! cmp -s version.h.tmp version.h; then \ - echo "updating version.h"; \ - mv version.h.tmp version.h ;\ + +$(IGT_LIB_PATH)/version.h: $(IGT_LIB_PATH)/version.h.tmp + @if ! cmp -s $(IGT_LIB_PATH)/version.h.tmp $(IGT_LIB_PATH)/version.h; then \ + mv $(IGT_LIB_PATH)/version.h.tmp $(IGT_LIB_PATH)/version.h ; \ else \ - rm version.h.tmp ;\ + rm $(IGT_LIB_PATH)/version.h.tmp ; \ fi -BUILT_SOURCES = version.h -CLEANFILES = version.h version.h.tmp +BUILT_SOURCES = $(IGT_LIB_PATH)/version.h +CLEANFILES = $(IGT_LIB_PATH)/version.h $(IGT_LIB_PATH)/version.h.tmp |