Re: [PATCH 2/2] kbuild: Improved external module support

From: Petr Vandrovec
Date: Sun Jun 20 2004 - 20:44:51 EST


On Sun, Jun 20, 2004 at 11:23:53PM +0200, Sam Ravnborg wrote:
> # If System.map exists, run depmod. This deliberately does not have a
> diff -Nru a/scripts/mkmakefile b/scripts/mkmakefile
> --- /dev/null Wed Dec 31 16:00:00 196900
> +++ b/scripts/mkmakefile 2004-06-20 23:06:03 +02:00
> @@ -0,0 +1,25 @@
> +#!/bin/sh
> +# Generates a small Makefile used in the root of the output
> +# directory, to allow make to be started from there.
> +# The Makefile also allow for more convinient build of external modules
> +
> +# Usage
> +# $1 - Kernel src directory
> +# $2 - Output directory
> +
> +
> +cat << EOF
> +
> +KERNELSRC := $1
> +KERNELOUTPUT := $2
> +
> +MAKEFLAGS += --no-print-directory
> +
> +all:
> + \$(MAKE) -C \$(KERNELSRC) O=\$(KERNELOUTPUT)
> +
> +%:
> + \$(MAKE) -C \$(KERNELSRC) O=\$(KERNELOUTPUT) \$@
> +
> +EOF
> +

In addition to what Arjan said - If you insist on doing it this way,
it would be nice if that generated Makefile could contain also

VERSION = 2
PATCHLEVEL = 6

so I can detect (by grepping that Makefile - or by some other method which
works on 2.0 - 2.6 kernels) which kbuild system I should use - whether 2.6.x,
or 2.4.x, or standalone makefile for 2.2.x and 2.0.x. I see
no way how to find what Makefile I should prepare for this thing.

Other possible solution is that you'll guarantee that this is last version
which will be ever invented. But you probably cannot guarantee this,
so some version number is needed.
Thanks,
Petr Vandrovec

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