diff options
author | Sam Ravnborg <sam@ravnborg.org> | 2010-07-28 11:33:09 -0400 |
---|---|---|
committer | Michal Marek <mmarek@suse.cz> | 2010-08-03 08:09:45 -0400 |
commit | 6588169d516560f68672e2928680b71c647b7806 (patch) | |
tree | 91b20bf9197c718ff4b5830bb1aea0b1bc0de272 /Makefile | |
parent | d6f4ceb796ebf1a8c8a9ad4a8ea0d181aaec7de6 (diff) |
kbuild: allow assignment to {A,C,LD}FLAGS_MODULE on the command line
It is now possible to assign options to AS, CC and LD
on the command line - which is only used when building modules.
{A,C,LD}FLAGS_MODULE was all used both in the top-level Makefile
in the arch makefiles, thus users had no way to specify
additional options to AS, CC, LD when building modules
without overriding the original value.
Introduce a new set of variables KBUILD_{A,C,LD}FLAGS_MODULE
that is used by arch specific files and free up
{A,C,LD}FLAGS_MODULE so they can be assigned on
the command line.
All arch Makefiles that used the old variables has been updated.
Note: Previously we had a MODFLAGS variable for both
AS and CC. But in favour of consistency this was dropped.
So in some cases arch Makefile has one assignmnet replaced by
two assignmnets.
Note2: MODFLAGS was not documented and is dropped
without any notice. I do not expect much/any breakage
from this.
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Cc: Denys Vlasenko <vda.linux@googlemail.com>
Cc: Haavard Skinnemoen <hskinnemoen@atmel.com>
Cc: Mike Frysinger <vapier@gentoo.org>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Chen Liqin <liqin.chen@sunplusct.com>
Acked-by: Mike Frysinger <vapier@gentoo.org> [blackfin]
Acked-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com> [avr32]
Signed-off-by: Michal Marek <mmarek@suse.cz>
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 13 |
1 files changed, 8 insertions, 5 deletions
@@ -332,10 +332,9 @@ CHECK = sparse | |||
332 | 332 | ||
333 | CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ \ | 333 | CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ \ |
334 | -Wbitwise -Wno-return-void $(CF) | 334 | -Wbitwise -Wno-return-void $(CF) |
335 | MODFLAGS = -DMODULE | 335 | CFLAGS_MODULE = |
336 | CFLAGS_MODULE = $(MODFLAGS) | 336 | AFLAGS_MODULE = |
337 | AFLAGS_MODULE = $(MODFLAGS) | 337 | LDFLAGS_MODULE = |
338 | LDFLAGS_MODULE = -T $(srctree)/scripts/module-common.lds | ||
339 | CFLAGS_KERNEL = | 338 | CFLAGS_KERNEL = |
340 | AFLAGS_KERNEL = | 339 | AFLAGS_KERNEL = |
341 | CFLAGS_GCOV = -fprofile-arcs -ftest-coverage | 340 | CFLAGS_GCOV = -fprofile-arcs -ftest-coverage |
@@ -355,6 +354,9 @@ KBUILD_CFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \ | |||
355 | -Wno-format-security \ | 354 | -Wno-format-security \ |
356 | -fno-delete-null-pointer-checks | 355 | -fno-delete-null-pointer-checks |
357 | KBUILD_AFLAGS := -D__ASSEMBLY__ | 356 | KBUILD_AFLAGS := -D__ASSEMBLY__ |
357 | KBUILD_AFLAGS_MODULE := -DMODULE | ||
358 | KBUILD_CFLAGS_MODULE := -DMODULE | ||
359 | KBUILD_LDFLAGS_MODULE := -T $(srctree)/scripts/module-common.lds | ||
358 | 360 | ||
359 | # Read KERNELRELEASE from include/config/kernel.release (if it exists) | 361 | # Read KERNELRELEASE from include/config/kernel.release (if it exists) |
360 | KERNELRELEASE = $(shell cat include/config/kernel.release 2> /dev/null) | 362 | KERNELRELEASE = $(shell cat include/config/kernel.release 2> /dev/null) |
@@ -369,6 +371,7 @@ export HOSTCXX HOSTCXXFLAGS LDFLAGS_MODULE CHECK CHECKFLAGS | |||
369 | export KBUILD_CPPFLAGS NOSTDINC_FLAGS LINUXINCLUDE OBJCOPYFLAGS LDFLAGS | 371 | export KBUILD_CPPFLAGS NOSTDINC_FLAGS LINUXINCLUDE OBJCOPYFLAGS LDFLAGS |
370 | export KBUILD_CFLAGS CFLAGS_KERNEL CFLAGS_MODULE CFLAGS_GCOV | 372 | export KBUILD_CFLAGS CFLAGS_KERNEL CFLAGS_MODULE CFLAGS_GCOV |
371 | export KBUILD_AFLAGS AFLAGS_KERNEL AFLAGS_MODULE | 373 | export KBUILD_AFLAGS AFLAGS_KERNEL AFLAGS_MODULE |
374 | export KBUILD_AFLAGS_MODULE KBUILD_CFLAGS_MODULE KBUILD_LDFLAGS_MODULE | ||
372 | 375 | ||
373 | # When compiling out-of-tree modules, put MODVERDIR in the module | 376 | # When compiling out-of-tree modules, put MODVERDIR in the module |
374 | # tree rather than in the kernel tree. The kernel tree might | 377 | # tree rather than in the kernel tree. The kernel tree might |
@@ -607,7 +610,7 @@ endif | |||
607 | # Use --build-id when available. | 610 | # Use --build-id when available. |
608 | LDFLAGS_BUILD_ID = $(patsubst -Wl$(comma)%,%,\ | 611 | LDFLAGS_BUILD_ID = $(patsubst -Wl$(comma)%,%,\ |
609 | $(call cc-ldoption, -Wl$(comma)--build-id,)) | 612 | $(call cc-ldoption, -Wl$(comma)--build-id,)) |
610 | LDFLAGS_MODULE += $(LDFLAGS_BUILD_ID) | 613 | KBUILD_LDFLAGS_MODULE += $(LDFLAGS_BUILD_ID) |
611 | LDFLAGS_vmlinux += $(LDFLAGS_BUILD_ID) | 614 | LDFLAGS_vmlinux += $(LDFLAGS_BUILD_ID) |
612 | 615 | ||
613 | ifeq ($(CONFIG_STRIP_ASM_SYMS),y) | 616 | ifeq ($(CONFIG_STRIP_ASM_SYMS),y) |