From patchwork Wed Jun 15 15:45:47 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 9178817 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 63D67604DB for ; Wed, 15 Jun 2016 15:45:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 52BBE27EED for ; Wed, 15 Jun 2016 15:45:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 463CC27F3E; Wed, 15 Jun 2016 15:45:08 +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=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0139927EED for ; Wed, 15 Jun 2016 15:45:08 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D863C6E985; Wed, 15 Jun 2016 15:45:04 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.17.13]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4882D6E983 for ; Wed, 15 Jun 2016 15:44:39 +0000 (UTC) Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue102) with ESMTPA (Nemesis) id 0McnPF-1avGSy32Hp-00HwoH; Wed, 15 Jun 2016 17:44:29 +0200 From: Arnd Bergmann To: Michal Marek Subject: [PATCH v2 05/11] Kbuild: don't add obj tree in additional includes Date: Wed, 15 Jun 2016 17:45:47 +0200 Message-Id: <20160615154553.3177021-6-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20160615154553.3177021-1-arnd@arndb.de> References: <20160615154553.3177021-1-arnd@arndb.de> X-Provags-ID: V03:K0:J37js9QvM7JrfnyhtoBgKH4p1UwMtvKqKHrsGCPBuepPF2oMdOv eG7ozGNbiuxzh1Yo9jr0Tkot9Vu3DrG2BSNvzdbbuYCWQRp7mTDix0B6b58litheygpb7cz 8d8fw18Y2q98XsDixz0WVjzbdWhCqfnFsqOCqJfx4CSv18nxfa0pHpC/iV5KN9JLLuNOHfm P8urvUV2g3J6giaLACSqQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:pLlTV+q1ny8=:ZPYog6hZEN8d8eo0a9Yybp YEWhMYqBUek6bfkntLUaG1jHwht4Pu5VpxicxqUhRUGbxgI/3oPsFsy6gt+Yik6VxevV4ygTI AwGq8bTLDtw8pC+AutNmL+LGgyeb8K9BhaTIm6RCNnfV9uyjBfzVmST//rhtl0ogGFE1rfteU JpTvqrI0xnazZOJOMgBV5Vtc7EDO8qIZ2znj6HATdJo/Ugd251mZK7SrJMck6dXXh/dcj54u4 e07rMrBoPeV207NlAzalAuTav/0zYF0kmuqeBIja64y6dtElZ7wAqDgBx5qkPHF8y5hj7uzvx YFGF3t3vBOHtkhweM7qaf8ZWIOjdKwMWKCj/qDfr6JUU+dkTXDLXyU3rrK8CftTashMMZgUjo ZLdnG7Y3NlIG7mc7FqoxsBoI0RuSD2WAARY0oDaKjOmNXYIWlcGIGGKHp0nZqAiFk2qDs1qP+ /JxqJH5G2Bpq1Sz2QkU28zOLWTyhPNygc8kByaS5xjfB4FXZuw+ZD829vJE0+TRGfwU7ekoSl z1YJdveDkVzlC7KKBc8j44/bIkJyxwrl3OUjBo/zL5mVfEy7GqkeM0dPSu6JsHnwqYiP4a2fK +aCDmj6VayO67t5xNtOOgd11ebTHLfNgf/kVLNM62HRBDc1mG/w31rvyhlhIVdMt7PBN7JKr3 4txCLbaoKPsCI0F1bu/SflZMnTt8iJwJP0wO+57lMwvbeSM+INOIUMKnzMiEume5SjB0= Cc: Arnd Bergmann , linux-kbuild@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP When building with separate object directories and driver specific Makefiles that add additional header include paths, Kbuild adjusts the gcc flags so that we include both the directory in the source tree and in the object tree. However, due to another bug I fixed earlier, this did not actually include the correct directory in the object tree, so we know that we only really need the source tree here. Also, including the object tree sometimes causes warnings about nonexisting directories when the include path only exists in the source. This changes the logic to only emit the -I argument for the srctree, not for objects. We still need both $(srctree)/$(src) and $(obj) though, so I'm adding them manually. Signed-off-by: Arnd Bergmann --- scripts/Kbuild.include | 2 +- scripts/Makefile.lib | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include index f8b45eb47ed3..15b196fc2f49 100644 --- a/scripts/Kbuild.include +++ b/scripts/Kbuild.include @@ -202,7 +202,7 @@ hdr-inst := -f $(srctree)/scripts/Makefile.headersinst obj # Prefix -I with $(srctree) if it is not an absolute path. # skip if -I has no parameter addtree = $(if $(patsubst -I%,%,$(1)), \ -$(if $(filter-out -I/% -I../%,$(1)),$(patsubst -I%,-I$(srctree)/%,$(1))) $(1)) +$(if $(filter-out -I/% -I./% -I../%,$(1)),$(patsubst -I%,-I$(srctree)/%,$(1)),$(1))) # Find all -I options and call addtree flags = $(foreach o,$($(1)),$(if $(filter -I%,$(o)),$(call addtree,$(o)),$(o))) diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index 76494e15417b..0a07f9014944 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib @@ -155,9 +155,10 @@ else # $(call addtree,-I$(obj)) locates .h files in srctree, from generated .c files # and locates generated .h files # FIXME: Replace both with specific CFLAGS* statements in the makefiles -__c_flags = $(call addtree,-I$(obj)) $(call flags,_c_flags) -__a_flags = $(call flags,_a_flags) -__cpp_flags = $(call flags,_cpp_flags) +__c_flags = $(if $(obj),-I$(srctree)/$(src) -I$(obj)) \ + $(call flags,_c_flags) +__a_flags = $(call flags,_a_flags) +__cpp_flags = $(call flags,_cpp_flags) endif c_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(LINUXINCLUDE) \