From patchwork Fri Nov 6 18:23:50 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nishanth Menon X-Patchwork-Id: 56142 Delivered-To: patch@linaro.org Received: by 10.112.61.134 with SMTP id p6csp1164708lbr; Fri, 6 Nov 2015 10:24:07 -0800 (PST) X-Received: by 10.194.5.2 with SMTP id o2mr15966478wjo.98.1446834247272; Fri, 06 Nov 2015 10:24:07 -0800 (PST) Return-Path: Received: from theia.denx.de (theia.denx.de. [85.214.87.163]) by mx.google.com with ESMTP id 140si308239wmq.15.2015.11.06.10.24.06; Fri, 06 Nov 2015 10:24:07 -0800 (PST) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.87.163 as permitted sender) client-ip=85.214.87.163; Authentication-Results: mx.google.com; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.87.163 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id EA8994BD97; Fri, 6 Nov 2015 19:24:05 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id K04JihQiCJsD; Fri, 6 Nov 2015 19:24:05 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 2129D4BD89; Fri, 6 Nov 2015 19:24:05 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id BE2424BD89 for ; Fri, 6 Nov 2015 19:24:01 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ixczibLD3kDu for ; Fri, 6 Nov 2015 19:24:01 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from devils.ext.ti.com (devils.ext.ti.com [198.47.26.153]) by theia.denx.de (Postfix) with ESMTPS id 42D874BD88 for ; Fri, 6 Nov 2015 19:23:57 +0100 (CET) Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id tA6INpap012385; Fri, 6 Nov 2015 12:23:51 -0600 Received: from DFLE72.ent.ti.com (dfle72.ent.ti.com [128.247.5.109]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id tA6INodK017674; Fri, 6 Nov 2015 12:23:50 -0600 Received: from dflp33.itg.ti.com (10.64.6.16) by DFLE72.ent.ti.com (128.247.5.109) with Microsoft SMTP Server id 14.3.224.2; Fri, 6 Nov 2015 12:23:51 -0600 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id tA6INoNd017588; Fri, 6 Nov 2015 12:23:50 -0600 Date: Fri, 6 Nov 2015 12:23:50 -0600 From: Nishanth Menon To: Masahiro Yamada Message-ID: <20151106182348.GA14217@ogun.home> References: <1446708504-5936-1-git-send-email-nm@ti.com> <563B0603.6040406@ti.com> <563CDEEF.3070403@ti.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <563CDEEF.3070403@ti.com> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: Michal Marek , Tom Rini , Lokesh , Stefan Roese , U-Boot Mailing List Subject: Re: [U-Boot] [PATCH] Makefile: Include vendor common library in include search path X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" On 11:10-20151106, Nishanth Menon wrote: > On 11/05/2015 10:50 PM, Masahiro Yamada wrote: > > 2015-11-06 12:30 GMT+09:00 Nishanth Menon : > >> On Thu, Nov 5, 2015 at 6:15 PM, Simon Glass wrote: > >>> Hi, > >>> > >>> On 5 November 2015 at 00:32, Nishanth Menon wrote: > >>>> On 11/05/2015 01:28 AM, Nishanth Menon wrote: > >>>>> When the vendor common libraries exists, then board should be able to > >>>>> reference headers located there, rather than having to do weird logic > >>>>> such as '#include "../common/xyz.h"'. > >>>>> > >>>>> Signed-off-by: Nishanth Menon > >>>>> --- > >>>>> > >>>>> Makefile | 1 + > >>>>> board/ti/am57xx/board.c | 2 +- > >>>>> 2 files changed, 2 insertions(+), 1 deletion(-) > >>>> > >>>> Arrgh.. Apologies on the diffstat messup, but anyways, the patch does > >>>> apply, and will wait to repost in case of further comments. > >>>> > >>>>> > >>>>> diff --git a/Makefile b/Makefile > >>>>> index 3c21f8ddf9e9..75d5ea802dfd 100644 > >>>>> --- a/Makefile > >>>>> +++ b/Makefile > >>>>> @@ -620,6 +620,7 @@ c_flags := $(KBUILD_CFLAGS) $(cpp_flags) > >>>>> # U-Boot objects....order is important (i.e. start must be first) > >>>>> > >>>>> HAVE_VENDOR_COMMON_LIB = $(if $(wildcard $(srctree)/board/$(VENDOR)/common/Makefile),y,n) > >>>>> +UBOOTINCLUDE += $(if $(HAVE_VENDOR_COMMON_LIB:y=1), -I$(srctree)/board/$(VENDOR)/common) > >>>>> > >>>>> libs-y += lib/ > >>>>> libs-$(HAVE_VENDOR_COMMON_LIB) += board/$(VENDOR)/common/ > >>>>> > >>>> > >>> > >>> I suppose this is OK. But it might be hard to figure out where a > >>> header file is coming from. I wonder if we could make it support: > >>> > >>> #include > >>> > >>> and it would find the file? > >>> > >> > >> Hmmm... Are folks ok if I create a softlink? > > > > > > Or, you can maybe add the following into board/ti/am57xx/Makefile. > > > > subdir-ccflags-y := -I$(src)/../common > > > > then, you can use #include from your board/ti/am57xx/board.c > > I could, OR i could even do ../common/xyz.h (which is what current > board files do) > > > > > > > > > But, I personally wouldn't do this in this case > > for the reason Simon mentioned. > > > > I agree as well. but the files are built without explicit board level > Makefile rules, but the root Makefile(which makes this happen) does > not ensure the headers are made available - that sounds contradictory. > > > > > How many vender-common do we have > > and is it worth supporting #include ? > > Surprisingly larger set that what I expected: > $ git branch -v|grep "^*" > * master c3c016cf7536 sf: Add SPI NOR protection mechanism > $ find board/ -iname "common"|wc -l > 19 > $ git grep "#include \"../common" board/|wc -l > 141 > Illustration Purposes only: example of how a #include