From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750904AbdHLKod (ORCPT ); Sat, 12 Aug 2017 06:44:33 -0400 Received: from mail.cn.fujitsu.com ([183.91.158.132]:35387 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750811AbdHLKob (ORCPT ); Sat, 12 Aug 2017 06:44:31 -0400 X-IronPort-AV: E=Sophos;i="5.41,363,1498492800"; d="scan'208";a="23372037" Subject: Re: [PATCH] fixdep: trivial: typo fix and correction To: Masahiro Yamada References: <1502198450-7374-1-git-send-email-caoj.fnst@cn.fujitsu.com> <598C64A6.2090109@cn.fujitsu.com> CC: Linux Kernel Mailing List , Linux Kbuild mailing list , Michal Marek From: Cao jin Message-ID: <598EDD4D.80204@cn.fujitsu.com> Date: Sat, 12 Aug 2017 18:49:49 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.167.226.69] X-yoursite-MailScanner-ID: 623F4472438E.A5637 X-yoursite-MailScanner: Found to be clean X-yoursite-MailScanner-From: caoj.fnst@cn.fujitsu.com Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 08/12/2017 07:31 AM, Masahiro Yamada wrote: > Hi. > > 2017-08-10 22:50 GMT+09:00 Cao jin : >> Hi Masahiro-san >> >> On 08/10/2017 12:05 AM, Masahiro Yamada wrote: >>> 2017-08-08 22:20 GMT+09:00 Cao jin : >>>> Signed-off-by: Cao jin >>> >>> Applied to linux-kbuild/fixes. Thanks! >>> >> >> I want to ask a question via this thread. >> >> I am tracing how each kernel source file compiled, and I met mounts-y in >> init/Makefile, I have trouble in finding the rule which compile >> $(mounts-y), but I clearly see the files in $(mounts-y) are compiled in >> the output of `make -n vmlinux`, but the files listed in mounts-y are >> not listed in obj-y. I think I must miss something, could you give some >> hint? >> > > > The magic is the following line: > > scripts/Makefile.lib line 55 > > # if $(foo-objs) exists, foo.o is a composite object > multi-used-y := $(sort $(foreach m,$(obj-y), $(if $(strip > $($(m:.o=-objs)) $($(m:.o=-y))), $(m)))) > > > If foo.o is added to obj-y and foo-objs or foo-y exist, > they are also expanded. > > > > > > If you see init/Makefile, mounts.o is added to obj-y. > > obj-y := main.o version.o mounts.o > > Finally figured out how $(mounts-y) is compiled and how init/mounts.o is linked, it is a bit complex than I expected, your hint really helps:) Thanks you very much, Masahiro-san. -- Sincerely, Cao jin