kbuild: allow assignment to {A,C}FLAGS_KERNEL on the command line

It is now possible to assign options to AS and CC
on the command line - which is only used for built-in code.

{A,C}FLAGS_KERNEL was used both in the top-level Makefile
in the arch makefiles, thus users had no way to specify
additional options to AS, CC without overriding
the original value.

Introduce a new set of variables KBUILD_{A,C}FLAGS_KERNEL
that is used by arch specific files and free up
{A,C}FLAGS_KERNEL so they can be assigned on
the command line.

All arch Makefiles that used the old variables has been updated.

Signed-off-by: Sam Ravnborg <[email protected]>
Cc: Tony Luck <[email protected]>
Cc: Hirokazu Takata <[email protected]>
Signed-off-by: Michal Marek <[email protected]>
This commit is contained in:
Sam Ravnborg 2010-07-28 19:11:27 +02:00 • committed by Michal Marek
commit 80c00ba942
6 changed files with 26 additions and 7 deletions

View file

@ -28,10 +28,20 @@ AFLAGS_MODULE
--------------------------------------------------
Addtional module specific options to use for $(AS).
AFLAGS_KERNEL
--------------------------------------------------
Addtional options for $(AS) when used for assembler
code for code that is compiled as built-in.
KCFLAGS
--------------------------------------------------
Additional options to the C compiler (for built-in and modules).
CFLAGS_KERNEL
--------------------------------------------------
Addtional options for $(CC) when used to compile
code that is compiled as built-in.
CFLAGS_MODULE
--------------------------------------------------
Addtional module specific options to use for $(CC).

View file

@ -923,9 +923,9 @@ When kbuild executes, the following steps are followed (roughly):
The first example utilises the trick that a config option expands
to 'y' when selected.
CFLAGS_KERNEL $(CC) options specific for built-in
KBUILD_AFLAGS_KERNEL $(AS) options specific for built-in
$(CFLAGS_KERNEL) contains extra C compiler flags used to compile
$(KBUILD_AFLAGS_KERNEL) contains extra C compiler flags used to compile
resident kernel code.
KBUILD_AFLAGS_MODULE Options for $(AS) when building modules
@ -934,6 +934,11 @@ When kbuild executes, the following steps are followed (roughly):
are used for $(AS).
From commandline AFLAGS_MODULE shall be used (see kbuild.txt).
KBUILD_CFLAGS_KERNEL $(CC) options specific for built-in
$(KBUILD_CFLAGS_KERNEL) contains extra C compiler flags used to compile
resident kernel code.
KBUILD_CFLAGS_MODULE Options for $(CC) when building modules
$(KBUILD_CFLAGS_MODULE) is used to add arch specific options that