diff options
author | Sam Ravnborg <sam@neptun.(none)> | 2007-10-14 16:21:35 -0400 |
---|---|---|
committer | Sam Ravnborg <sam@neptun.(none)> | 2007-10-14 16:21:35 -0400 |
commit | a0f97e06a43cf524e616f09e6af3398e1e9c1c5b (patch) | |
tree | 2503b24bdbc144aea9ea5bde6ead94b3406eaf98 /arch/um/Makefile | |
parent | 9a39e273d4df0560c724c5fe71f6314a0583ca2b (diff) |
kbuild: enable 'make CFLAGS=...' to add additional options to CC
The variable CFLAGS is a wellknown variable and the usage by
kbuild may result in unexpected behaviour.
On top of that several people over time has asked for a way to
pass in additional flags to gcc.
This patch replace use of CFLAGS with KBUILD_CFLAGS all over the
tree and enabling one to use:
make CFLAGS=...
to specify additional gcc commandline options.
One usecase is when trying to find gcc bugs but other
use cases has been requested too.
Patch was tested on following architectures:
alpha, arm, i386, x86_64, mips, sparc, sparc64, ia64, m68k
Test was simple to do a defconfig build, apply the patch and check
that nothing got rebuild.
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Diffstat (limited to 'arch/um/Makefile')
-rw-r--r-- | arch/um/Makefile | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/arch/um/Makefile b/arch/um/Makefile index 989224f21346..18123bf7b649 100644 --- a/arch/um/Makefile +++ b/arch/um/Makefile | |||
@@ -58,14 +58,14 @@ SYS_DIR := $(ARCH_DIR)/include/sysdep-$(SUBARCH) | |||
58 | # | 58 | # |
59 | # These apply to USER_CFLAGS to. | 59 | # These apply to USER_CFLAGS to. |
60 | 60 | ||
61 | CFLAGS += $(CFLAGS-y) -D__arch_um__ -DSUBARCH=\"$(SUBARCH)\" \ | 61 | KBUILD_CFLAGS += $(CFLAGS-y) -D__arch_um__ -DSUBARCH=\"$(SUBARCH)\" \ |
62 | $(ARCH_INCLUDE) $(MODE_INCLUDE) -Dvmap=kernel_vmap \ | 62 | $(ARCH_INCLUDE) $(MODE_INCLUDE) -Dvmap=kernel_vmap \ |
63 | -Din6addr_loopback=kernel_in6addr_loopback | 63 | -Din6addr_loopback=kernel_in6addr_loopback |
64 | 64 | ||
65 | AFLAGS += $(ARCH_INCLUDE) | 65 | AFLAGS += $(ARCH_INCLUDE) |
66 | 66 | ||
67 | USER_CFLAGS = $(patsubst $(KERNEL_DEFINES),,$(patsubst -D__KERNEL__,,\ | 67 | USER_CFLAGS = $(patsubst $(KERNEL_DEFINES),,$(patsubst -D__KERNEL__,,\ |
68 | $(patsubst -I%,,$(CFLAGS)))) $(ARCH_INCLUDE) $(MODE_INCLUDE) \ | 68 | $(patsubst -I%,,$(KBUILD_CFLAGS)))) $(ARCH_INCLUDE) $(MODE_INCLUDE) \ |
69 | -D_FILE_OFFSET_BITS=64 | 69 | -D_FILE_OFFSET_BITS=64 |
70 | 70 | ||
71 | include $(srctree)/$(ARCH_DIR)/Makefile-$(SUBARCH) | 71 | include $(srctree)/$(ARCH_DIR)/Makefile-$(SUBARCH) |
@@ -75,14 +75,14 @@ include $(srctree)/$(ARCH_DIR)/Makefile-os-$(OS) | |||
75 | 75 | ||
76 | # -Derrno=kernel_errno - This turns all kernel references to errno into | 76 | # -Derrno=kernel_errno - This turns all kernel references to errno into |
77 | # kernel_errno to separate them from the libc errno. This allows -fno-common | 77 | # kernel_errno to separate them from the libc errno. This allows -fno-common |
78 | # in CFLAGS. Otherwise, it would cause ld to complain about the two different | 78 | # in KBUILD_CFLAGS. Otherwise, it would cause ld to complain about the two different |
79 | # errnos. | 79 | # errnos. |
80 | # These apply to kernelspace only. | 80 | # These apply to kernelspace only. |
81 | 81 | ||
82 | KERNEL_DEFINES = -Derrno=kernel_errno -Dsigprocmask=kernel_sigprocmask \ | 82 | KERNEL_DEFINES = -Derrno=kernel_errno -Dsigprocmask=kernel_sigprocmask \ |
83 | -Dmktime=kernel_mktime $(ARCH_KERNEL_DEFINES) | 83 | -Dmktime=kernel_mktime $(ARCH_KERNEL_DEFINES) |
84 | CFLAGS += $(KERNEL_DEFINES) | 84 | KBUILD_CFLAGS += $(KERNEL_DEFINES) |
85 | CFLAGS += $(call cc-option,-fno-unit-at-a-time,) | 85 | KBUILD_CFLAGS += $(call cc-option,-fno-unit-at-a-time,) |
86 | 86 | ||
87 | # These are needed for clean and mrproper, since in that case .config is not | 87 | # These are needed for clean and mrproper, since in that case .config is not |
88 | # included; the values here are meaningless | 88 | # included; the values here are meaningless |