* Building multi-file modules
@ 2013-04-29 20:18 Arlie Stephens
2013-05-08 5:33 ` Yuva Raj
0 siblings, 1 reply; 2+ messages in thread
From: Arlie Stephens @ 2013-04-29 20:18 UTC (permalink / raw)
To: kernelnewbies
Hi Folks,
I've got a module, call it foo, presently built from a single source
file, drivers/char/foo.c It's gotten enormous, so I want to split it.
Ideally I'd keep the original name for one of the source files. So
what I want is a module named foo, build from source files foo.c,
bar.c and baz.c
kbuild is being uncooperative.
The following works:
obj-$(CONFIG_FOO) += foo_renamed.o
foo_renamed-objs := foo.o bar.o baz.o
I'd just prefer not to rename either the module or the original source
file. Is this supposed to be possible, and if so, how?
I'm on RHEL 6.1, aka kernel 2.6.32, in case that matters. Also, in
case that matters, I'm building the module into the kerenl ("y" not
"m" in the config.)
----what I've tried----
The following gives me warnings from make:
obj-$(CONFIG_FOO) += foo.o
foo-objs := foo.o bar.o baz.o
The following never compiles foo.c:
obj-$(CONFIG_FOO) += foo.o
foo-objs := bar.o baz.o
Thanks for any insight,
--
Arlie
(Arlie Stephens arlie at worldash.org)
^ permalink raw reply [flat|nested] 2+ messages in thread
* Building multi-file modules
2013-04-29 20:18 Building multi-file modules Arlie Stephens
@ 2013-05-08 5:33 ` Yuva Raj
0 siblings, 0 replies; 2+ messages in thread
From: Yuva Raj @ 2013-05-08 5:33 UTC (permalink / raw)
To: kernelnewbies
Hi Stephens,
Try this below one.
obj-$(CONFIG_FOO) += foo.o
foo-y := bar.o baz.o
This compiles module foo.ko from the foo.c , bar,c baz.c
Refer this for more information on Kbuild.
https://www.kernel.org/doc/Documentation/kbuild/modules.txt
Regards,
Yuva
On Tue, Apr 30, 2013 at 1:48 AM, Arlie Stephens <arlie@worldash.org> wrote:
> Hi Folks,
>
> I've got a module, call it foo, presently built from a single source
> file, drivers/char/foo.c It's gotten enormous, so I want to split it.
> Ideally I'd keep the original name for one of the source files. So
> what I want is a module named foo, build from source files foo.c,
> bar.c and baz.c
>
> kbuild is being uncooperative.
>
> The following works:
>
> obj-$(CONFIG_FOO) += foo_renamed.o
> foo_renamed-objs := foo.o bar.o baz.o
>
> I'd just prefer not to rename either the module or the original source
> file. Is this supposed to be possible, and if so, how?
>
> I'm on RHEL 6.1, aka kernel 2.6.32, in case that matters. Also, in
> case that matters, I'm building the module into the kerenl ("y" not
> "m" in the config.)
>
>
> ----what I've tried----
> The following gives me warnings from make:
>
> obj-$(CONFIG_FOO) += foo.o
> foo-objs := foo.o bar.o baz.o
>
>
> The following never compiles foo.c:
>
> obj-$(CONFIG_FOO) += foo.o
> foo-objs := bar.o baz.o
>
>
> Thanks for any insight,
>
> --
> Arlie
>
> (Arlie Stephens arlie at worldash.org)
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20130508/110533b0/attachment.html
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-05-08 5:33 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-29 20:18 Building multi-file modules Arlie Stephens
2013-05-08 5:33 ` Yuva Raj
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).