Index: /trunk/kBuild/tools/MINGW32.kmk
===================================================================
--- /trunk/kBuild/tools/MINGW32.kmk	(revision 2486)
+++ /trunk/kBuild/tools/MINGW32.kmk	(revision 2487)
@@ -254,9 +254,9 @@
 # @param    $(outbase)  Output basename (full). Use this for list files and such.
 TOOL_MINGW32_LINK_DLL_OUTPUT =
-TOOL_MINGW32_LINK_DLL_OUTPUT_MAYBE = $(outbase).a $(outbase).exp $(PATH_LIB)/$(notdir $(outbase)).exp $(PATH_LIB)/$(notdir $(outbase)).a
+TOOL_MINGW32_LINK_DLL_OUTPUT_MAYBE = $(outbase).a $(outbase).exp $(PATH_STAGE_LIB)/$(notdir $(outbase)).exp $(PATH_STAGE_LIB)/$(notdir $(outbase)).a
 ## @todo Find a better solution for installing the extra files (.a, .exp, .pdb, etc).
 TOOL_MINGW32_LINK_DLL_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib)))\
 	$(filter %.def %.res,$(othersrc))
-TOOL_MINGW32_LINK_DLL_DEPORD = $(call DIRDEP,$(PATH_LIB))
+TOOL_MINGW32_LINK_DLL_DEPORD = $(call DIRDEP,$(PATH_STAGE_LIB))
 define TOOL_MINGW32_LINK_DLL_CMDS
 	$(QUIET)$(TOOL_MINGW32_DLLWRAP) $(flags)\
@@ -269,5 +269,5 @@
 		$(foreach p,$(libpath), -L$(p))\
 		$(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(basename $(lib))), $(lib)))
-	$(QUIET)$(CP) $(outbase).exp $(outbase).a $(PATH_LIB)/
+	$(QUIET)$(CP) $(outbase).exp $(outbase).a $(PATH_STAGE_LIB)/
 endef
 ## @todo separate install stuff!
Index: /trunk/kBuild/tools/VCC100.kmk
===================================================================
--- /trunk/kBuild/tools/VCC100.kmk	(revision 2486)
+++ /trunk/kBuild/tools/VCC100.kmk	(revision 2487)
@@ -287,7 +287,7 @@
 # @param    $(outbase)  Output basename (full). Use this for list files and such.
 TOOL_VCC100_LINK_DLL_DEPEND = $(objs) $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
-TOOL_VCC100_LINK_DLL_DEPORD = $(call DIRDEP,$(PATH_LIB))
+TOOL_VCC100_LINK_DLL_DEPORD = $(call DIRDEP,$(PATH_STAGE_LIB))
 TOOL_VCC100_LINK_DLL_OUTPUT = $(outbase).map $(outbase).lib $(outbase).exp
-TOOL_VCC100_LINK_DLL_OUTPUT_MAYBE = $(outbase).pdb $(outbase).ilk $(out).manifest $(PATH_LIB)/$(notdir $(outbase)).lib $(PATH_LIB)/$(notdir $(outbase)).exp
+TOOL_VCC100_LINK_DLL_OUTPUT_MAYBE = $(outbase).pdb $(outbase).ilk $(out).manifest $(PATH_STAGE_LIB)/$(notdir $(outbase)).lib $(PATH_STAGE_LIB)/$(notdir $(outbase)).exp
 define TOOL_VCC100_LINK_DLL_CMDS
 	$(QUIET)$(TOOL_VCC100_LD) $(flags) \
@@ -304,6 +304,6 @@
 	$(QUIET)$(TEST) -f $(out).manifest -- \
 		$(TOOL_VCC100_MT) -manifest $(subst /,\\,$(out)).manifest '-outputresource:$(subst /,\\,$(out));#2'
-	$(QUIET)$(CP) --changed --ignore-non-existing $(outbase).exp $(outbase).lib $(PATH_LIB)/
-$(eval _DIRS += $(PATH_LIB))
+	$(QUIET)$(CP) --changed --ignore-non-existing $(outbase).exp $(outbase).lib $(PATH_STAGE_LIB)/
+$(eval _DIRS += $(PATH_STAGE_LIB))
 endef
 
Index: /trunk/kBuild/tools/VCC100AMD64.kmk
===================================================================
--- /trunk/kBuild/tools/VCC100AMD64.kmk	(revision 2486)
+++ /trunk/kBuild/tools/VCC100AMD64.kmk	(revision 2487)
@@ -154,4 +154,45 @@
 TOOL_VCC100AMD64_COMPILE_CXX_DEPEND =
 TOOL_VCC100AMD64_COMPILE_CXX_DEPORD =
+ifdef KBUILD_USE_KOBJCACHE
+TOOL_VCC100AMD64_COMPILE_CXX_USES_KOBJCACHE = 1
+TOOL_VCC100AMD64_COMPILE_CXX_OUTPUT = $(call TOOL_VCC100AMD64_PDB, $(outbase)-obj,idb) $(outbase).ii
+TOOL_VCC100AMD64_COMPILE_CXX_OUTPUT_MAYBE = $(call TOOL_VCC100AMD64_PDB, $(outbase)-obj,pdb)
+if 1
+define TOOL_VCC100AMD64_COMPILE_CXX_CMDS
+	$(QUIET)$(KOBJCACHE) -f $(outbase).koc -d $(PATH_OBJCACHE) -t $(bld_trg).$(bld_trg_arch) -r\
+		--named-pipe-compile $(subst /,\\,//./pipe/kObjCache/$(translate $(outbase),:,_)/$(notdir $(source)))\
+		--kObjCache-cpp $(outbase).ii\
+		$(TOOL_VCC100AMD64_CXX) -E\
+		$(flags)\
+		$(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
+		$(subst /,\\,$(abspath $(source))) \
+		--kObjCache-cc $(obj)\
+		windbg $(TOOL_VCC100AMD64_CXX) -c -TP\
+		$(flags)\
+		-Fd$(outbase)-obj.pdb \
+		-FD\
+		-Fo$(obj)\
+		$(subst /,\\,//./pipe/kObjCache/$(translate $(outbase),:,_)/$(notdir $(source)))
+	$(QUIET)$(DEP_IDB) -f -s -q -o $(dep) -t $(obj) $(call TOOL_VCC100AMD64_PDB,$(outbase)-obj,idb)
+endef
+else
+define TOOL_VCC100AMD64_COMPILE_CXX_CMDS
+	$(QUIET)$(KOBJCACHE) -f $(outbase).koc -d $(PATH_OBJCACHE) -t $(bld_trg).$(bld_trg_arch) -r\
+		--kObjCache-cpp $(outbase).ii\
+		$(TOOL_VCC100AMD64_CXX) -E\
+		$(flags)\
+		$(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
+		$(subst /,\\,$(abspath $(source))) \
+		--kObjCache-cc $(obj)\
+		$(TOOL_VCC100AMD64_CXX) -c -TP\
+		$(flags)\
+		-Fd$(outbase)-obj.pdb \
+		-FD\
+		-Fo$(obj)\
+		$(outbase).ii
+	$(QUIET)$(DEP_IDB) -f -s -q -o $(dep) -t $(obj) $(call TOOL_VCC100AMD64_PDB,$(outbase)-obj,idb)
+endef
+endif
+else  # !KBUILD_USE_KOBJCACHE
 TOOL_VCC100AMD64_COMPILE_CXX_OUTPUT = $(call TOOL_VCC100AMD64_PDB, $(outbase)-obj,idb)
 TOOL_VCC100AMD64_COMPILE_CXX_OUTPUT_MAYBE = $(call TOOL_VCC100AMD64_PDB, $(outbase)-obj,pdb)
@@ -165,5 +206,5 @@
 	$(QUIET)$(DEP_IDB) -f -s -q -o $(dep) -t $(obj) $(call TOOL_VCC100AMD64_PDB,$(outbase)-obj,idb)
 endef
-
+endif # !KBUILD_USE_KOBJCACHE
 
 ## Compile resource source.
@@ -264,7 +305,7 @@
 # @param    $(outbase)  Output basename (full). Use this for list files and such.
 TOOL_VCC100AMD64_LINK_DLL_DEPEND = $(objs) $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
-TOOL_VCC100AMD64_LINK_DLL_DEPORD = $(call DIRDEP,$(PATH_LIB))
+TOOL_VCC100AMD64_LINK_DLL_DEPORD = $(call DIRDEP,$(PATH_STAGE_LIB))
 TOOL_VCC100AMD64_LINK_DLL_OUTPUT = $(outbase).map $(outbase).lib $(outbase).exp
-TOOL_VCC100AMD64_LINK_DLL_OUTPUT_MAYBE = $(outbase).pdb $(outbase).ilk $(out).manifest $(PATH_LIB)/$(notdir $(outbase)).lib $(PATH_LIB)/$(notdir $(outbase)).exp
+TOOL_VCC100AMD64_LINK_DLL_OUTPUT_MAYBE = $(outbase).pdb $(outbase).ilk $(out).manifest $(PATH_STAGE_LIB)/$(notdir $(outbase)).lib $(PATH_STAGE_LIB)/$(notdir $(outbase)).exp
 define TOOL_VCC100AMD64_LINK_DLL_CMDS
 	$(QUIET)$(TOOL_VCC100AMD64_LD) $(flags) \
@@ -281,6 +322,6 @@
 	$(QUIET)$(TEST) -f $(out).manifest -- \
 		$(TOOL_VCC100AMD64_MT) -manifest $(subst /,\\,$(out)).manifest '-outputresource:$(subst /,\\,$(out));#2'
-	$(QUIET)$(CP) --changed --ignore-non-existing $(outbase).exp $(outbase).lib $(PATH_LIB)/
-$(eval _DIRS += $(PATH_LIB))
+	$(QUIET)$(CP) --changed --ignore-non-existing $(outbase).exp $(outbase).lib $(PATH_STAGE_LIB)/
+$(eval _DIRS += $(PATH_STAGE_LIB))
 endef
 
Index: /trunk/kBuild/tools/VCC100X86.kmk
===================================================================
--- /trunk/kBuild/tools/VCC100X86.kmk	(revision 2486)
+++ /trunk/kBuild/tools/VCC100X86.kmk	(revision 2487)
@@ -266,7 +266,7 @@
 # @param    $(outbase)  Output basename (full). Use this for list files and such.
 TOOL_VCC100X86_LINK_DLL_DEPEND = $(objs) $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
-TOOL_VCC100X86_LINK_DLL_DEPORD = $(call DIRDEP,$(PATH_LIB))
+TOOL_VCC100X86_LINK_DLL_DEPORD = $(call DIRDEP,$(PATH_STAGE_LIB))
 TOOL_VCC100X86_LINK_DLL_OUTPUT = $(outbase).map $(outbase).lib $(outbase).exp
-TOOL_VCC100X86_LINK_DLL_OUTPUT_MAYBE = $(outbase).pdb $(outbase).ilk $(out).manifest $(PATH_LIB)/$(notdir $(outbase)).lib $(PATH_LIB)/$(notdir $(outbase)).exp
+TOOL_VCC100X86_LINK_DLL_OUTPUT_MAYBE = $(outbase).pdb $(outbase).ilk $(out).manifest $(PATH_STAGE_LIB)/$(notdir $(outbase)).lib $(PATH_STAGE_LIB)/$(notdir $(outbase)).exp
 define TOOL_VCC100X86_LINK_DLL_CMDS
 	$(QUIET)$(TOOL_VCC100X86_LD) $(flags) \
@@ -283,6 +283,6 @@
 	$(QUIET)$(TEST) -f $(out).manifest -- \
 		$(TOOL_VCC100X86_MT) -manifest $(subst /,\\,$(out)).manifest '-outputresource:$(subst /,\\,$(out));#2'
-	$(QUIET)$(CP) --changed --ignore-non-existing $(outbase).exp $(outbase).lib $(PATH_LIB)/
-$(eval _DIRS += $(PATH_LIB))
+	$(QUIET)$(CP) --changed --ignore-non-existing $(outbase).exp $(outbase).lib $(PATH_STAGE_LIB)/
+$(eval _DIRS += $(PATH_STAGE_LIB))
 endef
 
Index: /trunk/kBuild/tools/VCC70.kmk
===================================================================
--- /trunk/kBuild/tools/VCC70.kmk	(revision 2486)
+++ /trunk/kBuild/tools/VCC70.kmk	(revision 2487)
@@ -295,7 +295,7 @@
 # @param    $(outbase)  Output basename (full). Use this for list files and such.
 TOOL_VCC70_LINK_DLL_OUTPUT = $(outbase).map $(outbase).lib $(outbase).exp
-TOOL_VCC70_LINK_DLL_OUTPUT_MAYBE = $(outbase).pdb $(outbase).ilk $(PATH_LIB)/$(notdir $(outbase)).lib $(PATH_LIB)/$(notdir $(outbase)).exp
+TOOL_VCC70_LINK_DLL_OUTPUT_MAYBE = $(outbase).pdb $(outbase).ilk $(PATH_STAGE_LIB)/$(notdir $(outbase)).lib $(PATH_STAGE_LIB)/$(notdir $(outbase)).exp
 TOOL_VCC70_LINK_DLL_DEPEND = $(objs) $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
-TOOL_VCC70_LINK_DLL_DEPORD = $(call DIRDEP,$(PATH_LIB))
+TOOL_VCC70_LINK_DLL_DEPORD = $(call DIRDEP,$(PATH_STAGE_LIB))
 define TOOL_VCC70_LINK_DLL_CMDS
 	$(QUIET)$(TOOL_VCC70_LD) $(flags) \
@@ -310,6 +310,6 @@
 		$(subst /,\\,$(objs)) \
 		$(subst /,\\,$(libs))
-	$(QUIET)$(CP) --changed --ignore-non-existing $(outbase).exp $(outbase).lib $(PATH_LIB)/
-$(eval _DIRS += $(PATH_LIB))
+	$(QUIET)$(CP) --changed --ignore-non-existing $(outbase).exp $(outbase).lib $(PATH_STAGE_LIB)/
+$(eval _DIRS += $(PATH_STAGE_LIB))
 endef
 
Index: /trunk/kBuild/tools/VCC80.kmk
===================================================================
--- /trunk/kBuild/tools/VCC80.kmk	(revision 2486)
+++ /trunk/kBuild/tools/VCC80.kmk	(revision 2487)
@@ -287,7 +287,7 @@
 # @param    $(outbase)  Output basename (full). Use this for list files and such.
 TOOL_VCC80_LINK_DLL_DEPEND = $(objs) $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
-TOOL_VCC80_LINK_DLL_DEPORD = $(call DIRDEP,$(PATH_LIB))
+TOOL_VCC80_LINK_DLL_DEPORD = $(call DIRDEP,$(PATH_STAGE_LIB))
 TOOL_VCC80_LINK_DLL_OUTPUT = $(outbase).map $(outbase).lib $(outbase).exp
-TOOL_VCC80_LINK_DLL_OUTPUT_MAYBE = $(outbase).pdb $(outbase).ilk $(out).manifest $(PATH_LIB)/$(notdir $(outbase)).lib $(PATH_LIB)/$(notdir $(outbase)).exp
+TOOL_VCC80_LINK_DLL_OUTPUT_MAYBE = $(outbase).pdb $(outbase).ilk $(out).manifest $(PATH_STAGE_LIB)/$(notdir $(outbase)).lib $(PATH_STAGE_LIB)/$(notdir $(outbase)).exp
 define TOOL_VCC80_LINK_DLL_CMDS
 	$(QUIET)$(TOOL_VCC80_LD) $(flags) \
@@ -304,6 +304,6 @@
 	$(QUIET)$(TEST) -f $(out).manifest -- \
 		$(TOOL_VCC80_MT) -manifest $(subst /,\\,$(out)).manifest '-outputresource:$(subst /,\\,$(out));#2'
-	$(QUIET)$(CP) --changed --ignore-non-existing $(outbase).exp $(outbase).lib $(PATH_LIB)/
-$(eval _DIRS += $(PATH_LIB))
+	$(QUIET)$(CP) --changed --ignore-non-existing $(outbase).exp $(outbase).lib $(PATH_STAGE_LIB)/
+$(eval _DIRS += $(PATH_STAGE_LIB))
 endef
 
Index: /trunk/kBuild/tools/VCC80AMD64.kmk
===================================================================
--- /trunk/kBuild/tools/VCC80AMD64.kmk	(revision 2486)
+++ /trunk/kBuild/tools/VCC80AMD64.kmk	(revision 2487)
@@ -264,7 +264,7 @@
 # @param    $(outbase)  Output basename (full). Use this for list files and such.
 TOOL_VCC80AMD64_LINK_DLL_DEPEND = $(objs) $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
-TOOL_VCC80AMD64_LINK_DLL_DEPORD = $(call DIRDEP,$(PATH_LIB))
+TOOL_VCC80AMD64_LINK_DLL_DEPORD = $(call DIRDEP,$(PATH_STAGE_LIB))
 TOOL_VCC80AMD64_LINK_DLL_OUTPUT = $(outbase).map $(outbase).lib $(outbase).exp
-TOOL_VCC80AMD64_LINK_DLL_OUTPUT_MAYBE = $(outbase).pdb $(outbase).ilk $(out).manifest $(PATH_LIB)/$(notdir $(outbase)).lib $(PATH_LIB)/$(notdir $(outbase)).exp
+TOOL_VCC80AMD64_LINK_DLL_OUTPUT_MAYBE = $(outbase).pdb $(outbase).ilk $(out).manifest $(PATH_STAGE_LIB)/$(notdir $(outbase)).lib $(PATH_STAGE_LIB)/$(notdir $(outbase)).exp
 define TOOL_VCC80AMD64_LINK_DLL_CMDS
 	$(QUIET)$(TOOL_VCC80AMD64_LD) $(flags) \
@@ -281,6 +281,6 @@
 	$(QUIET)$(TEST) -f $(out).manifest -- \
 		$(TOOL_VCC80AMD64_MT) -manifest $(subst /,\\,$(out)).manifest '-outputresource:$(subst /,\\,$(out));#2'
-	$(QUIET)$(CP) --changed --ignore-non-existing $(outbase).exp $(outbase).lib $(PATH_LIB)/
-$(eval _DIRS += $(PATH_LIB))
+	$(QUIET)$(CP) --changed --ignore-non-existing $(outbase).exp $(outbase).lib $(PATH_STAGE_LIB)/
+$(eval _DIRS += $(PATH_STAGE_LIB))
 endef
 
Index: /trunk/kBuild/tools/VCC80X86.kmk
===================================================================
--- /trunk/kBuild/tools/VCC80X86.kmk	(revision 2486)
+++ /trunk/kBuild/tools/VCC80X86.kmk	(revision 2487)
@@ -266,7 +266,7 @@
 # @param    $(outbase)  Output basename (full). Use this for list files and such.
 TOOL_VCC80X86_LINK_DLL_DEPEND = $(objs) $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
-TOOL_VCC80X86_LINK_DLL_DEPORD = $(call DIRDEP,$(PATH_LIB))
+TOOL_VCC80X86_LINK_DLL_DEPORD = $(call DIRDEP,$(PATH_STAGE_LIB))
 TOOL_VCC80X86_LINK_DLL_OUTPUT = $(outbase).map $(outbase).lib $(outbase).exp
-TOOL_VCC80X86_LINK_DLL_OUTPUT_MAYBE = $(outbase).pdb $(outbase).ilk $(out).manifest $(PATH_LIB)/$(notdir $(outbase)).lib $(PATH_LIB)/$(notdir $(outbase)).exp
+TOOL_VCC80X86_LINK_DLL_OUTPUT_MAYBE = $(outbase).pdb $(outbase).ilk $(out).manifest $(PATH_STAGE_LIB)/$(notdir $(outbase)).lib $(PATH_STAGE_LIB)/$(notdir $(outbase)).exp
 define TOOL_VCC80X86_LINK_DLL_CMDS
 	$(QUIET)$(TOOL_VCC80X86_LD) $(flags) \
@@ -283,6 +283,6 @@
 	$(QUIET)$(TEST) -f $(out).manifest -- \
 		$(TOOL_VCC80X86_MT) -manifest $(subst /,\\,$(out)).manifest '-outputresource:$(subst /,\\,$(out));#2'
-	$(QUIET)$(CP) --changed --ignore-non-existing $(outbase).exp $(outbase).lib $(PATH_LIB)/
-$(eval _DIRS += $(PATH_LIB))
+	$(QUIET)$(CP) --changed --ignore-non-existing $(outbase).exp $(outbase).lib $(PATH_STAGE_LIB)/
+$(eval _DIRS += $(PATH_STAGE_LIB))
 endef
 
