From patchwork Tue Dec 11 12:01:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 10723703 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 3C0D113AF for ; Tue, 11 Dec 2018 12:02:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2D85B2A2DC for ; Tue, 11 Dec 2018 12:02:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1E4292A04C; Tue, 11 Dec 2018 12:02:23 +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 BB9C32A04C for ; Tue, 11 Dec 2018 12:02:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726470AbeLKMCL (ORCPT ); Tue, 11 Dec 2018 07:02:11 -0500 Received: from conuserg-08.nifty.com ([210.131.2.75]:34041 "EHLO conuserg-08.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726400AbeLKMCL (ORCPT ); Tue, 11 Dec 2018 07:02:11 -0500 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-08.nifty.com with ESMTP id wBBC1w9Z007779; Tue, 11 Dec 2018 21:02:00 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-08.nifty.com wBBC1w9Z007779 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1544529721; bh=VY6PS7A6EyULkYhFUtP89rFGqR6EiqSvhhdTmpWHtDk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AbzUkXpt5AmZw+OJoOEqKY4bbw5I5vvZmwyI0EwanhUct+XIGOlAwH1Ixw+KZkJeE WGp8b5A+Tdo6WipryQjXY3qXwVCotwppQVYv3Et5Rgff5bhoQtN3qlC9g8AC75c34h u+ampOWy/WFByNkDAD9db7dzKzVtI++ZOwdBCUpS9DaugJmHygnAc2z5pPaMpsM85P dV54uPQ3Q9SpGxwnDJDf/c1qSPjltZ3+hO8IwgK9Y3s394a8bBnIqVGAu3f49ZPc7T a2NVy2f9dfATSwSUtRbSSvib01P+mjC4bTmROvHz/N2ZZl+nhPVLaquIMUOa+jdWlp LoSf22sah5qWA== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Masahiro Yamada , Michal Marek , linux-kernel@vger.kernel.org Subject: [PATCH 3/4] kbuild: refactor part-of-module Date: Tue, 11 Dec 2018 21:01:55 +0900 Message-Id: <1544529716-4917-3-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1544529716-4917-1-git-send-email-yamada.masahiro@socionext.com> References: <1544529716-4917-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 Use $(foreach ...) to make it shorter. Signed-off-by: Masahiro Yamada --- scripts/Makefile.build | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/scripts/Makefile.build b/scripts/Makefile.build index f26ae45..321b5b7 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build @@ -94,17 +94,15 @@ endif # --------------------------------------------------------------------------- # Default is built-in, unless we know otherwise +$(foreach x, i lst o s, $(patsubst %.o,%.$(x),$(real-obj-m))): \ + part-of-module := y + modkern_cflags = \ $(if $(part-of-module), \ $(KBUILD_CFLAGS_MODULE) $(CFLAGS_MODULE), \ $(KBUILD_CFLAGS_KERNEL) $(CFLAGS_KERNEL)) quiet_modtag = $(if $(part-of-module),[M], ) -$(real-obj-m) : part-of-module := y -$(real-obj-m:.o=.i) : part-of-module := y -$(real-obj-m:.o=.s) : part-of-module := y -$(real-obj-m:.o=.lst): part-of-module := y - quiet_cmd_cc_s_c = CC $(quiet_modtag) $@ cmd_cc_s_c = $(CC) $(c_flags) $(DISABLE_LTO) -fverbose-asm -S -o $@ $<