kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
From: greg@kroah.com (Greg KH)
To: kernelnewbies@lists.kernelnewbies.org
Subject: Out-of-tree module build in a dedicated build directory.
Date: Thu, 15 Mar 2018 14:00:48 +0100	[thread overview]
Message-ID: <20180315130048.GA6347@kroah.com> (raw)
In-Reply-To: <CAA181px=nR67+pijfjmKRjgCFdBQTKzDE-6gb79kopVT-hp2rA@mail.gmail.com>

On Thu, Mar 15, 2018 at 01:14:57PM +0100, Aleksei Fedotov wrote:
> Hello,
> 
> I have a question regarding building of out-of-tree kernel modules in
> separate build directory.
> 
> I have a source tree containing two out-of-tree kernel modules which is spread
> in two directories, module1 and module2. The build produces two independent
> modules: module1.ko and module2.ko.
> 
> $ tree --charset=ascii
> .
> |-- Kbuild
> |-- module1
> |   |-- Kbuild
> |   `-- task1.c
> `-- module2
>     |-- Kbuild
>     `-- task2.c
> 
> The root Kbuild points on sub-directories where the actual modules are located:
> 
> $ cat Kbuild
> obj-y += module1/
> obj-y += module2/
> 
> I want to use a dedicated build directory, so I could build the same set of
> sources for different platforms (ARM and x86).
> 
> It looks like passing O= or KBUILD_OUTPUT= doesn't work for out of tree modules.

It doesn't?  It should, what is the result when you try to do that?

And do you have a pointer to your Makefile, perhaps you are doing
something "wrong" in it?

thanks,

greg k-h

  reply	other threads:[~2018-03-15 13:00 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-15 12:14 Out-of-tree module build in a dedicated build directory Aleksei Fedotov
2018-03-15 13:00 ` Greg KH [this message]
2018-03-15 13:33   ` Aleksei Fedotov
2018-03-15 13:36     ` Denis Kirjanov
2018-03-15 14:01     ` Greg KH
2018-03-15 14:36       ` Aleksei Fedotov
2018-03-15 14:52         ` Aruna Hewapathirane
2018-03-15 15:27           ` Aruna Hewapathirane
2018-03-15 16:26             ` Greg KH
2018-03-15 16:39               ` Aleksei Fedotov
2018-03-15 17:14                 ` Greg KH
2018-03-15 18:58                 ` Aruna Hewapathirane

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=20180315130048.GA6347@kroah.com \
    --to=greg@kroah.com \
    --cc=kernelnewbies@lists.kernelnewbies.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).