mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Woodhouse <dwmw2@infradead.org>
To: Sam Ravnborg <sam@ravnborg.org>
Cc: yiding_wang@agilent.com, linux-kernel@vger.kernel.org,
	Kai Germaschewski <kai@tp1.ruhr-uni-bochum.de>
Subject: Re: 2.5.x module make questions
Date: Mon, 11 Aug 2003 12:27:34 +0100	[thread overview]
Message-ID: <1060601246.8833.9.camel@passion.cambridge.redhat.com> (raw)
In-Reply-To: <20030729210916.GA20154@mars.ravnborg.org>

On Tue, 2003-07-29 at 22:09, Sam Ravnborg wrote:
> What Corbet suggest in the referenced doc is to have the following:
> 
> ifndef KERNELRELEASE
> here goes old style Makefile
> else
> here goes Kbuild makefile
> endif

This is pointless. The 'make -C $KERNELDIR SUBDIRS=`pwd`' form has been
working since at least 2.0, and surely nobody's trying to build for 1.3
kernels any more? Just do it the latter way unconditionally.


> > ag.o: ../../../../t/s/ts.o ../../../f/c/fc.o ../../../f/i/fi.o  s/sl.o 
> > 	ld -r -o ag.o ../../../../t/s/ts.o ../../../f/c/fc.o ../../../f/i/fi.o s/sl.o 
> 
> This looks really ugly. I do not expect kbuild to even get close to help
> you here. kbuild is designed around the idea that objects are built
> directory-by-directory, and in the upper level directory the are linked.
> What you have surely does not follow that principle.

In fact, the kbuild system just uses strings for the SUBDIRS variable...
it doesn't inspect them to check for '..' in them and deliberately barf
(although perhaps it should :).

ifndef TOPDIR
# Invoked from the command line... do it properly

# KERNELDIR can be overridden on the command line
KERNELDIR := /lib/modules/`uname -r`/build

default:
	make -C $(KERNELDIR) SUBDIRS=`pwd` modules

else
# Invoked from the kernel build...

SUBDIRS := ../../../../t/s../../../f/c ../../../f/i s

ag-objs := ../../../../t/s/ts.o ../../../f/c/fc.o ../../../f/i/fi.o \
		s/sl.o 
obj-m := ag.o

endif
> > Any suggestion is welcomed.  If the kbuild cannot do ascending, I have to change the source tree structure but that is the least I want to do.
> 
> This is my best suggestion. Follow the normal way of doing things in the
> kernel make it easier/possible to use the infrastructure provided
> by the kernel.
> 
> PS. Please also read the paper by Kai Germashewski from OLS -
> see www.linuxsymposium.org - it provide good background info on kbuild.
> 
> 	Sam
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

-- 
dwmw2


  reply	other threads:[~2003-08-11 11:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-07-29 20:45 yiding_wang
2003-07-29 21:09 ` Sam Ravnborg
2003-08-11 11:27   ` David Woodhouse [this message]
2003-07-29 21:33 yiding_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=1060601246.8833.9.camel@passion.cambridge.redhat.com \
    --to=dwmw2@infradead.org \
    --cc=kai@tp1.ruhr-uni-bochum.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sam@ravnborg.org \
    --cc=yiding_wang@agilent.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®