Index: /trunk/kBuild/footer.kmk
===================================================================
--- /trunk/kBuild/footer.kmk	(revision 1495)
+++ /trunk/kBuild/footer.kmk	(revision 1496)
@@ -346,8 +346,8 @@
 # @param    properties_deferred_r List of the properties with deferred expansion (e.g. function), accumulating on the right side.
 define def_inherit_keyword
-prefix   := $(word 1,$(subst :, ,$(prefix_keyword)))
-trg_key  := $(word 2,$(subst :, ,$(prefix_keyword)))
-src_key  := $($(prefix)_$(trg_key)_EXTENDS)
-by       := $($(prefix)_$(trg_key)_EXTENDS_BY)
+local prefix   := $(word 1,$(subst :, ,$(prefix_keyword)))
+local trg_key  := $(word 2,$(subst :, ,$(prefix_keyword)))
+local src_key  := $($(prefix)_$(trg_key)_EXTENDS)
+local by       := $($(prefix)_$(trg_key)_EXTENDS_BY)
 
 # Inherit the properties.
@@ -546,11 +546,11 @@
 define def_inherit
 
-# Load it.
+# Load it - loading is a mess, fix.
 ifneq ($(load_function),)
- loading := $(patsubst $(src_prefix)%,%,$(trg))
- $(eval $(value $(load_function)))
-endif
-
-src := $(strip $($(trg)_EXTENDS))
+ local loading := $(patsubst $(src_prefix)%,%,$(trg))
+ $(evalvalctx $(load_function))
+endif
+
+local src := $(strip $($(trg)_EXTENDS))
 ifneq ($(src),)
  ifndef $(trg)_EXTENDS_STATUS_
@@ -559,10 +559,10 @@
   # Load the source.
   ifneq ($(load_function),)
-   loading := $(src)
-   $(eval $(value $(load_function)))
+   local loading := $(src)
+   $(evalvalctx $(load_function))
   endif
 
   # less typing.
-  src := $(src_prefix)$(src)
+  local src := $(src_prefix)$(src)
 
   # Recursivly process the parent (src) if it's inherting from somebody too.
@@ -572,13 +572,13 @@
 	# out current variable. 'src' OTOH will be overwritten.
     #$ (warning def_inherit: recursing into $(src) from $(trg))
-    $(foreach trg, $(src), $(eval $(value def_inherit)))
-    src := $(src_prefix)$(strip $($(trg)_EXTENDS))
+    $(foreach trg, $(src), $(evalval def_inherit))
+    local src := $(src_prefix)$(strip $($(trg)_EXTENDS))
    endif
   endif
 
   # Get & check EXTENDS_BY.
-  by = $(strip $($(trg)_EXTENDS_BY))
+  local by = $(strip $($(trg)_EXTENDS_BY))
   ifeq ($(by),)
-   by = overriding
+   local by = overriding
   else ifn1of ($(by), overriding appending prepending)
    $(error kBuild: Invalid EXTENDS_BY value '$(by)' on '$(trg)'!)
@@ -604,5 +604,5 @@
 
 # Keyword inheritance.
-$(foreach prefix_keyword, $(join $(_KEYWORDS_PREFIX), $(addprefix :,$(_KEYWORDS_EXTENDS))), $(eval $(value def_inherit_keyword)))
+$(foreach prefix_keyword, $(join $(_KEYWORDS_PREFIX), $(addprefix :,$(_KEYWORDS_EXTENDS))), $(evalval def_inherit_keyword))
 
 endef # def_inherit
@@ -630,5 +630,5 @@
 ifndef TEMPLATE_$(loading)
  TEMPLATE_$(loading)_KMK_FILE := $(firstword $(foreach path, $(KBUILD_TEMPLATE_PATHS) $(PATH_KBUILD)/templates $(KBUILD_DEFAULT_PATHS), $(wildcard $(path)/$(loading).kmk)))
- ifneq ($(TEMPLATE_$(loading)_KMK_FILE),)
+ ifeq ($(TEMPLATE_$(loading)_KMK_FILE),)
   $(error kBuild: Cannot find include file for the template '$(loading)'! Searched: $(KBUILD_TEMPLATE_PATHS) $(PATH_KBUILD)/templates $(KBUILD_DEFAULT_PATHS))
  endif
@@ -639,5 +639,5 @@
 endif
 endef # def_templates_load_function
-$(foreach loading, $(_TEMPLATES), $(eval $(value def_templates_load_function)))
+$(foreach loading, $(_TEMPLATES), $(evalval def_templates_load_function))
 
 
@@ -682,5 +682,5 @@
 endef # def_collect_bld_xyz
 $(foreach src, $(addprefix TEMPLATE_, $(_TEMPLATES)) $(_ALL_TARGETS) \
-	,$(eval $(value def_collect_bld_xyz)))
+	,$(evalval def_collect_bld_xyz))
 
 # Drop duplicate values.
@@ -697,5 +697,5 @@
 define def_keyword_ordering
 # Check for EXTENDS, fix and validate it if found.
-src := $(strip $($(prefix)_$(keyword)_EXTENDS))
+local src := $(strip $($(prefix)_$(keyword)_EXTENDS))
 ifneq ($(src),)
  ifndef $(prefix)_$(keyword)_EXTENDS_STATUS_
@@ -709,12 +709,12 @@
    # 'foreach' will create 'keyword' in a new variable context hiding
    # out current variable. 'src' OTOH will be overwritten.
-   $(foreach keyword, $(src), $(eval $(value def_keyword_ordering)))
-   src := $(strip $($(prefix)_$(keyword)_EXTENDS))
+   $(foreach keyword, $(src), $(evalval def_keyword_ordering))
+   local src := $(strip $($(prefix)_$(keyword)_EXTENDS))
   endif
 
   # Check and strip EXTENDS_BY.
-  by = $(strip $($(prefix)_$(keyword)_EXTENDS_BY))
+  local by = $(strip $($(prefix)_$(keyword)_EXTENDS_BY))
   ifeq ($(by),)
-   by = overriding
+   local by = overriding
   else ifn1of ($(by), overriding appending prepending)
    $(error kBuild: Invalid EXTENDS_BY value '$(by)' on '$(keyword)'!)
@@ -750,17 +750,17 @@
 prefix := BLD_TYPE
 valid := $(KBUILD_BLD_TYPES)
-$(foreach keyword, $(_BLD_TYPES)  , $(eval $(value def_keyword_ordering)))
+$(foreach keyword, $(_BLD_TYPES)  , $(evalval def_keyword_ordering))
 
 prefix := BLD_TRG
 valid := $(KBUILD_OSES)
-$(foreach keyword, $(_BLD_TARGETS), $(eval $(value def_keyword_ordering)))
+$(foreach keyword, $(_BLD_TARGETS), $(evalval def_keyword_ordering))
 
 prefix := BLD_ARCH
 valid := $(KBUILD_ARCHES)
-$(foreach keyword, $(_BLD_ARCHES) , $(eval $(value def_keyword_ordering)))
+$(foreach keyword, $(_BLD_ARCHES) , $(evalval def_keyword_ordering))
 
 prefix := BLD_CPU
 valid := $(KBUILD_CPUS)
-$(foreach keyword, $(_BLD_CPUS)   , $(eval $(value def_keyword_ordering)))
+$(foreach keyword, $(_BLD_CPUS)   , $(evalval def_keyword_ordering))
 
 ## @todo Inherit bld_trg.bld_arch for too?
@@ -799,5 +799,5 @@
 properties_now_r    := $(PROPS_FETCHES_ACCUMULATE_R)
 properties_deferred := $(PROPS_FETCHES_DEFERRED)
-$(foreach trg, $(_ALL_FETCHES),$(eval $(value def_inherit)))
+$(foreach trg, $(_ALL_FETCHES),$(evalval def_inherit))
 
 ## Patches. - not implemented yet.
@@ -806,5 +806,5 @@
 #properties_now_r    := $(PROPS_PATCHES_ACCUMULATE_R)
 #properties_deferred := $(PROPS_PATCHES_DEFERRED)
-#$(foreach trg, $(_ALL_PATCHES),$(eval $(value def_inherit)))
+#$(foreach trg, $(_ALL_PATCHES),$(evalval def_inherit))
 
 # Programs and build programs.
@@ -813,5 +813,5 @@
 properties_now_r    := $(PROPS_PROGRAMS_ACCUMULATE_R)
 properties_deferred := $(PROPS_PROGRAMS_DEFERRED)
-$(foreach trg, $(_ALL_BLDPROGS) $(_ALL_PROGRAMS),$(eval $(value def_inherit)))
+$(foreach trg, $(_ALL_BLDPROGS) $(_ALL_PROGRAMS),$(evalval def_inherit))
 
 # Libraries and import libraries.
@@ -821,7 +821,7 @@
 properties_deferred := $(PROPS_LIBRARIES_DEFERRED)
 if1of ($(BUILD_TARGET), nt os2 win)
- $(foreach trg, $(_ALL_LIBRARIES) $(_ALL_IMPORT_LIBS),$(eval $(value def_inherit)))
+ $(foreach trg, $(_ALL_LIBRARIES) $(_ALL_IMPORT_LIBS),$(evalval def_inherit))
 else
- $(foreach trg, $(_ALL_LIBRARIES),$(eval $(value def_inherit)))
+ $(foreach trg, $(_ALL_LIBRARIES),$(evalval def_inherit))
 endif
 
@@ -832,7 +832,7 @@
 properties_deferred := $(PROPS_DLLS_DEFERRED)
 if1of ($(BUILD_TARGET), nt os2 win)
- $(foreach trg, $(_ALL_DLLS),$(eval $(value def_inherit)))
+ $(foreach trg, $(_ALL_DLLS),$(evalval def_inherit))
 else
- $(foreach trg, $(_ALL_DLLS) $(_ALL_IMPORT_LIBS),$(eval $(value def_inherit)))
+ $(foreach trg, $(_ALL_DLLS) $(_ALL_IMPORT_LIBS),$(evalval def_inherit))
 endif
 
@@ -842,5 +842,5 @@
 properties_now_r    := $(PROPS_SYSMODS_ACCUMULATE_R)
 properties_deferred := $(PROPS_SYSMODS_DEFERRED)
-$(foreach trg, $(_ALL_SYSMODS),$(eval $(value def_inherit)))
+$(foreach trg, $(_ALL_SYSMODS),$(evalval def_inherit))
 
 # Installs.
@@ -849,5 +849,5 @@
 properties_now_r    := $(PROPS_INSTALLS_ACCUMULATE_R)
 properties_deferred := $(PROPS_INSTALLS_DEFERRED)
-$(foreach trg, $(_ALL_INSTALLS),$(eval $(value def_inherit)))
+$(foreach trg, $(_ALL_INSTALLS),$(evalval def_inherit))
 
 ifdef KBUILD_PROFILE_SELF
@@ -878,5 +878,5 @@
 properties_deferred_l := $(PROPS_ACCUMULATE_L)
 properties_deferred_r := $(PROPS_ACCUMULATE_R)
-$(foreach trg, $(addprefix TEMPLATE_,$(_TEMPLATES)),$(eval $(value def_inherit)))
+$(foreach trg, $(addprefix TEMPLATE_,$(_TEMPLATES)),$(evalval def_inherit))
 
 # done inheriting.
@@ -1063,5 +1063,5 @@
 # Expand the template if specified.
 ifneq ($($(target)_TEMPLATE),)
-$(foreach prop,$(PROPS_SINGLE),$(eval $(value def_inherit_template_one)))
+$(foreach prop,$(PROPS_SINGLE),$(evalval def_inherit_template_one))
 $(foreach prop,$(PROPS_DEFERRED),$(eval $(def_inherit_template_one_deferred))) # exploits the 2 evaluation, so no value!
 $(foreach prop,$(PROPS_ACCUMULATE_L),$(eval $(def_inherit_template_one_accumulate_l))) # += works fine without value
@@ -1074,10 +1074,10 @@
 bld_trg_arch := $(BUILD_TARGET_ARCH)
 bld_trg_cpu := $(BUILD_TARGET_CPU)
-$(foreach target, $(_ALL_BUILD_TARGET_TARGETS),$(eval $(value def_inherit_template)))
+$(foreach target, $(_ALL_BUILD_TARGET_TARGETS),$(evalval def_inherit_template))
 
 bld_trg := $(BUILD_PLATFORM)
 bld_trg_arch := $(BUILD_PLATFORM_ARCH)
 bld_trg_cpu := $(BUILD_PLATFORM_CPU)
-$(foreach target, $(_ALL_BUILD_PLATFORM_TARGETS),$(eval $(value def_inherit_template)))
+$(foreach target, $(_ALL_BUILD_PLATFORM_TARGETS),$(evalval def_inherit_template))
 
 ifdef KBUILD_PROFILE_SELF
@@ -1126,8 +1126,8 @@
 
 define def_tools_sdks_target
-_bld_type := $(firstword $($(target)_BLD_TYPE) $(BUILD_TYPE))
-_bld_trg := $(firstword $($(target)_BLD_TRG) $(bld_trg))
-_bld_trg_arch := $(firstword $($(target)_BLD_TRG_ARCH) $(bld_trg_arch))
-_bld_trg_cpu := $(firstword $($(target)_BLD_TRG_CPU) $(bld_trg_cpu))
+local _bld_type := $(firstword $($(target)_BLD_TYPE) $(BUILD_TYPE))
+local _bld_trg := $(firstword $($(target)_BLD_TRG) $(bld_trg))
+local _bld_trg_arch := $(firstword $($(target)_BLD_TRG_ARCH) $(bld_trg_arch))
+local _bld_trg_cpu := $(firstword $($(target)_BLD_TRG_CPU) $(bld_trg_cpu))
 
 $(eval _TOOLS += $(foreach prop, $(PROPS_TOOLS), \
@@ -1148,12 +1148,12 @@
 	$($(target)_SOURCES.$(_bld_type)) \
 	$($(target)_SOURCES) \
-	, $(eval $(value def_tools_sdks_target_source)))
+	, $(evalval def_tools_sdks_target_source))
 endef # def_tools_sdks_target
 
 define def_tools_srcname_target
-_bld_type := $(firstword $($(target)_BLD_TYPE) $(BUILD_TYPE))
-_bld_trg := $(firstword $($(target)_BLD_TRG) $(bld_trg))
-_bld_trg_arch := $(firstword $($(target)_BLD_TRG_ARCH) $(bld_trg_arch))
-_bld_trg_cpu := $(firstword $($(target)_BLD_TRG_CPU) $(bld_trg_cpu))
+local _bld_type := $(firstword $($(target)_BLD_TYPE) $(BUILD_TYPE))
+local _bld_trg := $(firstword $($(target)_BLD_TRG) $(bld_trg))
+local _bld_trg_arch := $(firstword $($(target)_BLD_TRG_ARCH) $(bld_trg_arch))
+local _bld_trg_cpu := $(firstword $($(target)_BLD_TRG_CPU) $(bld_trg_cpu))
 
 $(foreach source, $(notdir\
@@ -1164,5 +1164,5 @@
 	$($(target)_SOURCES.$(_bld_type)) \
 	$($(target)_SOURCES) \
-	), $(eval $(value def_tools_sdks_target_source)))
+	), $(evalval def_tools_sdks_target_source))
 endef # def_tools_srcname_target
 
@@ -1170,11 +1170,11 @@
 bld_trg_arch := $(BUILD_TARGET_ARCH)
 bld_trg_cpu := $(BUILD_TARGET_CPU)
-$(foreach target, $(_ALL_BUILD_TARGET_TARGETS), $(eval $(value def_tools_sdks_target)))
-$(foreach target, $(_ALL_SRCNAME_TARGETS), $(eval $(value def_tools_srcname_target)))
+$(foreach target, $(_ALL_BUILD_TARGET_TARGETS), $(evalval def_tools_sdks_target))
+$(foreach target, $(_ALL_SRCNAME_TARGETS), $(evalval def_tools_srcname_target))
 
 bld_trg := $(BUILD_PLATFORM)
 bld_trg_arch := $(BUILD_PLATFORM_ARCH)
 bld_trg_cpu := $(BUILD_PLATFORM_CPU)
-$(foreach target, $(_ALL_BUILD_PLATFORM_TARGETS), $(eval $(value def_tools_sdks_target)))
+$(foreach target, $(_ALL_BUILD_PLATFORM_TARGETS), $(evalval def_tools_sdks_target))
 
 _TOOLS := $(sort $(_TOOLS))
@@ -1221,9 +1221,9 @@
 src_prefix := TOOL_
 load_function := def_tools_load_function
-$(foreach trg, $(_TOOLS), $(eval $(value def_inherit)))
+$(foreach trg, $(_TOOLS), $(evalval def_inherit))
 
 src_prefix := SDK_
 load_function := def_sdk_load_function
-$(foreach trg, $(_SDKS) , $(eval $(value def_inherit)))
+$(foreach trg, $(_SDKS) , $(evalval def_inherit))
 
 # done inheriting.
@@ -1269,11 +1269,11 @@
 define def_pass1_link_common
 
-bld_type    := $(firstword $($(target)_BLD_TYPE)     $(BUILD_TYPE))
-bld_trg     := $(firstword $($(target)_BLD_TRG)      $(BUILD_$(bld_trg_base_var)))
-bld_trg_arch:= $(firstword $($(target)_BLD_TRG_ARCH) $(BUILD_$(bld_trg_base_var)_ARCH))
-bld_trg_cpu := $(firstword $($(target)_BLD_TRG_CPU)  $(BUILD_$(bld_trg_base_var)_CPU))
-
-tool        := $(call _TARGET_TOOL,$(target),$(tool_prefix))
-name        := $(firstword\
+local bld_type    := $(firstword $($(target)_BLD_TYPE)     $(BUILD_TYPE))
+local bld_trg     := $(firstword $($(target)_BLD_TRG)      $(BUILD_$(bld_trg_base_var)))
+local bld_trg_arch:= $(firstword $($(target)_BLD_TRG_ARCH) $(BUILD_$(bld_trg_base_var)_ARCH))
+local bld_trg_cpu := $(firstword $($(target)_BLD_TRG_CPU)  $(BUILD_$(bld_trg_base_var)_CPU))
+
+local tool        := $(call _TARGET_TOOL,$(target),$(tool_prefix))
+local name        := $(firstword\
 	$($(target)_NAME.$(bld_trg).$(bld_trg_arch))\
 	$($(target)_NAME.$(bld_trg_arch))\
@@ -1282,5 +1282,5 @@
 	$($(target)_NAME)\
 	$(target))
-outbase     := $(call TARGET_BASE,$(name),$(target))
+local outbase     := $(call TARGET_BASE,$(name),$(target))
 ifndef PATH_$(target)
  PATH_$(target) := $(patsubst %/,%,$(dir $(outbase)))
@@ -1289,5 +1289,5 @@
 endif
 ifeq ($(tool_prefix),AR) ## @todo fix this mess!
-suff := $(firstword\
+local suff := $(firstword\
 	$($(target)_$(EXT)SUFF.$(bld_trg).$(bld_trg_arch))\
 	$($(target)_$(EXT)SUFF.$(bld_trg))\
@@ -1298,5 +1298,5 @@
 	$(SUFF_LIB))
 else
-suff := $(firstword \
+local suff := $(firstword \
 	$($(target)_$(EXT)SUFF) \
 	$($(target)_$(EXT)SUFF) \
@@ -1304,5 +1304,5 @@
 	$($(EXTPRE)SUFF_$(EXT)))
 endif
-out := $(outbase)$(suff)
+local out := $(outbase)$(suff)
 
 # TARGET_*
@@ -1329,5 +1329,5 @@
 $(target)_NOINST := 1
 endif
-$(eval $(value def_pass1_link_common))
+$(evalval def_pass1_link_common)
 endef
 
@@ -1338,5 +1338,5 @@
 bld_trg_base_var := PLATFORM
 $(foreach target, $(BLDPROGS) $(BLDPROGS.$(BUILD_PLATFORM)) $(BLDPROGS.$(BUILD_PLATFORM).$(BUILD_PLATFORM_ARCH)), \
-	$(eval $(value def_pass1_bldprog)))
+	$(evalval def_pass1_bldprog))
 
 
@@ -1350,5 +1350,5 @@
 bld_trg_base_var := TARGET
 $(foreach target, $(LIBRARIES) $(LIBRARIES.$(BUILD_TARGET)) $(LIBRARIES.$(BUILD_TARGET).$(BUILD_TARGET_ARCH)), \
-	$(eval $(value def_pass1_link_common)))
+	$(evalval def_pass1_link_common))
 
 
@@ -1362,5 +1362,5 @@
 bld_trg_base_var := TARGET
 $(foreach target, $(DLLS) $(DLLS.$(BUILD_TARGET)) $(DLLS.$(BUILD_TARGET).$(BUILD_TARGET_ARCH)), \
-	$(eval $(value def_pass1_link_common)))
+	$(evalval def_pass1_link_common))
 
 
@@ -1378,5 +1378,5 @@
  bld_trg_base_var := TARGET
  $(foreach target, $(IMPORT_LIBS) $(IMPORT_LIBS.$(BUILD_TARGET)) $(IMPORT_LIBS.$(BUILD_TARGET).$(BUILD_TARGET_ARCH)), \
-	$(eval $(value def_pass1_link_common)))
+	$(evalval def_pass1_link_common))
 else
  EXT     := DLL
@@ -1386,5 +1386,5 @@
  bld_trg_base_var := TARGET
  $(foreach target, $(IMPORT_LIBS) $(IMPORT_LIBS.$(BUILD_TARGET)) $(IMPORT_LIBS.$(BUILD_TARGET).$(BUILD_TARGET_ARCH)), \
-	$(eval $(value def_pass1_link_common)))
+	$(evalval def_pass1_link_common))
 endif
 
@@ -1399,5 +1399,5 @@
 bld_trg_base_var := TARGET
 $(foreach target, $(PROGRAMS) $(PROGRAMS.$(BUILD_TARGET)) $(PROGRAMS.$(BUILD_TARGET).$(BUILD_TARGET_ARCH)), \
-	$(eval $(value def_pass1_link_common)))
+	$(evalval def_pass1_link_common))
 
 
@@ -1411,5 +1411,5 @@
 bld_trg_base_var := TARGET
 $(foreach target, $(SYSMODS) $(SYSMODS.$(BUILD_TARGET)) $(SYSMODS.$(BUILD_TARGET).$(BUILD_TARGET_ARCH)), \
-	$(eval $(value def_pass1_link_common)))
+	$(evalval def_pass1_link_common))
 
 
@@ -1419,8 +1419,8 @@
 #
 define def_pass1_install
-bld_type    := $(firstword $($(target)_BLD_TYPE)     $(BUILD_TYPE))
-bld_trg     := $(firstword $($(target)_BLD_TRG)      $(BUILD_TARGET))
-bld_trg_arch:= $(firstword $($(target)_BLD_TRG_ARCH) $(BUILD_TARGET_ARCH))
-bld_trg_cpu := $(firstword $($(target)_BLD_TRG_CPU)  $(BUILD_TARGET_CPU))
+local bld_type    := $(firstword $($(target)_BLD_TYPE)     $(BUILD_TYPE))
+local bld_trg     := $(firstword $($(target)_BLD_TRG)      $(BUILD_TARGET))
+local bld_trg_arch:= $(firstword $($(target)_BLD_TRG_ARCH) $(BUILD_TARGET_ARCH))
+local bld_trg_cpu := $(firstword $($(target)_BLD_TRG_CPU)  $(BUILD_TARGET_CPU))
 # TARGET_*
 TARGET_$(target) := $(PATH_TARGET)/$(target).ins
@@ -1428,5 +1428,5 @@
 endef
 $(foreach target, $(INSTALLS) $(INSTALLS.$(BUILD_TARGET)) $(INSTALLS.$(BUILD_TARGET).$(BUILD_TARGET_ARCH)), \
-	$(eval $(value def_pass1_install)))
+	$(evalval def_pass1_install))
 
 ifdef KBUILD_PROFILE_SELF
@@ -1506,5 +1506,5 @@
 $(out) + $($(target)_$(srcname)_FETCH_OUTPUT_) +| $($(target)_$(srcname)_FETCH_OUTPUT_MAYBE_)  : \
 		| $($(target)_$(srcname)_FETCH_DEPORD_)
-	$$(call MSG_FETCH_DL,$(target),$(source),$(out))
+	%$$(call MSG_FETCH_DL,$(target),$(source),$(out))
 	@## @todo do fancy stuff like download continuation.
 	$$(QUIET)$$(RM) -f $(out)
@@ -1516,5 +1516,5 @@
 # Intermediate goal for making sure the md5 and size matches. it will (re) fetch the archive if necessary.
 $(out).checked_$(md5)_$(size): $($(target)_$(srcname)_FETCH_DEPEND_) | $($(target)_$(srcname)_FETCH_DEPORD_)
-	$$(call MSG_FETCH_CHK,$(target),$(source),$(out))
+	%$$(call MSG_FETCH_CHK,$(target),$(source),$(out))
 	$$(QUIET)$$(RM) -f $$@
 	@# (re)fetch the file if it doesn't exist or if it doesn't matches the md5.
@@ -1538,5 +1538,5 @@
 		$($(target)_$(srcname)_UNPACK_DEPEND_) \
 		| $($(target)_$(srcname)_UNPACK_DEPORD_) $(archive).checked_$(md5)_$(size)
-	$$(call MSG_FETCH_UP,$(target),$(archive),$(inst))
+	%$$(call MSG_FETCH_UP,$(target),$(archive),$(inst))
 	$$(QUIET)$$(RM) -f $(out)
 	@# if the source archive doesn't exist fetch it (can have been deleted to save space).
@@ -1561,6 +1561,6 @@
 
 # common
-srcname := $(notdir $(source))
-inst := $(firstword \
+local srcname := $(notdir $(source))
+local inst := $(firstword \
 	$($(target)_$(source)_INST)\
 	$($(target)_$(srcname)_INST)\
@@ -1573,5 +1573,5 @@
 endif
 INSTARGET_$(target)_$(srcname) := $(inst)
-fetchdir := $(firstword \
+local fetchdir := $(firstword \
 	$($(target)_$(source)_FETCHDIR)\
 	$($(target)_$(srcname)_FETCHDIR)\
@@ -1582,5 +1582,5 @@
 	$(PATH_TARGET)\
 )
-deps := \
+local deps := \
 	$($(target)_$(source)_DEPS)\
 	$($(target)_$(srcname)_DEPS)\
@@ -1588,5 +1588,5 @@
 	$($(srcname)_DEPS)\
 	$($(target)_DEPS)
-orderdeps := \
+local orderdeps := \
 	$($(target)_$(source)_ORDERDEPS)\
 	$($(target)_$(srcname)_ORDERDEPS)\
@@ -1594,5 +1594,5 @@
 	$($(srcname)_ORDERDEPS)\
 	$($(target)_ORDERDEPS)
-md5 := $(firstword \
+local md5 := $(firstword \
 	$($(target)_$(source)_MD5)\
 	$($(target)_$(srcname)_MD5)\
@@ -1601,5 +1601,5 @@
 	$($(target)_MD5)\
 )
-size := $(firstword \
+local size := $(firstword \
 	$($(target)_$(source)_SIZE)\
 	$($(target)_$(srcname)_SIZE)\
@@ -1608,5 +1608,5 @@
 	$($(target)_SIZE)\
 )
-dep := # not legal for fetch and unpack tools
+local dep := # not legal for fetch and unpack tools
 
 
@@ -1614,9 +1614,9 @@
 # The fetching.
 #
-out := $(fetchdir)/$(srcname)
-archive := $(out)
+local out := $(fetchdir)/$(srcname)
+local archive := $(out)
 TARGET_$(target)_$(srcname) := $(out)
-dirdep := $(call DIRDEP,$(fetchdir))
-tool := $(firstword \
+local dirdep := $(call DIRDEP,$(fetchdir))
+local tool := $(firstword \
 	$($(target)_$(source)_FETCHTOOL)\
 	$($(target)_$(srcname)_FETCHTOOL)\
@@ -1630,5 +1630,5 @@
 	$($(target)_TOOL)\
 	)
-flags :=\
+local flags :=\
 	$(TOOL_$(tool)_FETCHFLAGS)\
 	$(FETCHFLAGS)\
@@ -1670,7 +1670,7 @@
 # The unpacking / installing.
 #
-out := $(inst)_kBuild_$(target)_$(srcname)_unpacked.lst
-dirdep := $(call DIRDEP,$(inst))
-tool := $(firstword \
+local out := $(inst)_kBuild_$(target)_$(srcname)_unpacked.lst
+local dirdep := $(call DIRDEP,$(inst))
+local tool := $(firstword \
 	$($(target)_$(source)_UNPACKTOOL)\
 	$($(target)_$(srcname)_UNPACKTOOL)\
@@ -1685,8 +1685,8 @@
 	)
 ifeq ($(tool),)
-tool := $(toupper $(subst .,,$(suffix $(subst tar.,TAR,$(srcname)))))
-$(eval $(value def_tools_include))
-endif
-flags :=\
+local tool := $(toupper $(subst .,,$(suffix $(subst tar.,TAR,$(srcname)))))
+$(evalval def_tools_include)
+endif
+local flags :=\
 	$(TOOL_$(tool)_UNPACKFLAGS)\
 	$(UNPACKFLAGS)\
@@ -1742,5 +1742,5 @@
 
 $(out).lst: $(_TARGET_$(target)_UNPACKED) | $(call DIRDEP,$(inst))
-	$$(call MSG_FETCH_OK,$(target))
+	%$$(call MSG_FETCH_OK,$(target))
 	$$(QUIET)$$(RM) -f $$@ $$@.tmp
 	$$(QUIET2)$$(APPEND) $$@.tmp '$(notdir $(out))'
@@ -1749,5 +1749,5 @@
 
 $(out)_unfetched:
-	$$(call MSG_UNFETCH,$(target))
+	%$$(call MSG_UNFETCH,$(target))
 	$$(QUIET)$$(RM) -f $$(addprefix $(inst),$$(shell $$(CAT_EXT) $(out).lst 2> /dev/null | $$(SED) -e '/\/$$$$/d'))
 	$$(QUIET)$$(RMDIR) -p --ignore-fail-on-non-empty --ignore-fail-on-not-exist $$(dir $$@) \
@@ -1758,5 +1758,5 @@
 $(out): $(comp-vars _TARGET_$(target)_DIGEST_PREV,_TARGET_$(target)_DIGEST,FORCE) | $(call DIRDEP,$(inst))
 	$$(QUIET)$$(RM) -f $$@
-	$$(if $$(_TARGET_$(target)_DIGEST),$$(if $$(wildcard $(out).lst)\
+	%$$(if $$(_TARGET_$(target)_DIGEST),$$(if $$(wildcard $(out).lst)\
 		,$$(call MSG_REFETCH,$(target)),$$(call MSG_FETCH,$(target))),$$(call MSG_UNFETCH,$(target)))
 	$$(QUIET)$$(if $$(wildcard $(out).lst      ),$$(MAKE) -f $(MAKEFILE) --no-print-directory $(out)_unfetched)
@@ -1788,9 +1788,9 @@
 #$ (warning dbg fetch: target=$(target) sources=$($(target)_SOURCES) $($(target)_SOURCES.$(BUILD_TYPE)) $($(target)_SOURCES.$(BUILD_TARGET)) $($(target)_SOURCES.$(BUILD_TARGET_ARCH)) $($(target)_SOURCES.$(BUILD_TARGET).$(BUILD_TARGET_ARCH)))
 $(foreach source,$($(target)_SOURCES) $($(target)_SOURCES.$(BUILD_TYPE)) $($(target)_SOURCES.$(BUILD_TARGET)) $($(target)_SOURCES.$(BUILD_TARGET_ARCH)) $($(target)_SOURCES.$(BUILD_TARGET).$(BUILD_TARGET_ARCH)),\
-	$(eval $(value def_fetch_src)))
+	$(evalval def_fetch_src))
 
 # The target.
-inst := $(INSTARGET_$(target))
-out := $(inst)_kBuild_fetch_$(target)
+local inst := $(INSTARGET_$(target))
+local out := $(inst)_kBuild_fetch_$(target)
 
 $(eval includedep $(out))
@@ -1814,5 +1814,5 @@
 bld_trg_arch := $(BUILD_TARGET_ARCH)
 $(foreach target, $(FETCHES) $(FETCHES.$(BUILD_TARGET)) $(FETCHES.$(BUILD_TARGET).$(BUILD_TARGET_ARCH)), \
-	$(eval $(value def_fetch)))
+	$(evalval def_fetch))
 
 # some aliases.
@@ -1844,5 +1844,5 @@
 #
 #$(foreach source,$($(target)_SOURCES) $($(target)_SOURCES.$(BUILD_TYPE)) $($(target)_SOURCES.$(BUILD_TARGET)) $($(target)_SOURCES.$(BUILD_TARGET_ARCH)) $($(target)_SOURCES.$(BUILD_TARGET).$(BUILD_TARGET_ARCH)),\
-#	$(eval $(value def_patch_src)))
+#	$(evalval def_patch_src))
 #
 #_PATCHES +=
@@ -1850,5 +1850,5 @@
 #
 #$(foreach target, $(PATCHES) $(PATCHES.$(BUILD_TARGET)) $(PATCHES.$(BUILD_TARGET).$(BUILD_TARGET_ARCH)), \
-#	$(eval $(value def_patch)))
+#	$(evalval def_patch))
 #
 
@@ -1860,5 +1860,5 @@
 ## wrapper the compile command dependency check.
 ifndef NO_COMPILE_CMDS_DEPS
- _DEP_COMPILE_CMDS = $(comp-cmds $(target)_$(source)_CMDS_PREV_,$(target)_$(source)_CMDS_,FORCE)
+ _DEP_COMPILE_CMDS = $$(comp-cmds-ex $$($(target)_$(source)_CMDS_PREV_),$$(commands $(obj)),FORCE)
 else
  _DEP_COMPILE_CMDS =
@@ -1877,5 +1877,5 @@
 		$($(target)_$(source)_DEPORD_) \
 		$$($(target)_INTERMEDIATES)
-	$$(call MSG_COMPILE,$(target),$(source),$$@,$(type))
+	%$$(call MSG_COMPILE,$(target),$(source),$$@,$(type))
 else
 $(obj) + $($(target)_$(source)_OUTPUT_) +| $($(target)_$(source)_OUTPUT_MAYBE_) : \
@@ -1885,5 +1885,5 @@
 		$($(target)_$(source)_DEPORD_) \
 		$$($(target)_INTERMEDIATES)
-	$$(call MSG_COMPILE,$(target),$(source),$$@,$(type))
+	%$$(call MSG_COMPILE,$(target),$(source),$$@,$(type))
 ifdef TOOL_$(tool)_COMPILE_$(type)_DONT_PURGE_OUTPUT
 	$$(QUIET)$$(RM) -f $(dep) $(obj) $($(target)_$(source)_OUTPUT_) $($(target)_OUTPUT_MAYBE_)
@@ -1894,12 +1894,15 @@
 
 ifndef NO_COMPILE_CMDS_DEPS
-	$$(QUIET2)$$(APPEND) '$(dep)'
-	$$(QUIET2)$$(APPEND) '$(dep)' 'define $(target)_$(source)_CMDS_PREV_'
-	$$(QUIET2)$$(APPEND) -v '$(dep)' '$(target)_$(source)_CMDS_'
-	$$(QUIET2)$$(APPEND) '$(dep)' 'endef'
+	%$$(QUIET2)$$(APPEND) '$(dep)'
+	%$$(QUIET2)$$(APPEND) '$(dep)' 'define $(target)_$(source)_CMDS_PREV_'
+	%$$(QUIET2)$$(APPEND) -c '$(dep)' '$(obj)'
+	%$$(QUIET2)$$(APPEND) '$(dep)' 'endef'
 endif
 
 $(basename $(notdir $(obj))).o: $(obj)
 $(basename $(notdir $(obj))).obj: $(obj)
+
+## @todo make this 'local cmds' in 0.2.x or when a new kb-src-one is added.
+$(target)_$(source)_CMDS_ :=
 endef
 
@@ -1907,5 +1910,5 @@
 ## wrapper the link command dependency check.
 ifndef NO_COMPILE_CMDS_DEPS
- _DEP_LINK_CMDS = $(comp-cmds $(target)_CMDS_PREV_,$(target)_CMDS_,FORCE)
+ _DEP_LINK_CMDS = $$(comp-cmds-ex $$($(target)_CMDS_PREV_),$$(commands $(out)),FORCE)
 else
  _DEP_LINK_CMDS =
@@ -1919,7 +1922,7 @@
 # @param    $($(target)_OUTPUT_)    Output files from the link.
 # @param    $($(target)_OUTPUT_MAYBE_)	Output files that the link may perhaps create.
-# @param    $($(target)_DEPEND_)	Dependencies.
+# @param    $($(target)_DEPEND_)    Dependencies.
 # @param    $($(target)_DEPORD_)    Dependencies which should only affect build order.
-# @param    $($(target)_CMDS_)      The link commands.
+# @param    $(cmds)                 The link commands.
 # @param    $($(target)_CMDS_PREV_) The link commands from the previous run.
 define def_link_rule
@@ -1929,13 +1932,13 @@
 		| \
 		$($(target)_DEPORD_)
-	$$(call MSG_LINK,$(target),$$@,$(tool_do))
+	%$$(call MSG_LINK,$(target),$$@,$(tool_do))
 	$$(QUIET)$$(RM) -f $(dep) $(out) $($(target)_OUTPUT_) $($(target)_OUTPUT_MAYBE_)
 
-$($(target)_CMDS_)
+$(cmds)
 
 ifndef NO_LINK_CMDS_DEPS
-	$$(QUIET2)$$(APPEND) '$(dep)' 'define $(target)_CMDS_PREV_'
-	$$(QUIET2)$$(APPEND) -v '$(dep)' '$(target)_CMDS_'
-	$$(QUIET2)$$(APPEND) '$(dep)' 'endef'
+	%$$(QUIET2)$$(APPEND) '$(dep)' 'define $(target)_CMDS_PREV_'
+	%$$(QUIET2)$$(APPEND) -c '$(dep)' '$(out)'
+	%$$(QUIET2)$$(APPEND) '$(dep)' 'endef'
 endif
 
@@ -1952,5 +1955,5 @@
 define def_link_install_rule
 $(INSTARGET_$(target)) : $(out) | $(call DIRDEP,$(dir $(INSTARGET_$(target))))
-	$$(call MSG_INST_TRG,$(target),$(out),$$@)
+	%$$(call MSG_INST_TRG,$(target),$(out),$$@)
 	$$(QUIET)$$(INSTALL) $$(if $(mode),-m $(mode)) $(out) $$@
 
@@ -1965,25 +1968,25 @@
 # @{
 define def_src_handler_c
-type := C
+local type := C
  $(kb-src-one )
 endef
 
 define def_src_handler_cxx
-type := CXX
+local type := CXX
  $(kb-src-one )
 endef
 
 define def_src_handler_objc
-type := OBJC
+local type := OBJC
  $(kb-src-one )
 endef
 
 define def_src_handler_asm
-type := AS
+local type := AS
  $(kb-src-one )
 endef
 
 define def_src_handler_rc
-type := RC
+local type := RC
  $(kb-src-one )
 endef
@@ -2001,10 +2004,10 @@
 # .
 define def_src_handler_one
-suff := $(suffix $(source))
-src_handler := $(firstword $(filter $(suff):%, $($(target)_$(source)_SRC_HANDLERS) $($(source)_SRC_HANDLERS) $(target_src_handlers) ))
-handler := $(patsubst $(suff):%,%,$(src_handler))
+local suff := $(suffix $(source))
+local src_handler := $(firstword $(filter $(suff):%, $($(target)_$(source)_SRC_HANDLERS) $($(source)_SRC_HANDLERS) $(target_src_handlers) ))
+local handler := $(patsubst $(suff):%,%,$(src_handler))
 #$ (warning def_src_handler_one: source=$(source) suff=$(suff) src_handler=$(src_handler) handler=$(handler))
 ifneq ($(handler),)
- $(eval $(value $(handler)))
+ $(evalval $(handler))
 else
  othersrc += $(source)
@@ -2018,5 +2021,5 @@
 # @returns  othersrc, $(target)_OBJS_, ++
 define def_target_sources
-target_src_handlers := $($(target)_SRC_HANDLERS) $(KBUILD_SRC_HANDLERS)
+local target_src_handlers := $($(target)_SRC_HANDLERS) $(KBUILD_SRC_HANDLERS)
 $(foreach source,\
 	$($(target)_SOURCES)\
@@ -2026,5 +2029,5 @@
 	$($(target)_SOURCES.$(bld_trg_cpu))\
 	$($(target)_SOURCES.$(bld_type))\
-	,$(eval $(value def_src_handler_one)) )
+	,$(evalval def_src_handler_one) )
 endef
 
@@ -2075,13 +2078,13 @@
 # library basics
 ## @todo prefix
-bld_type    := $(firstword $($(target)_BLD_TYPE)     $(BUILD_TYPE))
-bld_trg     := $(firstword $($(target)_BLD_TRG)      $(BUILD_TARGET))
-bld_trg_arch:= $(firstword $($(target)_BLD_TRG_ARCH) $(BUILD_TARGET_ARCH))
-bld_trg_cpu := $(firstword $($(target)_BLD_TRG_CPU)  $(BUILD_TARGET_CPU))
-tool        := $(call _TARGET_TOOL,$(target),AR)
+local bld_type    := $(firstword $($(target)_BLD_TYPE)     $(BUILD_TYPE))
+local bld_trg     := $(firstword $($(target)_BLD_TRG)      $(BUILD_TARGET))
+local bld_trg_arch:= $(firstword $($(target)_BLD_TRG_ARCH) $(BUILD_TARGET_ARCH))
+local bld_trg_cpu := $(firstword $($(target)_BLD_TRG_CPU)  $(BUILD_TARGET_CPU))
+local tool        := $(call _TARGET_TOOL,$(target),AR)
 ifeq ($(tool),)
 $(error kBuild: Library target $(target) does not have a tool defined!)
 endif
-name        := $(firstword\
+local name        := $(firstword\
 	$($(target)_NAME.$(bld_trg).$(bld_trg_arch))\
 	$($(target)_NAME.$(bld_trg_arch))\
@@ -2090,7 +2093,7 @@
 	$($(target)_NAME)\
 	$(target))
-outbase     := $(call TARGET_BASE,$(name),$(target))
+local outbase     := $(call TARGET_BASE,$(name),$(target))
 ifndef PATH_$(target)
- PATH_$(target) := $(patsubst %/,%,$(dir $(outbase)))
+ PATH_$(target)   := $(patsubst %/,%,$(dir $(outbase)))
 else
  ifneq ($(PATH_$(target)),$(patsubst %/,%,$(dir $(outbase))))
@@ -2098,5 +2101,5 @@
  endif
 endif
-suff        := $(firstword\
+local suff        := $(firstword\
 	$($(target)_LIBSUFF.$(bld_trg).$(bld_trg_arch))\
 	$($(target)_LIBSUFF.$(bld_trg))\
@@ -2106,16 +2109,17 @@
 	$(TOOL_$(tool)_ARLIBSUFF)\
 	$(SUFF_LIB))
-out         := $(outbase)$(suff)
-TARGET_$(target) := $(out)
-$(target)_OBJS_ :=
-defpath := $($(target)_PATH)
-othersrc :=
+local out         := $(outbase)$(suff)
+local defpath     := $($(target)_PATH)
+TARGET_$(target)  := $(out)
+# no local here - must be writable across some foreachs.
+othersrc          :=
+$(target)_OBJS_   :=
 
 # source -> object
-$(eval $(value def_target_sources))
+$(evalval def_target_sources)
 
 # library linking
-tool        := $(call _TARGET_TOOL,$(target),AR)
-name        := $(firstword\
+local tool        := $(call _TARGET_TOOL,$(target),AR)
+local name        := $(firstword\
 	$($(target)_NAME.$(bld_trg).$(bld_trg_arch))\
 	$($(target)_NAME.$(bld_trg_arch))\
@@ -2124,6 +2128,6 @@
 	$($(target)_NAME)\
 	$(target))
-outbase     := $(call TARGET_BASE,$(name),$(target))
-flags       :=\
+local outbase     := $(call TARGET_BASE,$(name),$(target))
+local flags       :=\
 	$(TOOL_$(tool)_ARFLAGS)\
 	$(TOOL_$(tool)_ARFLAGS.$(bld_type))\
@@ -2136,13 +2140,13 @@
 	$($(target)_ARFLAGS.$(bld_trg).$(bld_trg_arch)) \
 	$($(target)_ARFLAGS.$(bld_trg_cpu))
-dirdep      := $(call DIRDEP,$(dir $(out)))
-deps        := $($(target)_DEPS)
-orderdeps   := $($(target)_ORDERDEPS)
+local dirdep      := $(call DIRDEP,$(dir $(out)))
+local deps        := $($(target)_DEPS)
+local orderdeps   := $($(target)_ORDERDEPS)
 
 # Adjust paths if we got a default path.
 ifneq ($(defpath),)
- $(target)_OBJS_ := $(abspathex $($(target)_OBJS_),$(defpath))
- deps := $(abspathex $(deps),$(defpath))
- orderdeps := $(abspathex $(orderdeps),$(defpath))
+ $(target)_OBJS_  := $(abspathex $($(target)_OBJS_),$(defpath))
+ local deps       := $(abspathex $(deps),$(defpath))
+ local orderdeps  := $(abspathex $(orderdeps),$(defpath))
  othersrc := $(abspathex $(othersrc),$(defpath))
 endif
@@ -2151,69 +2155,69 @@
 # Custom pre-link actions.
 ifdef $(target)_PRE_CMDS.$(bld_trg).$(bld_trg_arch).$(bld_type)
- pre_cmds := $($(target)_PRE_CMDS.$(bld_trg).$(bld_trg_arch).$(bld_type))
+ local pre_cmds := $($(target)_PRE_CMDS.$(bld_trg).$(bld_trg_arch).$(bld_type))
 else ifdef $(target)_PRE_CMDS.$(bld_trg).$(bld_trg_arch)
- pre_cmds := $($(target)_PRE_CMDS.$(bld_trg).$(bld_trg_arch))
+ local pre_cmds := $($(target)_PRE_CMDS.$(bld_trg).$(bld_trg_arch))
 else ifdef $(target)_PRE_CMDS.$(bld_trg).$(bld_type)
- pre_cmds := $($(target)_PRE_CMDS.$(bld_trg).$(bld_type))
+ local pre_cmds := $($(target)_PRE_CMDS.$(bld_trg).$(bld_type))
 else ifdef $(target)_PRE_CMDS.$(bld_trg_arch)
- pre_cmds := $($(target)_PRE_CMDS.$(bld_trg_arch))
+ local pre_cmds := $($(target)_PRE_CMDS.$(bld_trg_arch))
 else ifdef $(target)_PRE_CMDS.$(bld_trg)
- pre_cmds := $($(target)_PRE_CMDS.$(bld_trg))
+ local pre_cmds := $($(target)_PRE_CMDS.$(bld_trg))
 else ifdef $(target)_PRE_CMDS.$(bld_type)
- pre_cmds := $($(target)_PRE_CMDS.$(bld_type))
+ local pre_cmds := $($(target)_PRE_CMDS.$(bld_type))
 else ifdef $(target)_PRE_CMDS
- pre_cmds := $($(target)_PRE_CMDS)
+ local pre_cmds := $($(target)_PRE_CMDS)
 else ifdef PRE_CMDS.$(bld_trg).$(bld_trg_arch).$(bld_type)
- pre_cmds := $(PRE_CMDS.$(bld_trg).$(bld_trg_arch).$(bld_type))
+ local pre_cmds := $(PRE_CMDS.$(bld_trg).$(bld_trg_arch).$(bld_type))
 else ifdef PRE_CMDS.$(bld_trg).$(bld_trg_arch)
- pre_cmds := $(PRE_CMDS.$(bld_trg).$(bld_trg_arch))
+ local pre_cmds := $(PRE_CMDS.$(bld_trg).$(bld_trg_arch))
 else ifdef PRE_CMDS.$(bld_trg).$(bld_type)
- pre_cmds := $(PRE_CMDS.$(bld_trg).$(bld_type))
+ local pre_cmds := $(PRE_CMDS.$(bld_trg).$(bld_type))
 else ifdef PRE_CMDS.$(bld_trg_arch)
- pre_cmds := $(PRE_CMDS.$(bld_trg_arch))
+ local pre_cmds := $(PRE_CMDS.$(bld_trg_arch))
 else ifdef PRE_CMDS.$(bld_trg)
- pre_cmds := $(PRE_CMDS.$(bld_trg))
+ local pre_cmds := $(PRE_CMDS.$(bld_trg))
 else ifdef PRE_CMDS.$(bld_type)
- pre_cmds := $(PRE_CMDS.$(bld_type))
+ local pre_cmds := $(PRE_CMDS.$(bld_type))
 else
- pre_cmds := $(PRE_CMDS)
+ local pre_cmds := $(PRE_CMDS)
 endif
 
 # Custom post-link actions.
 ifdef $(target)_POST_CMDS.$(bld_trg).$(bld_trg_arch).$(bld_type)
- post_cmds := $($(target)_POST_CMDS.$(bld_trg).$(bld_trg_arch).$(bld_type))
+ local post_cmds := $($(target)_POST_CMDS.$(bld_trg).$(bld_trg_arch).$(bld_type))
 else ifdef $(target)_POST_CMDS.$(bld_trg).$(bld_trg_arch)
- post_cmds := $($(target)_POST_CMDS.$(bld_trg).$(bld_trg_arch))
+ local post_cmds := $($(target)_POST_CMDS.$(bld_trg).$(bld_trg_arch))
 else ifdef $(target)_POST_CMDS.$(bld_trg).$(bld_type)
- post_cmds := $($(target)_POST_CMDS.$(bld_trg).$(bld_type))
+ local post_cmds := $($(target)_POST_CMDS.$(bld_trg).$(bld_type))
 else ifdef $(target)_POST_CMDS.$(bld_trg_arch)
- post_cmds := $($(target)_POST_CMDS.$(bld_trg_arch))
+ local post_cmds := $($(target)_POST_CMDS.$(bld_trg_arch))
 else ifdef $(target)_POST_CMDS.$(bld_trg)
- post_cmds := $($(target)_POST_CMDS.$(bld_trg))
+ local post_cmds := $($(target)_POST_CMDS.$(bld_trg))
 else ifdef $(target)_POST_CMDS.$(bld_type)
- post_cmds := $($(target)_POST_CMDS.$(bld_type))
+ local post_cmds := $($(target)_POST_CMDS.$(bld_type))
 else ifdef $(target)_POST_CMDS
- post_cmds := $($(target)_POST_CMDS)
+ local post_cmds := $($(target)_POST_CMDS)
 else ifdef POST_CMDS.$(bld_trg).$(bld_trg_arch).$(bld_type)
- post_cmds := $(POST_CMDS.$(bld_trg).$(bld_trg_arch).$(bld_type))
+ local post_cmds := $(POST_CMDS.$(bld_trg).$(bld_trg_arch).$(bld_type))
 else ifdef POST_CMDS.$(bld_trg).$(bld_trg_arch)
- post_cmds := $(POST_CMDS.$(bld_trg).$(bld_trg_arch))
+ local post_cmds := $(POST_CMDS.$(bld_trg).$(bld_trg_arch))
 else ifdef POST_CMDS.$(bld_trg).$(bld_type)
- post_cmds := $(POST_CMDS.$(bld_trg).$(bld_type))
+ local post_cmds := $(POST_CMDS.$(bld_trg).$(bld_type))
 else ifdef POST_CMDS.$(bld_trg_arch)
- post_cmds := $(POST_CMDS.$(bld_trg_arch))
+ local post_cmds := $(POST_CMDS.$(bld_trg_arch))
 else ifdef POST_CMDS.$(bld_trg)
- post_cmds := $(POST_CMDS.$(bld_trg))
+ local post_cmds := $(POST_CMDS.$(bld_trg))
 else ifdef POST_CMDS.$(bld_type)
- post_cmds := $(POST_CMDS.$(bld_type))
+ local post_cmds := $(POST_CMDS.$(bld_type))
 else
- post_cmds := $(POST_CMDS)
+ local post_cmds := $(POST_CMDS)
 endif
 
 # eliminate this guy?
-objs = $($(target)_OBJS_)
+local objs = $($(target)_OBJS_)
 
 # dependency file
-dep := $(out)$(SUFF_DEP)
+local dep := $(out)$(SUFF_DEP)
 ifndef NO_LINK_CMDS_DEPS
  _DEPFILES_INCLUDED += $(dep)
@@ -2240,10 +2244,10 @@
 
 # call the tool
-$(target)_CMDS_   := $(TOOL_$(tool)_LINK_LIBRARY_CMDS)
+local cmds := $(TOOL_$(tool)_LINK_LIBRARY_CMDS)
 ifneq ($(pre_cmds),)
- $(target)_CMDS_  := $(TAB)$(pre_cmds)$(NL)$(TAB)$($(target)_CMDS_)
+ local cmds := $(TAB)$(pre_cmds)$(NL)$(TAB)$(cmds)
 endif
 ifneq ($(post_cmds),)
- $(target)_CMDS_  := $($(target)_CMDS_)$(NL)$(TAB)$(post_cmds)
+ local cmds  := $(cmds)$(NL)$(TAB)$(post_cmds)
 endif
 $(target)_OUTPUT_ := $(TOOL_$(tool)_LINK_LIBRARY_OUTPUT)
@@ -2256,5 +2260,5 @@
 
 # installing and globals
-$(eval $(value def_target_install_pluss))
+$(evalval def_target_install_pluss)
 endef
 
@@ -2264,5 +2268,5 @@
 tool_do := LINK_LIBRARY
 mode := 0644
-$(foreach target, $(LIBRARIES) $(LIBRARIES.$(BUILD_TARGET)) $(LIBRARIES.$(BUILD_TARGET).$(BUILD_TARGET_ARCH)), $(eval $(value def_lib)))
+$(foreach target, $(LIBRARIES) $(LIBRARIES.$(BUILD_TARGET)) $(LIBRARIES.$(BUILD_TARGET).$(BUILD_TARGET_ARCH)), $(evalval def_lib))
 
 ifdef KBUILD_PROFILE_SELF
@@ -2287,11 +2291,11 @@
 define def_link_common
 # basics
-bld_type    := $(firstword $($(target)_BLD_TYPE)     $(BUILD_TYPE))
-bld_trg     := $(firstword $($(target)_BLD_TRG)      $(BUILD_$(bld_trg_base_var)))
-bld_trg_arch:= $(firstword $($(target)_BLD_TRG_ARCH) $(BUILD_$(bld_trg_base_var)_ARCH))
-bld_trg_cpu := $(firstword $($(target)_BLD_TRG_CPU)  $(BUILD_$(bld_trg_base_var)_CPU))
-
-tool        := $(call _TARGET_TOOL,$(target),LD)
-name        := $(firstword\
+local bld_type    := $(firstword $($(target)_BLD_TYPE)     $(BUILD_TYPE))
+local bld_trg     := $(firstword $($(target)_BLD_TRG)      $(BUILD_$(bld_trg_base_var)))
+local bld_trg_arch:= $(firstword $($(target)_BLD_TRG_ARCH) $(BUILD_$(bld_trg_base_var)_ARCH))
+local bld_trg_cpu := $(firstword $($(target)_BLD_TRG_CPU)  $(BUILD_$(bld_trg_base_var)_CPU))
+
+local tool        := $(call _TARGET_TOOL,$(target),LD)
+local name        := $(firstword\
 	$($(target)_NAME.$(bld_trg).$(bld_trg_arch))\
 	$($(target)_NAME.$(bld_trg_arch))\
@@ -2300,7 +2304,7 @@
 	$($(target)_NAME)\
 	$(target))
-outbase     := $(call TARGET_BASE,$(name),$(target))
+local outbase     := $(call TARGET_BASE,$(name),$(target))
 ifndef PATH_$(target)
- PATH_$(target) := $(patsubst %/,%,$(dir $(outbase)))
+ PATH_$(target)   := $(patsubst %/,%,$(dir $(outbase)))
 else
  ifneq ($(PATH_$(target)),$(patsubst %/,%,$(dir $(outbase))))
@@ -2308,21 +2312,22 @@
  endif
 endif
-suff        := $(firstword \
+local suff        := $(firstword \
 	$($(target)_$(EXT)SUFF) \
 	$($(target)_$(EXT)SUFF) \
 	$(TOOL_$(tool)_LD$(EXT)SUFF) \
 	$($(EXTPRE)SUFF_$(EXT)))
-out         := $(outbase)$(suff)
-TARGET_$(target) := $(out)
-$(target)_OBJS_  :=
-defpath := $($(target)_PATH)
-othersrc :=
+local out         := $(outbase)$(suff)
+TARGET_$(target)  := $(out)
+local defpath     := $($(target)_PATH)
+# no local here - must be writable across some foreachs.
+othersrc          :=
+$(target)_OBJS_   :=
 
 # source -> object
-$(eval $(value def_target_sources))
+$(evalval def_target_sources)
 
 # more link stuff.
-tool        := $(call _TARGET_TOOL,$(target),LD)
-name        := $(firstword\
+local tool        := $(call _TARGET_TOOL,$(target),LD)
+local name        := $(firstword\
 	$($(target)_NAME.$(bld_trg).$(bld_trg_arch))\
 	$($(target)_NAME.$(bld_trg_arch))\
@@ -2331,6 +2336,6 @@
 	$($(target)_NAME)\
 	$(target))
-outbase     := $(call TARGET_BASE,$(name),$(target))
-flags       :=\
+local outbase     := $(call TARGET_BASE,$(name),$(target))
+local flags       :=\
 	$(TOOL_$(tool)_LDFLAGS)\
 	$(TOOL_$(tool)_LDFLAGS.$(bld_type))\
@@ -2373,5 +2378,5 @@
 	$($(target)_LDFLAGS.$(bld_trg).$(bld_trg_arch))\
 	$($(target)_LDFLAGS.$(bld_trg_cpu))
-libs        :=\
+local libs        :=\
 	$($(target)_LIBS.$(bld_trg_cpu))\
 	$($(target)_LIBS.$(bld_trg).$(bld_trg_arch))\
@@ -2414,5 +2419,5 @@
 	$(TOOL_$(tool)_LIBS.$(bld_type))\
 	$(TOOL_$(tool)_LIBS)
-libpath    :=\
+local libpath    :=\
 	$($(target)_LIBPATH.$(bld_trg_cpu))\
 	$($(target)_LIBPATH.$(bld_trg).$(bld_trg_arch))\
@@ -2455,14 +2460,14 @@
 	$(TOOL_$(tool)_LIBPATH.$(bld_type))\
 	$(TOOL_$(tool)_LIBPATH)
-dirdep      := $(call DIRDEP,$(dir $(out)))
-deps        := $($(target)_DEPS)
-orderdeps   := $($(target)_ORDERDEPS)
+local dirdep      := $(call DIRDEP,$(dir $(out)))
+local deps        := $($(target)_DEPS)
+local orderdeps   := $($(target)_ORDERDEPS)
 
 # Adjust paths if we got a default path.
 ifneq ($(defpath),)
- libpath := $(abspathex $(libpath),$(defpath))
- $(target)_OBJS_ := $(abspathex $($(target)_OBJS_),$(defpath))
- deps := $(abspathex $(deps),$(defpath))
- orderdeps := $(abspathex $(orderdeps),$(defpath))
+ local libpath    := $(abspathex $(libpath),$(defpath))
+ $(target)_OBJS_  := $(abspathex $($(target)_OBJS_),$(defpath))
+ local deps       := $(abspathex $(deps),$(defpath))
+ local orderdeps  := $(abspathex $(orderdeps),$(defpath))
  othersrc := $(abspathex $(othersrc),$(defpath))
  # libs are not subject to this because of the the -l<lib> stuff. Use $(<target>_PATH)/lib if relative to current dir!
@@ -2471,66 +2476,66 @@
 # Custom pre-link actions.
 ifdef $(target)_PRE_CMDS.$(bld_trg).$(bld_trg_arch).$(bld_type)
- pre_cmds := $($(target)_PRE_CMDS.$(bld_trg).$(bld_trg_arch).$(bld_type))
+ local pre_cmds := $($(target)_PRE_CMDS.$(bld_trg).$(bld_trg_arch).$(bld_type))
 else ifdef $(target)_PRE_CMDS.$(bld_trg).$(bld_trg_arch)
- pre_cmds := $($(target)_PRE_CMDS.$(bld_trg).$(bld_trg_arch))
+ local pre_cmds := $($(target)_PRE_CMDS.$(bld_trg).$(bld_trg_arch))
 else ifdef $(target)_PRE_CMDS.$(bld_trg).$(bld_type)
- pre_cmds := $($(target)_PRE_CMDS.$(bld_trg).$(bld_type))
+ local pre_cmds := $($(target)_PRE_CMDS.$(bld_trg).$(bld_type))
 else ifdef $(target)_PRE_CMDS.$(bld_trg_arch)
- pre_cmds := $($(target)_PRE_CMDS.$(bld_trg_arch))
+ local pre_cmds := $($(target)_PRE_CMDS.$(bld_trg_arch))
 else ifdef $(target)_PRE_CMDS.$(bld_trg)
- pre_cmds := $($(target)_PRE_CMDS.$(bld_trg))
+ local pre_cmds := $($(target)_PRE_CMDS.$(bld_trg))
 else ifdef $(target)_PRE_CMDS.$(bld_type)
- pre_cmds := $($(target)_PRE_CMDS.$(bld_type))
+ local pre_cmds := $($(target)_PRE_CMDS.$(bld_type))
 else ifdef $(target)_PRE_CMDS
- pre_cmds := $($(target)_PRE_CMDS)
+ local pre_cmds := $($(target)_PRE_CMDS)
 else ifdef PRE_CMDS.$(bld_trg).$(bld_trg_arch).$(bld_type)
- pre_cmds := $(PRE_CMDS.$(bld_trg).$(bld_trg_arch).$(bld_type))
+ local pre_cmds := $(PRE_CMDS.$(bld_trg).$(bld_trg_arch).$(bld_type))
 else ifdef PRE_CMDS.$(bld_trg).$(bld_trg_arch)
- pre_cmds := $(PRE_CMDS.$(bld_trg).$(bld_trg_arch))
+ local pre_cmds := $(PRE_CMDS.$(bld_trg).$(bld_trg_arch))
 else ifdef PRE_CMDS.$(bld_trg).$(bld_type)
- pre_cmds := $(PRE_CMDS.$(bld_trg).$(bld_type))
+ local pre_cmds := $(PRE_CMDS.$(bld_trg).$(bld_type))
 else ifdef PRE_CMDS.$(bld_trg_arch)
- pre_cmds := $(PRE_CMDS.$(bld_trg_arch))
+ local pre_cmds := $(PRE_CMDS.$(bld_trg_arch))
 else ifdef PRE_CMDS.$(bld_trg)
- pre_cmds := $(PRE_CMDS.$(bld_trg))
+ local pre_cmds := $(PRE_CMDS.$(bld_trg))
 else ifdef PRE_CMDS.$(bld_type)
- pre_cmds := $(PRE_CMDS.$(bld_type))
+ local pre_cmds := $(PRE_CMDS.$(bld_type))
 else
- pre_cmds := $(PRE_CMDS)
+ local pre_cmds := $(PRE_CMDS)
 endif
 
 # Custom post-link actions.
 ifdef $(target)_POST_CMDS.$(bld_trg).$(bld_trg_arch).$(bld_type)
- post_cmds := $($(target)_POST_CMDS.$(bld_trg).$(bld_trg_arch).$(bld_type))
+ local post_cmds := $($(target)_POST_CMDS.$(bld_trg).$(bld_trg_arch).$(bld_type))
 else ifdef $(target)_POST_CMDS.$(bld_trg).$(bld_trg_arch)
- post_cmds := $($(target)_POST_CMDS.$(bld_trg).$(bld_trg_arch))
+ local post_cmds := $($(target)_POST_CMDS.$(bld_trg).$(bld_trg_arch))
 else ifdef $(target)_POST_CMDS.$(bld_trg).$(bld_type)
- post_cmds := $($(target)_POST_CMDS.$(bld_trg).$(bld_type))
+ local post_cmds := $($(target)_POST_CMDS.$(bld_trg).$(bld_type))
 else ifdef $(target)_POST_CMDS.$(bld_trg_arch)
- post_cmds := $($(target)_POST_CMDS.$(bld_trg_arch))
+ local post_cmds := $($(target)_POST_CMDS.$(bld_trg_arch))
 else ifdef $(target)_POST_CMDS.$(bld_trg)
- post_cmds := $($(target)_POST_CMDS.$(bld_trg))
+ local post_cmds := $($(target)_POST_CMDS.$(bld_trg))
 else ifdef $(target)_POST_CMDS.$(bld_type)
- post_cmds := $($(target)_POST_CMDS.$(bld_type))
+ local post_cmds := $($(target)_POST_CMDS.$(bld_type))
 else ifdef $(target)_POST_CMDS
- post_cmds := $($(target)_POST_CMDS)
+ local post_cmds := $($(target)_POST_CMDS)
 else ifdef POST_CMDS.$(bld_trg).$(bld_trg_arch).$(bld_type)
- post_cmds := $(POST_CMDS.$(bld_trg).$(bld_trg_arch).$(bld_type))
+ local post_cmds := $(POST_CMDS.$(bld_trg).$(bld_trg_arch).$(bld_type))
 else ifdef POST_CMDS.$(bld_trg).$(bld_trg_arch)
- post_cmds := $(POST_CMDS.$(bld_trg).$(bld_trg_arch))
+ local post_cmds := $(POST_CMDS.$(bld_trg).$(bld_trg_arch))
 else ifdef POST_CMDS.$(bld_trg).$(bld_type)
- post_cmds := $(POST_CMDS.$(bld_trg).$(bld_type))
+ local post_cmds := $(POST_CMDS.$(bld_trg).$(bld_type))
 else ifdef POST_CMDS.$(bld_trg_arch)
- post_cmds := $(POST_CMDS.$(bld_trg_arch))
+ local post_cmds := $(POST_CMDS.$(bld_trg_arch))
 else ifdef POST_CMDS.$(bld_trg)
- post_cmds := $(POST_CMDS.$(bld_trg))
+ local post_cmds := $(POST_CMDS.$(bld_trg))
 else ifdef POST_CMDS.$(bld_type)
- post_cmds := $(POST_CMDS.$(bld_type))
+ local post_cmds := $(POST_CMDS.$(bld_type))
 else
- post_cmds := $(POST_CMDS)
+ local post_cmds := $(POST_CMDS)
 endif
 
 # eliminate this guy?
-objs = $($(target)_OBJS_)
+local objs = $($(target)_OBJS_)
 
 # installation targets
@@ -2552,5 +2557,5 @@
 
 # dependency file
-dep := $(outbase)$(SUFF_DEP)
+local dep := $(outbase)$(SUFF_DEP)
 ifndef NO_LINK_CMDS_DEPS
  _DEPFILES_INCLUDED += $(dep)
@@ -2577,10 +2582,10 @@
 
 # call the tool
-$(target)_CMDS_   := $(TOOL_$(tool)_$(tool_do)_CMDS)
+local cmds   := $(TOOL_$(tool)_$(tool_do)_CMDS)
 ifneq ($(pre_cmds),)
- $(target)_CMDS_  := $(TAB)$(pre_cmds)$(NL)$(TAB)$($(target)_CMDS_)
+ local cmds  := $(TAB)$(pre_cmds)$(NL)$(TAB)$(cmds)
 endif
 ifneq ($(post_cmds),)
- $(target)_CMDS_  := $($(target)_CMDS_)$(NL)$(TAB)$(post_cmds)
+ local cmds  := $(cmds)$(NL)$(TAB)$(post_cmds)
 endif
 $(target)_OUTPUT_ := $(TOOL_$(tool)_$(tool_do)_OUTPUT)
@@ -2617,5 +2622,5 @@
 
 # do the usual stuff.
-$(eval $(value def_link_common))
+$(evalval def_link_common)
 
 endef
@@ -2629,5 +2634,5 @@
 mode    := 0755
 bld_trg_base_var := PLATFORM
-$(foreach target, $(BLDPROGS) $(BLDPROGS.$(BUILD_PLATFORM)) $(BLDPROGS.$(BUILD_PLATFORM).$(BUILD_PLATFORM_ARCH)), $(eval $(value def_bldprog)))
+$(foreach target, $(BLDPROGS) $(BLDPROGS.$(BUILD_PLATFORM)) $(BLDPROGS.$(BUILD_PLATFORM).$(BUILD_PLATFORM_ARCH)), $(evalval def_bldprog))
 
 ifdef KBUILD_PROFILE_SELF
@@ -2651,5 +2656,5 @@
 mode    := 0644
 bld_trg_base_var := TARGET
-$(foreach target, $(DLLS) $(DLLS.$(BUILD_TARGET)) $(DLLS.$(BUILD_TARGET).$(BUILD_TARGET_ARCH)), $(eval $(value def_link_common)))
+$(foreach target, $(DLLS) $(DLLS.$(BUILD_TARGET)) $(DLLS.$(BUILD_TARGET).$(BUILD_TARGET_ARCH)), $(evalval def_link_common))
 
 ifdef KBUILD_PROFILE_SELF
@@ -2675,10 +2680,10 @@
  tool_do := LINK_LIBRARY
  definst := $(PATH_LIB)
- $(foreach target, $(IMPORT_LIBS) $(IMPORT_LIBS.$(BUILD_TARGET)) $(IMPORT_LIBS.$(BUILD_TARGET).$(BUILD_TARGET_ARCH)), $(eval $(value def_lib)))
+ $(foreach target, $(IMPORT_LIBS) $(IMPORT_LIBS.$(BUILD_TARGET)) $(IMPORT_LIBS.$(BUILD_TARGET).$(BUILD_TARGET_ARCH)), $(evalval def_lib))
 else
  EXT     := DLL
  tool_do := LINK_DLL
  definst := $(PATH_DLL)
- $(foreach target, $(IMPORT_LIBS) $(IMPORT_LIBS.$(BUILD_TARGET)) $(IMPORT_LIBS.$(BUILD_TARGET).$(BUILD_TARGET_ARCH)), $(eval $(value def_link_common)))
+ $(foreach target, $(IMPORT_LIBS) $(IMPORT_LIBS.$(BUILD_TARGET)) $(IMPORT_LIBS.$(BUILD_TARGET).$(BUILD_TARGET_ARCH)), $(evalval def_link_common))
 endif
 
@@ -2703,5 +2708,5 @@
 mode    := 0755
 bld_trg_base_var := TARGET
-$(foreach target, $(PROGRAMS) $(PROGRAMS.$(BUILD_TARGET)) $(PROGRAMS.$(BUILD_TARGET).$(BUILD_TARGET_ARCH)), $(eval $(value def_link_common)))
+$(foreach target, $(PROGRAMS) $(PROGRAMS.$(BUILD_TARGET)) $(PROGRAMS.$(BUILD_TARGET).$(BUILD_TARGET_ARCH)), $(evalval def_link_common))
 
 ifdef KBUILD_PROFILE_SELF
@@ -2725,5 +2730,5 @@
 mode    := 0644
 bld_trg_base_var := TARGET
-$(foreach target, $(SYSMODS) $(SYSMODS.$(BUILD_TARGET)) $(SYSMODS.$(BUILD_TARGET).$(BUILD_TARGET_ARCH)), $(eval $(value def_link_common)))
+$(foreach target, $(SYSMODS) $(SYSMODS.$(BUILD_TARGET)) $(SYSMODS.$(BUILD_TARGET).$(BUILD_TARGET_ARCH)), $(evalval def_link_common))
 
 ifdef KBUILD_PROFILE_SELF
@@ -2749,5 +2754,5 @@
 # the install rule
 $(insdst) : $(srcsrc) | $(call DIRDEP,$(dir $(insdst)))
-	$$(call MSG_INST_FILE,$(srcsrc),$(insdst))
+	%$$(call MSG_INST_FILE,$(srcsrc),$(insdst))
 	$$(QUIET)$(inscmd)
 endef
@@ -2757,33 +2762,33 @@
 
 # deal with '=>' in the source file name.
-srcdst := $(subst =>, ,$(src))
-srcsrc := $(firstword $(srcdst))
-srcdstdir := $(dir $(word 2,$(srcdst)))
-srcdst := $(word $(words $(srcdst)),$(srcdst))
+local srcdst := $(subst =>, ,$(src))
+local srcsrc := $(firstword $(srcdst))
+local srcdstdir := $(dir $(word 2,$(srcdst)))
+local srcdst := $(word $(words $(srcdst)),$(srcdst))
 
 # _INSTFUN
 ifdef $(srcsrc)_INSTFUN
- instfun := $(srcsrc)_INSTFUN
+ local instfun := $(srcsrc)_INSTFUN
 else ifdef $(target)_INSTFUN
- instfun := $(target)_INSTFUN
+ local instfun := $(target)_INSTFUN
 else
- instfun := _INSTALL_FILE
+ local instfun := _INSTALL_FILE
 endif
 
 # _INST
 ifdef $(srcsrc)_INST
- inst := $(patsubst %/,%,$($(srcsrc)_INST))/$(dir $(srcdstdir))
+ local inst := $(patsubst %/,%,$($(srcsrc)_INST))/$(dir $(srcdstdir))
 else ifdef $(target)_INST
- inst := $(patsubst %/,%,$($(target)_INST))/$(dir $(srcdstdir))
+ local inst := $(patsubst %/,%,$($(target)_INST))/$(dir $(srcdstdir))
 else
- inst := $(dir $(srcdstdir))
+ local inst := $(dir $(srcdstdir))
 endif
 
 # calc target
-insdst := $(call $(instfun),$(srcdst),$(target),$(inst),$(PATH_INS))
+local insdst := $(call $(instfun),$(srcdst),$(target),$(inst),$(PATH_INS))
 #$(warning instfun=$(instfun) srcdst=$(srcdst) target=$(target) inst=$(inst) => insdst=$(insdst))
 
 # mode, uid and gid
-mode := $(firstword \
+local mode := $(firstword \
 	$($(target)_$(srcsrc)_MODE.$(bld_trg).$(bld_trg_arch)) \
 	$($(target)_$(srcsrc)_MODE.$(bld_trg)) \
@@ -2801,5 +2806,5 @@
 	$($(target)_MODE.$(bld_trg)) \
 	$($(target)_MODE))
-uid := $(firstword \
+local uid := $(firstword \
 	$($(target)_$(srcsrc)_UID.$(bld_trg).$(bld_trg_arch)) \
 	$($(target)_$(srcsrc)_UID.$(bld_trg)) \
@@ -2817,5 +2822,5 @@
 	$($(target)_UID.$(bld_trg)) \
 	$($(target)_UID))
-gid := $(firstword \
+local gid := $(firstword \
 	$($(target)_$(srcsrc)_GID.$(bld_trg).$(bld_trg_arch)) \
 	$($(target)_$(srcsrc)_GID.$(bld_trg)) \
@@ -2833,5 +2838,5 @@
 	$($(target)_GID.$(bld_trg)) \
 	$($(target)_GID))
-flags := \
+local flags := \
 	$($(target)_IFFLAGS) \
 	$($(target)_IFFLAGS.$(bld_trg)) \
@@ -2853,14 +2858,14 @@
 # Adjust the source if we got a default PATH. (This must be done this late!)
 ifdef $(target)_PATH
- srcsrc := $(abspathex $(srcsrc),$($(target)_PATH))
+ local srcsrc := $(abspathex $(srcsrc),$($(target)_PATH))
 endif
 
 # create the command
 ifdef $(srcsrc)_INSTALLER
- inscmd := $(call $(srcsrc)_INSTALLER,$(srcsrc),$(insdst),$(target),$(flags))
+ local inscmd := $(call $(srcsrc)_INSTALLER,$(srcsrc),$(insdst),$(target),$(flags))
 else ifdef $(target)_INSTALLER
- inscmd := $(call $(target)_INSTALLER,$(srcsrc),$(insdst),$(target),$(flags))
+ local inscmd := $(call $(target)_INSTALLER,$(srcsrc),$(insdst),$(target),$(flags))
 else
- inscmd := $$(INSTALL)\
+ local inscmd := $$(INSTALL)\
 		$(if $(uid),-o $(uid))\
 		$(if $(gid),-g $(gid))\
@@ -2881,5 +2886,5 @@
 # the install rule
 $(insdst) : | $(call DIRDEP,$(dir $(insdst)))
-	$$(call MSG_INST_SYM,$(insdst),$(symdst))
+	%$$(call MSG_INST_SYM,$(insdst),$(symdst))
 	$$(QUIET)$$(RM) -f $$@
 	$$(QUIET)$$(LN_SYMLINK) $(symdst) $(insdst)
@@ -2890,28 +2895,28 @@
 
 # deal with '=>' in the source file name.
-symdst := $(subst =>, ,$(src))
-symlnk := $(firstword $(symdst))
-symdst := $(word $(words $(symdst)),$(symdst))
+local symdst := $(subst =>, ,$(src))
+local symlnk := $(firstword $(symdst))
+local symdst := $(word $(words $(symdst)),$(symdst))
 
 # _INSTFUN
 ifdef $(symlnk)_INSTFUN
- instfun := $(symlnk)_INSTFUN
+ local instfun := $(symlnk)_INSTFUN
 else ifdef $(target)_INSTFUN
- instfun := $(target)_INSTFUN
+ local instfun := $(target)_INSTFUN
 else
- instfun := _INSTALL_FILE
+ local instfun := _INSTALL_FILE
 endif
 
 # _INST
 ifdef $(symlnk)_INST
- inst := $(patsubst %/,%,$($(symlnk)_INST))/$(dir $(symlnk))
+ local inst := $(patsubst %/,%,$($(symlnk)_INST))/$(dir $(symlnk))
 else ifdef $(target)_INST
- inst := $(patsubst %/,%,$($(target)_INST))/$(dir $(symlnk))
+ local inst := $(patsubst %/,%,$($(target)_INST))/$(dir $(symlnk))
 else
- inst := $(dir $(symlnk))
+ local inst := $(dir $(symlnk))
 endif
 
 # calc target
-insdst := $(call $(instfun),$(symlnk),$(target),$(inst),$(PATH_INS))
+local insdst := $(call $(instfun),$(symlnk),$(target),$(inst),$(PATH_INS))
 #$(warning symlnk=$(symlnk) symdst=$(symdst) insdst=$(insdst) instfun=$(instfun) inst='$(inst)')
 
@@ -2927,5 +2932,5 @@
 # the install rule
 $(insdst):
-	$$(call MSG_INST_DIR,$(insdst))
+	%$$(call MSG_INST_DIR,$(insdst))
 	$$(QUIET)$$(INSTALL) -d \
 		$(if $(uid),-o $(uid))\
@@ -2944,12 +2949,12 @@
 # _INST
 ifdef $(directory)_INST
- inst := $(PATH_INS)/$(patsubst %/,%,$($(directory)_INST))
+ local inst := $(PATH_INS)/$(patsubst %/,%,$($(directory)_INST))
 else ifdef $(target)_INST
- inst := $(PATH_INS)/$(patsubst %/,%,$($(target)_INST))
+ local inst := $(PATH_INS)/$(patsubst %/,%,$($(target)_INST))
 else
- inst := $(PATH_INS)
-endif
-
-mode := $(firstword \
+ local inst := $(PATH_INS)
+endif
+
+local mode := $(firstword \
 	$($(target)_$(directory)_MODE.$(bld_trg).$(bld_trg_arch)) \
 	$($(target)_$(directory)_MODE.$(bld_trg)) \
@@ -2961,5 +2966,5 @@
 	$($(target)_MODE.$(bld_trg)) \
 	$($(target)_MODE))
-uid := $(firstword \
+local uid := $(firstword \
 	$($(target)_$(directory)_UID.$(bld_trg).$(bld_trg_arch)) \
 	$($(target)_$(directory)_UID.$(bld_trg)) \
@@ -2971,5 +2976,5 @@
 	$($(target)_UID.$(bld_trg)) \
 	$($(target)_UID))
-gid := $(firstword \
+local gid := $(firstword \
 	$($(target)_$(directory)_GID.$(bld_trg).$(bld_trg_arch)) \
 	$($(target)_$(directory)_GID.$(bld_trg)) \
@@ -2981,5 +2986,5 @@
 	$($(target)_GID.$(bld_trg)) \
 	$($(target)_GID))
-flags := \
+local flags := \
 	$($(target)_IDFLAGS)\
 	$($(target)_IDFLAGS.$(bld_trg)) \
@@ -2992,5 +2997,5 @@
 	$($(target)_$(directory)_IDFLAGS.$(bld_trg).$(bld_trg_arch))
 
-insdst := $(inst)/$(directory)/
+local insdst := $(inst)/$(directory)/
 #$(warning directory=$(directory) inst=$(inst) insdst=$(insdst) mode=$(mode) gid=$(gid) uid=$(uid))
 
@@ -3005,8 +3010,8 @@
 define def_install
 # the basics.
-bld_type  := $(firstword $($(target)_BLD_TYPE)     $(BUILD_TYPE))
-bld_trg   := $(firstword $($(target)_BLD_TRG)      $(BUILD_TARGET))
-bld_trg_arch:= $(firstword $($(target)_BLD_TRG_ARCH) $(BUILD_TARGET_ARCH))
-bld_trg_cpu := $(firstword $($(target)_BLD_TRG_CPU)  $(BUILD_TARGET_CPU))
+local bld_type  := $(firstword $($(target)_BLD_TYPE)     $(BUILD_TYPE))
+local bld_trg   := $(firstword $($(target)_BLD_TRG)      $(BUILD_TARGET))
+local bld_trg_arch:= $(firstword $($(target)_BLD_TRG_ARCH) $(BUILD_TARGET_ARCH))
+local bld_trg_cpu := $(firstword $($(target)_BLD_TRG_CPU)  $(BUILD_TARGET_CPU))
 
 INSTARGET_$(target) := $($(target)_GOALS)
@@ -3014,11 +3019,11 @@
 
 $(foreach directory,$($(target)_DIRS) $($(target)_DIRS.$(bld_trg)) $($(target)_DIRS.$(bld_trg).$(bld_trg_arch)) $($(target)_DIRS.$(bld_trg_arch)) $($(target)_DIRS.$(bld_trg_cpu)) $($(target)_DIRS.$(bld_type)), \
-	$(eval $(value def_install_directory)))
+	$(evalval def_install_directory))
 
 $(foreach src,$($(target)_SOURCES) $($(target)_SOURCES.$(bld_trg)) $($(target)_SOURCES.$(bld_trg).$(bld_trg_arch)) $($(target)_SOURCES.$(bld_trg_arch)) $($(target)_SOURCES.$(bld_trg_cpu)) $($(target)_SOURCES.$(bld_type)), \
-	$(eval $(value def_install_src)))
+	$(evalval def_install_src))
 
 $(foreach src,$($(target)_SYMLINKS) $($(target)_SYMLINKS.$(bld_trg)) $($(target)_SYMLINKS.$(bld_trg).$(bld_trg_arch)) $($(target)_SYMLINKS.$(bld_trg_arch)) $($(target)_SYMLINKS.$(bld_trg_cpu)) $($(target)_SYMLINKS.$(bld_type)), \
-	$(eval $(value def_install_symlink)))
+	$(evalval def_install_symlink))
 
 # the collection target
@@ -3038,5 +3043,5 @@
 ## process all install targets
 $(foreach target, $(INSTALLS) $(INSTALLS.$(BUILD_TARGET)) $(INSTALLS.$(BUILD_TARGET).$(BUILD_TARGET_ARCH)), \
-	$(eval $(value def_install)))
+	$(evalval def_install))
 
 ifdef KBUILD_PROFILE_SELF
@@ -3068,5 +3073,5 @@
 define def_mkdir_rule
 $(directory):
-	$$(call MSG_MKDIR,$$@)
+	%$$(call MSG_MKDIR,$$@)
 	$$(QUIET)$$(MKDIR) -p $$@
 endef
@@ -3090,5 +3095,5 @@
 	@$(ECHO) 'stat: $(make-stats )'
 endif
-	$(call MSG_NOTHING)
+	%$(call MSG_NOTHING)
 
 
@@ -3097,5 +3102,5 @@
 #
 do-clean:
-	$(call MSG_CLEAN)
+	%$(call MSG_CLEAN)
 	$(QUIET)$(RM) -f $(_OUT_FILES) $(_OBJS) $(_DEPFILES) $(_DEPFILES_INCLUDED) $(_CLEAN_FILES) $(OTHER_CLEAN)
 	$(QUIET)$(RMDIR) -p --ignore-fail-on-non-empty --ignore-fail-on-not-exist $(rsort $(dir $(_OUT_FILES) $(_OBJS) $(_DEPFILES) $(_DEPFILES_INCLUDED) $(_CLEAN_FILES) $(OTHER_CLEAN)))
@@ -3207,5 +3212,5 @@
 .PHONY: pass_$(pass)_order
 pass_$(pass)_order: $(pass_prev)
-	$$(call MSG_PASS,$$(if $$(PASS_$(PASS)),$$(PASS_$(PASS)),$(pass)))
+	%$$(call MSG_PASS,$$(if $$(PASS_$(PASS)),$$(PASS_$(PASS)),$(pass)))
 	+ $$(QUIET)$$(MAKE) -f $$(MAKEFILE) pass_$(pass)
 else
@@ -3213,5 +3218,5 @@
 .PHONY:       pass_$(pass)_order pass_$(pass)_banner
 pass_$(pass)_banner:
-	$$(call MSG_PASS,$$(if $$(PASS_$(PASS)),$$(PASS_$(PASS)),$(pass)))
+	%$$(call MSG_PASS,$$(if $$(PASS_$(PASS)),$$(PASS_$(PASS)),$(pass)))
 pass_$(pass)_order: \
 		$(pass_prev) \
Index: /trunk/kBuild/header.kmk
===================================================================
--- /trunk/kBuild/header.kmk	(revision 1495)
+++ /trunk/kBuild/header.kmk	(revision 1496)
@@ -1052,5 +1052,5 @@
   QUIET  := @
   QUIET2 := @
-  MSG_L1 ?= @$(ECHO) "kBuild: $1"
+  MSG_L1 ?= %@$(ECHO) "kBuild: $1"
   MSG_L2  =
  else ifeq ($(KBUILD_VERBOSE),1)
@@ -1058,5 +1058,5 @@
   QUIET  := @
   QUIET2 := @
-  MSG_L1 ?= @$(ECHO) "kBuild: $1 $2"
+  MSG_L1 ?= %@$(ECHO) "kBuild: $1 $2"
   MSG_L2  =
  else ifeq ($(KBUILD_VERBOSE),2)
@@ -1064,12 +1064,12 @@
   QUIET  :=
   QUIET2 := @
-  MSG_L1 ?= @$(ECHO) "kBuild: $1 $2"
-  MSG_L2 ?= @$(ECHO) "kBuild: $1"
+  MSG_L1 ?= %@$(ECHO) "kBuild: $1 $2"
+  MSG_L2 ?= %@$(ECHO) "kBuild: $1"
  else
   # maximal output.
   QUIET  :=
   QUIET2 :=
-  MSG_L1 ?= @$(ECHO) "kBuild: $1 $2"
-  MSG_L2 ?= @$(ECHO) "kBuild: $1"
+  MSG_L1 ?= %@$(ECHO) "kBuild: $1 $2"
+  MSG_L2 ?= %@$(ECHO) "kBuild: $1"
  endif
 endif
