mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2025-06-28 10:16:12 +00:00
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>
This commit is contained in:
parent
8408e00e62
commit
57bd86068a
@ -1,6 +1,7 @@
|
|||||||
LOCAL_PATH := $(call my-dir)
|
LOCAL_PATH := $(call my-dir)
|
||||||
|
|
||||||
GPU_TOOLS_PATH := $(LOCAL_PATH)/..
|
GPU_TOOLS_PATH := $(LOCAL_PATH)/..
|
||||||
|
IGT_LIB_PATH := $(LOCAL_PATH)
|
||||||
|
|
||||||
# FIXME: autogenerate this info #
|
# FIXME: autogenerate this info #
|
||||||
$(GPU_TOOLS_PATH)/config.h:
|
$(GPU_TOOLS_PATH)/config.h:
|
||||||
@ -13,7 +14,7 @@ include $(LOCAL_PATH)/Makefile.sources
|
|||||||
include $(CLEAR_VARS)
|
include $(CLEAR_VARS)
|
||||||
|
|
||||||
LOCAL_GENERATED_SOURCES := \
|
LOCAL_GENERATED_SOURCES := \
|
||||||
$(GPU_TOOLS_PATH)/lib/version.h \
|
$(IGT_LIB_PATH)/version.h \
|
||||||
$(GPU_TOOLS_PATH)/config.h
|
$(GPU_TOOLS_PATH)/config.h
|
||||||
|
|
||||||
LOCAL_C_INCLUDES += \
|
LOCAL_C_INCLUDES += \
|
||||||
|
@ -1,3 +1,6 @@
|
|||||||
|
IGT_LIB_PATH := $(builddir)
|
||||||
|
GPU_TOOLS_PATH := $(top_srcdir)
|
||||||
|
|
||||||
include Makefile.sources
|
include Makefile.sources
|
||||||
|
|
||||||
noinst_LTLIBRARIES = libintel_tools.la
|
noinst_LTLIBRARIES = libintel_tools.la
|
||||||
|
@ -48,12 +48,14 @@ libintel_tools_la_SOURCES = \
|
|||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
.PHONY: version.h.tmp
|
.PHONY: version.h.tmp
|
||||||
version.h.tmp:
|
|
||||||
|
$(IGT_LIB_PATH)/version.h.tmp:
|
||||||
@touch $@
|
@touch $@
|
||||||
@if test -d $(top_srcdir)/.git; then \
|
@if test -d $(GPU_TOOLS_PATH)/.git; then \
|
||||||
if which git > /dev/null 2>&1; then git log -n 1 --oneline | \
|
if which git > /dev/null 2>&1; then cd $(@D); \
|
||||||
|
git log -n 1 --oneline | \
|
||||||
sed 's/^\([^ ]*\) .*/#define IGT_GIT_SHA1 "g\1"/' \
|
sed 's/^\([^ ]*\) .*/#define IGT_GIT_SHA1 "g\1"/' \
|
||||||
>> $@ ; \
|
>> $(@F) ; \
|
||||||
else \
|
else \
|
||||||
echo '#define IGT_GIT_SHA1 "NO-GIT"' >> $@ ; \
|
echo '#define IGT_GIT_SHA1 "NO-GIT"' >> $@ ; \
|
||||||
fi \
|
fi \
|
||||||
@ -61,14 +63,14 @@ version.h.tmp:
|
|||||||
echo '#define IGT_GIT_SHA1 "NOT-GIT"' >> $@ ; \
|
echo '#define IGT_GIT_SHA1 "NOT-GIT"' >> $@ ; \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
version.h: version.h.tmp
|
|
||||||
@if ! cmp -s version.h.tmp version.h; then \
|
$(IGT_LIB_PATH)/version.h: $(IGT_LIB_PATH)/version.h.tmp
|
||||||
echo "updating version.h"; \
|
@if ! cmp -s $(IGT_LIB_PATH)/version.h.tmp $(IGT_LIB_PATH)/version.h; then \
|
||||||
mv version.h.tmp version.h ;\
|
mv $(IGT_LIB_PATH)/version.h.tmp $(IGT_LIB_PATH)/version.h ; \
|
||||||
else \
|
else \
|
||||||
rm version.h.tmp ;\
|
rm $(IGT_LIB_PATH)/version.h.tmp ; \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
BUILT_SOURCES = version.h
|
BUILT_SOURCES = $(IGT_LIB_PATH)/version.h
|
||||||
CLEANFILES = version.h version.h.tmp
|
CLEANFILES = $(IGT_LIB_PATH)/version.h $(IGT_LIB_PATH)/version.h.tmp
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user