Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp3340778imj; Tue, 19 Feb 2019 01:35:39 -0800 (PST) X-Google-Smtp-Source: AHgI3IbN4o6q3lMFt8vUPYy622Vdih+tjbnM3vz/bTSoNmF86akH8rHGv3SrYiTJuT6ltpLrS3WR X-Received: by 2002:a17:902:b784:: with SMTP id e4mr18401601pls.308.1550568939814; Tue, 19 Feb 2019 01:35:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550568939; cv=none; d=google.com; s=arc-20160816; b=MhuSGlaQq95hDhRyFi07OPVxZKI5nJGrwD2vERAF/emgW0YxHvI0VA8fr5QmNmpWqR BaU0J0+HDrHEaqbsfPh1EjWwA9I6KSyGWv1tLk4wvQ6CdQkdjjl7NABb3T2Z0Jcrrv+N q3EACAyor+x6/E6lIbQCrd+EAH7rXBx+lYJQZx6zahO6svPImAgyl2kSvXch/GK8gWfD 5yGvSrQDe++T05Vojz8HyFFA8DC/HcL6yjme5tvhnHKBYKcExflxCLu35qjpj6Wa8el6 4dTc1PEXlXyBE1cnn7jr8esdBJ/CabVO0Mi8YLBvqbLQ0XJQmFr1SZnMkmPMu98FUOuT sX8A== 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 a95si16814057pla.401.2019.02.19.01.35.23; Tue, 19 Feb 2019 01:35: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 S1728298AbfBSJdh (ORCPT + 99 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(-) 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 -- 2.7.4