diff mbox

[2/4] tools: gpio: Add necessary include paths

Message ID 1456214089-13954-2-git-send-email-mpa@pengutronix.de
State New
Headers show

Commit Message

Markus Pargmann Feb. 23, 2016, 7:54 a.m. UTC
Add include paths to the Makefile so that linux/gpio.h can be found even
on systems without this header.

Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
---
 tools/gpio/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Linus Walleij Feb. 23, 2016, 1:26 p.m. UTC | #1
On Tue, Feb 23, 2016 at 8:54 AM, Markus Pargmann <mpa@pengutronix.de> wrote:

> Add include paths to the Makefile so that linux/gpio.h can be found even
> on systems without this header.
>
> Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
(...)
> -CFLAGS += -Wall -g -D_GNU_SOURCE
> +CFLAGS += -Wall -g -D_GNU_SOURCE -I ../include -I ../../include/uapi

This is probably not how userspace compilation is supposed
to work. The way I understand it, userspace programs from tools/*
should be compiled like this:

make headers_install ARCH=foo INSTALL_HDR_PATH=<bar>
cd tools/gpio
make CFLAGS="$CFLAGS -I<bar>"

The reason being that UAPI files can differ after install depending
on arch.

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Markus Pargmann Feb. 24, 2016, 6:39 a.m. UTC | #2
On Tuesday, February 23, 2016 02:26:09 PM Linus Walleij wrote:
> On Tue, Feb 23, 2016 at 8:54 AM, Markus Pargmann <mpa@pengutronix.de> wrote:
> 
> > Add include paths to the Makefile so that linux/gpio.h can be found even
> > on systems without this header.
> >
> > Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
> (...)
> > -CFLAGS += -Wall -g -D_GNU_SOURCE
> > +CFLAGS += -Wall -g -D_GNU_SOURCE -I ../include -I ../../include/uapi
> 
> This is probably not how userspace compilation is supposed
> to work. The way I understand it, userspace programs from tools/*
> should be compiled like this:
> 
> make headers_install ARCH=foo INSTALL_HDR_PATH=<bar>
> cd tools/gpio
> make CFLAGS="$CFLAGS -I<bar>"
> 
> The reason being that UAPI files can differ after install depending
> on arch.

I see, thanks for explaining.

Best Regards,

Markus
diff mbox

Patch

diff --git a/tools/gpio/Makefile b/tools/gpio/Makefile
index 4d198d5c4203..3f5b3f427b9c 100644
--- a/tools/gpio/Makefile
+++ b/tools/gpio/Makefile
@@ -1,5 +1,5 @@ 
 CC = $(CROSS_COMPILE)gcc
-CFLAGS += -Wall -g -D_GNU_SOURCE
+CFLAGS += -Wall -g -D_GNU_SOURCE -I ../include -I ../../include/uapi
 
 all: lsgpio