From nobody Sun May 5 18:34:36 2024 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3D2EEC6FD1F for ; Sat, 25 Mar 2023 06:28:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232319AbjCYG2h (ORCPT ); Sat, 25 Mar 2023 02:28:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50254 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231308AbjCYG2e (ORCPT ); Sat, 25 Mar 2023 02:28:34 -0400 X-Greylist: delayed 122 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Fri, 24 Mar 2023 23:28:32 PDT Received: from outboundhk.mxmail.xiaomi.com (outboundhk.mxmail.xiaomi.com [207.226.244.122]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id D235D13D44 for ; Fri, 24 Mar 2023 23:28:32 -0700 (PDT) X-IronPort-AV: E=Sophos;i="5.97,212,1669046400"; d="scan'208,223";a="72235275" Received: from hk-mbx02.mioffice.cn (HELO xiaomi.com) ([10.56.8.122]) by outboundhk.mxmail.xiaomi.com with ESMTP; 25 Mar 2023 14:25:20 +0800 Received: from BJ-MBX16.mioffice.cn (10.237.8.136) by HK-MBX02.mioffice.cn (10.56.8.122) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Sat, 25 Mar 2023 14:25:20 +0800 Received: from BJ-MBX14.mioffice.cn (10.237.8.134) by BJ-MBX16.mioffice.cn (10.237.8.136) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Sat, 25 Mar 2023 14:25:19 +0800 Received: from BJ-MBX14.mioffice.cn ([fe80::6818:35a6:e09:60fa]) by BJ-MBX14.mioffice.cn ([fe80::6818:35a6:e09:60fa%9]) with mapi id 15.02.0986.041; Sat, 25 Mar 2023 14:25:19 +0800 From: =?gb2312?B?1Ky9qMX0?= To: masahiroy , nathan , ndesaulniers , nicolas , linux-kbuild CC: linux-kernel Subject: [PATCH] kbuild: support external module out-of-tree build Thread-Topic: [PATCH] kbuild: support external module out-of-tree build Thread-Index: AQHZXuHovkJw/vrxJEqawHIlFohm/A== Date: Sat, 25 Mar 2023 06:25:19 +0000 Message-ID: Accept-Language: zh-CN, en-US Content-Language: zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [10.237.8.11] Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From 205af45582ad0cb1293839a95ee01d383f1cfbf1 Mon Sep 17 00:00:00 2001 From: Yuan Jianpeng Date: Sat, 25 Mar 2023 10:24:38 +0800 Subject: [PATCH] kbuild: support external module out-of-tree build A new module build variable KBUILD_EXTMOD_SRC is added which specifying the external module source path. Build like this: make -C $KDIR M=3D KBUILD_EXTMOD_SRC=3D Signed-off-by: Yuan Jianpeng --- scripts/Makefile.build | 2 +- scripts/Makefile.clean | 2 +- scripts/Makefile.modpost | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/Makefile.build b/scripts/Makefile.build index 76323201232a..971a2161d502 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build @@ -3,7 +3,7 @@ # Building # =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D -src :=3D $(obj) +src :=3D $(if $(KBUILD_EXTMOD_SRC),$(KBUILD_EXTMOD_SRC)$(patsubst $(KBUILD= _EXTMOD)%,%,$(obj)),$(obj)) PHONY :=3D $(obj)/ $(obj)/: diff --git a/scripts/Makefile.clean b/scripts/Makefile.clean index 3649900696dd..5232a0b6e139 100644 --- a/scripts/Makefile.clean +++ b/scripts/Makefile.clean @@ -3,7 +3,7 @@ # Cleaning up # =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D -src :=3D $(obj) +src :=3D $(if $(KBUILD_EXTMOD_SRC),$(KBUILD_EXTMOD_SRC)$(patsubst $(KBUILD= _EXTMOD)%,%,$(obj)),$(obj)) PHONY :=3D __clean __clean: diff --git a/scripts/Makefile.modpost b/scripts/Makefile.modpost index 0980c58d8afc..3f0b23157c68 100644 --- a/scripts/Makefile.modpost +++ b/scripts/Makefile.modpost @@ -103,7 +103,7 @@ else # set src + obj - they may be used in the modules's Makefile obj :=3D $(KBUILD_EXTMOD) -src :=3D $(obj) +src :=3D $(if $(KBUILD_EXTMOD_SRC),$(KBUILD_EXTMOD_SRC)$(patsubst $(KBUILD= _EXTMOD)%,%,$(obj)),$(obj)) # Include the module's Makefile to find KBUILD_EXTRA_SYMBOLS include $(kbuild-file) -- 2.38.1 #/******=E6=9C=AC=E9=82=AE=E4=BB=B6=E5=8F=8A=E5=85=B6=E9=99=84=E4=BB=B6=E5= =90=AB=E6=9C=89=E5=B0=8F=E7=B1=B3=E5=85=AC=E5=8F=B8=E7=9A=84=E4=BF=9D=E5=AF= =86=E4=BF=A1=E6=81=AF=EF=BC=8C=E4=BB=85=E9=99=90=E4=BA=8E=E5=8F=91=E9=80=81= =E7=BB=99=E4=B8=8A=E9=9D=A2=E5=9C=B0=E5=9D=80=E4=B8=AD=E5=88=97=E5=87=BA=E7= =9A=84=E4=B8=AA=E4=BA=BA=E6=88=96=E7=BE=A4=E7=BB=84=E3=80=82=E7=A6=81=E6=AD= =A2=E4=BB=BB=E4=BD=95=E5=85=B6=E4=BB=96=E4=BA=BA=E4=BB=A5=E4=BB=BB=E4=BD=95= =E5=BD=A2=E5=BC=8F=E4=BD=BF=E7=94=A8=EF=BC=88=E5=8C=85=E6=8B=AC=E4=BD=86=E4= =B8=8D=E9=99=90=E4=BA=8E=E5=85=A8=E9=83=A8=E6=88=96=E9=83=A8=E5=88=86=E5=9C= =B0=E6=B3=84=E9=9C=B2=E3=80=81=E5=A4=8D=E5=88=B6=E3=80=81=E6=88=96=E6=95=A3= =E5=8F=91=EF=BC=89=E6=9C=AC=E9=82=AE=E4=BB=B6=E4=B8=AD=E7=9A=84=E4=BF=A1=E6= =81=AF=E3=80=82=E5=A6=82=E6=9E=9C=E6=82=A8=E9=94=99=E6=94=B6=E4=BA=86=E6=9C= =AC=E9=82=AE=E4=BB=B6=EF=BC=8C=E8=AF=B7=E6=82=A8=E7=AB=8B=E5=8D=B3=E7=94=B5= =E8=AF=9D=E6=88=96=E9=82=AE=E4=BB=B6=E9=80=9A=E7=9F=A5=E5=8F=91=E4=BB=B6=E4= =BA=BA=E5=B9=B6=E5=88=A0=E9=99=A4=E6=9C=AC=E9=82=AE=E4=BB=B6=EF=BC=81 This = e-mail and its attachments contain confidential information from XIAOMI, wh= ich is intended only for the person or entity whose address is listed above= . Any use of the information contained herein in any way (including, but no= t limited to, total or partial disclosure, reproduction, or dissemination) = by persons other than the intended recipient(s) is prohibited. If you recei= ve this e-mail in error, please notify the sender by phone or email immedia= tely and delete it!******/#