From: sam@ravnborg.org
To: Song Wang <wsonguci@yahoo.com>
Cc: Sam Ravnborg <sam@ravnborg.org>,
kbuild-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org
Subject: Re: [kbuild-devel] kbuild support to build one module with multiple separate components?
Date: Mon, 19 Jul 2004 19:29:12 +0200 [thread overview]
Message-ID: <20040719172912.GA6988@mars.ravnborg.org> (raw)
In-Reply-To: <20040714214044.69938.qmail@web40006.mail.yahoo.com>
On Wed, Jul 14, 2004 at 02:40:44PM -0700, Song Wang wrote:
> Hi, Sam
>
> Thanks for the reply.
>
> However, in the way you indicate, the
> mainmodule and each submodule will be built
> as separate kernel modules. You will get
> mainmodule.ko, a_sub_module.ko, b_sub_module.ko etc.
>
> This is not what I tried to get. I tried to
> build a single kernel module, which means that
> mainmodule.o, a_sub_module.o, b_sub_module.o
> should be linked together to produce the single
> module.
OK.
This is even simpler:
Makefile:
EXTRA_CFLAGS := -I $(obj)/include
module-y := file.o dir/file.o
obj-m := module.o
And then code your C files as usual.
Assumig you have a directory named include.
Include header files like this:
#include "header.h"
So you end up having:
module/file.c
module/Makefile
module/dir/file.c
module/include/header.h
And you use:
make -C kernelsrcdir M=$PWD
to compile your module.
If this does not solve your issue please say so.
Sam
prev parent reply other threads:[~2004-07-19 15:28 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20040702234735.63710.qmail@web40003.mail.yahoo.com>
2004-07-14 21:19 ` Sam Ravnborg
2004-07-14 21:40 ` Song Wang
2004-07-19 17:29 ` sam [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=20040719172912.GA6988@mars.ravnborg.org \
--to=sam@ravnborg.org \
--cc=kbuild-devel@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
--cc=wsonguci@yahoo.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
all inboxes | Powered by JetHome®