linux-kbuild.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sam Ravnborg <sam@ravnborg.org>
To: Tomi Valkeinen <tomi.valkeinen@ti.com>
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 21:46:38 +0100	[thread overview]
Message-ID: <20151210204638.GA32218@ravnborg.org> (raw)
In-Reply-To: <56692D6D.6060607@ti.com>

On Thu, Dec 10, 2015 at 09:44:45AM +0200, Tomi Valkeinen wrote:
> 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.
The extra config symbol is the most elegant solution here IMO.
Make sure to document that this config symbol enables the boot-time
setup stuff.

	Sam

  reply	other threads:[~2015-12-10 20:46 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
2015-12-10 20:46     ` Sam Ravnborg [this message]
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=20151210204638.GA32218@ravnborg.org \
    --to=sam@ravnborg.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=mmarek@suse.com \
    --cc=tomi.valkeinen@ti.com \
    /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).