From: Sam Ravnborg <sam@ravnborg.org>
To: Axel Weiss <aweiss@informatik.hu-berlin.de>
Cc: Sam Ravnborg <sam@ravnborg.org>, linux-kernel@vger.kernel.org
Subject: Re: compiling external modules
Date: Fri, 16 Apr 2004 22:51:57 +0200 [thread overview]
Message-ID: <20040416205157.GD2697@mars.ravnborg.org> (raw)
In-Reply-To: <200404162209.56651.aweiss@informatik.hu-berlin.de>
On Fri, Apr 16, 2004 at 10:09:56PM +0200, Axel Weiss wrote:
>
> Sure, but compilation with 2.6.5 would fail again, missing export-objs.
export-objs has not been needed by 2.6.*, only during earlier 2.5.*
> If I got you right, we should simplify things so that 2.6 means >= 2.6.6?
Yup.
> # Template Makefile for external module compilation
>
> KDIR := /lib/modules/$(shell uname -r)/build
> PWD := $(shell pwd)
> KERNEL_24 := $(if $(wildcard $(KDIR)/Rules.make),1,0)
>
> ifneq ($(KERNELRELEASE),)
>
> obj-m := <mod-name>.o
> <mod-name>-objs := <mod-object-list>
>
> endif # ifneq ($(KERNELRELEASE),)
I do not see why you need to wrap this in KERNELRELEASE.
> .PHONY: all clean
>
> ifeq ($(KERNEL_24),1)
Hide the backward compatibility stuff in the bottom (= 2.4 stuff).
Just MO.
> ifneq ($(KERNELRELEASE),)
>
> export-objs := <mod-export-list>
>
> include $(KDIR)/Rules.make
> adc64_bm.o: $(<mod-name>-objs)
> $(Q)$(LD) $(LD_RFLAG) -r -o $@ $(<mod-name>-objs)
> else # ifneq ($(KERNELRELEASE),)
> all:
> $(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules
> clean:
> rm -f *.ko *.o .*.cmd .*.o.flags *.mod.c
> endif # ifneq ($(KERNELRELEASE),)
>
> else #################### ifeq ($(KERNEL_24),1)
>
> ifeq ($(KERNELRELEASE),)
> all:
> $(MAKE) -C $(KDIR) M=$(PWD)
> clean:
Here you should add modules_install also.
> $(MAKE) -C $(KDIR) M=$(PWD) $@
> endif # ifeq ($(KERNELRELEASE),)
>
> endif #################### ifeq ($(KERNEL_24),1)
>
> # end of Makefile Template
>
> I reordered the cases a bit so that
> 1. kernel-version dependend branches stay together
> 2. <mod-object-list> needs only be written once
>
> Now everything fits on a single screen-page :)
Good!
>
> Sam, please note two things:
> 1. the clean rule must be explicit to be recognized (GNU Make 3.80).
I had some problems with this, but I do not remeber how i solved it.
> 2. 2.6 compilation requires root privileges for compilation, 2.4 does not.
I never ever compile as root - so something is broken here.
> Can we relax some file accesses (e.g. $(KDIR)/.__modpost.cmd and the
> local .tmp_versions) to allow non-privileged users to compile external
> modules and to be able to make clean?
I do not have a file named .__modpost.cmd???
And root should not be required??
Sam
next prev parent reply other threads:[~2004-04-16 20:44 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-04-16 15:41 compiling external modules Axel Weiss
2004-04-16 16:54 ` Sam Ravnborg
2004-04-16 20:09 ` Axel Weiss
2004-04-16 20:51 ` Sam Ravnborg [this message]
2004-04-16 21:04 ` Sam Ravnborg
2004-04-16 23:24 ` Axel Weiss
-- strict thread matches above, loose matches on Subject: below --
2004-04-15 21:05 Axel Weiss
2004-04-15 21:59 ` Sam Ravnborg
2004-04-16 7:22 ` Duncan Sands
2004-04-16 12:06 ` Axel Weiss
2004-04-16 12:34 ` Axel Weiss
2004-04-16 16:55 ` Sam Ravnborg
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=20040416205157.GD2697@mars.ravnborg.org \
--to=sam@ravnborg.org \
--cc=aweiss@informatik.hu-berlin.de \
--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