kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
From: ydroneaud@opteya.com (Yann Droneaud)
To: kernelnewbies@lists.kernelnewbies.org
Subject: kbuild: building external module in separate output directory
Date: Wed, 13 Feb 2013 16:28:46 +0100	[thread overview]
Message-ID: <1360769326.29496.16.camel@test.quest-ce.net> (raw)

Hi,

With kbuild, we can build external modules using:

  make -C $KERNEL_BUILDDIR M=$PWD

But I'm looking for the proper way to not clobber my module source
directory with files from the build, eg. I'd like the build to output
the files in another directory.

I'd like to do:

  mkdir obj-$ARCH
  cd obj-$ARCH
  make -C $KERNEL_BUILDDIR M=$PWD/.. O=$PWD

But O= is not supported for external module. It can only be used when
building the kernel (and its modules) itself.

I have found people explaining that the currently only way is to
copy/link the sources inside the object directory.
But I find this tasteless and error prone.

Do someone know another method or a patch to the kbuild system to
improve external module compilation ?

Regards.

-- 
Yann Droneaud
OPTEYA

                 reply	other threads:[~2013-02-13 15:28 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1360769326.29496.16.camel@test.quest-ce.net \
    --to=ydroneaud@opteya.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).