Index: trunk/kBuild/footer.kmk
===================================================================
--- trunk/kBuild/footer.kmk	(revision 183)
+++ trunk/kBuild/footer.kmk	(revision 184)
@@ -577,6 +577,19 @@
 $(eval obj         := $(outbase)$(objsuff))
 $(eval dep         := $(outbase)$(SUFF_DEP))
-
-#$ (warning dbg: target=$(target) source=$(source) tool=$(tool) obj=$(obj) dep=$(dep) flags=$(flags) defs=$(defs) incs=$(incs) dirdep=$(dirdep) outbase=$(outbase) objsuff=$(objsuff))
+$(eval deps        := \
+	$($(target)_$(source)_DEPS)\
+    $($(target)_$(source)_DEPS.$(BUILD_TYPE))\
+    $($(target)_$(source)_DEPS.$(BUILD_TARGET))\
+    $($(target)_$(source)_DEPS.$(BUILD_TARGET_ARCH))\
+    $($(target)_$(source)_DEPS.$(BUILD_TARGET_CPU))\
+	$($(source)_DEPS)\
+	$($(source)_DEPS.$(BUILD_TYPE))\
+	$($(source)_DEPS.$(BUILD_TARGET))\
+	$($(target)_DEPS)\
+	$($(target)_DEPS.$(BUILD_TARGET_ARCH))\
+	$($(target)_DEPS.$(BUILD_TARGET_CPU)))
+
+
+#$ (warning dbg: target=$(target) source=$(source) tool=$(tool) obj=$(obj) dep=$(dep) flags=$(flags) defs=$(defs) incs=$(incs) dirdep=$(dirdep) outbase=$(outbase) objsuff=$(objsuff) deps=$(deps))
 ifndef TOOL_$(tool)_COMPILE_$(type)
 $$(warning kBuild: TOOL_$(tool)_COMPILE_$(type) is not defined. source=$(source) target=$(target) )
@@ -667,5 +680,5 @@
 $(eval dirdep      := $(dir $(lib)).dir_created)
 ## @todo fix dependencies on makefiles an such
-$(eval deps        := )
+$(eval deps        := $($(target)_DEPS))
 
 $(eval $(TOOL_$(tool)_LINK_LIBRARY))
@@ -798,5 +811,5 @@
 $(eval dirdep      := $(dir $(exe)).dir_created)
 ## @todo fix dependencies
-$(eval deps        := )
+$(eval deps        := $($(target)_DEPS))
 #
 $(eval custom_pre    := $(strip $(firstword
@@ -950,5 +963,5 @@
 $(eval dirdep      := $(dir $(dll)).dir_created)
 ## @todo fix dependencies
-$(eval deps        := )
+$(eval deps        := $($(target)_DEPS))
 #
 $(eval custom_pre    := $(strip $(firstword
@@ -1116,5 +1129,5 @@
 $(eval dirdep      := $(dir $(sys)).dir_created)
 ## @todo fix dependencies
-$(eval deps        := )
+$(eval deps        := $($(target)_DEPS))
 #
 $(eval custom_pre    := $(strip $(firstword
Index: trunk/kBuild/tools/GCC.kmk
===================================================================
--- trunk/kBuild/tools/GCC.kmk	(revision 183)
+++ trunk/kBuild/tools/GCC.kmk	(revision 184)
@@ -75,10 +75,11 @@
 # @param    $(incs)     Includes. No -I or something.
 # @param	$(dirdep)   Directory creation dependency.
+# @param	$(deps)		Other dependencies.
 #
 # @param    $(outbase)  Output basename (full). Use this for list files and such.
 # @param	$(objsuff)  Object suffix.
 define TOOL_GCC_COMPILE_C
-#$ (warning dbg: TOOL_GCC_COMPILE_C: target=$(target) source=$(source) obj=$(obj) dep=$(dep) flags=$(flags) defs=$(defs) incs=$(incs) dirdep=$(dirdep) outbase=$(outbase) objsuff=$(objsuff))
-$(obj): $(dirdep) $(PATH_CURRENT)/$(source)
+#$ (warning dbg: TOOL_GCC_COMPILE_C: target=$(target) source=$(source) obj=$(obj) dep=$(dep) flags=$(flags) defs=$(defs) incs=$(incs) dirdep=$(dirdep) outbase=$(outbase) objsuff=$(objsuff) deps=$(deps))
+$(obj): $(dirdep) $(PATH_CURRENT)/$(source) $(deps)
 	$(call MSG_L2,Compiling $$@ using GCC)
 	$(TOOL_GCC_CC) -c\
@@ -87,5 +88,5 @@
 		-o $$@\
 		$(call ABSPATH,$(source))
-		
+
 endef
 
@@ -100,10 +101,11 @@
 # @param    $(incs)     Includes. No -I or something.
 # @param	$(dirdep)   Directory creation dependency.
+# @param	$(deps)		Other dependencies.
 #
 # @param    $(outbase)  Output basename (full). Use this for list files and such.
 # @param	$(objsuff)  Object suffix.
 define TOOL_GCC_COMPILE_CXX
-#$ (warning dbg: TOOL_GCC_COMPILE_CXX: target=$(target) source=$(source) obj=$(obj) dep=$(dep) flags=$(flags) defs=$(defs) incs=$(incs) dirdep=$(dirdep) outbase=$(outbase) objsuff=$(objsuff))
-$(obj): $(dirdep) $(source)
+#$ (warning dbg: TOOL_GCC_COMPILE_CXX: target=$(target) source=$(source) obj=$(obj) dep=$(dep) flags=$(flags) defs=$(defs) incs=$(incs) dirdep=$(dirdep) outbase=$(outbase) objsuff=$(objsuff) deps=$(deps))
+$(obj): $(dirdep) $(source) $(deps)
 	$(call MSG_L2,Compiling $$@ using GCC)
 	$(TOOL_GCC_CXX) -c\
@@ -112,5 +114,5 @@
 		-o $$@\
 		$(call ABSPATH,$(source))
-		
+
 endef
 
@@ -131,5 +133,5 @@
 	$(RM) -f $$@
 	$(TOOL_GCC_AR) $(flags) $$@ $(objs)
-	
+
 endef
 
@@ -155,11 +157,11 @@
 ifneq ($(custom_pre),)
 	$(eval $(custom_pre))
-endif	
+endif
 	$(TOOL_GCC_LD) $(flags) -o $$@ $(objs) \
 	$(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(basename $(lib))), $(lib)))
 ifneq ($(custom_post),)
 	$(eval $(custom_post))
-endif	
-	
+endif
+
 endef
 
@@ -185,11 +187,11 @@
 ifneq ($(custom_pre),)
 	$(eval $(custom_pre))
-endif	
+endif
 	$(TOOL_GCC_LD) $(TOOL_GCC_LDFLAGS.dll) $(flags) -o $$@ $(objs) \
 	$(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(basename $(lib))), $(lib)))
 ifneq ($(custom_post),)
 	$(eval $(custom_post))
-endif	
-	
+endif
+
 endef
 
Index: trunk/kBuild/tools/GCC3.kmk
===================================================================
--- trunk/kBuild/tools/GCC3.kmk	(revision 183)
+++ trunk/kBuild/tools/GCC3.kmk	(revision 184)
@@ -80,4 +80,5 @@
 # @param    $(incs)     Includes. No -I or something.
 # @param	$(dirdep)   Directory creation dependency.
+# @param	$(deps)		Other dependencies.
 #
 # @param    $(outbase)  Output basename (full). Use this for list files and such.
@@ -85,5 +86,5 @@
 define TOOL_GCC3_COMPILE_C
 #$ (warning dbg: TOOL_GCC3_COMPILE_C: target=$(target) source=$(source) obj=$(obj) dep=$(dep) flags=$(flags) defs=$(defs) incs=$(incs) dirdep=$(dirdep) outbase=$(outbase) objsuff=$(objsuff))
-$(obj): $(dirdep) $(source)
+$(obj): $(dirdep) $(source) $(deps)
 	$(call MSG_L2,Compiling $$@ using GCC3)
 	$(TOOL_GCC3_CC) -c\
@@ -92,5 +93,5 @@
 		-o $$@\
 		$(call ABSPATH,$(source))
-		
+
 endef
 
@@ -105,4 +106,5 @@
 # @param    $(incs)     Includes. No -I or something.
 # @param	$(dirdep)   Directory creation dependency.
+# @param	$(deps)		Other dependencies.
 #
 # @param    $(outbase)  Output basename (full). Use this for list files and such.
@@ -110,5 +112,5 @@
 define TOOL_GCC3_COMPILE_CXX
 #$ (warning dbg: TOOL_GCC3_COMPILE_CXX: target=$(target) source=$(source) obj=$(obj) dep=$(dep) flags=$(flags) defs=$(defs) incs=$(incs) dirdep=$(dirdep) outbase=$(outbase) objsuff=$(objsuff))
-$(obj): $(dirdep) $(source)
+$(obj): $(dirdep) $(source) $(deps)
 	$(call MSG_L2,Compiling $$@ using GCC3)
 	$(TOOL_GCC3_CXX) -c\
@@ -117,5 +119,5 @@
 		-o $$@\
 		$(call ABSPATH,$(source))
-		
+
 endef
 
@@ -136,5 +138,5 @@
 	$(RM) -f $$@
 	$(TOOL_GCC3_AR) $(flags) $$@ $(objs)
-	
+
 endef
 
@@ -160,5 +162,5 @@
 ifneq ($(custom_pre),)
 	$(eval $(custom_pre))
-endif	
+endif
 	$(TOOL_GCC3_LD) $(flags) -o $$@ $(objs) \
 	$(foreach p,$(libpath), -L$(p)) \
@@ -166,6 +168,6 @@
 ifneq ($(custom_post),)
 	$(eval $(custom_post))
-endif	
-	
+endif
+
 endef
 
@@ -191,5 +193,5 @@
 ifneq ($(custom_pre),)
 	$(eval $(custom_pre))
-endif	
+endif
 	$(TOOL_GCC3_LD) $(TOOL_GCC3_LDFLAGS.dll) $(flags) -o $$@ $(objs) \
 	$(foreach p,$(libpath), -L$(p)) \
@@ -197,6 +199,6 @@
 ifneq ($(custom_post),)
 	$(eval $(custom_post))
-endif	
-	
+endif
+
 endef
 
@@ -221,5 +223,5 @@
 ifneq ($(custom_pre),)
 	$(eval $(custom_pre))
-endif	
+endif
 	$(TOOL_GCC3_LD_SYSMOD) $(TOOL_GCC3_LDFLAGS.sysmod) $(flags) -o $$@ $(objs) \
 		$(foreach p,$(libpath), -L$(p)) \
@@ -227,6 +229,6 @@
 ifneq ($(custom_post),)
 	$(eval $(custom_post))
-endif	
-
-endef
-													
+endif
+
+endef
+
Index: trunk/kBuild/tools/GCC3OMF.kmk
===================================================================
--- trunk/kBuild/tools/GCC3OMF.kmk	(revision 183)
+++ trunk/kBuild/tools/GCC3OMF.kmk	(revision 184)
@@ -80,10 +80,11 @@
 # @param    $(incs)     Includes. No -I or something.
 # @param	$(dirdep)   Directory creation dependency.
+# @param	$(deps)		Other dependencies.
 #
 # @param    $(outbase)  Output basename (full). Use this for list files and such.
 # @param	$(objsuff)  Object suffix.
 define TOOL_GCC3OMF_COMPILE_C
-#$ (warning dbg: TOOL_GCC3OMF_COMPILE_C: target=$(target) source=$(source) obj=$(obj) dep=$(dep) flags=$(flags) defs=$(defs) incs=$(incs) dirdep=$(dirdep) outbase=$(outbase) objsuff=$(objsuff))
-$(obj): $(dirdep) $(source)
+#$ (warning dbg: TOOL_GCC3OMF_COMPILE_C: target=$(target) source=$(source) obj=$(obj) dep=$(dep) flags=$(flags) defs=$(defs) incs=$(incs) dirdep=$(dirdep) outbase=$(outbase) objsuff=$(objsuff) deps=$(deps))
+$(obj): $(dirdep) $(source) $(deps)
 	$(call MSG_L2,Compiling $$@ using GCC3)
 	$(TOOL_GCC3OMF_CC) -c\
@@ -92,5 +93,5 @@
 		-o $$@\
 		$(call ABSPATH,$(source))
-		
+
 endef
 
@@ -105,10 +106,11 @@
 # @param    $(incs)     Includes. No -I or something.
 # @param	$(dirdep)   Directory creation dependency.
+# @param	$(deps)		Other dependencies.
 #
 # @param    $(outbase)  Output basename (full). Use this for list files and such.
 # @param	$(objsuff)  Object suffix.
 define TOOL_GCC3OMF_COMPILE_CXX
-#$ (warning dbg: TOOL_GCC3OMF_COMPILE_CXX: target=$(target) source=$(source) obj=$(obj) dep=$(dep) flags=$(flags) defs=$(defs) incs=$(incs) dirdep=$(dirdep) outbase=$(outbase) objsuff=$(objsuff))
-$(obj): $(dirdep) $(source)
+#$ (warning dbg: TOOL_GCC3OMF_COMPILE_CXX: target=$(target) source=$(source) obj=$(obj) dep=$(dep) flags=$(flags) defs=$(defs) incs=$(incs) dirdep=$(dirdep) outbase=$(outbase) objsuff=$(objsuff) deps=$(deps))
+$(obj): $(dirdep) $(source) $(deps)
 	$(call MSG_L2,Compiling $$@ using GCC3)
 	$(TOOL_GCC3OMF_CXX) -c\
@@ -117,5 +119,5 @@
 		-o $$@\
 		$(call ABSPATH,$(source))
-		
+
 endef
 
@@ -136,5 +138,5 @@
 	$(RM) -f $$@
 	$(TOOL_GCC3OMF_AR) $(flags) $$@ $(objs)
-	
+
 endef
 
@@ -160,5 +162,5 @@
 ifneq ($(custom_pre),)
 	$(eval $(custom_pre))
-endif	
+endif
 	$(TOOL_GCC3OMF_LD) $(flags) -o $$@ $(objs) \
 	$(foreach p,$(libpath), -L$(p)) \
@@ -166,6 +168,6 @@
 ifneq ($(custom_post),)
 	$(eval $(custom_post))
-endif	
-	
+endif
+
 endef
 
@@ -191,5 +193,5 @@
 ifneq ($(custom_pre),)
 	$(eval $(custom_pre))
-endif	
+endif
 	$(TOOL_GCC3OMF_LD) $(TOOL_GCC3OMF_LDFLAGS.dll) $(flags) -o $$@ $(objs) \
 	$(foreach p,$(libpath), -L$(p)) \
@@ -197,6 +199,6 @@
 ifneq ($(custom_post),)
 	$(eval $(custom_post))
-endif	
-	
+endif
+
 endef
 
@@ -221,5 +223,5 @@
 ifneq ($(custom_pre),)
 	$(eval $(custom_pre))
-endif	
+endif
 	$(TOOL_GCC3OMF_LD_SYSMOD) $(TOOL_GCC3OMF_LDFLAGS.sysmod) $(flags) -o $$@ $(objs) \
 		$(foreach p,$(libpath), -L$(p)) \
@@ -227,6 +229,6 @@
 ifneq ($(custom_post),)
 	$(eval $(custom_post))
-endif	
-
-endef
-													
+endif
+
+endef
+
Index: trunk/kBuild/tools/MINGW32.kmk
===================================================================
--- trunk/kBuild/tools/MINGW32.kmk	(revision 183)
+++ trunk/kBuild/tools/MINGW32.kmk	(revision 184)
@@ -28,5 +28,5 @@
 
 # find latest installed version
-ifndef PATH_TOOL_MINGW32								
+ifndef PATH_TOOL_MINGW32
 PATH_TOOL_MINGW32            := $(sort $(wildcard $(PATH_DEV)/$(BUILD_PLATFORM_ARCH).$(BUILD_PLATFORM)/mingw32/v*.*))
 ifeq ($(PATH_TOOL_MINGW32),)
@@ -55,5 +55,5 @@
 endif
 endif
-								
+
 TOOL_MINGW32_CC                 := $(_TOOL_MINGW32_PREFIX)gcc$(_TOOL_MINGW32_SUFF_EXE)
 TOOL_MINGW32_COBJSUFF           := .o
@@ -105,10 +105,11 @@
 # @param    $(incs)     Includes. No -I or something.
 # @param	$(dirdep)   Directory creation dependency.
+# @param	$(deps)		Other dependencies.
 #
 # @param    $(outbase)  Output basename (full). Use this for list files and such.
 # @param	$(objsuff)  Object suffix.
 define TOOL_MINGW32_COMPILE_C
-#$ (warning dbg: TOOL_MINGW32_COMPILE_C: target=$(target) source=$(source) obj=$(obj) dep=$(dep) flags=$(flags) defs=$(defs) incs=$(incs) dirdep=$(dirdep) outbase=$(outbase) objsuff=$(objsuff))
-$(obj): $(dirdep) $(source)
+#$ (warning dbg: TOOL_MINGW32_COMPILE_C: target=$(target) source=$(source) obj=$(obj) dep=$(dep) flags=$(flags) defs=$(defs) incs=$(incs) dirdep=$(dirdep) outbase=$(outbase) objsuff=$(objsuff) deps=$(deps))
+$(obj): $(dirdep) $(source) $(deps)
 	$(call MSG_L2,Compiling $$@ using MINGW32)
 	$(TOOL_MINGW32_CC) -c\
@@ -117,5 +118,5 @@
 		-o $$@\
 		$(call ABSPATH,$(source))
-		
+
 endef
 
@@ -130,10 +131,11 @@
 # @param    $(incs)     Includes. No -I or something.
 # @param	$(dirdep)   Directory creation dependency.
+# @param	$(deps)		Other dependencies.
 #
 # @param    $(outbase)  Output basename (full). Use this for list files and such.
 # @param	$(objsuff)  Object suffix.
 define TOOL_MINGW32_COMPILE_CXX
-#$ (warning dbg: TOOL_MINGW32_COMPILE_CXX: target=$(target) source=$(source) obj=$(obj) dep=$(dep) flags=$(flags) defs=$(defs) incs=$(incs) dirdep=$(dirdep) outbase=$(outbase) objsuff=$(objsuff))
-$(obj): $(dirdep) $(source)
+#$ (warning dbg: TOOL_MINGW32_COMPILE_CXX: target=$(target) source=$(source) obj=$(obj) dep=$(dep) flags=$(flags) defs=$(defs) incs=$(incs) dirdep=$(dirdep) outbase=$(outbase) objsuff=$(objsuff) deps=$(deps))
+$(obj): $(dirdep) $(source) $(deps)
 	$(call MSG_L2,Compiling $$@ using MINGW32)
 	$(TOOL_MINGW32_CXX) -c\
@@ -142,5 +144,5 @@
 		-o $$@\
 		$(call ABSPATH,$(source))
-		
+
 endef
 
@@ -161,5 +163,5 @@
 	$(RM) -f $$@
 	$(TOOL_MINGW32_AR) $(flags) $$@ $(objs)
-	
+
 endef
 
@@ -185,5 +187,5 @@
 ifneq ($(custom_pre),)
 	$(eval $(custom_pre))
-endif	
+endif
 	$(TOOL_MINGW32_LD) $(flags) -o $$@ $(objs) \
 	$(foreach p,$(libpath), -L$(p)) \
@@ -191,6 +193,6 @@
 ifneq ($(custom_post),)
 	$(eval $(custom_post))
-endif	
-	
+endif
+
 endef
 
@@ -216,5 +218,5 @@
 ifneq ($(custom_pre),)
 	$(eval $(custom_pre))
-endif	
+endif
 	$(TOOL_MINGW32_DLLWRAP) $(flags) \
 		--dllname=$(dll) \
@@ -231,5 +233,5 @@
 ifneq ($(custom_post),)
 	$(eval $(custom_post))
-endif	
+endif
 _OUT_FILES += $(outbase).map $(outbase).a $(outbase).exp
 
Index: trunk/kBuild/tools/NASM.kmk
===================================================================
--- trunk/kBuild/tools/NASM.kmk	(revision 183)
+++ trunk/kBuild/tools/NASM.kmk	(revision 184)
@@ -33,5 +33,5 @@
 endif
 endif
-		
+
 ifneq ($(PATH_TOOL_NASM),)
 TOOL_NASM_AS                  := $(PATH_TOOL_NASM)/nasm$(HOSTSUFF_EXE)
@@ -51,10 +51,11 @@
 # @param    $(incs)     Includes. No -I or something.
 # @param	$(dirdep)   Directory creation dependency.
+# @param	$(deps)		Other dependencies.
 #
 # @param    $(outbase)  Output basename (full). Use this for list files and such.
 # @param	$(objsuff)  Object suffix.
 define TOOL_NASM_COMPILE_AS
-#$ (warning dbg: TOOL_NASM_COMPILE_AS: target=$(target) source=$(source) obj=$(obj) dep=$(dep) flags=$(flags) defs=$(defs) incs=$(incs) dirdep=$(dirdep) outbase=$(outbase) objsuff=$(objsuff))
-$(obj): $(dirdep) $(source)
+#$ (warning dbg: TOOL_NASM_COMPILE_AS: target=$(target) source=$(source) obj=$(obj) dep=$(dep) flags=$(flags) defs=$(defs) incs=$(incs) dirdep=$(dirdep) outbase=$(outbase) objsuff=$(objsuff) deps=$(deps))
+$(obj): $(dirdep) $(source) $(deps)
 	$(call MSG_L2,Compiling $$@ using NASM)
 	$(TOOL_NASM_AS) \
@@ -64,5 +65,5 @@
 		$(call ABSPATH,$(source))
 _OUT_FILES += $(outbase).lst
-		
+
 endef
 
Index: trunk/kBuild/tools/VCC70.kmk
===================================================================
--- trunk/kBuild/tools/VCC70.kmk	(revision 183)
+++ trunk/kBuild/tools/VCC70.kmk	(revision 184)
@@ -70,4 +70,5 @@
 # @param    $(incs)     Includes. No -I or something.
 # @param	$(dirdep)   Directory creation dependency.
+# @param	$(deps)		Other dependencies.
 #
 # @param    $(outbase)  Output basename (full). Use this for list files and such.
@@ -75,5 +76,5 @@
 define TOOL_VCC70_COMPILE_C
 #$ (warning dbg: TOOL_VCC70_COMPILE_C: target=$(target) source=$(source) obj=$(obj) dep=$(dep) flags=$(flags) defs=$(defs) incs=$(incs) dirdep=$(dirdep) outbase=$(outbase) objsuff=$(objsuff))
-$(obj): $(dirdep) $(source)
+$(obj): $(dirdep) $(source) $(deps)
 	$(call MSG_L2,Compiling $$@ using VCC70)
 	$(TOOL_VCC70_CC) -c\
@@ -101,4 +102,5 @@
 # @param    $(incs)     Includes. No -I or something.
 # @param	$(dirdep)   Directory creation dependency.
+# @param	$(deps)		Other dependencies.
 #
 # @param    $(outbase)  Output basename (full). Use this for list files and such.
@@ -106,5 +108,5 @@
 define TOOL_VCC70_COMPILE_CXX
 #$ (warning dbg: TOOL_VCC70_COMPILE_CXX: target=$(target) source=$(source) obj=$(obj) dep=$(dep) flags=$(flags) defs=$(defs) incs=$(incs) dirdep=$(dirdep) outbase=$(outbase) objsuff=$(objsuff))
-$(obj): $(dirdep) $(source)
+$(obj): $(dirdep) $(source) $(deps)
 	$(call MSG_L2,Compiling $$@ using VCC70)
 	$(TOOL_VCC70_CXX) -c\
@@ -118,5 +120,5 @@
 		-D__DATE__=\"0000.00.00\" -D__FILE__=\"filename.c\" -D__LINE__=42 -D__TIME__=\"00.00.00\" -D__TIMESTAMP__=\"lotsofnumbers\" \
 		$(addprefix -D, $(defs)) $(addprefix -I, $(incs)) \
-		$(call ABSPATH,$(source)) 
+		$(call ABSPATH,$(source))
 _OUT_FILES += $(outbase).pdb
 
@@ -252,5 +254,5 @@
 		$(foreach p,$(libpath), /LIBPATH:$(p)) \
 		$(subst /,\\,$(objs)) \
-		$(subst /,\\,$(libs))		
+		$(subst /,\\,$(libs))
 ifeq ($(filter %.exp .def,$(othersrc)),)
 	if test -f $(outbase).exp; then $(CP) $(outbase).exp $(PATH_LIB)/; fi
