From patchwork Fri Feb 22 07:40:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 158994 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp1421603jaa; Thu, 21 Feb 2019 23:40:48 -0800 (PST) X-Google-Smtp-Source: AHgI3IaJSm+4jbYU0NQ3kIiTsOA2G8y67+7AYD3mMgf/bVdVQLzobTD/0iCCfJs7Y9UWz2qsxvVY X-Received: by 2002:a62:a113:: with SMTP id b19mr2793472pff.227.1550821248476; Thu, 21 Feb 2019 23:40:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550821248; cv=none; d=google.com; s=arc-20160816; b=qWpHvxzkSr4gMVN8HvPK4W43WdP8UfnGRaLZNVFQSyY0/tTE/rTND4VsSQkkyDmmZW eV92JItdkhpNruPT4PXMArqHc/QxABZSe5ZBD/ya5C9T1dC/92yW0srgz9wmfgnotu6F JlHygFJQeGPla3H6tn/iPa04rFxywbmKDVg2FvQ5VQjdMwQ/ZxyEfcxHv1R0psuc9OXt P7If3Rf1dLjygnstQZpSVZSE565/dJwItsMqkm0PoTUrQJ7wN9MM8UbFD5yE3rUuFInT QK/JeH8DPhR5QJgp8OGJf7T5EhkQaw7oMZSy6EKeaBqSaU1X7cS+1WR3s4j6YBWU05MO 5TFA== 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=DQ+BN3fwZB03g2y4k35iROrRq0d7oQO8BBS0JgSdlB0=; b=uIEbxItp6kQ0vz5f0P6/rID7Iku/Lvr7u2+8adgqxgTi29xvymo/kI1ktGOeqRv40o J9XlvGW+tL4a81z2wQfonBxM0xFGV1FTAAVuyOtpX1PmkR76XF8QPI+yAFEdBOHTnrl/ oFGwyc65fds56BtoluEdFc4rsoCyIo593SZBvh7FZGiAAxgtkCuEFFix6ZFUoh5tnwvX 6Pf1AvhRKx+2CislCWndykyFVRmlEYRS1IKX0xImDZ5APg6omi5lcjF9p1zrn1au5Brq uG90EfNHQ6ECW1ItLzITNm20bt0jlul3jzqNZYrumhJxoitGtBW8a5zoL3eHwDuxVnV8 FYUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=oDBbG5lr; 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 m26si757091pfi.247.2019.02.21.23.40.48; Thu, 21 Feb 2019 23:40:48 -0800 (PST) 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=oDBbG5lr; 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 S1726478AbfBVHkW (ORCPT + 32 others); Fri, 22 Feb 2019 02:40:22 -0500 Received: from conuserg-07.nifty.com ([210.131.2.74]:53328 "EHLO conuserg-07.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726298AbfBVHkW (ORCPT ); Fri, 22 Feb 2019 02:40:22 -0500 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-07.nifty.com with ESMTP id x1M7eEN0013122; Fri, 22 Feb 2019 16:40:14 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-07.nifty.com x1M7eEN0013122 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1550821214; bh=DQ+BN3fwZB03g2y4k35iROrRq0d7oQO8BBS0JgSdlB0=; h=From:To:Cc:Subject:Date:From; b=oDBbG5lrr/abbSDWjIP9610qGqd5cIRV7P8tuLxOrYoqsXVBmgGqJLO293TFf8uWr OTlkUAW2LXdMy5iqu7Fsd2tBfGB8s0kNYZ2IE78y1HrtteOLLE9H7gypV/3jduILhN 1DVpkBa3+eU4pM+oLBx7M3WvnjdFWdsKQxrhywOut8I5//SUzKbjCJOkwflAuCDQm3 u/JUAAW6xywYA50BXNolHXbCNqH6Erkpf7GJninlo1jUqlPnzMuhRLK8HQuSsX05BQ OCYyB6Qjp6k+5gRCcLd/yOpmID38SeJ7yp6klTbt9Q1iF4k3Pe+GLuoW9ChbiRBOdH /VKS1mIQsIJIw== 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 1/6] kbuild: move tools_silent to a more relevant place Date: Fri, 22 Feb 2019 16:40:06 +0900 Message-Id: <1550821211-30324-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 This would disturb the change the sub-make part. Move it near the tools/ target. Signed-off-by: Masahiro Yamada --- Changes in v2: None Makefile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) -- 2.7.4 diff --git a/Makefile b/Makefile index bf4e77b..82091b8 100644 --- a/Makefile +++ b/Makefile @@ -90,7 +90,6 @@ endif ifneq ($(findstring s,$(filter-out --%,$(MAKEFLAGS))),) quiet=silent_ - tools_silent=s endif export quiet Q KBUILD_VERBOSE @@ -1678,6 +1677,11 @@ image_name: @echo $(KBUILD_IMAGE) # Clear a bunch of variables before executing the submake + +ifeq ($(quiet),silent_) +tools_silent=s +endif + tools/: FORCE $(Q)mkdir -p $(objtree)/tools $(Q)$(MAKE) LDFLAGS= MAKEFLAGS="$(tools_silent) $(filter --j% -j,$(MAKEFLAGS))" O=$(abspath $(objtree)) subdir=tools -C $(src)/tools/ From patchwork Fri Feb 22 07:40:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 158990 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp1421334jaa; Thu, 21 Feb 2019 23:40:27 -0800 (PST) X-Google-Smtp-Source: AHgI3Ibec0IU6Hz+o9tTq4Kk4bWlqg1aP6DikFg2mcbp4XezbcZL1AzcB842B6NWIdwXyne7DALu X-Received: by 2002:a62:be02:: with SMTP id l2mr2871313pff.55.1550821226912; Thu, 21 Feb 2019 23:40:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550821226; cv=none; d=google.com; s=arc-20160816; b=nY26cesRVZti9TrZekolCjiHEA3WuJpWt/8+NafGhx76X3hdYjwBzL1L7t56ETGi3N nPxe6dw9rWPn/Xs/PDYOejy7sctOJQfSlz0urnuQp/92oth7IgvmkbxHNmQU7lIVswHu S1YrINWRz33Hm6nXN3mlCat9sz1vN/Is04YDUE+41uFvucSYWNcWrurlTUK8h/zq+0vz uORcisD1raeacFBWgQXi4Miis7SYzODtP28/HvNuRefghp158WNpulk4zkZTQfskkU44 TeDxQ+TnklE0QGCJXtL9RWLv8A1gRMLJ5GG4L+g4doUjpdxxR1q2hHHdP0BMbffnMSPX rc7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter; bh=ShLhb3WIzeeB+W+Duw3DHWEdsX60HCOwaHOO2R3ie0k=; b=xHIp6NuaRt4y2yNCFisLk9SN0xqTGFRPBaF104oOQ2TjiQhSwHPIisXGwVao7CPQGM pdfhZHp+acYdkORbI0uZv9j5gBQzDmNcWMKXPaO6XY0C1poLS4xkUR3TjxYLpuIRl1BX YOLEq7zJMjkgoaJAkTVRQS6B+wMEhzciPLghS7QlFt+I1lno1ainbF91ccaagTDRnIRH 9wYc9DmgGF+Oeu2HZnOBwxL6fPbF4daUUspcUdzxomcb5K5r40vq13I23VZupRboa/kg odNwbmoE/4D9t9Wx66yaQQbguq/dj+GDFRj6ZfjmFE1PZ8taYa2xmRIYBwvXSokybFAb WY2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=qJcl0Md1; 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 25si765370pgt.419.2019.02.21.23.40.26; Thu, 21 Feb 2019 23:40:26 -0800 (PST) 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=qJcl0Md1; 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 S1726648AbfBVHkZ (ORCPT + 32 others); Fri, 22 Feb 2019 02:40:25 -0500 Received: from conuserg-07.nifty.com ([210.131.2.74]:53325 "EHLO conuserg-07.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725821AbfBVHkW (ORCPT ); Fri, 22 Feb 2019 02:40:22 -0500 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-07.nifty.com with ESMTP id x1M7eEN1013122; Fri, 22 Feb 2019 16:40:15 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-07.nifty.com x1M7eEN1013122 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1550821215; bh=ShLhb3WIzeeB+W+Duw3DHWEdsX60HCOwaHOO2R3ie0k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qJcl0Md10oQcoXayGlWXNY+W8O17qfDDowqRNY21BFSSaJW1JNH/kZ4PnY+mjDwMy 6ho86dwoE6PzWBTMmChQaNCGhTuKzMOqYk0MjoOBtOTJKCkp+jsy7JzQJXSSIrZV3X p+RJj/+mqn7jnCdLUKsiTbCSxIajc/hggYCWsJltvw+NvBZxtO9buY5Q3U47RmLs9E KUtXSAm3Bmb3UVFmDn6LVtw9jtamhd0DrV/TewFR4e4jFF8TpVOCqa8zz06CpUqxSo oZt2vv+CirwZl50AIpUup0UWy+lAkkmsf/qOA8cTg1wJYJwsd/KIa4NrZOgAforUD7 qHVoAmczjamNw== 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 2/6] kbuild: make -r/-R effective in top Makefile for old Make versions Date: Fri, 22 Feb 2019 16:40:07 +0900 Message-Id: <1550821211-30324-2-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1550821211-30324-1-git-send-email-yamada.masahiro@socionext.com> References: <1550821211-30324-1-git-send-email-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Adding -rR to MAKEFLAGS is important because we do not want to be bothered by built-in implicit rules or variables. One problem that used to exist in older GNU Make versions is MAKEFLAGS += -rR ... does not become effective in the current Makefile. When you are building with O= option, it becomes effective in the top Makefile since it recurses via 'sub-make' target. Otherwise, the top Makefile tries implicit rules. That is why we explicitly add empty rules for Makefiles, but we often miss to do that. In fact, adding -d option to older GNU Make versions shows it is trying a bunch of implicit pattern rules. Considering target file `scripts/Makefile.kcov'. Looking for an implicit rule for `scripts/Makefile.kcov'. Trying pattern rule with stem `Makefile.kcov'. Trying implicit prerequisite `scripts/Makefile.kcov.o'. Trying pattern rule with stem `Makefile.kcov'. Trying implicit prerequisite `scripts/Makefile.kcov.c'. Trying pattern rule with stem `Makefile.kcov'. Trying implicit prerequisite `scripts/Makefile.kcov.cc'. Trying pattern rule with stem `Makefile.kcov'. Trying implicit prerequisite `scripts/Makefile.kcov.C'. ... This issue was fixed by GNU Make commit 58dae243526b ("[Savannah #20501] Handle adding -r/-R to MAKEFLAGS in the makefile"). So, it is no longer a problem if you use GNU Make 4.0 or later. However, older versions are still widely used. So, I decided to patch the kernel Makefile to invoke sub-make regardless of O= option. This will allow further cleanups. Signed-off-by: Masahiro Yamada --- Changes in v2: - Rename KBUILD_SUBMAKE to sub-make-done Makefile | 48 ++++++++++++++++++++++++++---------------------- 1 file changed, 26 insertions(+), 22 deletions(-) -- 2.7.4 diff --git a/Makefile b/Makefile index 82091b8..f0bc078 100644 --- a/Makefile +++ b/Makefile @@ -15,19 +15,6 @@ NAME = Shy Crocodile PHONY := _all _all: -# 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 -LC_COLLATE=C -LC_NUMERIC=C -export LC_COLLATE LC_NUMERIC - -# Avoid interference with shell env settings -unexport GREP_OPTIONS - # We are using a recursive build, so we need to do a little thinking # to get the ordering right. # @@ -44,6 +31,21 @@ unexport GREP_OPTIONS # descending is started. They are now explicitly listed as the # prepare rule. +ifneq ($(sub-make-done),1) + +# 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 +LC_COLLATE=C +LC_NUMERIC=C +export LC_COLLATE LC_NUMERIC + +# Avoid interference with shell env settings +unexport GREP_OPTIONS + # Beautify output # --------------------------------------------------------------------------- # @@ -111,7 +113,6 @@ export quiet Q KBUILD_VERBOSE # KBUILD_SRC is not intended to be used by the regular user (for now), # it is set on invocation of make with KBUILD_OUTPUT or O= specified. -ifeq ($(KBUILD_SRC),) # OK, Make called in directory where kernel src resides # Do we want to locate output files in a separate directory? @@ -141,6 +142,13 @@ $(if $(KBUILD_OUTPUT),, \ # 'sub-make' below. MAKEFLAGS += --include-dir=$(CURDIR) +else + +# Do not print "Entering directory ..." at all for in-tree build. +MAKEFLAGS += --no-print-directory + +endif # ifneq ($(KBUILD_OUTPUT),) + PHONY += $(MAKECMDGOALS) sub-make $(filter-out _all sub-make $(CURDIR)/Makefile, $(MAKECMDGOALS)) _all: sub-make @@ -148,16 +156,12 @@ $(filter-out _all sub-make $(CURDIR)/Makefile, $(MAKECMDGOALS)) _all: sub-make # Invoke a second make in the output directory, passing relevant variables sub-make: - $(Q)$(MAKE) -C $(KBUILD_OUTPUT) KBUILD_SRC=$(CURDIR) \ + $(Q)$(MAKE) sub-make-done=1 \ + $(if $(KBUILD_OUTPUT),-C $(KBUILD_OUTPUT) KBUILD_SRC=$(CURDIR)) \ -f $(CURDIR)/Makefile $(filter-out _all sub-make,$(MAKECMDGOALS)) -# Leave processing to above invocation of make -skip-makefile := 1 -endif # ifneq ($(KBUILD_OUTPUT),) -endif # ifeq ($(KBUILD_SRC),) - +else # sub-make-done # We process the rest of the Makefile if this is the final invocation of make -ifeq ($(skip-makefile),) # Do not print "Entering directory ...", # but we want to display it when entering to the output directory @@ -1766,7 +1770,7 @@ $(cmd_files): ; # Do not try to update included dependency files endif # ifeq ($(config-targets),1) endif # ifeq ($(mixed-targets),1) -endif # skip-makefile +endif # sub-make-done PHONY += FORCE FORCE: From patchwork Fri Feb 22 07:40:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 158989 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp1421312jaa; Thu, 21 Feb 2019 23:40:25 -0800 (PST) X-Google-Smtp-Source: AHgI3IYaXwIcOta6QhYT09FA5xxakA/YClWdLacHnSwXpwo0g1GwrNqt0zQVA+GDoarjK9+icxoZ X-Received: by 2002:a17:902:7c85:: with SMTP id y5mr2414137pll.78.1550821225223; Thu, 21 Feb 2019 23:40:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550821225; cv=none; d=google.com; s=arc-20160816; b=xdprMny1xBOCdyL8RYupYlC3vRm7twPbp+5F7bxqGhG4bQ9Q6kuuX2gjUGNabZDgZH +NUH7NZcuGZJ2xNmzNoaN8DIcJrpJ/4ey5FPjoBhht9QFK+F0GkL8yaTcihE7MFMwro6 BaHlO1qDjKlbyZs/0Op6FRcm4y7wytdWMu1Zo1hUKdJ6ZQRL9vVWl5VzY/ocGwqPwMmb ZzQs0mY/2uDaVPc0WtSaH9yiDXnOIb3fqsGHYupo1jDSZcGv/bYvCB6dPwNs+Lu1Sq3w NM56PaoKFCt9rAeQyfFMWw1SNHsdFfFP3KToxrAl/oFPx3PQYKNp80qE2GLi4zDzQxBW y8Eg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter; bh=gzAGp20lwx555N74OLIUjuRuDhy6lpNK2qNzq0MFvi0=; b=DSeNe8dySdElkBCDYckHWc+3JmBf/aAfLJ+USLZd8H/UrbZnW6APpgl31CX2QAI6Uv yHkfN2TqAYLFB5GaS6TzmX7kl+UtYQzr2QnrqzePNPXn2DhYnbXlmRHez+LG+FIC75Rj I5s6IooypnIBwYMiO0zioPPbSOI7kuQN+zaChyCmn5M8Fu/WWYx9+mOqJc5GcYgADVEy JMuhIl1qIn66k+CxPSpYgsXNkKjHOpu2bpgobh6H2NBXlRhodKG15x1Tu1GKr/xYlgzu zXs7zAbGgC64DhNhVFH8r85PcFWKQ7AIbjrhWw1ovBtAj8Kg3DRc1M+KENw3eAsR4TbC SBnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=mLdftSA6; 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 25si765370pgt.419.2019.02.21.23.40.24; Thu, 21 Feb 2019 23:40:25 -0800 (PST) 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=mLdftSA6; 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 S1726573AbfBVHkX (ORCPT + 32 others); Fri, 22 Feb 2019 02:40:23 -0500 Received: from conuserg-07.nifty.com ([210.131.2.74]:53327 "EHLO conuserg-07.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726303AbfBVHkW (ORCPT ); Fri, 22 Feb 2019 02:40:22 -0500 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-07.nifty.com with ESMTP id x1M7eEN2013122; Fri, 22 Feb 2019 16:40:15 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-07.nifty.com x1M7eEN2013122 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1550821215; bh=gzAGp20lwx555N74OLIUjuRuDhy6lpNK2qNzq0MFvi0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mLdftSA6BczwG736OYyqiMv635Fnywbaz4TPoqU8CLsCGYGv+ghTJqnGKkXjkJU7L FCVVeWFuqSNWcnb5JKx0q//jwGesIQql1OnQuoHTovEh1hQow2WqaQOpxojidwpb2R mPWjpkidmDRZNVLEtlcnEQHoLl2YdnclkAdRh6/eJkbU/D/GRuRoGagmHyDAH4p8Xg v8G58xYD1jhvdQyqjP+6FaWzmxEwk9ro+FkMT+PDQcRfrlTiMOB08Jiktk7M42H12+ bJnOOCERgCzAW3P9C7Yy/Y5bHMjqgkd/VR1UD+mwQaQmEO/DLEvUFguyirnferBg4e mk7eyvEWrVUeg== 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 3/6] kbuild: remove empty rules for makefiles Date: Fri, 22 Feb 2019 16:40:08 +0900 Message-Id: <1550821211-30324-3-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1550821211-30324-1-git-send-email-yamada.masahiro@socionext.com> References: <1550821211-30324-1-git-send-email-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The previous commit made 'MAKEFLAGS += -rR' effective in the top Makefile regardless of O= option, GNU Make versions. The top Makefile does not need to cancel implicit rules for makefiles. There is still one place where an empty rule is useful. Since -rR is effective only after sub-make, GNU Make would try implicit rules to update the top Makefile. Although it is not a big overhead, cancel it just in case. Signed-off-by: Masahiro Yamada --- Changes in v2: - Revive empty rule for $(KCONFIG_CONFIG) include/config/auto.conf.cmd Makefile | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) -- 2.7.4 diff --git a/Makefile b/Makefile index f0bc078..538a4f1 100644 --- a/Makefile +++ b/Makefile @@ -37,6 +37,10 @@ ifneq ($(sub-make-done),1) # (this increases performance and avoids hard-to-debug behaviour) MAKEFLAGS += -rR +# 'MAKEFLAGS += -rR' does not become immediately effective for old +# GNU Make versions. Cancel implicit rules for this Makefile. +$(lastword $(MAKEFILE_LIST)): ; + # Avoid funny character set dependencies unexport LC_ALL LC_COLLATE=C @@ -120,9 +124,6 @@ ifeq ("$(origin O)", "command line") KBUILD_OUTPUT := $(O) endif -# Cancel implicit rules on top Makefile -$(CURDIR)/Makefile Makefile: ; - ifneq ($(words $(subst :, ,$(CURDIR))), 1) $(error main directory cannot contain spaces nor colons) endif @@ -303,8 +304,6 @@ __build_one_by_one: else -# We need some generic definitions (do not try to remake the file). -scripts/Kbuild.include: ; include scripts/Kbuild.include # Read KERNELRELEASE from include/config/kernel.release (if it exists) @@ -1764,9 +1763,7 @@ cmd_crmodverdir = $(Q)mkdir -p $(MODVERDIR) \ # read saved command lines for existing targets existing-targets := $(wildcard $(sort $(targets))) -cmd_files := $(foreach f,$(existing-targets),$(dir $(f)).$(notdir $(f)).cmd) -$(cmd_files): ; # Do not try to update included dependency files --include $(cmd_files) +-include $(foreach f,$(existing-targets),$(dir $(f)).$(notdir $(f)).cmd) endif # ifeq ($(config-targets),1) endif # ifeq ($(mixed-targets),1) From patchwork Fri Feb 22 07:40:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 158993 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp1421586jaa; Thu, 21 Feb 2019 23:40:46 -0800 (PST) X-Google-Smtp-Source: AHgI3IblS2fHKW9+LVnu48i3yJnH023V6J0q/VSHM2mH4NACMyvDmS5qe0IlPePNb+oWcs0YgEjy X-Received: by 2002:a17:902:8c95:: with SMTP id t21mr2786952plo.300.1550821246297; Thu, 21 Feb 2019 23:40:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550821246; cv=none; d=google.com; s=arc-20160816; b=ccWo9XOBi9DvVPt7J2VshU/UUSiDB1TOH7mE4fC5c/TozS867E8iybPm7K56rpgWEJ CZAYKRNvxsTCZFT0vWehBZeUlhSbT7agdnGaBwORCqQqls/tcfn5HHNL1hzKJ0nP+CmS 4FbNo4+xn87fIawWNJkN70EfKcr2GUBtuJQmxy36LwZA8VwT9F/uRgplsW1EgoEVFYoT KOrSaQdrjlnVNMrbjkHgksgO7ImZUKvRLTKNmjDFFRqa0NmhmFE1SoRT1f8v/F/cIJNl f79BBlLNl+cO0g0nGxKceo9XBEexd7dn+nLbA7rWCRtABRrtW5v5W4fod3AEI1njfZI9 qctg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter; bh=UcWNwsux7b1JpeJdXT16j2ZgXx6alk2fUysrOhB9agQ=; b=0TmwfDfoYTlPZCyVqp2LKazZeW8kL89BIfrCB5JJR82XUF3vdFNoXihzHwUyBh5C35 bASRR+UCzRr9k5zw9E1AMe6Re508fGZSTrqNIJssyged45bMmRTBfQx1tGeQuN8Q65vC kKn91Emg6JRtt/bbKB8qipjHGmohUgy0nXNQcRUYAJKkCOoPyZRJjBgrTqC9K6h/s1pN LG6CkqoLeP7wD9z2NHN53bjbZ6gl8sWamPFfHjtsIEp2rmhFu0Fop5ThXpQuiWLHNpdM ZtnTqw0rW0tlrIeH2Hprmlq/OZyi3A/qQ0l/8aWrA66oLSgRn5D4tJFshQT8HTW/K+3u X6WA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=d1VCRaOU; 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 128si734459pgb.373.2019.02.21.23.40.44; Thu, 21 Feb 2019 23:40:46 -0800 (PST) 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=d1VCRaOU; 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 S1726890AbfBVHkn (ORCPT + 32 others); Fri, 22 Feb 2019 02:40:43 -0500 Received: from conuserg-07.nifty.com ([210.131.2.74]:53323 "EHLO conuserg-07.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725894AbfBVHkW (ORCPT ); Fri, 22 Feb 2019 02:40:22 -0500 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-07.nifty.com with ESMTP id x1M7eEN3013122; Fri, 22 Feb 2019 16:40:16 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-07.nifty.com x1M7eEN3013122 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1550821216; bh=UcWNwsux7b1JpeJdXT16j2ZgXx6alk2fUysrOhB9agQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=d1VCRaOUNPYV1EmPwqZ2gKCkt7j4bSA6poEYuGWUcvxPOg9a+Igydih6CmYtl/T12 /tAUcE1p6hv3o6AZBCecFoy2oG/HRE2uIt1QIXrXYZVHBw3vNs+zAxhgArylt4GJFd wp92HZ9Ju5ph5ZYc/FIRKzcnnF3EzJT3RZm1hAAEM6krFIyUb0Soqv1iDk5cU6TeU2 Ny8X4wV3Jo9zIQ+nIiPRosnZQtFZOBLUj2R46SEl8eRM8qcylSG9XiJ+8d3NOft8X5 167HDIJLYNsmVJrMN8A27kLRQvdNHZLuaawYY2+3DepfmBCFx7vD4Ks3dUvCAQAXyN rqLZ1JLb8/mSA== 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 4/6] kbuild: simplify single target rules Date: Fri, 22 Feb 2019 16:40:09 +0900 Message-Id: <1550821211-30324-4-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1550821211-30324-1-git-send-email-yamada.masahiro@socionext.com> References: <1550821211-30324-1-git-send-email-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The dependency will be checked anyway after Kbuild descends into a sub-directory. Skip object/source dependency checks in top Makefile. VPATH can be simpler since the top Makefile no longer checks the presence of the source file, which is located in in the external module directory. One good thing is, it can compile an object from a generated source file. $ make crypto/rsapubkey.asn1.o ... ASN.1 crypto/rsapubkey.asn1.c CC crypto/rsapubkey.asn1.o Signed-off-by: Masahiro Yamada --- Changes in v2: - Do not merge pattern rules Makefile | 47 ++++++++++++++++++----------------------------- 1 file changed, 18 insertions(+), 29 deletions(-) -- 2.7.4 diff --git a/Makefile b/Makefile index 538a4f1..4d8516e 100644 --- a/Makefile +++ b/Makefile @@ -219,7 +219,7 @@ objtree := . src := $(srctree) obj := $(objtree) -VPATH := $(srctree)$(if $(KBUILD_EXTMOD),:$(KBUILD_EXTMOD)) +VPATH := $(srctree) export srctree objtree VPATH @@ -1703,31 +1703,23 @@ tools/%: FORCE # target-dir => where to store outputfile # build-dir => directory in kernel source tree to use -ifeq ($(KBUILD_EXTMOD),) - build-dir = $(patsubst %/,%,$(dir $@)) - target-dir = $(dir $@) -else - zap-slash=$(filter-out .,$(patsubst %/,%,$(dir $@))) - build-dir = $(KBUILD_EXTMOD)$(if $(zap-slash),/$(zap-slash)) - target-dir = $(if $(KBUILD_EXTMOD),$(dir $<),$(dir $@)) -endif - -%.s: %.c prepare FORCE - $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@) -%.i: %.c prepare FORCE - $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@) -%.o: %.c prepare FORCE - $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@) -%.lst: %.c prepare FORCE - $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@) -%.s: %.S prepare FORCE - $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@) -%.o: %.S prepare FORCE - $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@) -%.symtypes: %.c prepare FORCE - $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@) -%.ll: %.c prepare FORCE - $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@) +build-target = $(if $(KBUILD_EXTMOD), $(KBUILD_EXTMOD)/)$@ +build-dir = $(patsubst %/,%,$(dir $(build-target))) + +%.i: prepare FORCE + $(Q)$(MAKE) $(build)=$(build-dir) $(build-target) +%.ll: prepare FORCE + $(Q)$(MAKE) $(build)=$(build-dir) $(build-target) +%.lst: prepare FORCE + $(Q)$(MAKE) $(build)=$(build-dir) $(build-target) +%.o: prepare FORCE + $(Q)$(MAKE) $(build)=$(build-dir) $(build-target) +%.s: prepare FORCE + $(Q)$(MAKE) $(build)=$(build-dir) $(build-target) +%.symtypes: prepare FORCE + $(Q)$(MAKE) $(build)=$(build-dir) $(build-target) +%.ko: %.o + $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost # Modules PHONY += / @@ -1737,9 +1729,6 @@ PHONY += / Documentation/ samples/: headers_install %/: prepare FORCE $(Q)$(MAKE) KBUILD_MODULES=1 $(build)=$(build-dir) -%.ko: prepare FORCE - $(Q)$(MAKE) $(build)=$(build-dir) $(@:.ko=.o) - $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost # FIXME Should go into a make.lib or something # =========================================================================== From patchwork Fri Feb 22 07:40:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 158992 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp1421406jaa; Thu, 21 Feb 2019 23:40:33 -0800 (PST) X-Google-Smtp-Source: AHgI3IbMH8LkTNTxU36B4o/teATP23IhNij//n8qPsvOyxQiJIbU/7g99ZxMYCWKPxwfcCzM7qBK X-Received: by 2002:a63:fc59:: with SMTP id r25mr2744517pgk.302.1550821233342; Thu, 21 Feb 2019 23:40:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550821233; cv=none; d=google.com; s=arc-20160816; b=AkptUMNF/nGDHEMihjOV6wUqg2CMvVzj+35wvsshptxF+GgLmOs8bKsuXyluxJuJay WDAymCv6Z2OuZWJxAn2HCcsmXtjJR5x8gychG1kEvzCRtFRXQNAkyZvDEobbfyDbwq4k b+2vjn3DLHgxLxyV0YwS0gnzrbAhICx8HAxPE5MCGkML0nqu63FlVwEqmFHBTXKG6lbZ yVBnILBJw+wZWYbPXLePJWZW79UsIWawMfvEmX28YJ4BtvyOp5Ww90yDm7o8RN9xHVCs B7nUyZ1made5iDAKxFIpOw4gFgDsGmy5/jB24MtgVAchmAyMCavrc/m5SS3COZi06tO6 sU8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter; bh=EjgNKSfh8xtmbNhOrnDsrTe+nk2utBj1sqPU76jQ+JE=; b=fxvd/8iGfSjD4jeVTGSbCY+onTFMR23R0QWXLm1pl1RdrghZD7DRD+JFLaY+26b3Ze V1aX8YuVmcRpqPZ23wDyr17FFcZyvssdRHYqRRjszoKCAvYuINXC9WO1Z672jNVKJN9F O1d5B8wATlEtnpl5MkpumYbSHYPJhyIYwHpgf60kbvLalalIYWxbt2Ten5tqtUdObpYj Prw4MfHWT3Q1+vQu7+j8WhYPrvJX8tOmPe1BWneSPItf5aAe1/9qO7fu2slfvsCIiUio i5hKxROAasnrzMZgaxTZobjljRpBMRdltKed/SxIu0UgTF0jNtwd8Q4CZ6JMl7S6JEtx Kyzw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=W8QRvm5G; 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 e11si740234pfn.124.2019.02.21.23.40.32; Thu, 21 Feb 2019 23:40:33 -0800 (PST) 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=W8QRvm5G; 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 S1726751AbfBVHk0 (ORCPT + 32 others); Fri, 22 Feb 2019 02:40:26 -0500 Received: from conuserg-07.nifty.com ([210.131.2.74]:53324 "EHLO conuserg-07.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726313AbfBVHkW (ORCPT ); Fri, 22 Feb 2019 02:40:22 -0500 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-07.nifty.com with ESMTP id x1M7eEN4013122; Fri, 22 Feb 2019 16:40:16 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-07.nifty.com x1M7eEN4013122 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1550821216; bh=EjgNKSfh8xtmbNhOrnDsrTe+nk2utBj1sqPU76jQ+JE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=W8QRvm5GYUfOTZqBxI0sxCTeKRFOZD7FIl/LKktPFs0LMO6yAuN2DDcfOnWbiO8gc 1n61jmAREu/7s5KsjKMyHrflanVNicsNDYf4nd3ejg+TmccySK3AmGKqxZPXPwevpo 9SUNvxg1ZnMfBe/KI2annVsQNThjCqSIC21+jKLMcnqgzKxmgmWpy2kPjQFPEcEjTu UC9+g1230GZpqzKVqWLqv5yKBNmT8/+8hwsFANpkSR3lT2z9NtJueDWCiys+Kh0z1Y XqjZRBuVWzY0SMQ/JnrSKNgVcJEva/JUHxHrz6nY5nf53yxFw3fBdQi8SM51W8t//G MPWXuduUhqSng== 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 5/6] kbuild: invoke syncconfig if include/config/auto.conf.cmd is missing Date: Fri, 22 Feb 2019 16:40:10 +0900 Message-Id: <1550821211-30324-5-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1550821211-30324-1-git-send-email-yamada.masahiro@socionext.com> References: <1550821211-30324-1-git-send-email-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If include/config/auto.conf.cmd is lost for some reasons, it is not self-healing, so the top Makefile misses to run syncconfig. Move include/config/auto.conf.cmd to the target side. I used a pattern rule instead of a normal rule here although it is a bit gross. If the rule were written with a normal rule like this, include/config/auto.conf \ include/config/auto.conf.cmd \ include/config/tristate.conf: $(KCONFIG_CONFIG) $(Q)$(MAKE) -f $(srctree)/Makefile syncconfig ... syncconfig would be executed per target. Using a pattern rule makes sure that syncconfig is executed just once because Make assumes the recipe will create all of the targets. Here is a quote from the GNU Make manual [1]: "Pattern rules may have more than one target. Unlike normal rules, this does not act as many different rules with the same prerequisites and recipe. If a pattern rule has multiple targets, make knows that the rule's recipe is responsible for making all of the targets. The recipe is executed only once to make all the targets. When searching for a pattern rule to match a target, the target patterns of a rule other than the one that matches the target in need of a rule are incidental: make worries only about giving a recipe and prerequisites to the file presently in question. However, when this file's recipe is run, the other targets are marked as having been updated themselves." [1]: https://www.gnu.org/software/make/manual/html_node/Pattern-Intro.html Signed-off-by: Masahiro Yamada --- Changes in v2: - New patch Makefile | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) -- 2.7.4 diff --git a/Makefile b/Makefile index 4d8516e..aa9ff68 100644 --- a/Makefile +++ b/Makefile @@ -629,12 +629,17 @@ ifeq ($(may-sync-config),1) -include include/config/auto.conf.cmd # To avoid any implicit rule to kick in, define an empty command -$(KCONFIG_CONFIG) include/config/auto.conf.cmd: ; +$(KCONFIG_CONFIG): ; # The actual configuration files used during the build are stored in # include/generated/ and include/config/. Update them if .config is newer than # include/config/auto.conf (which mirrors .config). -include/config/%.conf: $(KCONFIG_CONFIG) include/config/auto.conf.cmd +# +# This exploits the 'multi-target pattern rule' trick. +# The syncconfig should be executed only once to make all the targets. +include/config/auto.% \ +include/config/auto.%.cmd \ +include/config/tristate.%: $(KCONFIG_CONFIG) $(Q)$(MAKE) -f $(srctree)/Makefile syncconfig else # External modules and some install targets need include/generated/autoconf.h From patchwork Fri Feb 22 07:40:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 158991 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp1421369jaa; Thu, 21 Feb 2019 23:40:30 -0800 (PST) X-Google-Smtp-Source: AHgI3IZPEHg9rc0JgHIJnRKj0v5d7+Us3g+aduYRGyv5K/e85m75CpWLkWuTB+WNYvb4PIyRy9hx X-Received: by 2002:a17:902:8b82:: with SMTP id ay2mr2848482plb.64.1550821230107; Thu, 21 Feb 2019 23:40:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550821230; cv=none; d=google.com; s=arc-20160816; b=gfI3HIYLHm64hWm9MBdBEZGEg6H5x2amznl5Wlk59gusN9ABM9ziADBYJybgJb31w1 1t/wSXX0Mxn/HMv1Vpuctf1boFF4c0KkXlV594XDcidzWiLosXlCu0WieLOPv+1y6AZ5 U0MOm5poUN+8CjqmB06SdWWMZff5O8ElrWrNDlwJECn61sHcCiHQYM4te8NRiraNjHVb pvQD/RCHCy2Ob2tpNtFheuN6sO4yYB0QoGZhNGtfpW0+Zpdx97WdMuVWRzUy+gIiLmh6 xX6SFpMgF3ZqT1bCYKJXjiGwCJ/HkiiPdWrXi9mxWPLZ2HQd8H3FiiCrwep+JrDwxdTG rm9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter; bh=bMNe7A0okspALkFQtHY95z2jxYuEKE/+Qu2TtqR/cjs=; b=PJXomQy6clTFgUqt//KjvYU8na2F2GPNKCikNgO9ywzkHtRrypfsnSEyD3kjnTN6vf uAqsBvSUAVv+I48XW/LUeW325P8l96bg9WYiw0K5WXclPPd0MRpypaMRU18sBzg9k6wR 2XQz//kE/8Z/x3xVAel5yRkuTgD/j+2vSOtMDjBCM1o9mjhQUsesOBxEFVEh7ouP7P4U /CpEFz/nr6A3sFXAEdmS8m5XQqHWy1nNgnD06CSZ15+beaIDotaw2KXsJwIgqNwmZDpd IxgUFwHKNUuU+VhvdEF30Tzs5AdmiZul6GLZaOeBaKdnlZFe1wUcZ8r6oOs5cgfIoIXx O6XQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=bZ45tHyA; 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 e11si740234pfn.124.2019.02.21.23.40.29; Thu, 21 Feb 2019 23:40:30 -0800 (PST) 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=bZ45tHyA; 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 S1726857AbfBVHk2 (ORCPT + 32 others); Fri, 22 Feb 2019 02:40:28 -0500 Received: from conuserg-07.nifty.com ([210.131.2.74]:53326 "EHLO conuserg-07.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725944AbfBVHkW (ORCPT ); Fri, 22 Feb 2019 02:40:22 -0500 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-07.nifty.com with ESMTP id x1M7eEN5013122; Fri, 22 Feb 2019 16:40:17 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-07.nifty.com x1M7eEN5013122 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1550821217; bh=bMNe7A0okspALkFQtHY95z2jxYuEKE/+Qu2TtqR/cjs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bZ45tHyAiCDn0ZbSCd2ozaFFwvONyLP/yPcxp8Ift+vGhhLkCmnbZTsCaMR4E/m1e Au6K4v4peI6k1ylEtMhZF5DX8L8aRfvuoTulxSDv+IR1ZEI9fri9l7/UB9XsdYNbht eiOq6fs/q7woZuKI1hcnQE9DUN8qJ71SARehfFV+YvCXf2PJDaKw8IZ+NW1N7hw9Wt KKi7RAgi8hTiTPrmINfLaASAC4Jr7aobJ8kcoHYXEMy167/kZngPT6sUytmJN+Bk66 dRof6yoTQC7MWH4WtuDMvFQThYVgEgJTJ74s3vFttUZckyBZQotL7rroQHJMTe/8zi c5Hn3zBODqdsA== 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 6/6] kbuild: move ".config not found!" message from Kconfig to Makefile Date: Fri, 22 Feb 2019 16:40:11 +0900 Message-Id: <1550821211-30324-6-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1550821211-30324-1-git-send-email-yamada.masahiro@socionext.com> References: <1550821211-30324-1-git-send-email-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If you run "make" in a pristine source tree, currently Kbuild will start to build Kconfig to let it show the error message. It would be more straightforward to check it in Makefile and let it fail immediately. Signed-off-by: Masahiro Yamada --- Changes in v2: - New patch Makefile | 10 ++++++++-- scripts/kconfig/conf.c | 13 ------------- 2 files changed, 8 insertions(+), 15 deletions(-) -- 2.7.4 diff --git a/Makefile b/Makefile index aa9ff68..84034c5 100644 --- a/Makefile +++ b/Makefile @@ -628,8 +628,14 @@ ifeq ($(may-sync-config),1) # because some architectures define CROSS_COMPILE there. -include include/config/auto.conf.cmd -# To avoid any implicit rule to kick in, define an empty command -$(KCONFIG_CONFIG): ; +$(KCONFIG_CONFIG): + @echo >&2 '***' + @echo >&2 '*** Configuration file "$@" not found!' + @echo >&2 '***' + @echo >&2 '*** Please run some configurator (e.g. "make oldconfig" or' + @echo >&2 '*** "make menuconfig" or "make xconfig").' + @echo >&2 '***' + @/bin/false # The actual configuration files used during the build are stored in # include/generated/ and include/config/. Update them if .config is newer than diff --git a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c index da89ef7..ef3678c 100644 --- a/scripts/kconfig/conf.c +++ b/scripts/kconfig/conf.c @@ -488,7 +488,6 @@ int main(int ac, char **av) const char *progname = av[0]; int opt; const char *name, *defconfig_file = NULL /* gcc uninit */; - struct stat tmpstat; int no_conf_write = 0; tty_stdio = isatty(0) && isatty(1); @@ -560,18 +559,6 @@ int main(int ac, char **av) name = av[optind]; conf_parse(name); //zconfdump(stdout); - if (sync_kconfig) { - name = conf_get_configname(); - if (stat(name, &tmpstat)) { - fprintf(stderr, "***\n" - "*** Configuration file \"%s\" not found!\n" - "***\n" - "*** Please run some configurator (e.g. \"make oldconfig\" or\n" - "*** \"make menuconfig\" or \"make xconfig\").\n" - "***\n", name); - exit(1); - } - } switch (input_mode) { case defconfig: