Re: building external library under 2.6

From: Sam Ravnborg
Date: Thu Sep 30 2004 - 09:04:40 EST


> Hi,
>
> I succeeded to build an externel module under 2.6 with the following
> Makefile:
>
> ifneq ($(KERNELRELEASE),)
> obj-m := testKernel.o
> testKernel-objs := $(OBJS)
> else
> KDIR := /lib/modules/$(shell uname -r)/build
> PWD := $(shell pwd)
> testKernel.ko :
> $(MAKE) -C $(KDIR) M=$(PWD) modules
> endif
Look ok except the way you use testKernel.ko.
Much better to use all: since this will not conflict
with a potential output file.

>
> I made modifications in order to build a library:
>
> ifneq ($(KERNELRELEASE),)
> lib-y := $(OBJS)
> else
> KDIR := /lib/modules/$(shell uname -r)/build
> PWD := $(shell pwd)
> lib.a :
> $(MAKE) -C $(KDIR) M=$(PWD) modules
> endif

Try wil all: as replacement for lib.a:
It should cure things.

No access to Linux box atm so I cannot check.

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/