Re: Re: how about KBUILD_MODNAME

From: AmÃrico Wang
Date: Tue Aug 03 2010 - 06:09:08 EST


On Tue, Aug 03, 2010 at 05:35:40PM +0800, hacklu wrote:
>
>I am compiling the boardcom's driver now.
>the driver had defined EXTRA_CFLAGS = -D"KBUILD_STR(s)=\#s" $(basename_flags) $(modname_flags)
>in the a.makefile.
>and the a.makefile was included by b.makefile.
>when in the b.makefile,
>there is this command.
> $(CC) $(DEPS_OPT) $(CFLAGS) $(EXTRA_CFLAGS) -o $@ -c $< ;)
>
>I had add "echo $(EXTRA_CFLAGS)" before this line;but returns NULL;
>
>so I suspicion the $(EXTRA_CFLAGS) hasn't been work.
>


You don't need to write this line by yourself, you just
need to provide a correct: obj-$(XXXXX) += your_module.o,
kbuild will automatically compile it with proper flags.
(If not, try CFLAGS_MODULE.)

If you insist to do this, I think you can just append
-D"KBUILD_MODNAME=your_module" to that line by hand.

Hope this helps.
--
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/