Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp7746001imu; Thu, 15 Nov 2018 00:29:57 -0800 (PST) X-Google-Smtp-Source: AJdET5cQUa1a/XmnhKkRN9QY8Xs8TGfu82F8/kmIBOJ1bAEl1VYptMoLcqD823M1RKgLnKvw1IRQ X-Received: by 2002:a17:902:4583:: with SMTP id n3-v6mr5287752pld.53.1542270597275; Thu, 15 Nov 2018 00:29:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542270597; cv=none; d=google.com; s=arc-20160816; b=fR8AU34bjMxD8lHpM8pb3EjTUVKi60DYMEHiirR7xqZqf8LHr6uiWvK/i+kVoCQbih zz67+4GtxxgBAUKQkO70fcGRow3xjThgu7nlfpHTEulWc8EzsLZEp0HpEUmXo1Sxfrk9 qOd+tcI4jlk9Z3XKEQ2JlkbqnAo1b1nD+ewfzUnfQybBN5JY0VgVA0rso89WgfbrufGg wAuxsnYqUXNHUT2X3bhxbQEjm9i6memenBmHAkv9rPzgRcmAlLgLXgYSwZf56GVye8ir oAvPBP5J3aYExn9LKwYOl57dKgb0TVIMEv6n5yicVxMlKLMVutsK+6XlB4FRtteow24v wIYQ== 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 k91-v6si27921821pld.209.2018.11.15.00.29.29; Thu, 15 Nov 2018 00:29:57 -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 S1731921AbeKOSf2 (ORCPT + 99 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(-) 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) -- 2.7.4