kbuild: enable 'make CFLAGS=...' to add additional options to CC
[deliverable/linux.git] / scripts / Makefile.lib
index fc498fee68edefe6c88afc2d546e0e459b9396d9..51ae412929a0ae3c39199514a4a71668fe4fa1d7 100644 (file)
@@ -1,5 +1,3 @@
-# Backward compatibility - to be removed...
-extra-y        += $(EXTRA_TARGETS)
 # Figure out what we need to build from the various variables
 # ===========================================================================
 
@@ -44,9 +42,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,7 +84,7 @@ 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)
+_c_flags       = $(KBUILD_CFLAGS) $(EXTRA_CFLAGS) $(CFLAGS_$(basetarget).o)
 _a_flags       = $(AFLAGS) $(EXTRA_AFLAGS) $(AFLAGS_$(basetarget).o)
 _cpp_flags     = $(CPPFLAGS) $(EXTRA_CPPFLAGS) $(CPPFLAGS_$(@F))
 
@@ -140,7 +138,7 @@ $(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
This page took 0.032801 seconds and 5 git commands to generate.