public inbox for linux-kbuild@vger.kernel.org
 help / color / mirror / Atom feed
From: Joel Becker <Joel.Becker@oracle.com>
To: murtuja bharmal <murtuja_bharmal@yahoo.com>
Cc: linux-kbuild <linux-kbuild@vger.kernel.org>
Subject: Re: Kbuild Makefile output
Date: Fri, 16 May 2008 02:32:43 -0700	[thread overview]
Message-ID: <20080516093243.GA499@mail.oracle.com> (raw)
In-Reply-To: <225576.17638.qm@web95110.mail.in2.yahoo.com>

On Fri, May 16, 2008 at 07:03:55AM +0100, murtuja bharmal wrote:
> 
> --- Joel Becker <Joel.Becker@oracle.com> wrote:
> 
> > 1) Have the build name the output files
> > appropritately.  That is,
> > compile foo.c to foo-kernel.o and foo-userspace.o. 
> > Then link as needed.
> > The makefile dependencies Just Work.
> > 
> 
> Thanks Joel,
> In case of Solution 1.
> what changes required in Makefile.
> I mean how to build foo-kernel.c from foo.c using
> kbuild makefile.

	I still prefer solution 2, but for solution 1, you could do
multiple things.  You could leave them as 
them foo.o and foo-userspace.o.  That is, build the kernel drivers
without a rename.  Whatever you do, you're going to hvae to be
consistent.  So...

> Suppose this is my makefile
> 
> obj-m := mymodule.o
> 
> mymodule-objs += \
>          dir1/foo.o   \
>          dir2/bar.o   
> 
> all:
>          make -C /usr/src/linux M=`pwd` modules.
> 
> I only want to change name for foo.c to foo-kernel.o,
> not for bar.c.

	Why would you do that?  bar.c is part of the kernel driver, so
it should be bar-kernel.o if you are renaming.  You don't have to
rename, of course.  You could use 'foo.o' for kernel objects and
'foo-userspace.o' for userspace objects.

Joel
-- 

"People with narrow minds usually have broad tongues."

Joel Becker
Principal Software Developer
Oracle
E-mail: joel.becker@oracle.com
Phone: (650) 506-8127

  reply	other threads:[~2008-05-16  9:33 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <339763.26248.qm@web95104.mail.in2.yahoo.com>
2008-05-15 17:42 ` Kbuild Makefile output Sam Ravnborg
2008-05-15 18:01   ` murtuja bharmal
2008-05-15 18:31   ` murtuja bharmal
2008-05-15 20:58     ` Joel Becker
2008-05-16  6:03       ` murtuja bharmal
2008-05-16  9:32         ` Joel Becker [this message]
2008-05-16 11:36           ` murtuja bharmal
2008-05-16 16:02             ` Joel Becker

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=20080516093243.GA499@mail.oracle.com \
    --to=joel.becker@oracle.com \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=murtuja_bharmal@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