aboutsummaryrefslogtreecommitdiff
path: root/scripts/Makefile.lib
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-16 11:23:06 -0700
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-16 11:23:06 -0700
commit821f3eff7cdb9d6c7076effabd46c96c322daed1 (patch)
tree60f13155196fd6c84424c8aebc133ca4a5f56749 /scripts/Makefile.lib
parentebc283118ee448dcb6e6cae74a8a43f17a1ccc3f (diff)
parentf77bf01425b11947eeb3b5b54685212c302741b8 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild
* git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild: (40 commits) kbuild: introduce ccflags-y, asflags-y and ldflags-y kbuild: enable 'make CPPFLAGS=...' to add additional options to CPP kbuild: enable use of AFLAGS and CFLAGS on commandline kbuild: enable 'make AFLAGS=...' to add additional options to AS kbuild: fix AFLAGS use in h8300 and m68knommu kbuild: check for wrong use of CFLAGS kbuild: enable 'make CFLAGS=...' to add additional options to CC kbuild: fix up CFLAGS usage kbuild: make modpost detect unterminated device id lists kbuild: call export_report from the Makefile kbuild: move Kai Germaschewski to CREDITS kconfig/menuconfig: distinguish between selected-by-another options and comments kconfig: tristate choices with mixed tristate and boolean values include/linux/Kbuild: remove duplicate entries kbuild: kill backward compatibility checks kbuild: kill EXTRA_ARFLAGS kbuild: fix documentation in makefiles.txt kbuild: call make once for all targets when O=.. is used kbuild: pass -g to assembler under CONFIG_DEBUG_INFO kbuild: update _shipped files for kconfig syntax cleanup ... Fix up conflicts in arch/um/sys-{x86_64,i386}/Makefile manually.
Diffstat (limited to 'scripts/Makefile.lib')
-rw-r--r--scripts/Makefile.lib30
1 files changed, 17 insertions, 13 deletions
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index fc498fee68e..3c5e88bfecf 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -1,5 +1,9 @@
-# Backward compatibility - to be removed...
-extra-y += $(EXTRA_TARGETS)
+# Backward compatibility
+asflags-y += $(EXTRA_AFLAGS)
+ccflags-y += $(EXTRA_CFLAGS)
+cppflags-y += $(EXTRA_CPPFLAGS)
+ldflags-y += $(EXTRA_LDFLAGS)
+
# Figure out what we need to build from the various variables
# ===========================================================================
@@ -44,9 +48,9 @@ multi-objs-y := $(foreach m, $(multi-used-y), $($(m:.o=-objs)) $($(m:.o=-y)))
multi-objs-m := $(foreach m, $(multi-used-m), $($(m:.o=-objs)) $($(m:.o=-y)))
multi-objs := $(multi-objs-y) $(multi-objs-m)
-# $(subdir-obj-y) is the list of objects in $(obj-y) which do not live
-# in the local directory
-subdir-obj-y := $(foreach o,$(obj-y),$(if $(filter-out $(o),$(notdir $(o))),$(o)))
+# $(subdir-obj-y) is the list of objects in $(obj-y) which uses dir/ to
+# tell kbuild to descend
+subdir-obj-y := $(filter %/built-in.o, $(obj-y))
# $(obj-dirs) is a list of directories that contain object files
obj-dirs := $(dir $(multi-objs) $(subdir-obj-y))
@@ -86,9 +90,9 @@ basename_flags = -D"KBUILD_BASENAME=KBUILD_STR($(call name-fix,$(basetarget)))"
modname_flags = $(if $(filter 1,$(words $(modname))),\
-D"KBUILD_MODNAME=KBUILD_STR($(call name-fix,$(modname)))")
-_c_flags = $(CFLAGS) $(EXTRA_CFLAGS) $(CFLAGS_$(basetarget).o)
-_a_flags = $(AFLAGS) $(EXTRA_AFLAGS) $(AFLAGS_$(basetarget).o)
-_cpp_flags = $(CPPFLAGS) $(EXTRA_CPPFLAGS) $(CPPFLAGS_$(@F))
+_c_flags = $(KBUILD_CFLAGS) $(ccflags-y) $(CFLAGS_$(basetarget).o)
+_a_flags = $(KBUILD_AFLAGS) $(asflags-y) $(AFLAGS_$(basetarget).o)
+_cpp_flags = $(KBUILD_CPPFLAGS) $(cppflags-y) $(CPPFLAGS_$(@F))
# If building the kernel in a separate objtree expand all occurrences
# of -Idir to -I$(srctree)/dir except for absolute paths (starting with '/').
@@ -108,16 +112,16 @@ __a_flags = $(call flags,_a_flags)
__cpp_flags = $(call flags,_cpp_flags)
endif
-c_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(CPPFLAGS) \
+c_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(KBUILD_CPPFLAGS) \
$(__c_flags) $(modkern_cflags) \
-D"KBUILD_STR(s)=\#s" $(basename_flags) $(modname_flags)
-a_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(CPPFLAGS) \
+a_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(KBUILD_CPPFLAGS) \
$(__a_flags) $(modkern_aflags)
cpp_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(__cpp_flags)
-ld_flags = $(LDFLAGS) $(EXTRA_LDFLAGS)
+ld_flags = $(LDFLAGS) $(ldflags-y)
# Finds the multi-part object the current object will be linked into
modname-multi = $(sort $(foreach m,$(multi-used),\
@@ -140,14 +144,14 @@ $(obj)/%:: $(src)/%_shipped
# target: source(s) FORCE
# $(if_changed,ld/objcopy/gzip)
#
-# and add target to EXTRA_TARGETS so that we know we have to
+# and add target to extra-y so that we know we have to
# read in the saved command line
# Linking
# ---------------------------------------------------------------------------
quiet_cmd_ld = LD $@
-cmd_ld = $(LD) $(LDFLAGS) $(EXTRA_LDFLAGS) $(LDFLAGS_$(@F)) \
+cmd_ld = $(LD) $(LDFLAGS) $(ldflags-y) $(LDFLAGS_$(@F)) \
$(filter-out FORCE,$^) -o $@
# Objcopy