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)