From: Tomi Valkeinen <tomi.valkeinen@ti.com>
To: Sam Ravnborg <sam@ravnborg.org>
Cc: Michal Marek <mmarek@suse.com>, linux-kbuild@vger.kernel.org
Subject: Re: Behaviour of kernel makefiles when entering a subdir using a config symbol = m
Date: Thu, 10 Dec 2015 09:44:45 +0200 [thread overview]
Message-ID: <56692D6D.6060607@ti.com> (raw)
In-Reply-To: <20151209213255.GA11031@ravnborg.org>
[-- Attachment #1: Type: text/plain, Size: 1329 bytes --]
Hi Sam,
On 09/12/15 23:32, Sam Ravnborg wrote:
> kbuild may enter a sub directory for two purposes:
> 1) to build object files to be part of the final image
> Only subdirs specified using obj-y is visited.
>
> 2) to build object files that will be included in a module
> Subdirs specified with obj-y and obj-m is visited
>
> Since you have the following code in your Makefile:
>
> obj-m += foo/
>
> then foo/ is only visited to build modules.
>
> So bar.o is built but is NOT included in the final image.
> This is also the behaviour you see.
Right.
We have three drivers (one fbdev, two drm), each of which can be built
as a module. But each of them also may require small boot-time setup,
which needs to be built-in.
I can get around the problem by entering the dir with obj-y, or by
creating a new extra config define which is y/n, and using that in the
makefile. The former makes make enter the dir even if the driver is not
enabled, and latter creates a config symbol only to solve this problem.
So I'd rather use the normal obj-$(CONFIG_MYDRIVER), as that's used by
all the fbdev and drm drivers, and (to me) makes most sense.
Is the purpose of the current behaviour to speed up the build when
compiling only the modules? Or why does it behave that way?
Tomi
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
next prev parent reply other threads:[~2015-12-10 7:44 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-09 18:25 Behaviour of kernel makefiles when entering a subdir using a config symbol = m Tomi Valkeinen
2015-12-09 21:32 ` Sam Ravnborg
2015-12-10 7:44 ` Tomi Valkeinen [this message]
2015-12-10 20:46 ` Sam Ravnborg
2015-12-11 9:31 ` Michal Marek
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=56692D6D.6060607@ti.com \
--to=tomi.valkeinen@ti.com \
--cc=linux-kbuild@vger.kernel.org \
--cc=mmarek@suse.com \
--cc=sam@ravnborg.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).