From: Sam Ravnborg <sam@ravnborg.org>
To: "Budde, Marco" <budde@telos.de>
Cc: linux-kernel@vger.kernel.org
Subject: Re: kbuild: libraries and subdirectories
Date: Thu, 8 Sep 2005 17:28:19 +0200 [thread overview]
Message-ID: <20050908152819.GA7749@mars.ravnborg.org> (raw)
In-Reply-To: <809C13DD6142E74ABE20C65B11A2439809C4C2@www.telos.de>
On Thu, Sep 08, 2005 at 03:40:59PM +0200, Budde, Marco wrote:
> I have a large number of sources files, which I have to
> compile into one kernel module. Let's assume I have the
> following source organisation:
>
> main/
> main_code.c
> lib1/
> part1/
> file_1_1_1.c
> part2/
> file_1_2_1.c
> lib2/
> part1/
> file_2_1_1.c
> part2/
> file_2_2_1.c
>
> I would like to build all source files in lib1 into one
> lib.a library and all files in lib2 into a second lib.a
> library.
kbuild is optimised for kernel usage.
And within the kernel only xfs and oprofile (+a few others)
have files spread over more than one directory like in your
example. This is not considered good practice and therefore
kbuild does not document this usage - neither encourage it.
Also kbuild does not support building .a file in the way you
want it to do.
You can do the following:
obj-$(CONFIG_foo) += main/main_code.o
obj-$(CONFIG_foo) += lib1/part1/file_1_1_1.c
obj-$(CONFIG_foo) += lib1/part2/file1_2_1.o
etc.
>
> At the end I would like to compile the code in main and
> link every together (result should be one kernel module).
>
> How can I archieve this with kbuild? Its documentation is not
> really deep.
Please point out in what section you miss information and I will try to
update it.
I for one consider the kbuild syntax well documented, but I may be a bit
biased in this respect.
Sam
prev parent reply other threads:[~2005-09-08 15:27 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-09-08 13:40 Budde, Marco
2005-09-08 15:28 ` Sam Ravnborg [this message]
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=20050908152819.GA7749@mars.ravnborg.org \
--to=sam@ravnborg.org \
--cc=budde@telos.de \
--cc=linux-kernel@vger.kernel.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
all inboxes | Powered by JetHome®