Received: by 2002:ac0:8845:0:0:0:0:0 with SMTP id g63csp1772882img; Wed, 27 Feb 2019 05:15:29 -0800 (PST) X-Google-Smtp-Source: AHgI3IZx6NxXAGWpsbbpa7s+ov/m45INYISJtE3Wo8AQweW9q44+oZxcB1ZPc11nOVsvaolFfmMH X-Received: by 2002:a17:902:e00d:: with SMTP id ca13mr2122689plb.206.1551273329684; Wed, 27 Feb 2019 05:15:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551273329; cv=none; d=google.com; s=arc-20160816; b=timFaRC+5T7aZpOXwofj3IFCC1N5XYNhgaAiu0nHOLQt5F6UQ0GmHeriLeOViCmn4W wLnio5sqBx/pAWXoni3saDW5Q/YUDV+zJQVlNg/QBvTlUqi2LyLg21jACakYuHjmU9WJ d1rj71RJ/xNPBz2aupAbQNaRp0a/vkOFrxYaREEK6QATiLgsRlQPMHj7UX9pkU/HEann kAvnGzzMbeLfTkYAKJBIjaKsVoztec03bcVOCXGP/OnOwUH94vA7oSUzwR/9FeJa5eXT PWfOJJ1RykA5s4uxq7ED4RDlv3D+0Ir489DIDKku5Ler0GPMG7nQrBUq8IR7AEyZb+Pc bxfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:organization:autocrypt:openpgp:from:references:cc:to :subject:reply-to:dkim-signature; bh=oDgK5A/HXYcfoHLyZxsgmKdIp6KNFQqUxiRODWJPfaI=; b=aoXDyY3kUIQOYVFuSjv0CMcEO/siOn7Mh7MOmWCa+KnGUZKFNa7dSKEAY+MlBoTBtL OnjbiyAQnoTpUc7vsPUJp2t6B0ktDfwnnPupi7bqy8uTwJlLb0HS84l1TYXZmBqp8tMg Lvn/jXDpUt/sOkgPuiCBhvbU+tATk7LK6cV0u3gmmhPHcz7a2PNwxO54YiKT9i5nPG8b kl4dL9qt5FSmNuA52K/GB92NaOCVmVNYtur4Q+Jv8fBMdvZ2a+oxbkdyEbzgjWUDybXT ctx9z5o4KCOxlaUv+dvz4ORHhSst6VvcuHDcPwC8SAycC1Pl0VowXu29Sq2MrF4jo9KA lvSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=oVKEBn6e; 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 62si12223971pla.154.2019.02.27.05.15.13; Wed, 27 Feb 2019 05:15:29 -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 (test mode) header.i=@ideasonboard.com header.s=mail header.b=oVKEBn6e; 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 S1728284AbfB0NCR (ORCPT + 99 others); Wed, 27 Feb 2019 08:02:17 -0500 Received: from perceval.ideasonboard.com ([213.167.242.64]:42228 "EHLO perceval.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725881AbfB0NCR (ORCPT ); Wed, 27 Feb 2019 08:02:17 -0500 Received: from [192.168.0.21] (cpc89242-aztw30-2-0-cust488.18-1.cable.virginm.net [86.31.129.233]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 2E2C249; Wed, 27 Feb 2019 14:02:14 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1551272534; bh=Y5iv9l/qp3ETWGeYHS/LNBQz2zkw8Sua33py/0p3CwY=; h=Reply-To:Subject:To:Cc:References:From:Date:In-Reply-To:From; b=oVKEBn6eM/RlU9ymcOjdz5GfBlVHS/kJC9VCW9ISG7UWh//cpwOQf2wj1D9bb9NgR eMnBZwc8wDzTXN+z88eE65WDWWEcJxeiDaHD3B4ws8PC2ysYwFZqxYOIj6Fjfikif7 h7EtXXOAVek5WiHXTV7gdzCuqF4xhR8BSHAu0oKI= Reply-To: kieran.bingham@ideasonboard.com Subject: Re: [PATCH 5/5] scripts/gdb: refactor rules for symlink creation To: Masahiro Yamada Cc: Linux Kbuild mailing list , Jan Kiszka , Linux Kernel Mailing List References: <1550568787-18710-1-git-send-email-yamada.masahiro@socionext.com> <1550568787-18710-5-git-send-email-yamada.masahiro@socionext.com> From: Kieran Bingham Openpgp: preference=signencrypt Autocrypt: addr=kieran.bingham@ideasonboard.com; keydata= mQINBFYE/WYBEACs1PwjMD9rgCu1hlIiUA1AXR4rv2v+BCLUq//vrX5S5bjzxKAryRf0uHat V/zwz6hiDrZuHUACDB7X8OaQcwhLaVlq6byfoBr25+hbZG7G3+5EUl9cQ7dQEdvNj6V6y/SC rRanWfelwQThCHckbobWiQJfK9n7rYNcPMq9B8e9F020LFH7Kj6YmO95ewJGgLm+idg1Kb3C potzWkXc1xmPzcQ1fvQMOfMwdS+4SNw4rY9f07Xb2K99rjMwZVDgESKIzhsDB5GY465sCsiQ cSAZRxqE49RTBq2+EQsbrQpIc8XiffAB8qexh5/QPzCmR4kJgCGeHIXBtgRj+nIkCJPZvZtf Kr2EAbc6tgg6DkAEHJb+1okosV09+0+TXywYvtEop/WUOWQ+zo+Y/OBd+8Ptgt1pDRyOBzL8 RXa8ZqRf0Mwg75D+dKntZeJHzPRJyrlfQokngAAs4PaFt6UfS+ypMAF37T6CeDArQC41V3ko lPn1yMsVD0p+6i3DPvA/GPIksDC4owjnzVX9kM8Zc5Cx+XoAN0w5Eqo4t6qEVbuettxx55gq 8K8FieAjgjMSxngo/HST8TpFeqI5nVeq0/lqtBRQKumuIqDg+Bkr4L1V/PSB6XgQcOdhtd36 O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z3ZLztFJKR3RD42VKVsrnNDKnoY0f4U0z7eJv2NeF8xHMuiU RCIzqxX1GVYaNkKTnb/Qja8hnYnkUzY1Lc+OtwiGmXTwYsPZjjAaDX35J/RSKAoy5wGo/YFA JxB1gWThL4kOTbsqqXj9GLcyOImkW0lJGGR3o/fV91Zh63S5TKnf2YGGGzxki+ADdxVQAm+Q sbsRB8KNNvVXBOVNwko86rQqF9drZuw= Organization: Ideas on Board Message-ID: Date: Wed, 27 Feb 2019 13:02:11 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Yamada-san, On 27/02/2019 12:32, Masahiro Yamada wrote: > Hi Kieran, > > > On Wed, Feb 27, 2019 at 8:56 PM Kieran Bingham > wrote: >> >> Hi Yamada-san, >> >> On 19/02/2019 09:33, Masahiro Yamada wrote: >>> gdb-scripts is not a real object, but (ab)used like a phony target. >>> >>> Rewrite the code in a more Kbuild-ish way. Add symlinks to extra-y >>> and use if_changed. >>> >>> Signed-off-by: Masahiro Yamada >>> --- >>> >>> scripts/gdb/linux/Makefile | 18 +++++++++++------- >>> 1 file changed, 11 insertions(+), 7 deletions(-) >>> >>> diff --git a/scripts/gdb/linux/Makefile b/scripts/gdb/linux/Makefile >>> index 7545806..3df395a 100644 >>> --- a/scripts/gdb/linux/Makefile >>> +++ b/scripts/gdb/linux/Makefile >>> @@ -1,13 +1,17 @@ >>> # SPDX-License-Identifier: GPL-2.0 >>> -always := gdb-scripts >>> >>> -SRCTREE := $(abspath $(srctree)) >>> - >>> -$(obj)/gdb-scripts: >>> ifneq ($(KBUILD_SRC),) >>> - $(Q)ln -fsn $(SRCTREE)/$(obj)/*.py $(objtree)/$(obj) >>> + >>> +symlinks := $(patsubst $(srctree)/$(src)/%,%,$(wildcard $(srctree)/$(src)/*.py)) >>> + >>> +quiet_cmd_symlink = SYMLINK $@ >>> + cmd_symlink = ln -fsn $(patsubst $(obj)/%,$(abspath $(srctree))/$(src)/%,$@) $@ >>> + >>> +extra-y += $(symlinks) >>> +$(addprefix $(obj)/, $(symlinks)): FORCE >>> + $(call if_changed,symlink) >>> + >>> endif >>> - @: >>> >>> quiet_cmd_gen_constants_py = GEN $@ >>> cmd_gen_constants_py = \ >>> @@ -18,4 +22,4 @@ extra-y += constants.py >>> $(obj)/constants.py: $(src)/constants.py.in FORCE >>> $(call if_changed_dep,gen_constants_py) >>> >>> -clean-files := *.pyc *.pyo $(if $(KBUILD_SRC),*.py) >>> +clean-files := *.pyc *.pyo >> >> Perhaps this answers my earlier question. >> I guess the extra-y hook is somehow handling the clean up of these files? >> >> Aha - yes, I've just found it in >> >> Documentation/kbuild/makefiles.txt: >>> === 5 Kbuild clean infrastructure >>> ... >>> Kbuild knows targets listed in $(hostprogs-y), $(hostprogs-m), $(always), $(extra-y) and $(targets). They are all deleted during "make clean". >> >> Perfect, so this is much better. > > Exactly. > > If you are interested in the real code, > see scripts/Makefile.clean > > > __clean-files := $(extra-y) $(extra-m) $(extra-) \ > $(always) $(targets) $(clean-files) \ > $(hostprogs-y) $(hostprogs-m) $(hostprogs-) \ > $(hostlibs-y) $(hostlibs-m) $(hostlibs-) \ > $(hostcxxlibs-y) $(hostcxxlibs-m) > Thank you - that makes it very clear. Thanks again for you work :) -- Kieran > >> Reviewed-by: Kieran Bingham >> >> -- >> Regards >> -- >> Kieran > > > -- Regards -- Kieran