Makefile to compile kernel modules

Sinan Nalkaya sardok at gmail.com
Thu Jun 28 01:50:46 EDT 2012


you can pass KCONFIG environment variable or 'ccflags-y' variable in makefile.

 for more information please look at;

http://lxr.linux.no/linux+v3.4.4/Documentation/kbuild/kbuild.txt
http://lxr.linux.no/linux+v3.4.4/Documentation/kbuild/makefiles.txt

On Thu, Jun 28, 2012 at 7:47 AM, Amit Nagal <helloin.amit at gmail.com> wrote:
> Hi ,
>
> i want to compile a standalone kernel module for  linux kernel
> version 2.6 or 3.0 .
>
> A basic Makefile goes like this :
>
> ==================
> obj-m += hello-1.o
>
> all:
>        make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
>
> clean:
>        make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean
>
> ====================
>
>
> i want to add debugging symbols information ( using -g option ) also
> via CFLAGS  usage flag .
>
> can i be guided how to modify this basic Makefile to add CFLAGS information for
> adding debugging symbols information .
>
> Regards
> Amit Nagal
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies



More information about the Kernelnewbies mailing list