diff mbox

[i-g-t,2/2] tools/Android.mk: add any extra program sources

Message ID 1437044853-7940-3-git-send-email-thomas.wood@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Thomas Wood July 16, 2015, 11:07 a.m. UTC
Cc: Derek Morton <derek.j.morton@intel.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
---
 tools/Android.mk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Derek Morton July 16, 2015, 2:13 p.m. UTC | #1
Hi Thomas,

I tried these patches on Android. They worked with some modifications. See comments below.

//Derek

>
>
>-----Original Message-----
>From: Wood, Thomas 
>Sent: Thursday, July 16, 2015 12:08 PM
>To: intel-gfx@lists.freedesktop.org
>Cc: Morton, Derek J
>Subject: [PATCH i-g-t 2/2] tools/Android.mk: add any extra program sources
>
>Cc: Derek Morton <derek.j.morton@intel.com>
>Signed-off-by: Thomas Wood <thomas.wood@intel.com>
>---
> tools/Android.mk | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
>diff --git a/tools/Android.mk b/tools/Android.mk index 39f4512..f7dc3bb 100644
>--- a/tools/Android.mk
>+++ b/tools/Android.mk
>@@ -1,13 +1,13 @@
> LOCAL_PATH := $(call my-dir)
> 
>-include $(LOCAL_PATH)/Makefile.sources
>+include ./$(LOCAL_PATH)/Makefile.sources

$(LOCAL_PATH) is an absolute path so putting ./ in front of it breaks things.

> 
> #================#
> 
> define add_tool
>     include $(CLEAR_VARS)
> 
>-    LOCAL_SRC_FILES := $1.c
>+    LOCAL_SRC_FILES := $1.c $($(1)_SOURCES)

This causes duplication errors as $1.c will also be in $($(1)_SOURCES). However $($(1)_SOURCES) on its own does not work either as it is not defined for all targets.
I ended up with:

ifeq ($($(1)_SOURCES),)
    LOCAL_SRC_FILES := $1.c
else
    LOCAL_SRC_FILES := $($(1)_SOURCES)
endif

> 
>     LOCAL_CFLAGS += -DHAVE_TERMIOS_H
>     LOCAL_CFLAGS += -DHAVE_STRUCT_SYSINFO_TOTALRAM
>--
>2.4.3
>
>
Thomas Wood July 16, 2015, 3:23 p.m. UTC | #2
On 16 July 2015 at 15:13, Morton, Derek J <derek.j.morton@intel.com> wrote:
>
> Hi Thomas,
>
> I tried these patches on Android. They worked with some modifications. See comments below.
>
> //Derek
>
> >
> >
> >-----Original Message-----
> >From: Wood, Thomas
> >Sent: Thursday, July 16, 2015 12:08 PM
> >To: intel-gfx@lists.freedesktop.org
> >Cc: Morton, Derek J
> >Subject: [PATCH i-g-t 2/2] tools/Android.mk: add any extra program sources
> >
> >Cc: Derek Morton <derek.j.morton@intel.com>
> >Signed-off-by: Thomas Wood <thomas.wood@intel.com>
> >---
> > tools/Android.mk | 4 ++--
> > 1 file changed, 2 insertions(+), 2 deletions(-)
> >
> >diff --git a/tools/Android.mk b/tools/Android.mk index 39f4512..f7dc3bb 100644
> >--- a/tools/Android.mk
> >+++ b/tools/Android.mk
> >@@ -1,13 +1,13 @@
> > LOCAL_PATH := $(call my-dir)
> >
> >-include $(LOCAL_PATH)/Makefile.sources
> >+include ./$(LOCAL_PATH)/Makefile.sources
>
> $(LOCAL_PATH) is an absolute path so putting ./ in front of it breaks things.

This was just for some (limited) local testing, so wasn't supposed to
be in the patch anyway.


>
> >
> > #================#
> >
> > define add_tool
> >     include $(CLEAR_VARS)
> >
> >-    LOCAL_SRC_FILES := $1.c
> >+    LOCAL_SRC_FILES := $1.c $($(1)_SOURCES)
>
> This causes duplication errors as $1.c will also be in $($(1)_SOURCES). However $($(1)_SOURCES) on its own does not work either as it is not defined for all targets.
> I ended up with:

Looks good; I'll make the changes and push the patches.

>
> ifeq ($($(1)_SOURCES),)
>     LOCAL_SRC_FILES := $1.c
> else
>     LOCAL_SRC_FILES := $($(1)_SOURCES)
> endif
>
> >
> >     LOCAL_CFLAGS += -DHAVE_TERMIOS_H
> >     LOCAL_CFLAGS += -DHAVE_STRUCT_SYSINFO_TOTALRAM
> >--
> >2.4.3
> >
> >
diff mbox

Patch

diff --git a/tools/Android.mk b/tools/Android.mk
index 39f4512..f7dc3bb 100644
--- a/tools/Android.mk
+++ b/tools/Android.mk
@@ -1,13 +1,13 @@ 
 LOCAL_PATH := $(call my-dir)
 
-include $(LOCAL_PATH)/Makefile.sources
+include ./$(LOCAL_PATH)/Makefile.sources
 
 #================#
 
 define add_tool
     include $(CLEAR_VARS)
 
-    LOCAL_SRC_FILES := $1.c
+    LOCAL_SRC_FILES := $1.c $($(1)_SOURCES)
 
     LOCAL_CFLAGS += -DHAVE_TERMIOS_H
     LOCAL_CFLAGS += -DHAVE_STRUCT_SYSINFO_TOTALRAM