Re: Getting out-of-kernel modules compiled

From: Sam Ravnborg
Date: Wed Jan 21 2009 - 12:21:23 EST


On Wed, Jan 21, 2009 at 10:57:25AM -0500, linux-os (Dick Johnson) wrote:
>
> Back in 2004, we make the following to compile
> out-of-kernel modules. It worked.
>
> Now, the kernel build doesn't "know" how to handle "asm.S"
> files and always thinks a "name.o" file is the result of
> a "name.c" file, so I can't buld them no matter how hard
> I try!
>
> What do I need to do????
>
> #
> # Project Makefile for kernel versions over 6
> # Created 05-OCT-2004 Richard B. Johnson
> #
>
> VER := $(shell uname -r)
> PWD := $(shell pwd)
>
> all: driver
>
> driver:
> make V=1 -C /usr/src/linux-$(VER) SUBDIRS=$(PWD) modules
>
> rtc_hwr.o: rtc_hwr.S
> as -o $@ $<
>
> obj-m = rtc.o
> obj-m += rtc_hwr.o

kbuild has never (at least for a very long time) not
supported to implement a module only in assembler.

So you will have no luck trying to build the
module rtc_hrw.ko

What you can do is to define a module like htis:
obj-m := dick.o
dick-y := rtc.o rtc_hwr.o

This will properly build rtc_hwr.S => rtc_hwr.o

Sam
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/