Pradeep Goswami
Pradeep Goswami

Reputation: 1975

regarding CFLAGS setting in Linux kernel?

While compiling Linux kernel I got following error :

no previous prototype for 'foo' [-Werror=missing-prototypes]

Command used to compile kernel:

 make -C kernel ARCH=arm CROSS_COMPILE=arm-eabi- 

I tried following command but not working

make ARCH=arm CROSS_COMPILE=arm-eabi- CFLAGS=-Wno-error

So I want to know to how to set CFLAGS to -Wno-error in Linux kernel from directory make command.

I know its great to have -Werror set and fix problem instead but as of now I want to know how to set CFLAGS to -Wno-error.

Any help will be appreciated.

Upvotes: 4

Views: 8440

Answers (1)

Oleksandr Kravchuk
Oleksandr Kravchuk

Reputation: 6327

You can either use ccflags-module_name, or ccflags-y to set it globally:

ccflags-foo.o := -Wno-error

or

ccflags-y := -Wno-error

As an alternative, you can use KBUILD_CFLAGS environment variable.

But I would fix your mistake instead of shutting up compiler.

Upvotes: 5

Related Questions