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

From: Sam Ravnborg
Date: Mon Jun 21 2004 - 17:04:40 EST


On Mon, Jun 21, 2004 at 11:01:34AM +0200, Geert Uytterhoeven wrote:
> > +
> > +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.

The Makefile is derived from the one you posted, I just typed it by hand.
Therefore the variable names differ.

In the "Match-Anything Rules::" part of 'info make' the trick needed to
let 'make drivers/char/mem.o' work was described - thanks for reminding me of this issue.

The match-anything rule must be marked as terminal rule using double-colon - viola.

So the rule now looks:
%::
\$(MAKE) -C \$(KERNELSRC) O=\$(KERNELOUTPUT) \$@


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/