All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] tools: iio: fix iio build error by adding KBUILD_OUTPUT support to makefile
@ 2016-08-11  6:01 ` Mugunthan V N
  0 siblings, 0 replies; 7+ messages in thread
From: Mugunthan V N @ 2016-08-11  6:01 UTC (permalink / raw)
  To: linux-iio
  Cc: Jonathan Cameron, Hartmut Knaack, Lars-Peter Clausen,
	Peter Meerwald-Stadler, linux-kernel, linux-omap, Sekhar Nori,
	Mugunthan V N

Current make doesn't have support to pass kernel built directory
to find events.h kernel header file, so adding support for
KBUILD_OUTPUT support to Makefile.

$ make CROSS_COMPILE=arm-linux-gnueabihf- -C tools/iio
make: Entering directory '/home/a0131834/workspace/git/mainline/linux/tools/iio'
arm-linux-gnueabihf-gcc -Wall -g -D_GNU_SOURCE   -c -o iio_event_monitor.o iio_event_monitor.c
arm-linux-gnueabihf-gcc -Wall -g -D_GNU_SOURCE   -c -o iio_utils.o iio_utils.c
arm-linux-gnueabihf-gcc -Wall -g -D_GNU_SOURCE   -c -o lsiio.o lsiio.c
arm-linux-gnueabihf-gcc -Wall -g -D_GNU_SOURCE   -c -o iio_generic_buffer.o iio_generic_buffer.c
arm-linux-gnueabihf-gcc   lsiio.o iio_utils.o   -o lsiio
arm-linux-gnueabihf-gcc   iio_generic_buffer.o iio_utils.o   -o iio_generic_buffer
iio_event_monitor.c:28:30: fatal error: linux/iio/events.h: No such file or directory
 #include <linux/iio/events.h>
                               ^
compilation terminated.
<builtin>: recipe for target 'iio_event_monitor.o' failed
make: *** [iio_event_monitor.o] Error 1
make: Leaving directory '/home/a0131834/workspace/git/mainline/linux/tools/iio'

Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
---

With this fix I am able to build the iio tools

$ make CROSS_COMPILE=arm-linux-gnueabihf- -C tools/iio KBUILD_OUTPUT=`pwd`
make: Entering directory '/home/a0131834/workspace/git/mainline/linux/tools/iio'
arm-linux-gnueabihf-gcc -Wall -g -D_GNU_SOURCE -I/home/a0131834/workspace/git/mainline/linux/usr/include   -c -o iio_event_monitor.o iio_event_monitor.c
arm-linux-gnueabihf-gcc -Wall -g -D_GNU_SOURCE -I/home/a0131834/workspace/git/mainline/linux/usr/include   -c -o iio_utils.o iio_utils.c
arm-linux-gnueabihf-gcc   iio_event_monitor.o iio_utils.o   -o iio_event_monitor
arm-linux-gnueabihf-gcc -Wall -g -D_GNU_SOURCE -I/home/a0131834/workspace/git/mainline/linux/usr/include   -c -o lsiio.o lsiio.c
arm-linux-gnueabihf-gcc   lsiio.o iio_utils.o   -o lsiio
arm-linux-gnueabihf-gcc -Wall -g -D_GNU_SOURCE -I/home/a0131834/workspace/git/mainline/linux/usr/include   -c -o iio_generic_buffer.o iio_generic_buffer.c
arm-linux-gnueabihf-gcc   iio_generic_buffer.o iio_utils.o   -o iio_generic_buffer
make: Leaving directory '/home/a0131834/workspace/git/mainline/linux/tools/iio'

---
 tools/iio/Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tools/iio/Makefile b/tools/iio/Makefile
index 5446d62..0ec3ea0 100644
--- a/tools/iio/Makefile
+++ b/tools/iio/Makefile
@@ -1,5 +1,6 @@
 CC = $(CROSS_COMPILE)gcc
-CFLAGS += -Wall -g -D_GNU_SOURCE
+KBUILD_OUTPUT ?= /lib/modules/$(shell uname -r)/build
+CFLAGS += -Wall -g -D_GNU_SOURCE -I$(KBUILD_OUTPUT)/usr/include
 
 BINDIR=usr/bin
 INSTALL_PROGRAM=install -m 755 -p
-- 
2.9.2.664.ga0a1831

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH] tools: iio: fix iio build error by adding KBUILD_OUTPUT support to makefile
@ 2016-08-11  6:01 ` Mugunthan V N
  0 siblings, 0 replies; 7+ messages in thread
From: Mugunthan V N @ 2016-08-11  6:01 UTC (permalink / raw)
  To: linux-iio-u79uwXL29TY76Z2rM5mHXA
  Cc: Jonathan Cameron, Hartmut Knaack, Lars-Peter Clausen,
	Peter Meerwald-Stadler, linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-omap-u79uwXL29TY76Z2rM5mHXA, Sekhar Nori, Mugunthan V N

Current make doesn't have support to pass kernel built directory
to find events.h kernel header file, so adding support for
KBUILD_OUTPUT support to Makefile.

$ make CROSS_COMPILE=arm-linux-gnueabihf- -C tools/iio
make: Entering directory '/home/a0131834/workspace/git/mainline/linux/tools/iio'
arm-linux-gnueabihf-gcc -Wall -g -D_GNU_SOURCE   -c -o iio_event_monitor.o iio_event_monitor.c
arm-linux-gnueabihf-gcc -Wall -g -D_GNU_SOURCE   -c -o iio_utils.o iio_utils.c
arm-linux-gnueabihf-gcc -Wall -g -D_GNU_SOURCE   -c -o lsiio.o lsiio.c
arm-linux-gnueabihf-gcc -Wall -g -D_GNU_SOURCE   -c -o iio_generic_buffer.o iio_generic_buffer.c
arm-linux-gnueabihf-gcc   lsiio.o iio_utils.o   -o lsiio
arm-linux-gnueabihf-gcc   iio_generic_buffer.o iio_utils.o   -o iio_generic_buffer
iio_event_monitor.c:28:30: fatal error: linux/iio/events.h: No such file or directory
 #include <linux/iio/events.h>
                               ^
compilation terminated.
<builtin>: recipe for target 'iio_event_monitor.o' failed
make: *** [iio_event_monitor.o] Error 1
make: Leaving directory '/home/a0131834/workspace/git/mainline/linux/tools/iio'

Signed-off-by: Mugunthan V N <mugunthanvnm-l0cyMroinI0@public.gmane.org>
---

With this fix I am able to build the iio tools

$ make CROSS_COMPILE=arm-linux-gnueabihf- -C tools/iio KBUILD_OUTPUT=`pwd`
make: Entering directory '/home/a0131834/workspace/git/mainline/linux/tools/iio'
arm-linux-gnueabihf-gcc -Wall -g -D_GNU_SOURCE -I/home/a0131834/workspace/git/mainline/linux/usr/include   -c -o iio_event_monitor.o iio_event_monitor.c
arm-linux-gnueabihf-gcc -Wall -g -D_GNU_SOURCE -I/home/a0131834/workspace/git/mainline/linux/usr/include   -c -o iio_utils.o iio_utils.c
arm-linux-gnueabihf-gcc   iio_event_monitor.o iio_utils.o   -o iio_event_monitor
arm-linux-gnueabihf-gcc -Wall -g -D_GNU_SOURCE -I/home/a0131834/workspace/git/mainline/linux/usr/include   -c -o lsiio.o lsiio.c
arm-linux-gnueabihf-gcc   lsiio.o iio_utils.o   -o lsiio
arm-linux-gnueabihf-gcc -Wall -g -D_GNU_SOURCE -I/home/a0131834/workspace/git/mainline/linux/usr/include   -c -o iio_generic_buffer.o iio_generic_buffer.c
arm-linux-gnueabihf-gcc   iio_generic_buffer.o iio_utils.o   -o iio_generic_buffer
make: Leaving directory '/home/a0131834/workspace/git/mainline/linux/tools/iio'

---
 tools/iio/Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tools/iio/Makefile b/tools/iio/Makefile
index 5446d62..0ec3ea0 100644
--- a/tools/iio/Makefile
+++ b/tools/iio/Makefile
@@ -1,5 +1,6 @@
 CC = $(CROSS_COMPILE)gcc
-CFLAGS += -Wall -g -D_GNU_SOURCE
+KBUILD_OUTPUT ?= /lib/modules/$(shell uname -r)/build
+CFLAGS += -Wall -g -D_GNU_SOURCE -I$(KBUILD_OUTPUT)/usr/include
 
 BINDIR=usr/bin
 INSTALL_PROGRAM=install -m 755 -p
-- 
2.9.2.664.ga0a1831

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] tools: iio: fix iio build error by adding KBUILD_OUTPUT support to makefile
@ 2016-08-21 19:05   ` Jonathan Cameron
  0 siblings, 0 replies; 7+ messages in thread
From: Jonathan Cameron @ 2016-08-21 19:05 UTC (permalink / raw)
  To: Mugunthan V N, linux-iio
  Cc: Hartmut Knaack, Lars-Peter Clausen, Peter Meerwald-Stadler,
	linux-kernel, linux-omap, Sekhar Nori

On 11/08/16 07:01, Mugunthan V N wrote:
> Current make doesn't have support to pass kernel built directory
> to find events.h kernel header file, so adding support for
> KBUILD_OUTPUT support to Makefile.
> 
> $ make CROSS_COMPILE=arm-linux-gnueabihf- -C tools/iio
> make: Entering directory '/home/a0131834/workspace/git/mainline/linux/tools/iio'
> arm-linux-gnueabihf-gcc -Wall -g -D_GNU_SOURCE   -c -o iio_event_monitor.o iio_event_monitor.c
> arm-linux-gnueabihf-gcc -Wall -g -D_GNU_SOURCE   -c -o iio_utils.o iio_utils.c
> arm-linux-gnueabihf-gcc -Wall -g -D_GNU_SOURCE   -c -o lsiio.o lsiio.c
> arm-linux-gnueabihf-gcc -Wall -g -D_GNU_SOURCE   -c -o iio_generic_buffer.o iio_generic_buffer.c
> arm-linux-gnueabihf-gcc   lsiio.o iio_utils.o   -o lsiio
> arm-linux-gnueabihf-gcc   iio_generic_buffer.o iio_utils.o   -o iio_generic_buffer
> iio_event_monitor.c:28:30: fatal error: linux/iio/events.h: No such file or directory
>  #include <linux/iio/events.h>
>                                ^
> compilation terminated.
> <builtin>: recipe for target 'iio_event_monitor.o' failed
> make: *** [iio_event_monitor.o] Error 1
> make: Leaving directory '/home/a0131834/workspace/git/mainline/linux/tools/iio'
> 
> Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
I can see where you are coming from, but wouldn't we normally expect the kernel
headers for the relevant kernel to available as part of the toolchain being
used to do the build?

They often lag a bit I guess, so perhaps we do want to put this little bit
of 'fudging' in place.

What do others think?

Jonathan
> ---
> 
> With this fix I am able to build the iio tools
> 
> $ make CROSS_COMPILE=arm-linux-gnueabihf- -C tools/iio KBUILD_OUTPUT=`pwd`
> make: Entering directory '/home/a0131834/workspace/git/mainline/linux/tools/iio'
> arm-linux-gnueabihf-gcc -Wall -g -D_GNU_SOURCE -I/home/a0131834/workspace/git/mainline/linux/usr/include   -c -o iio_event_monitor.o iio_event_monitor.c
> arm-linux-gnueabihf-gcc -Wall -g -D_GNU_SOURCE -I/home/a0131834/workspace/git/mainline/linux/usr/include   -c -o iio_utils.o iio_utils.c
> arm-linux-gnueabihf-gcc   iio_event_monitor.o iio_utils.o   -o iio_event_monitor
> arm-linux-gnueabihf-gcc -Wall -g -D_GNU_SOURCE -I/home/a0131834/workspace/git/mainline/linux/usr/include   -c -o lsiio.o lsiio.c
> arm-linux-gnueabihf-gcc   lsiio.o iio_utils.o   -o lsiio
> arm-linux-gnueabihf-gcc -Wall -g -D_GNU_SOURCE -I/home/a0131834/workspace/git/mainline/linux/usr/include   -c -o iio_generic_buffer.o iio_generic_buffer.c
> arm-linux-gnueabihf-gcc   iio_generic_buffer.o iio_utils.o   -o iio_generic_buffer
> make: Leaving directory '/home/a0131834/workspace/git/mainline/linux/tools/iio'
> 
> ---
>  tools/iio/Makefile | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/tools/iio/Makefile b/tools/iio/Makefile
> index 5446d62..0ec3ea0 100644
> --- a/tools/iio/Makefile
> +++ b/tools/iio/Makefile
> @@ -1,5 +1,6 @@
>  CC = $(CROSS_COMPILE)gcc
> -CFLAGS += -Wall -g -D_GNU_SOURCE
> +KBUILD_OUTPUT ?= /lib/modules/$(shell uname -r)/build
> +CFLAGS += -Wall -g -D_GNU_SOURCE -I$(KBUILD_OUTPUT)/usr/include
>  
>  BINDIR=usr/bin
>  INSTALL_PROGRAM=install -m 755 -p
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] tools: iio: fix iio build error by adding KBUILD_OUTPUT support to makefile
@ 2016-08-21 19:05   ` Jonathan Cameron
  0 siblings, 0 replies; 7+ messages in thread
From: Jonathan Cameron @ 2016-08-21 19:05 UTC (permalink / raw)
  To: Mugunthan V N, linux-iio-u79uwXL29TY76Z2rM5mHXA
  Cc: Hartmut Knaack, Lars-Peter Clausen, Peter Meerwald-Stadler,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-omap-u79uwXL29TY76Z2rM5mHXA, Sekhar Nori

On 11/08/16 07:01, Mugunthan V N wrote:
> Current make doesn't have support to pass kernel built directory
> to find events.h kernel header file, so adding support for
> KBUILD_OUTPUT support to Makefile.
> 
> $ make CROSS_COMPILE=arm-linux-gnueabihf- -C tools/iio
> make: Entering directory '/home/a0131834/workspace/git/mainline/linux/tools/iio'
> arm-linux-gnueabihf-gcc -Wall -g -D_GNU_SOURCE   -c -o iio_event_monitor.o iio_event_monitor.c
> arm-linux-gnueabihf-gcc -Wall -g -D_GNU_SOURCE   -c -o iio_utils.o iio_utils.c
> arm-linux-gnueabihf-gcc -Wall -g -D_GNU_SOURCE   -c -o lsiio.o lsiio.c
> arm-linux-gnueabihf-gcc -Wall -g -D_GNU_SOURCE   -c -o iio_generic_buffer.o iio_generic_buffer.c
> arm-linux-gnueabihf-gcc   lsiio.o iio_utils.o   -o lsiio
> arm-linux-gnueabihf-gcc   iio_generic_buffer.o iio_utils.o   -o iio_generic_buffer
> iio_event_monitor.c:28:30: fatal error: linux/iio/events.h: No such file or directory
>  #include <linux/iio/events.h>
>                                ^
> compilation terminated.
> <builtin>: recipe for target 'iio_event_monitor.o' failed
> make: *** [iio_event_monitor.o] Error 1
> make: Leaving directory '/home/a0131834/workspace/git/mainline/linux/tools/iio'
> 
> Signed-off-by: Mugunthan V N <mugunthanvnm-l0cyMroinI0@public.gmane.org>
I can see where you are coming from, but wouldn't we normally expect the kernel
headers for the relevant kernel to available as part of the toolchain being
used to do the build?

They often lag a bit I guess, so perhaps we do want to put this little bit
of 'fudging' in place.

What do others think?

Jonathan
> ---
> 
> With this fix I am able to build the iio tools
> 
> $ make CROSS_COMPILE=arm-linux-gnueabihf- -C tools/iio KBUILD_OUTPUT=`pwd`
> make: Entering directory '/home/a0131834/workspace/git/mainline/linux/tools/iio'
> arm-linux-gnueabihf-gcc -Wall -g -D_GNU_SOURCE -I/home/a0131834/workspace/git/mainline/linux/usr/include   -c -o iio_event_monitor.o iio_event_monitor.c
> arm-linux-gnueabihf-gcc -Wall -g -D_GNU_SOURCE -I/home/a0131834/workspace/git/mainline/linux/usr/include   -c -o iio_utils.o iio_utils.c
> arm-linux-gnueabihf-gcc   iio_event_monitor.o iio_utils.o   -o iio_event_monitor
> arm-linux-gnueabihf-gcc -Wall -g -D_GNU_SOURCE -I/home/a0131834/workspace/git/mainline/linux/usr/include   -c -o lsiio.o lsiio.c
> arm-linux-gnueabihf-gcc   lsiio.o iio_utils.o   -o lsiio
> arm-linux-gnueabihf-gcc -Wall -g -D_GNU_SOURCE -I/home/a0131834/workspace/git/mainline/linux/usr/include   -c -o iio_generic_buffer.o iio_generic_buffer.c
> arm-linux-gnueabihf-gcc   iio_generic_buffer.o iio_utils.o   -o iio_generic_buffer
> make: Leaving directory '/home/a0131834/workspace/git/mainline/linux/tools/iio'
> 
> ---
>  tools/iio/Makefile | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/tools/iio/Makefile b/tools/iio/Makefile
> index 5446d62..0ec3ea0 100644
> --- a/tools/iio/Makefile
> +++ b/tools/iio/Makefile
> @@ -1,5 +1,6 @@
>  CC = $(CROSS_COMPILE)gcc
> -CFLAGS += -Wall -g -D_GNU_SOURCE
> +KBUILD_OUTPUT ?= /lib/modules/$(shell uname -r)/build
> +CFLAGS += -Wall -g -D_GNU_SOURCE -I$(KBUILD_OUTPUT)/usr/include
>  
>  BINDIR=usr/bin
>  INSTALL_PROGRAM=install -m 755 -p
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] tools: iio: fix iio build error by adding KBUILD_OUTPUT support to makefile
  2016-08-21 19:05   ` Jonathan Cameron
@ 2016-09-16  5:26     ` Mugunthan V N
  -1 siblings, 0 replies; 7+ messages in thread
From: Mugunthan V N @ 2016-09-16  5:26 UTC (permalink / raw)
  To: Jonathan Cameron, linux-iio
  Cc: Hartmut Knaack, Lars-Peter Clausen, Peter Meerwald-Stadler,
	linux-kernel, linux-omap, Sekhar Nori

Jonathan

On Monday 22 August 2016 12:35 AM, Jonathan Cameron wrote:
> On 11/08/16 07:01, Mugunthan V N wrote:
>> > Current make doesn't have support to pass kernel built directory
>> > to find events.h kernel header file, so adding support for
>> > KBUILD_OUTPUT support to Makefile.
>> > 
>> > $ make CROSS_COMPILE=arm-linux-gnueabihf- -C tools/iio
>> > make: Entering directory '/home/a0131834/workspace/git/mainline/linux/tools/iio'
>> > arm-linux-gnueabihf-gcc -Wall -g -D_GNU_SOURCE   -c -o iio_event_monitor.o iio_event_monitor.c
>> > arm-linux-gnueabihf-gcc -Wall -g -D_GNU_SOURCE   -c -o iio_utils.o iio_utils.c
>> > arm-linux-gnueabihf-gcc -Wall -g -D_GNU_SOURCE   -c -o lsiio.o lsiio.c
>> > arm-linux-gnueabihf-gcc -Wall -g -D_GNU_SOURCE   -c -o iio_generic_buffer.o iio_generic_buffer.c
>> > arm-linux-gnueabihf-gcc   lsiio.o iio_utils.o   -o lsiio
>> > arm-linux-gnueabihf-gcc   iio_generic_buffer.o iio_utils.o   -o iio_generic_buffer
>> > iio_event_monitor.c:28:30: fatal error: linux/iio/events.h: No such file or directory
>> >  #include <linux/iio/events.h>
>> >                                ^
>> > compilation terminated.
>> > <builtin>: recipe for target 'iio_event_monitor.o' failed
>> > make: *** [iio_event_monitor.o] Error 1
>> > make: Leaving directory '/home/a0131834/workspace/git/mainline/linux/tools/iio'
>> > 
>> > Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
> I can see where you are coming from, but wouldn't we normally expect the kernel
> headers for the relevant kernel to available as part of the toolchain being
> used to do the build?

If it is a native build, we can expect toolchain to provide kernel
headers, but for a cross compile user has to provide where the kernel
headers present for the target which is done this patch.

> 
> They often lag a bit I guess, so perhaps we do want to put this little bit
> of 'fudging' in place.
> 
> What do others think?

Any updates on the patch?

Regards
Mugunthan V N

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] tools: iio: fix iio build error by adding KBUILD_OUTPUT support to makefile
@ 2016-09-16  5:26     ` Mugunthan V N
  0 siblings, 0 replies; 7+ messages in thread
From: Mugunthan V N @ 2016-09-16  5:26 UTC (permalink / raw)
  To: Jonathan Cameron, linux-iio
  Cc: Hartmut Knaack, Lars-Peter Clausen, Peter Meerwald-Stadler,
	linux-kernel, linux-omap, Sekhar Nori

Jonathan

On Monday 22 August 2016 12:35 AM, Jonathan Cameron wrote:
> On 11/08/16 07:01, Mugunthan V N wrote:
>> > Current make doesn't have support to pass kernel built directory
>> > to find events.h kernel header file, so adding support for
>> > KBUILD_OUTPUT support to Makefile.
>> > 
>> > $ make CROSS_COMPILE=arm-linux-gnueabihf- -C tools/iio
>> > make: Entering directory '/home/a0131834/workspace/git/mainline/linux/tools/iio'
>> > arm-linux-gnueabihf-gcc -Wall -g -D_GNU_SOURCE   -c -o iio_event_monitor.o iio_event_monitor.c
>> > arm-linux-gnueabihf-gcc -Wall -g -D_GNU_SOURCE   -c -o iio_utils.o iio_utils.c
>> > arm-linux-gnueabihf-gcc -Wall -g -D_GNU_SOURCE   -c -o lsiio.o lsiio.c
>> > arm-linux-gnueabihf-gcc -Wall -g -D_GNU_SOURCE   -c -o iio_generic_buffer.o iio_generic_buffer.c
>> > arm-linux-gnueabihf-gcc   lsiio.o iio_utils.o   -o lsiio
>> > arm-linux-gnueabihf-gcc   iio_generic_buffer.o iio_utils.o   -o iio_generic_buffer
>> > iio_event_monitor.c:28:30: fatal error: linux/iio/events.h: No such file or directory
>> >  #include <linux/iio/events.h>
>> >                                ^
>> > compilation terminated.
>> > <builtin>: recipe for target 'iio_event_monitor.o' failed
>> > make: *** [iio_event_monitor.o] Error 1
>> > make: Leaving directory '/home/a0131834/workspace/git/mainline/linux/tools/iio'
>> > 
>> > Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
> I can see where you are coming from, but wouldn't we normally expect the kernel
> headers for the relevant kernel to available as part of the toolchain being
> used to do the build?

If it is a native build, we can expect toolchain to provide kernel
headers, but for a cross compile user has to provide where the kernel
headers present for the target which is done this patch.

> 
> They often lag a bit I guess, so perhaps we do want to put this little bit
> of 'fudging' in place.
> 
> What do others think?

Any updates on the patch?

Regards
Mugunthan V N

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH] tools: iio: fix iio build error by adding KBUILD_OUTPUT support to makefile
@ 2016-08-10 15:41 Mugunthan V N
  0 siblings, 0 replies; 7+ messages in thread
From: Mugunthan V N @ 2016-08-10 15:41 UTC (permalink / raw)
  To: linux-iio
  Cc: Jonathan Cameron, Hartmut Knaack, Lars-Peter Clausen,
	Peter Meerwald-Stadler, linux-kernel, linux-omap, Sekhar Nori,
	Mugunthan V N

Current make doesn't have support to pass kernel built directory
to find events.h kernel header file, so adding support for
KBUILD_OUTPUT support to Makefile.

$ make CROSS_COMPILE=arm-linux-gnueabihf- -C tools/iio
make: Entering directory '/home/a0131834/workspace/git/mainline/linux/tools/iio'
arm-linux-gnueabihf-gcc -Wall -g -D_GNU_SOURCE   -c -o iio_event_monitor.o iio_event_monitor.c
arm-linux-gnueabihf-gcc -Wall -g -D_GNU_SOURCE   -c -o iio_utils.o iio_utils.c
arm-linux-gnueabihf-gcc -Wall -g -D_GNU_SOURCE   -c -o lsiio.o lsiio.c
arm-linux-gnueabihf-gcc -Wall -g -D_GNU_SOURCE   -c -o iio_generic_buffer.o iio_generic_buffer.c
arm-linux-gnueabihf-gcc   lsiio.o iio_utils.o   -o lsiio
arm-linux-gnueabihf-gcc   iio_generic_buffer.o iio_utils.o   -o iio_generic_buffer
iio_event_monitor.c:28:30: fatal error: linux/iio/events.h: No such file or directory
 #include <linux/iio/events.h>
                               ^
compilation terminated.
<builtin>: recipe for target 'iio_event_monitor.o' failed
make: *** [iio_event_monitor.o] Error 1
make: Leaving directory '/home/a0131834/workspace/git/mainline/linux/tools/iio'

Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
---

With this fix I am able to build the iio tools

$ make CROSS_COMPILE=arm-linux-gnueabihf- -C tools/iio KBUILD_OUTPUT=`pwd`
make: Entering directory '/home/a0131834/workspace/git/mainline/linux/tools/iio'
arm-linux-gnueabihf-gcc -Wall -g -D_GNU_SOURCE -I/home/a0131834/workspace/git/mainline/linux/usr/include   -c -o iio_event_monitor.o iio_event_monitor.c
arm-linux-gnueabihf-gcc -Wall -g -D_GNU_SOURCE -I/home/a0131834/workspace/git/mainline/linux/usr/include   -c -o iio_utils.o iio_utils.c
arm-linux-gnueabihf-gcc   iio_event_monitor.o iio_utils.o   -o iio_event_monitor
arm-linux-gnueabihf-gcc -Wall -g -D_GNU_SOURCE -I/home/a0131834/workspace/git/mainline/linux/usr/include   -c -o lsiio.o lsiio.c
arm-linux-gnueabihf-gcc   lsiio.o iio_utils.o   -o lsiio
arm-linux-gnueabihf-gcc -Wall -g -D_GNU_SOURCE -I/home/a0131834/workspace/git/mainline/linux/usr/include   -c -o iio_generic_buffer.o iio_generic_buffer.c
arm-linux-gnueabihf-gcc   iio_generic_buffer.o iio_utils.o   -o iio_generic_buffer
make: Leaving directory '/home/a0131834/workspace/git/mainline/linux/tools/iio'

---
 tools/iio/Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tools/iio/Makefile b/tools/iio/Makefile
index 5446d62..0ec3ea0 100644
--- a/tools/iio/Makefile
+++ b/tools/iio/Makefile
@@ -1,5 +1,6 @@
 CC = $(CROSS_COMPILE)gcc
-CFLAGS += -Wall -g -D_GNU_SOURCE
+KBUILD_OUTPUT ?= /lib/modules/$(shell uname -r)/build
+CFLAGS += -Wall -g -D_GNU_SOURCE -I$(KBUILD_OUTPUT)/usr/include
 
 BINDIR=usr/bin
 INSTALL_PROGRAM=install -m 755 -p
-- 
2.9.2.664.ga0a1831

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2016-09-16  5:27 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-11  6:01 [PATCH] tools: iio: fix iio build error by adding KBUILD_OUTPUT support to makefile Mugunthan V N
2016-08-11  6:01 ` Mugunthan V N
2016-08-21 19:05 ` Jonathan Cameron
2016-08-21 19:05   ` Jonathan Cameron
2016-09-16  5:26   ` Mugunthan V N
2016-09-16  5:26     ` Mugunthan V N
  -- strict thread matches above, loose matches on Subject: below --
2016-08-10 15:41 Mugunthan V N

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.