From patchwork Thu Feb 14 03:05:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 158292 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp834751jaa; Wed, 13 Feb 2019 19:06:11 -0800 (PST) X-Google-Smtp-Source: AHgI3IbNR/H84brc3gPqLGq6GbvTPGxAlkSGsWjnGuKtKgQaFI/KdPQV0NKGUiFSoGTIIFIU4pnd X-Received: by 2002:a62:4bd5:: with SMTP id d82mr1612945pfj.85.1550113571552; Wed, 13 Feb 2019 19:06:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550113571; cv=none; d=google.com; s=arc-20160816; b=hyWI7kdjU4xV6OJ21WvC9bb+r+iIt8s+rHy+ZOV6apHGw5y6kyICeWuuOnzXpy4EUM gCAVws9ySmgDSkFBbpnTo1iBk6pzJ676Y4Dps+Us3jeafliaJt9LKAd1Bv/ZFVoFfaSi 6l/ujAKDyCXFhmQmEojiY1nD3rgelkWtJVGZv+W2mtp7aVMupd4Bn07xgbDgZ9OiXwaA 4TbXN6Ttz1Jpbv9i4rZU5hlLFKQRKizNvzCykgyWlIeQmq4NRQbAK2I9ygERE9967U3c gTzdwYJNnyrq61jf1PVxCkKt7cflI2jt8i3qUp7waxQKIBeN8a0o3ITYOib/CGjUMKOB UiNQ== 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=9rCnJrZhrNGJF/7A8mlLM75Z8BqThK/fBdPkgtUyRPA=; b=qOcwmARfpZm80eFLRJiH1ZXC/xYKSjJnozoMyzn/YOLdLjXVn5K1ROf9gn6XT9TnAv 8NwPPA/jOfMxLDkhD2HaANd6hy8elx26obk5rMauBwzpt3brixKqQ7Rs4WOPIO/uXBJK o2b7n83qktJ1f7dp4CCjNlpYtq5c0AAHQC140xlLd0q20WjbRk1SAmLPEAXOIY5pCCGY q95dc62jcys96G/yzO7t9Sg5OzfIqc99PEOTOT8evzVgjBj3VmHo+2LrGBOqNR57qj3k qb2uAHwYsm7hNjZ0kCeeYOhMsKiwEaGZO2TyBsmjzD659ygkbLEXBo8kgksAUzxWLT34 R8cQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=YHX966Qj; 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 23si1139650pgc.221.2019.02.13.19.06.11; Wed, 13 Feb 2019 19:06:11 -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=YHX966Qj; 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 S2395308AbfBNDGI (ORCPT + 31 others); Wed, 13 Feb 2019 22:06:08 -0500 Received: from conuserg-07.nifty.com ([210.131.2.74]:64384 "EHLO conuserg-07.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2394268AbfBNDGG (ORCPT ); Wed, 13 Feb 2019 22:06:06 -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 x1E35Pg8020814; Thu, 14 Feb 2019 12:05:29 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-07.nifty.com x1E35Pg8020814 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1550113529; bh=9rCnJrZhrNGJF/7A8mlLM75Z8BqThK/fBdPkgtUyRPA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YHX966QjGfaHOVTquVmuzHmIIdhYCCM6T/lIo243Ly6iBmhF/LJ76ItK3CsAh+GZh A9ionEc55vwALlYZXihilnIQi/q6yBLM4lxAJfWHTQambXxNMch63348VWxCAHj4pJ LC/kCJ4MNa6WgfVj6ROeXAsL8Y9BgGHP6SJ9nCKY7Epspf9kV1jYKN8fUp3zYpv+fS NA5kuV/JTaHvOJd5wFTR522ny/WsOIGwi/ab7QXpJpo8HHtrc0HCnwkrACzdkwa0Zo w8PP+6lp50lVKeUjl5FRxIRhbVM+7cDVxWgRXsCHp8kb5eB1eCdwgHqD9fvajxQQzR sm1dYtn9UQE+A== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Sam Ravnborg , Masahiro Yamada , Michal Marek , linux-kernel@vger.kernel.org Subject: [PATCH 7/8] kbuild: remove empty rules for makefiles Date: Thu, 14 Feb 2019 12:05:20 +0900 Message-Id: <1550113521-23577-7-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1550113521-23577-1-git-send-email-yamada.masahiro@socionext.com> References: <1550113521-23577-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 --- Makefile | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) -- 2.7.4 diff --git a/Makefile b/Makefile index 25d7d46..f7f1aa1 100644 --- a/Makefile +++ b/Makefile @@ -37,6 +37,10 @@ ifndef KBUILD_SUBMAKE # (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) @@ -627,9 +626,6 @@ 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) include/config/auto.conf.cmd: ; - # 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). @@ -1750,9 +1746,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)