mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Song Wang <wsonguci@yahoo.com>
To: linux-kernel@vger.kernel.org
Subject: kbuild support to build one module with multiple separate components?
Date: Fri, 2 Jul 2004 11:36:23 -0700 (PDT)	[thread overview]
Message-ID: <20040702183623.74495.qmail@web40001.mail.yahoo.com> (raw)

Hi, Folks

I'm puzzled by the kbuild system in 2.6 kernel.
I want to write a kernel module, which consists of
several components. The module is produced by
linking these components. These components are located
in separate subdirectories (for example A, B,C). 
Each component is generated also by linking 
multiple files. (For example, a_1.c, a_2.c for
building A.o, b_1.c, b_2.c for building B.o, then A.o
and B.o
should be linked to produce mymodule.o) 

I know if I put all the files in a single directory
The makefile of the module looks like

obj-$(CONFIG_MYMODULE) += mymodule.o
mymodule-objs := a_1.o a_2.o b_1.o b_2.o c_1.o c_2.o

It should work. But it is really messy, especially
there are a lot of files or each component requires
different EXTRA_CFLAGS. However, if I write
separate Makefiles for each component in their own
subdirectory, the Makefile of component A looks like

obj-y := A.o (or obj-$(CONFIG_MYMODULE) +=  A.o)
A-objs := a_1.o a_2.o

This is wrong, because kbuild will treat A as
independent module. All I want is to treat
A as component of the only module mymodule.o. It
should be linked to mymodule.o

Any idea on how to write a kbuild Makefile to
support such kind of single module produced
by linking multiple components and each component
is located in separate directory? Thanks.

-Song




		
__________________________________
Do you Yahoo!?
Yahoo! Mail - 50x more storage than other providers!
http://promotions.yahoo.com/new_mail

             reply	other threads:[~2004-07-02 18:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-07-02 18:36 Song Wang [this message]
     [not found] <20040709215700.GB4316@linux-mips.org>
2004-07-14 21:59 ` Song Wang

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=20040702183623.74495.qmail@web40001.mail.yahoo.com \
    --to=wsonguci@yahoo.com \
    --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®