Index: trunk/kBuild/footer.kmk
===================================================================
--- trunk/kBuild/footer.kmk	(revision 121)
+++ trunk/kBuild/footer.kmk	(revision 122)
@@ -292,9 +292,11 @@
 _SDKS := $(SDKS)
 define def_sdks_target_source
-$(foreach sdk, $($(source)_SDKS) $($(target)_$(source)_SDKS), \
+$(foreach sdk, $($(source)_SDKS) $($(source)_SDKS.$(BUILD_TARGET)) $($(source)_SDKS.$(BUILD_MODE)) \
+			   $($(target)_$(source)_SDKS) $($(target)_$(source)_SDKS.$(BUILD_TARGET)) $($(target)_$(source)_SDKS.$(BUILD_MODE)), \
 	$(eval _SDKS += $(sdk)))
 endef
 define def_sdks_target
-$(foreach sdk, $($(target)_SDKS), $(eval _SDKS += $(sdk)))
+$(foreach sdk, $($(target)_SDKS) $($(target)_SDKS.$(BUILD_TARGET)) $($(target)_SDKS.$(BUILD_MODE))\
+	, $(eval _SDKS += $(sdk)))
 $(foreach source, $($(target)_SOURCES) $($(target)_SOURCES.$(BUILD_TARGET)) $($(target)_SOURCES.$(BUILD_MODE))\
 	, $(eval $(def_sdks_target_source)))
@@ -303,10 +305,10 @@
 _SDKS := $(sort $(_SDKS))
 
-define def_sdks_include
+define def_sdks_include_one
 ifndef SDK_$(sdk)
 include $(firstword $(wildcard $(PATH_KBUILD)/sdks/$(sdk).kmk))
 endif
 endef
-$(foreach sdk, $(_SDKS), $(eval $(def_sdk)))
+$(foreach sdk, $(_SDKS), $(eval $(def_sdks_include_one)))
 
 #
@@ -702,4 +704,12 @@
 	$($(target)_LIBS.$(BUILD_TYPE))\
 	$($(target)_LIBS)\
+	$(foreach sdk, $($(target)_SDKS.$(BUILD_TARGET)) \
+				   $($(target)_SDKS.$(BUILD_TYPE)) \
+				   $($(target)_SDKS),\
+	$(SDK_$(sdk)_LIBS.$(BUILD_TARGET_CPU))\
+	$(SDK_$(sdk)_LIBS.$(BUILD_TARGET_ARCH))\
+	$(SDK_$(sdk)_LIBS.$(BUILD_TARGET))\
+	$(SDK_$(sdk)_LIBS.$(BUILD_TYPE))\
+	$(SDK_$(sdk)_LIBS))\
 	$(LIBS.$(BUILD_TARGET_CPU))\
 	$(LIBS.$(BUILD_TARGET_ARCH))\
@@ -707,4 +717,15 @@
 	$(LIBS.$(BUILD_TYPE))\
 	$(LIBS)\
+	$(foreach sdk, $(SDKS.$(BUILD_TARGET)) \
+				   $(SDKS.$(BUILD_TYPE)) \
+				   $(SDKS),\
+	$(SDK_$(sdk)_LIBS.$(BUILD_TARGET_CPU))\
+	$(SDK_$(sdk)_LIBS.$(BUILD_TARGET_ARCH))\
+	$(SDK_$(sdk)_LIBS.$(BUILD_TARGET))\
+	$(SDK_$(sdk)_LIBS.$(BUILD_TYPE))\
+	$(SDK_$(sdk)_LIBS))\
+	$(TOOL_$(tool)_LIBS.$(BUILD_TARGET_CPU))\
+	$(TOOL_$(tool)_LIBS.$(BUILD_TARGET_ARCH))\
+	$(TOOL_$(tool)_LIBS.$(BUILD_TARGET))\
 	$(TOOL_$(tool)_LIBS.$(BUILD_TYPE))\
 	$(TOOL_$(tool)_LIBS)\
@@ -716,4 +737,12 @@
 	$($(target)_LIBPATH.$(BUILD_TYPE))\
 	$($(target)_LIBPATH)\
+	$(foreach sdk, $($(target)_SDKS.$(BUILD_TARGET)) \
+				   $($(target)_SDKS.$(BUILD_TYPE)) \
+				   $($(target)_SDKS),\
+	$(SDK_$(sdk)_LIBPATH.$(BUILD_TARGET_CPU))\
+	$(SDK_$(sdk)_LIBPATH.$(BUILD_TARGET_ARCH))\
+	$(SDK_$(sdk)_LIBPATH.$(BUILD_TARGET))\
+	$(SDK_$(sdk)_LIBPATH.$(BUILD_TYPE))\
+	$(SDK_$(sdk)_LIBPATH))\
 	$(LIBPATH.$(BUILD_TARGET_CPU))\
 	$(LIBPATH.$(BUILD_TARGET_ARCH))\
@@ -721,4 +750,12 @@
 	$(LIBPATH.$(BUILD_TYPE))\
 	$(LIBPATH)\
+	$(foreach sdk, $(SDKS.$(BUILD_TARGET)) \
+				   $(SDKS.$(BUILD_TYPE)) \
+				   $(SDKS),\
+	$(SDK_$(sdk)_LIBPATH.$(BUILD_TARGET_CPU))\
+	$(SDK_$(sdk)_LIBPATH.$(BUILD_TARGET_ARCH))\
+	$(SDK_$(sdk)_LIBPATH.$(BUILD_TARGET))\
+	$(SDK_$(sdk)_LIBPATH.$(BUILD_TYPE))\
+	$(SDK_$(sdk)_LIBPATH))\
 	$(TOOL_$(tool)_LIBPATH.$(BUILD_TARGET_CPU))\
 	$(TOOL_$(tool)_LIBPATH.$(BUILD_TARGET_ARCH))\
@@ -821,4 +858,12 @@
 	$($(target)_LIBS.$(BUILD_TYPE))\
 	$($(target)_LIBS)\
+	$(foreach sdk, $($(target)_SDKS.$(BUILD_TARGET)) \
+				   $($(target)_SDKS.$(BUILD_TYPE)) \
+				   $($(target)_SDKS),\
+	$(SDK_$(sdk)_LIBS.$(BUILD_TARGET_CPU))\
+	$(SDK_$(sdk)_LIBS.$(BUILD_TARGET_ARCH))\
+	$(SDK_$(sdk)_LIBS.$(BUILD_TARGET))\
+	$(SDK_$(sdk)_LIBS.$(BUILD_TYPE))\
+	$(SDK_$(sdk)_LIBS))\
 	$(LIBS.$(BUILD_TARGET_CPU))\
 	$(LIBS.$(BUILD_TARGET_ARCH))\
@@ -826,4 +871,15 @@
 	$(LIBS.$(BUILD_TYPE))\
 	$(LIBS)\
+	$(foreach sdk, $(SDKS.$(BUILD_TARGET)) \
+				   $(SDKS.$(BUILD_TYPE)) \
+				   $(SDKS),\
+	$(SDK_$(sdk)_LIBS.$(BUILD_TARGET_CPU))\
+	$(SDK_$(sdk)_LIBS.$(BUILD_TARGET_ARCH))\
+	$(SDK_$(sdk)_LIBS.$(BUILD_TARGET))\
+	$(SDK_$(sdk)_LIBS.$(BUILD_TYPE))\
+	$(SDK_$(sdk)_LIBS))\
+	$(TOOL_$(tool)_LIBS.$(BUILD_TARGET_CPU))\
+	$(TOOL_$(tool)_LIBS.$(BUILD_TARGET_ARCH))\
+	$(TOOL_$(tool)_LIBS.$(BUILD_TARGET))\
 	$(TOOL_$(tool)_LIBS.$(BUILD_TYPE))\
 	$(TOOL_$(tool)_LIBS)\
@@ -835,4 +891,12 @@
 	$($(target)_LIBPATH.$(BUILD_TYPE))\
 	$($(target)_LIBPATH)\
+	$(foreach sdk, $($(target)_SDKS.$(BUILD_TARGET)) \
+				   $($(target)_SDKS.$(BUILD_TYPE)) \
+				   $($(target)_SDKS),\
+	$(SDK_$(sdk)_LIBPATH.$(BUILD_TARGET_CPU))\
+	$(SDK_$(sdk)_LIBPATH.$(BUILD_TARGET_ARCH))\
+	$(SDK_$(sdk)_LIBPATH.$(BUILD_TARGET))\
+	$(SDK_$(sdk)_LIBPATH.$(BUILD_TYPE))\
+	$(SDK_$(sdk)_LIBPATH))\
 	$(LIBPATH.$(BUILD_TARGET_CPU))\
 	$(LIBPATH.$(BUILD_TARGET_ARCH))\
@@ -840,4 +904,12 @@
 	$(LIBPATH.$(BUILD_TYPE))\
 	$(LIBPATH)\
+	$(foreach sdk, $(SDKS.$(BUILD_TARGET)) \
+				   $(SDKS.$(BUILD_TYPE)) \
+				   $(SDKS),\
+	$(SDK_$(sdk)_LIBPATH.$(BUILD_TARGET_CPU))\
+	$(SDK_$(sdk)_LIBPATH.$(BUILD_TARGET_ARCH))\
+	$(SDK_$(sdk)_LIBPATH.$(BUILD_TARGET))\
+	$(SDK_$(sdk)_LIBPATH.$(BUILD_TYPE))\
+	$(SDK_$(sdk)_LIBPATH))\
 	$(TOOL_$(tool)_LIBPATH.$(BUILD_TARGET_CPU))\
 	$(TOOL_$(tool)_LIBPATH.$(BUILD_TARGET_ARCH))\
