From patchwork Thu Aug 11 06:01:24 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mugunthan V N X-Patchwork-Id: 9274507 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id F3F1A60231 for ; Thu, 11 Aug 2016 06:02:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E0FDA284E9 for ; Thu, 11 Aug 2016 06:02:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D444F284EE; Thu, 11 Aug 2016 06:02:10 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 84C4E284E9 for ; Thu, 11 Aug 2016 06:02:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932243AbcHKGBx (ORCPT ); Thu, 11 Aug 2016 02:01:53 -0400 Received: from comal.ext.ti.com ([198.47.26.152]:52266 "EHLO comal.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932227AbcHKGBw (ORCPT ); Thu, 11 Aug 2016 02:01:52 -0400 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id u7B61Vei004951; Thu, 11 Aug 2016 01:01:31 -0500 Received: from DFLE72.ent.ti.com (dfle72.ent.ti.com [128.247.5.109]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id u7B61UCZ031460; Thu, 11 Aug 2016 01:01:30 -0500 Received: from dlep32.itg.ti.com (157.170.170.100) by DFLE72.ent.ti.com (128.247.5.109) with Microsoft SMTP Server id 14.3.294.0; Thu, 11 Aug 2016 01:01:29 -0500 Received: from a0131834lt.dhcp.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep32.itg.ti.com (8.14.3/8.13.8) with ESMTP id u7B61QnN013866; Thu, 11 Aug 2016 01:01:26 -0500 From: Mugunthan V N To: CC: Jonathan Cameron , Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler , , , Sekhar Nori , Mugunthan V N Subject: [PATCH] tools: iio: fix iio build error by adding KBUILD_OUTPUT support to makefile Date: Thu, 11 Aug 2016 11:31:24 +0530 Message-ID: <20160811060124.6604-1-mugunthanvnm@ti.com> X-Mailer: git-send-email 2.9.2.664.ga0a1831 MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 ^ compilation terminated. : 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 --- 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