From patchwork Sat Aug 10 15:53:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 171029 Delivered-To: patch@linaro.org Received: by 2002:a92:d204:0:0:0:0:0 with SMTP id y4csp696731ily; Sat, 10 Aug 2019 08:55:09 -0700 (PDT) X-Google-Smtp-Source: APXvYqzZJRvcBKL8XC4htSQn0aLWkky/49yhgf3Tq3sYVJVqowpwWZVKlyz6qxRaFsKaLJAYW7iy X-Received: by 2002:a62:87c8:: with SMTP id i191mr27589577pfe.133.1565452509000; Sat, 10 Aug 2019 08:55:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565452508; cv=none; d=google.com; s=arc-20160816; b=lTZkUZrCv/+nzkcXh+Dxr5tjMbVCdRDjeGRw0QYF9jt3wD3tc8OVHS7suKrTJ+GZEd Bo1oFVo0vWFfNqsS7guXNJOQOQVUeb/rRs4Ri+sPxJo4WmsliLGtOwdCKB2p4UG4BIjk mGLwON5h+kFiv/o9Ing18JTIf7TtiaT6JqRxQ1cTIrOhmVSusT8vIOjtKDF6n/hc611C /GZlvq7Y17Evk1bBSumv/5pfPLcJ4HmjTEF2JT6Cv5c+9bt/4TZMlCP3nqc8RbGqfR3d d6R7o07gjBzPXwHYyfhZjWTENDhF/DAwEBnzg1Hz7uZzKeRTYhmm+EGDYQrtIDG0Zv5E UzYg== 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=3uihMbIv8Nur7ulPukTwG5sn3YtGF2A6GIOehwU06DM=; b=QrIaGMKkbecjbuwu9oxv5TiX45o/rLLxFWJ84DmgFqjGSsVhjSt3zWG4YqO8IVckXq KfmEjmIjGX47eYSAYpfwn4MxdashPJLAzFIECDLLY750B6p9hhLFT13J0HQh64jAYEoJ J0t4h2l6zLzBv+1yFLdQOjUme21yJPBuZZ/DwOU0aGwuAH/1pN5g0lQ7wH0AKXVbO/wv wvQila6GZdd+UdYZGhP3uDYfa87P3GY4L+ApK5NiwJ0/yvQnad+c5XHO3PoTD2BBE5fZ 6mOpdcgjz0exZ7VFzqSzdtU3p3Wz9roGeZSV0W4pH1w8f3gDVVizXgjkgBebU05Gcud5 awLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=g5RJmpth; 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 i8si21157224pfr.97.2019.08.10.08.55.08; Sat, 10 Aug 2019 08:55:08 -0700 (PDT) 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=g5RJmpth; 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 S1726587AbfHJPzH (ORCPT + 28 others); Sat, 10 Aug 2019 11:55:07 -0400 Received: from conuserg-11.nifty.com ([210.131.2.78]:34502 "EHLO conuserg-11.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726382AbfHJPyn (ORCPT ); Sat, 10 Aug 2019 11:54:43 -0400 Received: from grover.flets-west.jp (softbank126125143222.bbtec.net [126.125.143.222]) (authenticated) by conuserg-11.nifty.com with ESMTP id x7AFrG94009713; Sun, 11 Aug 2019 00:53:24 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-11.nifty.com x7AFrG94009713 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1565452405; bh=3uihMbIv8Nur7ulPukTwG5sn3YtGF2A6GIOehwU06DM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=g5RJmpthjrYY+ky7lYOx1qHnu5iZqFYdq8HYzF1KXWIrkPurQDacurfHc4bcYuzx9 EnN7Yo/U2d0lwRIbhM43uLI/KY5WXfco3rB2D2CUng+D3Y8T79Vkewd2JmSHk1xva9 cqyND8OD1R8eFpskfxH/6buVX9BI2UAH37pIpB61O/noYv6KBg0QcDTX2NMkHfple5 P0bdFsuHqBTww/xxL7bQIG/WV9oJc66A/x8Y/PnP1bwQ+z/+ZD6eyiSODOH0Z6bE3G kNAR4jNoi/YVL9MJ2FfP33qibLLlxjNGqQG4o0N8wXLJc6gZikqYJQQeeg8+/sAbJd 5FWCl/e4gJ41A== X-Nifty-SrcIP: [126.125.143.222] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Christoph Hellwig , Sam Ravnborg , Masahiro Yamada , Michal Marek , linux-kernel@vger.kernel.org Subject: [PATCH 09/11] kbuild: unify clean-dirs rule for in-kernel and external module Date: Sun, 11 Aug 2019 00:53:05 +0900 Message-Id: <20190810155307.29322-10-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190810155307.29322-1-yamada.masahiro@socionext.com> References: <20190810155307.29322-1-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Factor out the duplicated code for in-kernel and external module cleaning. Signed-off-by: Masahiro Yamada --- Makefile | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) -- 2.17.1 diff --git a/Makefile b/Makefile index e60c09d57b30..871c42e241a6 100644 --- a/Makefile +++ b/Makefile @@ -1017,6 +1017,7 @@ vmlinux-alldirs := $(sort $(vmlinux-dirs) Documentation \ $(drivers-) $(net-) $(libs-) $(virt-)))) build-dirs := $(vmlinux-dirs) +clean-dirs := $(vmlinux-alldirs) init-y := $(patsubst %/, %/built-in.a, $(init-y)) core-y := $(patsubst %/, %/built-in.a, $(core-y)) @@ -1388,11 +1389,8 @@ DISTCLEAN_FILES += tags TAGS cscope* GPATH GTAGS GRTAGS GSYMS # clean: rm-dirs := $(CLEAN_DIRS) clean: rm-files := $(CLEAN_FILES) -clean-dirs := $(addprefix _clean_, $(vmlinux-alldirs)) -PHONY += $(clean-dirs) clean archclean vmlinuxclean -$(clean-dirs): - $(Q)$(MAKE) $(clean)=$(patsubst _clean_%,%,$@) +PHONY += archclean vmlinuxclean vmlinuxclean: $(Q)$(CONFIG_SHELL) $(srctree)/scripts/link-vmlinux.sh clean @@ -1629,12 +1627,7 @@ PHONY += _emodinst_post _emodinst_post: _emodinst_ $(call cmd,depmod) -clean-dirs := $(addprefix _clean_,$(KBUILD_EXTMOD)) - -PHONY += $(clean-dirs) clean -$(clean-dirs): - $(Q)$(MAKE) $(clean)=$(patsubst _clean_%,%,$@) - +clean-dirs := $(KBUILD_EXTMOD) clean: rm-files := $(KBUILD_EXTMOD)/Module.symvers PHONY += / @@ -1664,6 +1657,11 @@ descend: $(build-dirs) $(build-dirs): prepare $(Q)$(MAKE) $(build)=$@ need-builtin=1 need-modorder=1 +clean-dirs := $(addprefix _clean_, $(clean-dirs)) +PHONY += $(clean-dirs) clean +$(clean-dirs): + $(Q)$(MAKE) $(clean)=$(patsubst _clean_%,%,$@) + clean: $(clean-dirs) $(call cmd,rmdirs) $(call cmd,rmfiles)