Messages in this thread | | | Date | Thu, 3 Jan 2008 09:19:40 +0100 | From | Sam Ravnborg <> | Subject | Re: Linux 2.6 KBUILD Help Required. |
| |
On Thu, Jan 03, 2008 at 01:45:32PM +0530, murtuja bharmal wrote: > Hello, > > I have a one question. > If I have to add additional external flag on my external kernel module source during compilation with KBUILD. > lest say I have one kernel module file hello.c > and I want to add one flag -D testdebug. > > suppose this is my makefile. > > obj-m += hello.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 > > where I can add this flag.
From Documentation/kbuild/makefile.txt: --- 3.7 Compilation flags
ccflags-y, asflags-y and ldflags-y The three flags listed above applies only to the kbuild makefile where they are assigned. They are used for all the normal cc, as and ld invocation happenign during a recursive build. Note: Flags with the same behaviour were previously named: EXTRA_CFLAGS, EXTRA_AFLAGS and EXTRA_LDFLAGS. They are yet supported but their use are deprecated.
ccflags-y specifies options for compiling C files with $(CC).
Example: # drivers/sound/emu10k1/Makefile ccflags-y += -I$(obj) ccflags-$(DEBUG) += -DEMU10K1_DEBUG
Sam
| |