mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sam Ravnborg <sam@ravnborg.org>
To: Kedar Sovani <kedars@gmail.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Kbuild trick
Date: Sun, 22 May 2005 09:28:13 +0200	[thread overview]
Message-ID: <20050522072813.GA16814@mars.ravnborg.org> (raw)
In-Reply-To: <5edf7fc905052103593ea75abf@mail.gmail.com>

On Sat, May 21, 2005 at 04:29:35PM +0530, Kedar Sovani wrote:
> One of the question that I haven't yet managed to solve properly is
> how do we manage kernel modules which have its C files in multiple
> underlying directories.
> 
> say :
> /src/Makefile
> /src/main.c
> /src/module1/Makefile
> /src/module1/module1.c
> /src/module1/module_stuff.c
> 
> And the 3 C files should be built into a single module at the top level.
> I tried something like this in the top level Makefile, but it does not work.
> 
> obj-m += mymodule.o
> main-objs=main.o module1/

This create a number of modules - sometimes a good way to do it.
We have several examples in the kernel using this method.

> 
> I could use,
> main-objs=main.o module1/module1.o module1/module_stuff.o
> 
> But I don't think that is a good idea. I looked at
> Documentation/kbuild/, but no luck.
This is one way to do it.
The other way as used by the kernel is to avoid spreading the .c
files in multiple directories.

	Sam

  reply	other threads:[~2005-05-22  7:25 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-17 21:46 sparse error: unable to open 'stdarg.h' Timur Tabi
2005-05-17 20:11 ` Christopher Li
2005-05-18 14:08   ` Timur Tabi
2005-05-18 12:38     ` Christopher Li
2005-05-18 15:51       ` Timur Tabi
2005-05-18 13:24         ` Christopher Li
2005-05-18 16:45           ` Timur Tabi
2005-05-18 18:22             ` Sam Ravnborg
2005-05-18 18:23               ` Timur Tabi
2005-05-20 19:37                 ` Kbuild trick Sam Ravnborg
2005-05-20 23:43                   ` Joel Becker
2005-05-21  5:12                     ` Sam Ravnborg
2005-05-21  5:48                       ` randy_dunlap
2005-05-21 20:41                       ` Joel Becker
2005-05-21 10:59                   ` Kedar Sovani
2005-05-22  7:28                     ` Sam Ravnborg [this message]
2005-05-17 22:39 ` sparse error: unable to open 'stdarg.h' Timur Tabi
2005-05-18 18:22   ` Sam Ravnborg
2005-05-18 22:14     ` Timur Tabi

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=20050522072813.GA16814@mars.ravnborg.org \
    --to=sam@ravnborg.org \
    --cc=kedars@gmail.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®