From patchwork Thu Nov 15 08:27:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 151205 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp6714002ljp; Thu, 15 Nov 2018 00:28:40 -0800 (PST) X-Google-Smtp-Source: AJdET5fgo1XeoBQmNBZBPyT4faUsx+Q30WOEK53uveXnYDxIk5SnzifVNtRSHUedR7Mfa79cfsEj X-Received: by 2002:a63:594d:: with SMTP id j13mr4949989pgm.210.1542270520359; Thu, 15 Nov 2018 00:28:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542270520; cv=none; d=google.com; s=arc-20160816; b=Qknc3XRciAloOjtq/KKiVB9CkcNb/vyAGWdpSf0RRktdsj9piB1QVzr/E+xYK4D2LI o5svYr9eINKvTgVFC/l9Bv8GnaWNcn7dhiXGi843BkT8Nx3UqufCSeZnBab3S0l7sY6T gyVxyovdqKrs/NCyiBcbH+hiVmoO1m4T1KXmspJ98FFFGI39wXZUJqwptlWWjvjOJcLI e/6iMLt2WmzRWr+vcCBmQmX2QZ3RdpFIPOShDxnO/GFqMAL2tcffXOBIOxL6CwgsIMy9 xXI6COiLPLRb1smWBHFZ8fCOpbv3/N8aGF+Wrg65EvR98GLJPeIzv2hkHza5/DCoWD7Y R1zA== 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=c8ZdXLBNCXHefDwQ/cCwID3DrPEA1GhMAWsKRg379ak=; b=rBOEPPMfxvPpSo7Fiu9RTiDiD56YrtJBzmNHuOO1AVxL1xlJunWpwMtMstHI6V89Ce 0HLMhFci4v0ONfS0ycwDpOmx/6PVYwqKj9TYgMZVN0F1e/PKF2HyJISVEmFFo+hIQ23o yaOp1zGYxDXjXah/nWONPPuaWFSBu+wAfbKX/MVA6mXzBLKaC7DO99+Cra9IBW+P/k9z v/SsauTa7e4w/O5gmRLJKTkM/skFf5CoHuTQevCGBZbNTK9e3DVQ0crXYTQWLwy+Xp1B givyaq/5/GmGXyHU+tR1BKfCRWO90CYTbK94XrdAFbtelzHONzbGAb04YcZZw/QsyTyU gOkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b="1n/fyluE"; 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 f5-v6si5488509pfn.85.2018.11.15.00.28.40; Thu, 15 Nov 2018 00:28:40 -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="1n/fyluE"; 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 S1732588AbeKOSf2 (ORCPT + 32 others); Thu, 15 Nov 2018 13:35:28 -0500 Received: from conuserg-08.nifty.com ([210.131.2.75]:50788 "EHLO conuserg-08.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728757AbeKOSf1 (ORCPT ); Thu, 15 Nov 2018 13:35:27 -0500 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-08.nifty.com with ESMTP id wAF8RHoe022794; Thu, 15 Nov 2018 17:27:24 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-08.nifty.com wAF8RHoe022794 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1542270444; bh=c8ZdXLBNCXHefDwQ/cCwID3DrPEA1GhMAWsKRg379ak=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1n/fyluEv1Jy+qDU2a1EdK7oFAh96OhBAlXu5p2U14kXiZfLHGT3vxhdIicbD26ot Qf2lDPdW1jxq13zIxIAx5GUrtj/rSWxMoLc4ZVy4w1PjUmcgCYPshEhzZHtRROkscX ooWK0iHP/SobPz5si+KnCUDNOLiZd0V7h40xmN2a9/Mv8a1gAaCLkjbYWwSpR10g/a LiYbuomoLO90zs9FLlJt2Bf8J2HFlBaVQ2Zsjiy+VjV4d2cdBa3aIshVSxKaRM4J6v YvKR9gyr4M+EJNkUOCY2ZrEkcLbHh9KOlLBcy0KK0RlpsOuy7GZneT2/mLLQXIkmt0 9xum95VKXKZig== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Sam Ravnborg , Nicolas Pitre , Rasmus Villemoes , Masahiro Yamada , Michal Marek , linux-kernel@vger.kernel.org Subject: [PATCH 7/8] kbuild: refactor if_changed and if_changed_dep Date: Thu, 15 Nov 2018 17:27:14 +0900 Message-Id: <1542270435-11181-8-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1542270435-11181-1-git-send-email-yamada.masahiro@socionext.com> References: <1542270435-11181-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 '@set -e; $(echo-cmd) $(cmd_$(1)' can be replaced with '$(cmd)'. More cleanups. Signed-off-by: Masahiro Yamada --- scripts/Kbuild.include | 9 +++------ scripts/Makefile.build | 4 ++-- 2 files changed, 5 insertions(+), 8 deletions(-) -- 2.7.4 diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include index 5e47bf6..e4b77ef7 100644 --- a/scripts/Kbuild.include +++ b/scripts/Kbuild.include @@ -251,17 +251,14 @@ any-prereq = $(filter-out $(PHONY),$?) $(filter-out $(PHONY) $(wildcard $^),$^) # Execute command if command has changed or prerequisite(s) are updated. if_changed = $(if $(strip $(any-prereq) $(arg-check)), \ - @set -e; \ - $(echo-cmd) $(cmd_$(1)); \ + $(cmd); \ printf '%s\n' 'cmd_$@ := $(make-cmd)' > $(dot-target).cmd, @:) # Execute the command and also postprocess generated .d dependencies file. -if_changed_dep = $(if $(strip $(any-prereq) $(arg-check) ), \ - @set -e; \ - $(cmd_and_fixdep), @:) +if_changed_dep = $(if $(strip $(any-prereq) $(arg-check)), $(cmd_and_fixdep), @:) cmd_and_fixdep = \ - $(echo-cmd) $(cmd_$(1)); \ + $(cmd); \ scripts/basic/fixdep $(depfile) $@ '$(make-cmd)' > $(dot-target).tmp;\ rm -f $(depfile); \ mv -f $(dot-target).tmp $(dot-target).cmd; diff --git a/scripts/Makefile.build b/scripts/Makefile.build index 78e647f..0f28df2 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build @@ -264,7 +264,7 @@ endif define rule_cc_o_c $(call cmd,checksrc) - @$(call cmd_and_fixdep,cc_o_c) + $(call cmd_and_fixdep,cc_o_c) $(call cmd,gen_ksymdeps) $(call cmd,checkdoc) $(call cmd,objtool) @@ -273,7 +273,7 @@ define rule_cc_o_c endef define rule_as_o_S - @$(call cmd_and_fixdep,as_o_S) + $(call cmd_and_fixdep,as_o_S) $(call cmd,gen_ksymdeps) $(call cmd,objtool) $(call cmd,modversions_S)