From patchwork Fri Sep 14 06:33:23 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 146679 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp334079ljw; Thu, 13 Sep 2018 23:33:40 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbM/nyo7cfsT18CuqowULw725XMxAWnFeraWxTdnagk0Q10EjFMrMv0rjZL7CBhdeaJknLG X-Received: by 2002:a63:141c:: with SMTP id u28-v6mr10327483pgl.247.1536906819852; Thu, 13 Sep 2018 23:33:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536906819; cv=none; d=google.com; s=arc-20160816; b=ztkSXTcvcml1Id1I4M5ILcRRduOVbRnYQ6CvMV967ZSsXLNtdaYmGSsLBOdZ4zthDB sMWBvEWR3PrqYg9GLza7cYjLsSZvyKWv6d3hgIps6Km/M30jHrsXBmPENgurcJftFkx8 ztuag2tuEBB7KkybUEBVdf2hqq+f7yLScGkAI7Azx1wPhVscgjNo1TjWfN7/ggsZCipj AIezLIGa7wf3flECouuVPnUU052t9VOwpn/6zP6a1sKv/I/fZpHLR86E8ldKY1ONXIPU WxIqpy90zfo0s2Q9IGguZU2i9YNJ3yI9zJXo+JdoIgsBpwAoVJp2dmd1DTqtiuMHi6wf H2Bw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:dkim-filter; bh=sNYJNwxQn2ji5PU7VgX3O1LuSS4Scj+ZO1y5I/Ok0o0=; b=iGJar2WmRC9vy+vogNfURwXjMLhqotszPmxgMHaziJzm0xoX+RjVllq2dQPZejxZGJ bB46dpHZvY+Dt9TrN21+n93jTF/d1MtKGBCLeTiHRfXF8Op/wGT1g6jeD/AhyW9XXVgi A/PNubh4c4CtDQOV/riQNT/iUfrbfxqHfJAsEae7JEQ37hFvpL8MBnyB/gqxpipDIXWI Lj9F5hcnBIt7Dvsh+AKDUpKqa0wpUiHTx+KK4zRmqkD4imlkOzyAf2dYKfnuQpzomoZ2 5K6puDzWaw0G6CCbqJpZA/tlZRVdsypIlKMcfkz6P4beFVK0jFP8hwr78qwvZYVhio4P JGzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b="0Pa78A/q"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e7-v6si6052082pgc.233.2018.09.13.23.33.39; Thu, 13 Sep 2018 23:33:39 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b="0Pa78A/q"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727690AbeINLqf (ORCPT + 32 others); Fri, 14 Sep 2018 07:46:35 -0400 Received: from conuserg-09.nifty.com ([210.131.2.76]:31994 "EHLO conuserg-09.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726831AbeINLqf (ORCPT ); Fri, 14 Sep 2018 07:46:35 -0400 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-09.nifty.com with ESMTP id w8E6XR4X027457; Fri, 14 Sep 2018 15:33:27 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-09.nifty.com w8E6XR4X027457 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1536906808; bh=sNYJNwxQn2ji5PU7VgX3O1LuSS4Scj+ZO1y5I/Ok0o0=; h=From:To:Cc:Subject:Date:From; b=0Pa78A/qUQi6HlgL9ldUIuiPNloO71YFuMw4D5f+4AH6Vj2F1wSYdeXOhdJjNR01X eEMfVgpH4UUig8lQgLYav5LNDBAFuayWuc6U+2qfpFxNcvdOCshT2SqDhq7ygqnuMy YeD7jmfqPfWn5giktd4U+GuMoYwJvYu8Qn7sdueJut2fjW3U5m7ktG+RvjSpTxNPG0 pMIRQq0gh3khFh69r7M4BYOguqe0gqfVe+pUlT2zdNjUnrYXd3+T5HA8z9TDCXOLK0 kDy8ZdH+AH2sSzQHRcFlrD2cgM07xyl6eblJyH2Awctv+KrnlK2VH/rlOODMryudkN fKRGSTzMGwjnA== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Masahiro Yamada , Michal Marek , linux-kernel@vger.kernel.org Subject: [PATCH v2] kbuild: add --include-dir flag only for out-of-tree build Date: Fri, 14 Sep 2018 15:33:23 +0900 Message-Id: <1536906803-29741-1-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The --include-dir flag is used to include check-in Makefiles from $(objtree) without $(srctree)/ prefix. Obviously, this is unneeded for in-tree build. Add the flag just before changing the working directory. This becomes effective after invoking sub-make. Add a little bit comments about it. Signed-off-by: Masahiro Yamada --- Changes in v2: - Add some more comments Makefile | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) -- 2.7.4 diff --git a/Makefile b/Makefile index f8c8e12..233b57d 100644 --- a/Makefile +++ b/Makefile @@ -15,10 +15,9 @@ NAME = Merciless Moray PHONY := _all _all: -# o Do not use make's built-in rules and variables -# (this increases performance and avoids hard-to-debug behaviour); -# o Look for make include files relative to root of kernel src -MAKEFLAGS += -rR --include-dir=$(CURDIR) +# Do not use make's built-in rules and variables +# (this increases performance and avoids hard-to-debug behaviour) +MAKEFLAGS += -rR # Avoid funny character set dependencies unexport LC_ALL @@ -136,6 +135,13 @@ KBUILD_OUTPUT := $(shell mkdir -p $(KBUILD_OUTPUT) && cd $(KBUILD_OUTPUT) \ $(if $(KBUILD_OUTPUT),, \ $(error failed to create output directory "$(saved-output)")) +# Look for make include files relative to root of kernel src +# +# This does not become effective immediately because MAKEFLAGS is re-parsed +# once after the Makefile is read. It is OK since we are going to invoke +# 'sub-make' below. +MAKEFLAGS += --include-dir=$(CURDIR) + PHONY += $(MAKECMDGOALS) sub-make $(filter-out _all sub-make $(CURDIR)/Makefile, $(MAKECMDGOALS)) _all: sub-make