aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/Makefile.lib
diff options
context:
space:
mode:
authorSam Ravnborg <sam@neptun.(none)>2007-10-15 16:25:06 -0400
committerSam Ravnborg <sam@neptun.(none)>2007-10-15 16:25:06 -0400
commitf77bf01425b11947eeb3b5b54685212c302741b8 (patch)
tree1d2b8dc9eec4538b5e44139d77c018d9c3ee1f30 /scripts/Makefile.lib
parent06c5040cdb13d27adad118f2fbfae905a1911b37 (diff)
kbuild: introduce ccflags-y, asflags-y and ldflags-y
Introduce ccflags-y, asflags-y and ldflags-y so we soon can deprecate use of EXTRA_CFLAGS, EXTRA_AFLAGS and EXTRA_LDFLAGS. This patch does not touch any in-tree users - thats next round. Lets get this committed first and then fix the users of the soon to be deprecated variants next. The rationale behind this change is to introduce support for makefile fragments like: ccflags-$(CONFIG_WHATEVER_DEBUG) := -DDEBUG As a replacement for the uglier: ifeq ($(CONFIG_WHATEVER_DEBUG),y) EXTRA_CFLAGS := -DDEBUG endif Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Diffstat (limited to 'scripts/Makefile.lib')
-rw-r--r--scripts/Makefile.lib16
1 files changed, 11 insertions, 5 deletions
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index 95e6e0fbdbd0..3c5e88bfecf1 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -1,3 +1,9 @@
1# Backward compatibility
2asflags-y += $(EXTRA_AFLAGS)
3ccflags-y += $(EXTRA_CFLAGS)
4cppflags-y += $(EXTRA_CPPFLAGS)
5ldflags-y += $(EXTRA_LDFLAGS)
6
1# Figure out what we need to build from the various variables 7# Figure out what we need to build from the various variables
2# =========================================================================== 8# ===========================================================================
3 9
@@ -84,9 +90,9 @@ basename_flags = -D"KBUILD_BASENAME=KBUILD_STR($(call name-fix,$(basetarget)))"
84modname_flags = $(if $(filter 1,$(words $(modname))),\ 90modname_flags = $(if $(filter 1,$(words $(modname))),\
85 -D"KBUILD_MODNAME=KBUILD_STR($(call name-fix,$(modname)))") 91 -D"KBUILD_MODNAME=KBUILD_STR($(call name-fix,$(modname)))")
86 92
87_c_flags = $(KBUILD_CFLAGS) $(EXTRA_CFLAGS) $(CFLAGS_$(basetarget).o) 93_c_flags = $(KBUILD_CFLAGS) $(ccflags-y) $(CFLAGS_$(basetarget).o)
88_a_flags = $(KBUILD_AFLAGS) $(EXTRA_AFLAGS) $(AFLAGS_$(basetarget).o) 94_a_flags = $(KBUILD_AFLAGS) $(asflags-y) $(AFLAGS_$(basetarget).o)
89_cpp_flags = $(KBUILD_CPPFLAGS) $(EXTRA_CPPFLAGS) $(CPPFLAGS_$(@F)) 95_cpp_flags = $(KBUILD_CPPFLAGS) $(cppflags-y) $(CPPFLAGS_$(@F))
90 96
91# If building the kernel in a separate objtree expand all occurrences 97# If building the kernel in a separate objtree expand all occurrences
92# of -Idir to -I$(srctree)/dir except for absolute paths (starting with '/'). 98# of -Idir to -I$(srctree)/dir except for absolute paths (starting with '/').
@@ -115,7 +121,7 @@ a_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(KBUILD_CPPFLAGS) \
115 121
116cpp_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(__cpp_flags) 122cpp_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(__cpp_flags)
117 123
118ld_flags = $(LDFLAGS) $(EXTRA_LDFLAGS) 124ld_flags = $(LDFLAGS) $(ldflags-y)
119 125
120# Finds the multi-part object the current object will be linked into 126# Finds the multi-part object the current object will be linked into
121modname-multi = $(sort $(foreach m,$(multi-used),\ 127modname-multi = $(sort $(foreach m,$(multi-used),\
@@ -145,7 +151,7 @@ $(obj)/%:: $(src)/%_shipped
145# --------------------------------------------------------------------------- 151# ---------------------------------------------------------------------------
146 152
147quiet_cmd_ld = LD $@ 153quiet_cmd_ld = LD $@
148cmd_ld = $(LD) $(LDFLAGS) $(EXTRA_LDFLAGS) $(LDFLAGS_$(@F)) \ 154cmd_ld = $(LD) $(LDFLAGS) $(ldflags-y) $(LDFLAGS_$(@F)) \
149 $(filter-out FORCE,$^) -o $@ 155 $(filter-out FORCE,$^) -o $@
150 156
151# Objcopy 157# Objcopy