From patchwork Tue Feb 19 09:33:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 158708 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp3451116jaa; Tue, 19 Feb 2019 01:33:39 -0800 (PST) X-Google-Smtp-Source: AHgI3IZ2W2ghsVL7OCx2WAPFaSyJqVJDmWcldpqiFyUVeJZHbMHFN5i6nXgp1PEyvapCufQ0VGif X-Received: by 2002:a65:65c9:: with SMTP id y9mr23634530pgv.438.1550568819859; Tue, 19 Feb 2019 01:33:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550568819; cv=none; d=google.com; s=arc-20160816; b=SGTlrmarsBsQIEooW19kph3cQfzYEt1nSdPa65umI8FiSkWsVf4djvzKFh/g5G4PnE ReQskWthmeZGZKQFHSoX7puptSXxeI9wqaRtOPwYLTQ7Tfqal7j5oQcFt8NQUJCt7QqZ BLDDYUTqdXRrSSaev4n/QtDU3OTwK+cIBIQoEXtByCvxc2yfoDBReLEGUX5XRl6Q/U3C o5IcMMNrZZHfnAp/e0SEuBbLmThSdLMbDrTtR8ziz08EE+uS8PP8YODF1w1Zh/2nQm6v OfGPppUHRpwkhDjHKYgDAZ/uiXDnh4LfSJOC1klP+Sa/vq3bBXgWgjCkmtfis0M4qORH 6Jpw== 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=6wrERf29hesZXgquMmrDWBzvVksZP5BU5OXJ1r+sURQ=; b=eU1h+kkDFLAYoOWK0+sbcEbPq4+MqFSUC+JkGVfSa7RvZk4Gb+D3Gbw9OWK0RcRTfP i27pHxs6RzSpiBL0flyxHW9j+MsN9LGFSPZawaOHs1xvqO519/4rHPsEbD2dSqKq9mTb G3PbfFPylEPjTSQtWabJTFy3souhYVHlIY1C3UgdNat0HpdvGnew6p9i4+6M8mgwslss dnAG8D1smQXAtrzkL5bQ9QvdrmRQLY7kaOtwZ3WOZ9UWSxmz9Qx72vAgREStOYqW1qf/ NtK1JL4v3TZjiRuIG1l068UNoIfAa9mM3l/dyS651tQK6y1oxXPrO34bOaanoArspQdQ L5EQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=U2L+ckxP; 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 s2si15669174plp.380.2019.02.19.01.33.39; Tue, 19 Feb 2019 01:33:39 -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=U2L+ckxP; 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 S1728303AbfBSJdh (ORCPT + 32 others); Tue, 19 Feb 2019 04:33:37 -0500 Received: from conuserg-09.nifty.com ([210.131.2.76]:52939 "EHLO conuserg-09.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725763AbfBSJdf (ORCPT ); Tue, 19 Feb 2019 04:33:35 -0500 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-09.nifty.com with ESMTP id x1J9XBkO002572; Tue, 19 Feb 2019 18:33:13 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-09.nifty.com x1J9XBkO002572 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1550568794; bh=6wrERf29hesZXgquMmrDWBzvVksZP5BU5OXJ1r+sURQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=U2L+ckxPzqR3/OKKx4x8xdvNNP0cs6m2bw/kKVa2BlY57bgG4qKLLa+cmOplneZAr bXv25/29kCDxo1dANx4lQJqloag4X0haUF3BAM/ZnEk9dRR5thhbHvJyUCCmWWX5s3 zFYkNXZJXMfBGO1ONrNq6QCmvL2imiBAZZR0gsKYmTmRuJPWz0OE4QFIsg2RoqPnzK 8x0QzJ9ooPaHLLS+/08WQAn3NYzd+lJSfjS4PiXN9Aj5CC8ShgYiEZDZ0+TyTX+uG+ IUEkI+TibQhR/mvemANw9KJWokorKgyy+eTV9uks8WYi6ZhKsWAyoaASAxghlAQzg/ KFOUidpbpdfJQ== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Kieran Bingham , Masahiro Yamada , Jan Kiszka , linux-kernel@vger.kernel.org Subject: [PATCH 5/5] scripts/gdb: refactor rules for symlink creation Date: Tue, 19 Feb 2019 18:33:06 +0900 Message-Id: <1550568787-18710-5-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1550568787-18710-1-git-send-email-yamada.masahiro@socionext.com> References: <1550568787-18710-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 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(-) -- 2.7.4 Reviewed-by: Kieran Bingham 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