Makefile to compile kernel modules

Amit Nagal helloin.amit at
Thu Jun 28 00:47:53 EDT 2012

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

	make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules

	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 .

Amit Nagal

More information about the Kernelnewbies mailing list