Re: build -->/usr/src/linux

From: Jamie Lokier (lk@tantalophile.demon.co.uk)
Date: Mon Apr 09 2001 - 10:02:27 EST


Miquel van Smoorenburg wrote:
> >There is a way though I'd not call it clean. Here is an extract from
>
> Do you think something like this is the correct approach? If it
> was part of the official kernel you could write a Makefile like this:
>
> [code to creake /lib/modules/`uname -r`/config.mak

I agree with that idea in principle, although for quite a while
something else is required, to deal with older kernels. You'll notice
that my fragment greps for SMP from the kernel's Makefile: that is to
deal with 2.2 kernels and isn't required for 2.4 kernels. This is not
an issue if you only care about future-compatibility.

Fortunately, the file $(KERNEL_SOURCE)/arc/$(ARCH)/Makefile provides
most of the variables like CFLAGS et al.

Unfortunately, determining ARCH is rather ugly. I copied the expression
from the kernel's top level Makefile.

One more thing: some systems do not have a /lib/modules directory. On
those systems it's good to hunt in /usr/src/linux.

> -modules: include/config/MARKER $(patsubst %, _mod_%, $(SUBDIRS))
> +modules: include/config/MARKER $(patsubst %, _mod_%, $(SUBDIRS)) \
> + include/linux/config.mak

The file needs to be created even if you don't do `make modules'. Some
kernels will support third party modules, but don't actually have any
modules of their own.

> +include/linux/config.mak: ./Makefile

This must depend on the configuration somehow. If the kernel's
reconfigured, a new file needs to be created. For 2.2 kernels it must
depend on whether SMP is defined too.

-- Jamie
-
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/



This archive was generated by hypermail 2b29 : Sun Apr 15 2001 - 21:00:11 EST