From patchwork Tue Feb 19 09:33:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 10819581 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 233A16CB for ; Tue, 19 Feb 2019 09:33:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 10A042B85D for ; Tue, 19 Feb 2019 09:33:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 051152C014; Tue, 19 Feb 2019 09:33:45 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8E03C2B85D for ; Tue, 19 Feb 2019 09:33:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728180AbfBSJd2 (ORCPT ); Tue, 19 Feb 2019 04:33:28 -0500 Received: from conuserg-09.nifty.com ([210.131.2.76]:52743 "EHLO conuserg-09.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728116AbfBSJd2 (ORCPT ); Tue, 19 Feb 2019 04:33:28 -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 x1J9XBkK002572; Tue, 19 Feb 2019 18:33:11 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-09.nifty.com x1J9XBkK002572 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1550568791; bh=HvvF60VcQISFTj9szcbmZ1V43ms0dB+V6d8yWP+KhJc=; h=From:To:Cc:Subject:Date:From; b=woJkBY3gNgTmTZVBCNIZlOa4za9glgTvi90k465n5OoQRqtYYZMH7V4hk+lKWOwbz /ilk9kK4N5n9hfEaPxfagugnF0eDtDEHpgdxGwUBD7HPedVNbrbZRAsV9hhAyUN+FR MFAznGGAtIc5TxDPkQ2xGgcGTP1yethh1lkLqo+lU4EjYymavxQb78KcHzA6Q92+aZ qzynSDziCPKAS27c+U0egQR6aibPiloCaBNVuOtIkT5VflqbGw4ZZgAh+jAWA8+aux IOkl3nNNaqx5GY8pgEtQum3EC/TPCdVr/eJnCrVYWP5mY8Yqu0zFiyT6/BwVdlR9R8 Ts0S4iXkICFtg== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Kieran Bingham , Masahiro Yamada , Michal Marek , Heiko Carstens , linux-kernel@vger.kernel.org Subject: [PATCH 1/5] scripts/gdb: delay generation of gdb constants.py Date: Tue, 19 Feb 2019 18:33:02 +0900 Message-Id: <1550568787-18710-1-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP scripts/gdb/linux/constants.py is never used in the kernel build process. There is no good reason to create it so early. Get it out of the 'prepare' stage. Signed-off-by: Masahiro Yamada Reviewed-by: Kieran Bingham --- Kbuild | 10 ---------- Makefile | 11 +++++++++++ 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/Kbuild b/Kbuild index 65db5be..4cebcc7 100644 --- a/Kbuild +++ b/Kbuild @@ -6,7 +6,6 @@ # 2) Generate timeconst.h # 3) Generate asm-offsets.h (may need bounds.h and timeconst.h) # 4) Check for missing system calls -# 5) Generate constants.py (may need bounds.h) ##### # 1) Generate bounds.h @@ -58,14 +57,5 @@ quiet_cmd_syscalls = CALL $< missing-syscalls: scripts/checksyscalls.sh $(offsets-file) FORCE $(call cmd,syscalls) -##### -# 5) Generate constants for Python GDB integration -# - -extra-$(CONFIG_GDB_SCRIPTS) += build_constants_py - -build_constants_py: $(timeconst-file) $(bounds-file) - @$(MAKE) $(build)=scripts/gdb/linux $@ - # Keep these three files during make clean no-clean-files := $(bounds-file) $(offsets-file) $(timeconst-file) diff --git a/Makefile b/Makefile index 88db36b..26dbcb7 100644 --- a/Makefile +++ b/Makefile @@ -1513,6 +1513,17 @@ PHONY += $(DOC_TARGETS) $(DOC_TARGETS): scripts_basic FORCE $(Q)$(MAKE) $(build)=Documentation $@ +# Misc +# --------------------------------------------------------------------------- + +PHONY += scripts_gdb +scripts_gdb: prepare + $(Q)$(MAKE) $(build)=scripts/gdb/linux build_constants_py + +ifdef CONFIG_GDB_SCRIPTS +all: scripts_gdb +endif + else # KBUILD_EXTMOD ### From patchwork Tue Feb 19 09:33:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 10819577 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id F080913B5 for ; Tue, 19 Feb 2019 09:33:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DE4FD2B85D for ; Tue, 19 Feb 2019 09:33:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D224D2C014; Tue, 19 Feb 2019 09:33:29 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7E7EE2B85D for ; Tue, 19 Feb 2019 09:33:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728184AbfBSJd2 (ORCPT ); Tue, 19 Feb 2019 04:33:28 -0500 Received: from conuserg-09.nifty.com ([210.131.2.76]:52740 "EHLO conuserg-09.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725767AbfBSJd2 (ORCPT ); Tue, 19 Feb 2019 04:33:28 -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 x1J9XBkL002572; Tue, 19 Feb 2019 18:33:11 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-09.nifty.com x1J9XBkL002572 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1550568792; bh=XdRtcC+1Mcw++lGM+PLPkwfGmBgVfh6AWmRhE8986rg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hEvMmmB5m3NMDEiB7kr23gwULh9WWUEQ+qWbY7PSU1maiy2Y9xWdHdGYBMd28loWD p+UabPfvYnqp8TQXQfVP9ldu3U7Nz+R6kWLNLfAMHCYBLVq8EH9w8ZYS2AQLA68QZY mTVn8M2l7W9zNlTP/6r1AhvteyXO1k74GyxRJl8HhIZfzg4vHI+Y3WFgVm5lvbjyg+ p1u7xjuz6UoJn1ZV7NqZORWBFnfozk7MgbSshQ/D35Mr51aPQX8RdkRe3VvtbBU9wg zQ5vvHS2NXrkW4UcTNX7j1SC3LpfzQTXZxDIpibFUbXrmsudBAaHFvfthA6Cz8Qw35 7yfII6F+PvTRQ== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Kieran Bingham , Masahiro Yamada , Heiko Carstens , linux-kernel@vger.kernel.org Subject: [PATCH 2/5] kbuild: remove unimportant comments from ./Kbuild Date: Tue, 19 Feb 2019 18:33:03 +0900 Message-Id: <1550568787-18710-2-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-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Every time we add/remove a target, we need to touch the header part, including renumbering. This is not so important information. Numbering targets is rather misleading because they are not necessarily generated in this order. For example, 1) and 2) can be executed simultaneously when the -j option is given. Signed-off-by: Masahiro Yamada Reviewed-by: Kieran Bingham --- Kbuild | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/Kbuild b/Kbuild index 4cebcc7..a07bbd6 100644 --- a/Kbuild +++ b/Kbuild @@ -1,14 +1,9 @@ # SPDX-License-Identifier: GPL-2.0 # # Kbuild for top-level directory of the kernel -# This file takes care of the following: -# 1) Generate bounds.h -# 2) Generate timeconst.h -# 3) Generate asm-offsets.h (may need bounds.h and timeconst.h) -# 4) Check for missing system calls ##### -# 1) Generate bounds.h +# Generate bounds.h bounds-file := include/generated/bounds.h @@ -19,7 +14,7 @@ $(bounds-file): kernel/bounds.s FORCE $(call filechk,offsets,__LINUX_BOUNDS_H__) ##### -# 2) Generate timeconst.h +# Generate timeconst.h timeconst-file := include/generated/timeconst.h @@ -31,8 +26,7 @@ $(timeconst-file): kernel/time/timeconst.bc FORCE $(call filechk,gentimeconst) ##### -# 3) Generate asm-offsets.h -# +# Generate asm-offsets.h offsets-file := include/generated/asm-offsets.h @@ -45,8 +39,7 @@ $(offsets-file): arch/$(SRCARCH)/kernel/asm-offsets.s FORCE $(call filechk,offsets,__ASM_OFFSETS_H__) ##### -# 4) Check for missing system calls -# +# Check for missing system calls always += missing-syscalls targets += missing-syscalls From patchwork Tue Feb 19 09:33:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 10819583 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8826C1805 for ; Tue, 19 Feb 2019 09:33:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 766D72B85D for ; Tue, 19 Feb 2019 09:33:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6B0652BFFE; Tue, 19 Feb 2019 09:33:45 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1269C2C020 for ; Tue, 19 Feb 2019 09:33:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728202AbfBSJdo (ORCPT ); Tue, 19 Feb 2019 04:33:44 -0500 Received: from conuserg-09.nifty.com ([210.131.2.76]:53209 "EHLO conuserg-09.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726969AbfBSJdo (ORCPT ); Tue, 19 Feb 2019 04:33:44 -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 x1J9XBkM002572; Tue, 19 Feb 2019 18:33:12 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-09.nifty.com x1J9XBkM002572 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1550568792; bh=LpVzcmMvxAwWbg6InvMN4itJqp0PH2zyJ5T3ksV7i4k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tcmWlt0YrbAbfQcvzqsVEym5Ev6XG7pQYx+bxUitf2wUusx3Koem9zJVWSybCa68k 5qRJhxnDq9KJd4k17ANUWC64q1kNPGE/+rRSEah+jVPexeFlO9Zd+j16z/botu1L++ xAYI2s7vJZLg87W3eJywNrLvJstlRn2RXgwiltTtbBXsXUhr20vRUUDGuD+XYqEHPP r+S4xsWLb1cxdzEX0UeTOZR8PzWCN5HP8X5viBZt3A125IvuQH+8wsF9o0iw03qi5B 8vuSgfw4QM3NOj2uzcexOl2Cl2Lge6kvDC1ebFZmiyjfHRM3wnWq+cWrkp2rF22lv0 XDoJkg1HaHoQg== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Kieran Bingham , Masahiro Yamada , linux-kernel@vger.kernel.org, Michal Marek , Jan Kiszka Subject: [PATCH 3/5] scripts/gdb: do not descend into scripts/gdb from scripts Date: Tue, 19 Feb 2019 18:33:04 +0900 Message-Id: <1550568787-18710-3-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-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Currently, Kbuild descends from scripts/Makefile to scripts/gdb/Makefile just for creating symbolic links, but it does not need to do it so early. Merge the two descending paths to simplify the code. Signed-off-by: Masahiro Yamada Reviewed-by: Kieran Bingham --- Makefile | 2 +- scripts/Makefile | 3 +-- scripts/gdb/linux/Makefile | 9 +++------ 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index 26dbcb7..a5762c6 100644 --- a/Makefile +++ b/Makefile @@ -1518,7 +1518,7 @@ $(DOC_TARGETS): scripts_basic FORCE PHONY += scripts_gdb scripts_gdb: prepare - $(Q)$(MAKE) $(build)=scripts/gdb/linux build_constants_py + $(Q)$(MAKE) $(build)=scripts/gdb ifdef CONFIG_GDB_SCRIPTS all: scripts_gdb diff --git a/scripts/Makefile b/scripts/Makefile index feb1f71..9d442ee 100644 --- a/scripts/Makefile +++ b/scripts/Makefile @@ -39,7 +39,6 @@ build_unifdef: $(obj)/unifdef subdir-$(CONFIG_GCC_PLUGINS) += gcc-plugins subdir-$(CONFIG_MODVERSIONS) += genksyms subdir-$(CONFIG_SECURITY_SELINUX) += selinux -subdir-$(CONFIG_GDB_SCRIPTS) += gdb # Let clean descend into subdirs -subdir- += basic dtc kconfig mod package +subdir- += basic dtc gdb kconfig mod package diff --git a/scripts/gdb/linux/Makefile b/scripts/gdb/linux/Makefile index aba23be..7545806 100644 --- a/scripts/gdb/linux/Makefile +++ b/scripts/gdb/linux/Makefile @@ -14,11 +14,8 @@ quiet_cmd_gen_constants_py = GEN $@ $(CPP) -E -x c -P $(c_flags) $< > $@ ;\ sed -i '1,//d;' $@ -targets += constants.py -$(obj)/constants.py: $(SRCTREE)/$(obj)/constants.py.in FORCE +extra-y += constants.py +$(obj)/constants.py: $(src)/constants.py.in FORCE $(call if_changed_dep,gen_constants_py) -build_constants_py: $(obj)/constants.py - @: - -clean-files := *.pyc *.pyo $(if $(KBUILD_SRC),*.py) $(obj)/constants.py +clean-files := *.pyc *.pyo $(if $(KBUILD_SRC),*.py) From patchwork Tue Feb 19 09:33: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: 10819575 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 79B5413B5 for ; Tue, 19 Feb 2019 09:33:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 676B92B85D for ; Tue, 19 Feb 2019 09:33:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 58FBC2C014; Tue, 19 Feb 2019 09:33:26 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CB3B52B85D for ; Tue, 19 Feb 2019 09:33:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727321AbfBSJdZ (ORCPT ); Tue, 19 Feb 2019 04:33:25 -0500 Received: from conuserg-09.nifty.com ([210.131.2.76]:52670 "EHLO conuserg-09.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725767AbfBSJdZ (ORCPT ); Tue, 19 Feb 2019 04:33:25 -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 x1J9XBkN002572; Tue, 19 Feb 2019 18:33:13 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-09.nifty.com x1J9XBkN002572 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1550568793; bh=7gGXpYHokVbBLif6nFDQjQ8PsczV06ea6Pz4i46Teys=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NBtDSjoaKI9YCnanZOAMfXNl7l+Krp0LfVGtm2Nx1oIoWIy83i0AA+zYPonFcriDR wqemtThqdUEfaUHh4RG7mxtORkPOI7GfBL13sgTAVNobW0hVSjOor8AYo4jpP0ktq4 zin/vnfEuEhsz034eFCYk6anhtQ+UsVmIkwrpqppIYrvjhGZ+iVUK/79ifzoa2zKHn fkS2Jd6NLFKvQc133jTVulKaee5ltE1wXgFQ/TaynGI9klzbdBRRlwmLGxsra8UHO4 4Q8cVCkFx3s6bP5KxduKezmIPR51qe021OZEugZoFHe55fUnijzJEdhpifhUe92Due wmHqbJXU608Pg== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Kieran Bingham , Masahiro Yamada , Michal Marek , linux-kernel@vger.kernel.org Subject: [PATCH 4/5] kbuild: create symlink to vmlinux-gdb.py in scripts_gdb target Date: Tue, 19 Feb 2019 18:33:05 +0900 Message-Id: <1550568787-18710-4-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-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP It is weird to create gdb stuff as a side-effect of vmlinux. Move it to a more relevant place. Signed-off-by: Masahiro Yamada Reviewed-by: Kieran Bingham --- Makefile | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Makefile b/Makefile index a5762c6..0459260 100644 --- a/Makefile +++ b/Makefile @@ -1015,9 +1015,6 @@ cmd_link-vmlinux = \ $(if $(ARCH_POSTLINK), $(MAKE) -f $(ARCH_POSTLINK) $@, true) vmlinux: scripts/link-vmlinux.sh autoksyms_recursive $(vmlinux-deps) FORCE -ifdef CONFIG_GDB_SCRIPTS - $(Q)ln -fsn $(abspath $(srctree)/scripts/gdb/vmlinux-gdb.py) -endif +$(call if_changed,link-vmlinux) targets := vmlinux @@ -1519,6 +1516,7 @@ $(DOC_TARGETS): scripts_basic FORCE PHONY += scripts_gdb scripts_gdb: prepare $(Q)$(MAKE) $(build)=scripts/gdb + $(Q)ln -fsn $(abspath $(srctree)/scripts/gdb/vmlinux-gdb.py) ifdef CONFIG_GDB_SCRIPTS all: scripts_gdb 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: 10819579 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6FC096CB for ; Tue, 19 Feb 2019 09:33:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5E3CF2B85D for ; Tue, 19 Feb 2019 09:33:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 523B02C014; Tue, 19 Feb 2019 09:33:42 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D91652B85D for ; Tue, 19 Feb 2019 09:33:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725767AbfBSJdf (ORCPT ); Tue, 19 Feb 2019 04:33:35 -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-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Reviewed-by: Kieran Bingham --- 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