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

From: Geert Uytterhoeven
Date: Mon Jun 21 2004 - 04:04:33 EST


On Sun, 20 Jun 2004, Sam Ravnborg wrote:
> # 1) When using a separate output directory create a small
> # Makefile that is a simple wrapper, calling the Makefile
> # in the kernel tree.
> # - This allows the user to shift to the output directory
> # and execute make.
> # - The Makefile is also useful to document the location
> # source used for the kernel

> 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

The generated Makefile looks sufficiently similar to the one I'm using, so I'm
wondering: Does it work if I say e.g. `make drivers/char/mem.o'? For me that
part never worked, but `make drivers/char/' does work.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
-
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/