Received: by 10.223.185.116 with SMTP id b49csp5712446wrg; Wed, 7 Mar 2018 17:07:49 -0800 (PST) X-Google-Smtp-Source: AG47ELufx79YADp4C5nQYAWqb+DVGTqCkQZlgRwxwtN7H2FXTS7AkpLQNSiSzMn9lvlePaM5okhA X-Received: by 10.98.141.205 with SMTP id p74mr24404837pfk.211.1520471269812; Wed, 07 Mar 2018 17:07:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520471269; cv=none; d=google.com; s=arc-20160816; b=GamwCI9HVSoyutgwA40PNtrvzgwgqB+qdAlEM7kXpoJ5c4tIPYg3TJ8C8cDwR8mJV8 HIUQXwAHN2l4bncruR7yu6XNMiUaS93UamX3Wo1QiO3tLWUnM9JikP/1qH/z3KYvrESS 8G2DDZwn9UPfcVnO9yHt8GyWU/b0KYrXZIoPI5jLxbZLFQhfEcQmTdXNAjCRPpsnuATm rZj3kWbKMiXR39Fa+PIZaY9QhCAvdhe2Q+ovXkSzZFzvjPKNyMuaYCFR33voQWiXXYp7 OkaCBpl1KzM6FVy3a0FofU9/vkRnLCrSZAejfXQlW7aO+xvNidsmpXynQSXPw5xuuyFO wc3w== 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 :arc-authentication-results; bh=kPbx/GkwrVXPj2Zt+vFWBog7PgLKKWZn1LiMH0RqacQ=; b=l94uRPCAMvASOa7JE7IhM29qzrztqYtm5F1wRwl3NQi5ivtqW10wN7ilIwhzeX5lGU xrRJY9hTh7t+FAnc8BDkTowZn72d04BcCJeOcTbI9kG3DwO80/j0ZedeVMykk9lyvmMq d43Mk8iASBkLPRpz4CqsHJTz4Y7JKvhtRcp+KJkhhz1Br102unVI1Jg6qpak2Ig9cCYs Y0+nB5qOdbhnpRX4/7NCqkIbK0StEM+UfpWShaH8QYieJFEqjErUl4C2GXXE4aC+RcA2 EYykWrTUskjXn6nv2ehHhvV/EDZD5U2rWnwqjNC8IqK/bNDEoXyG5Dq+4zct4c8AIPQo D+fQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=UuRlkpGg; 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 t19-v6si13570699plo.742.2018.03.07.17.07.35; Wed, 07 Mar 2018 17:07:49 -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=UuRlkpGg; 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 S1755096AbeCHBF7 (ORCPT + 99 others); Wed, 7 Mar 2018 20:05:59 -0500 Received: from conuserg-10.nifty.com ([210.131.2.77]:60403 "EHLO conuserg-10.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754875AbeCHBF4 (ORCPT ); Wed, 7 Mar 2018 20:05:56 -0500 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-10.nifty.com with ESMTP id w28156G9018694; Thu, 8 Mar 2018 10:05:10 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-10.nifty.com w28156G9018694 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1520471110; bh=kPbx/GkwrVXPj2Zt+vFWBog7PgLKKWZn1LiMH0RqacQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UuRlkpGgWwJRjg9HYIPg6KpPAL4qm9vaQZEHeWqOxIkxe6jJ1XE6tkoa1GW8SvPeK n+hh1GeBWJQYjDPdMsjKc6rYAzR+kRJzjEp37NmiOCFlAzyFNw3d12YNbUVdkBS/+T 67ceyQSX9UTgkSwrqc0ENL+UUx7YvVM9P27cKNQ8MIhb0awRY7P3lgLoi4Q3+eLzdd MRM3ifq/b59GxPPjznwoLobwBqmR6SyJFRTKwMwAbJRhDQ5F4LmZTQmFIolXS7gR8j axlHWzEhjuvDkAhbdAQqL0Nohm6Y3hgpieDLL5u9r1CbMOFh/cgYwtvNgt8ZFm5mYW HMkHtoqXCzbGA== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Sam Ravnborg , Michal Marek , Cao jin , Govind Singh , Kalle Valo , Masahiro Yamada , linux-kernel@vger.kernel.org Subject: [PATCH 4/5] kbuild: simplify modname calculation Date: Thu, 8 Mar 2018 10:05:02 +0900 Message-Id: <1520471103-10089-5-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1520471103-10089-1-git-send-email-yamada.masahiro@socionext.com> References: <1520471103-10089-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 modname can be calculated much more simply. If modname-multi is empty, it is a single-used object. So, modname = $(basetarget). Otherwise, modname = $(modname-multi). Signed-off-by: Masahiro Yamada --- scripts/Makefile.build | 12 +----------- scripts/Makefile.lib | 7 ------- 2 files changed, 1 insertion(+), 18 deletions(-) diff --git a/scripts/Makefile.build b/scripts/Makefile.build index 4f2b25d..b8aecb7 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build @@ -131,17 +131,7 @@ $(real-objs-m:.o=.lst): quiet_modtag := [M] $(obj-m) : quiet_modtag := [M] -# Default for not multi-part modules -modname = $(basetarget) - -$(multi-objs-m) : modname = $(modname-multi) -$(multi-objs-m:.o=.i) : modname = $(modname-multi) -$(multi-objs-m:.o=.s) : modname = $(modname-multi) -$(multi-objs-m:.o=.lst) : modname = $(modname-multi) -$(multi-objs-y) : modname = $(modname-multi) -$(multi-objs-y:.o=.i) : modname = $(modname-multi) -$(multi-objs-y:.o=.s) : modname = $(modname-multi) -$(multi-objs-y:.o=.lst) : modname = $(modname-multi) +modname = $(if $(modname-multi),$(modname-multi),$(basetarget)) quiet_cmd_cc_s_c = CC $(quiet_modtag) $@ cmd_cc_s_c = $(CC) $(c_flags) $(DISABLE_LTO) -fverbose-asm -S -o $@ $< diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index 9217d40..e4e8e1b 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib @@ -47,11 +47,6 @@ multi-used-m := $(sort $(foreach m,$(obj-m), $(if $(strip $($(m:.o=-objs)) $($(m multi-used := $(multi-used-y) $(multi-used-m) single-used-m := $(sort $(filter-out $(multi-used-m),$(obj-m))) -# Build list of the parts of our composite objects, our composite -# objects depend on those (obviously) -multi-objs-y := $(foreach m, $(multi-used-y), $($(m:.o=-objs)) $($(m:.o=-y))) -multi-objs-m := $(foreach m, $(multi-used-m), $($(m:.o=-objs)) $($(m:.o=-y)) $($(m:.o=-m))) - # $(subdir-obj-y) is the list of objects in $(obj-y) which uses dir/ to # tell kbuild to descend subdir-obj-y := $(filter %/built-in.o, $(obj-y)) @@ -80,8 +75,6 @@ real-objs-m := $(addprefix $(obj)/,$(real-objs-m)) single-used-m := $(addprefix $(obj)/,$(single-used-m)) multi-used-y := $(addprefix $(obj)/,$(multi-used-y)) multi-used-m := $(addprefix $(obj)/,$(multi-used-m)) -multi-objs-y := $(addprefix $(obj)/,$(multi-objs-y)) -multi-objs-m := $(addprefix $(obj)/,$(multi-objs-m)) subdir-ym := $(addprefix $(obj)/,$(subdir-ym)) # These flags are needed for modversions and compiling, so we define them here -- 2.7.4