Index: trunk/kBuild/footer.kmk
===================================================================
--- trunk/kBuild/footer.kmk	(revision 773)
+++ trunk/kBuild/footer.kmk	(revision 776)
@@ -624,5 +624,5 @@
 .PRECIOUS: $(out)
 $(out) $($(target)_$(srcname)_FETCH_OUTPUT_): | $($(target)_$(srcname)_FETCH_DEPORD_)
-	$$(call MSG_L1,Downloading $(source)...)
+	$$(call MSG_FETCH_DL,$(target),$(source),$(out))
 	@## @todo do fancy stuff like download continuation.
 	$$(QUIET)$$(RM) -f $(out) $(out).md5
@@ -635,5 +635,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_L1,Checking $(out),($(source))...)
+	$$(call MSG_FETCH_CHK,$(target),$(source),$(out))
 	$$(QUIET)$$(RM) -f $$@ $(out).md5
 	@# creates the .md5 we pass to md5sum.
@@ -658,5 +658,5 @@
 $(out) $($(target)_$(srcname)_UNPACK_OUTPUT_): $($(target)_$(srcname)_UNPACK_DEPEND_) \
 		| $($(target)_$(srcname)_UNPACK_DEPORD_) $(archive).checked_$(md5)_$(size)
-	$$(call MSG_L1,Unpacking $(archive),into $(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).
@@ -854,5 +854,5 @@
 
 $(out).lst: $(_TARGET_$(target)_UNPACKED) | $(call DIRDEP,$(inst))
-	$$(call MSG_L1,Successfully fetched $(target))
+	$$(call MSG_FETCH_OK,$(target))
 	$$(QUIET)$$(RM) -f $$@ $$@.tmp
 	$$(QUIET2)$$(APPEND) $$@.tmp "$(notdir $(out))"
@@ -861,5 +861,5 @@
 
 $(out)_unfetched:
-	$$(call MSG_L1,Unfetching $(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 $$@) \
@@ -870,5 +870,6 @@
 $(out): $(comp-vars _TARGET_$(target)_DIGEST_PREV,_TARGET_$(target)_DIGEST,FORCE) | $(call DIRDEP,$(inst))
 	$$(QUIET)$$(RM) -f $$@
-	$$(call MSG_L1,$$(if $$(_TARGET_$(target)_DIGEST),$$(if $$(wildcard $(out).lst),Re-fetching,Fetching),Removing) $(target)...)
+	$$(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)
 	$$(QUIET)$$(if  $$(_TARGET_$(target)_DIGEST),$$(MAKE) -f $(MAKEFILE) --no-print-directory $(out).lst,$$(RMDIR) -p --ignore-fail-on-non-empty --ignore-fail-on-not-exist $$(dir $$@))
@@ -978,5 +979,5 @@
 		| \
 		$($(target)_$(source)_DEPORD_)
-	$$(call MSG_L1,Compiling $(target) - $(source),=> $$@)
+	$$(call MSG_COMPILE,$(target),$(source),$$@,$(type))
 	$$(QUIET)$$(RM) -f $(dep) $(obj) $($(target)_$(source)_OUTPUT_)
 	$(custom_pre)
@@ -1024,5 +1025,5 @@
 		| \
 		$($(target)_DEPORD_)
-	$$(call MSG_L1,Linking $$@)
+	$$(call MSG_LINK,$(target),$$@,$(tool_do))
 	$$(QUIET)$$(RM) -f $(dep) $(out) $($(target)_OUTPUT_)
 	$(custom_pre)
@@ -1053,5 +1054,5 @@
 define def_link_install_rule
 $(INSTARGET_$(target)) : $(out) | $(call DIRDEP,$(dir $(INSTARGET_$(target))))
-	$$(call MSG_L1,Installing $(target) => $$@)
+	$$(call MSG_INST_TRG,$(target),$(out),$$@)
 	$$(QUIET)$$(INSTALL) $$(if $(mode),-m $(mode)) $(out) $$@
 
@@ -1263,4 +1264,5 @@
 
 # Process libraries
+tool_do := LINK_LIBRARY
 mode := 0644
 $(foreach target, $(LIBRARIES) $(LIBRARIES.$(BUILD_TARGET)) $(LIBRARIES.$(BUILD_TARGET).$(BUILD_TARGET_ARCH)), $(eval $(value def_lib)))
@@ -1630,5 +1632,5 @@
 # the install rule
 $(insdst) : $(srcsrc) | $(call DIRDEP,$(dir $(insdst)))
-	$$(call MSG_L1,Installing $(insdst),(<= $(srcsrc)))
+	$$(call MSG_INST_FILE,$(srcsrc),$(insdst))
 	$$(QUIET)$$(if $$(filter $(INSTALL),$(inscmd)),,$$(RM) -f $$@)
 	$$(QUIET)$(inscmd)
@@ -1752,5 +1754,5 @@
 # the install rule
 $(insdst) : | $(call DIRDEP,$(dir $(insdst)))
-	$$(call MSG_L1,Installing symlink $(insdst),pointing to $(symdst))
+	$$(call MSG_INST_SYM,$(insdst),$(symdst))
 	$$(QUIET)$$(RM) -f $$@
 	$$(QUIET)$$(LN_SYMLINK) $(symdst) $(insdst)
@@ -1802,5 +1804,5 @@
 # the install rule
 $(insdst):
-	$$(call MSG_L1,Installing directory $(insdst))
+	$$(call MSG_INST_DIR,$(insdst))
 	$$(QUIET)$$(INSTALL) -d \
 		$(if $(uid),-o $(uid))\
@@ -1917,5 +1919,5 @@
 define def_mkdir_rule
 $(directory):
-	$$(call MSG_L2,Creating directory $$@)
+	$$(call MSG_MKDIR,$$@)
 	$$(QUIET)$$(MKDIR) -p $$@
 endef
@@ -1928,5 +1930,5 @@
 #
 do-nothing:
-	$(call MSG_L1,Did nothing in $(CURDIR))
+	$(call MSG_NOTHING)
 
 
@@ -1935,5 +1937,5 @@
 #
 do-clean:
-	$(call MSG_L1,Cleaning...)
+	$(call MSG_CLEAN)
 	$(QUIET)$(RM) -f $(_OUT_FILES) $(_OBJS) $(_DEPFILES) $(_DEPFILES_INCLUDED) $(_CLEAN_FILES) $(OTHER_CLEAN)
 
@@ -2043,5 +2045,5 @@
 .PHONY: pass_$(pass)_order
 pass_$(pass)_order: $(pass_prev)
-	$$(call MSG_L1,Pass - $$(if $$(PASS_$(PASS)),$$(PASS_$(PASS)),$(pass)))
+	$$(call MSG_PASS,$$(if $$(PASS_$(PASS)),$$(PASS_$(PASS)),$(pass)))
 	+ $$(QUIET)$$(MAKE) -f $$(MAKEFILE) pass_$(pass)
 else
@@ -2049,5 +2051,5 @@
 .PHONY:       pass_$(pass)_order pass_$(pass)_banner
 pass_$(pass)_banner:
-	$$(call MSG_L1,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 773)
+++ trunk/kBuild/header.kmk	(revision 776)
@@ -411,4 +411,11 @@
 endif
 
+PRINTF_EXT  := $(PATH_KBUILD_BIN)/kmk_printf$(HOSTSUFF_EXE)
+ifeq ($(filter printf,$(KMK_BUILTIN)),printf)
+PRINTF      := kmk_builtin_printf
+else
+PRINTF      := $(PRINTF_EXT)
+endif
+
 RM_EXT      := $(PATH_KBUILD_BIN)/kmk_rm$(HOSTSUFF_EXE)
 ifeq ($(filter rm,$(KMK_BUILTIN)),rm)
@@ -712,4 +719,18 @@
 endif
 
+#
+# Check for --pretty-command-printing before including the Config.kmk
+# so that anyone overriding the message macros can take the implied
+# verbosity level change into account.
+#
+ifndef KBUILD_VERBOSE
+ ifndef KBUILD_QUIET
+  ifneq ($(filter --pretty-command-printing,$(MAKEFLAGS)),)
+   export KBUILD_VERBOSE := 1
+  endif
+ endif
+endif
+
+
 # Include the config.kmk we found file (or the default one).
 include $(_CFGFILE)
@@ -717,4 +738,157 @@
 
 #
+# Currently two message styles are supported: default and dense.
+#
+KBUILD_MSG_STYLE ?= default
+ifeq ($(KBUILD_MSG_STYLE),default)
+ #
+ # The 'default' style.
+ #
+
+ ## Fetch starting.
+ # @param 1     Target name.
+ MSG_FETCH    ?= $(call MSG_L1,Fetching $1...)
+ ## Re-fetch starting.
+ # @param 1     Target name.
+ MSG_REFETCH  ?= $(call MSG_L1,Re-fetching $1...)
+ ## Downloading a fetch component.
+ # @param 1     Target name.
+ # @param 2     The source URL.
+ # @param 3     The destination file name.
+ MSG_FETCH_DL ?= $(call MSG_L1,Downloading $1 - $2,=> $3)
+ ## Checking a fetch component.
+ # @param 1     Target name.
+ # @param 2     The source URL.
+ # @param 3     The destination file name.
+ MSG_FETCH_CHK?= $(call MSG_L1,Checking $1 - $3, ($2))
+ ## Unpacking a fetch component.
+ # @param 1     Target name.
+ # @param 2     The archive file name.
+ # @param 3     The target directory.
+ MSG_FETCH_UP ?= $(call MSG_L1,Unpacking $1 - $2 => $3)
+ ## Fetch completed.
+ # @param 1     Target name.
+ MSG_FETCH_OK ?= $(call MSG_L1,Successfully fetched $1)
+ ## Unfetch a fetch target.
+ # @param 1     Target name.
+ MSG_UNFETCH  ?= $(call MSG_L1,Unfetching $1...)
+ ## Compiling a source file.
+ # @param 1     Target name.
+ # @param 2     The source filename.
+ # @param 3     The primary link output file name.
+ # @param 4     The source type (CXX,C,AS,RC,++).
+ MSG_COMPILE  ?= $(call MSG_L1,Compiling $1 - $2,=> $3)
+ ## Linking a bldprog/dll/program/sysmod target.
+ # @param 1     Target name.
+ # @param 2     The primary link output file name.
+ # @param 3     The link tool operation (LINK_LIBRARY,LINK_PROGRAM,LINK_DLL,LINK_SYSMOD,++).
+ MSG_LINK     ?= $(call MSG_L1,Linking $1,=> $2)
+ ## Creating a directory (build).
+ # @param 1     Directory name.
+ MSG_MKDIR    ?= $(call MSG_L2,Creating directory $1)
+ ## Cleaning.
+ MSG_CLEAN    ?= $(call MSG_L1,Cleaning...)
+ ## Nothing.
+ MSG_NOTHING  ?= $(call MSG_L1,Did nothing in $(CURDIR))
+ ## Pass
+ # @param 1     The pass name.
+ MSG_PASS     ?= $(call MSG_L1,Pass - $1)
+ ## Installing a bldprog/lib/dll/program/sysmod target.
+ # @param 1     Target name.
+ # @param 2     The source filename.
+ # @param 3     The destination file name.
+ MSG_INST_TRG ?= $(call MSG_L1,Installing $1 => $3)
+ ## Installing a file (install target).
+ # @param 1     The source filename.
+ # @param 2     The destination filename.
+ MSG_INST_FILE?= $(call MSG_L1,Installing $2,(<= $1))
+ ## Installing a symlink.
+ # @param 1     Symlink
+ # @param 2     Link target
+ MSG_INST_SYM ?= $(call MSG_L1,Installing symlink $1,=> $2)
+ ## Installing a directory.
+ # @param 1     Directory name.
+ MSG_INST_DIR ?= $(call MSG_L1,Installing directory $1)
+
+else ifeq ($(KBUILD_MSG_STYLE),dense)
+ #
+ # The 'dense' style
+ #
+ ifndef KBUILD_VERBOSE
+  MSG_L1 ?= @$(ECHO) "  $(subst $(PATH_ROOT)/,{R}/,$(subst $(PATH_OUT)/,{O}/,$(subst $(CURDIR)/,{C}/,$(subst $(PATH_TARGET)/,{T}/,$1))))"
+ else
+  MSG_L1 ?= @$(ECHO) "  $(subst $(PATH_ROOT)/,{R}/,$(subst $(PATH_OUT)/,{O}/,$(subst $(CURDIR)/,{C}/,$(subst $(PATH_TARGET)/,{T}/,$1 $2))))"
+  MSG_L2 ?= @$(ECHO) "  $(subst $(PATH_ROOT)/,{R}/,$(subst $(PATH_OUT)/,{O}/,$(subst $(CURDIR)/,{C}/,$(subst $(PATH_TARGET)/,{T}/,$1))))"
+ endif
+ MAKEFLAGS := --no-print-directory $(MAKEFLAGS)
+
+ ## Fetch starting.
+ # @param 1     Target name.
+ MSG_FETCH    ?= $(call MSG_L1,FTCH $1...)
+ ## Re-fetch starting.
+ # @param 1     Target name.
+ MSG_REFETCH  ?= $(call MSG_L1,RFTCH $1...)
+ ## Downloading a fetch component.
+ # @param 1     Target name.
+ # @param 2     The source URL.
+ # @param 3     The destination file name.
+ MSG_FETCH_DL ?= $(call MSG_L1,GET  $1 - $2,=> $3)
+ ## Checking a fetch component.
+ # @param 1     Target name.
+ # @param 2     The source URL.
+ # @param 3     The destination file name.
+ MSG_FETCH_CHK?= $(call MSG_L1,CHK  $1 - $3, ($2))
+ ## Unpacking a fetch component.
+ # @param 1     Target name.
+ # @param 2     The archive file name.
+ # @param 3     The target directory.
+ MSG_FETCH_UP ?= $(call MSG_L1,UNPK $1 - $2,=> $3)
+ ## Fetch completed.
+ # @param 1     Target name.
+ MSG_FETCH_OK ?= $(call MSG_L1,DONE $1)
+ ## Unfetch a fetch target.
+ # @param 1     Target name.
+ MSG_UNFETCH  ?= $(call MSG_L1,RM   $1...)
+ ## Compiling a source file.
+ # @param 1     Target name.
+ # @param 2     The source filename.
+ # @param 3     The primary link output file name.
+ # @param 4     The source type (CXX,C,AS,RC,++).
+ MSG_COMPILE  ?= $(call MSG_L1,CC   $1 - $2,=> $3)
+ ## Linking a bldprog/dll/program/sysmod target.
+ # @param 1     Target name.
+ # @param 2     The primary link output file name.
+ # @param 3     The link tool operation (LINK_LIBRARY,LINK_PROGRAM,LINK_DLL,LINK_SYSMOD,++).
+ MSG_LINK     ?= $(call MSG_L1,$(if $(eq $3,LINK_LIBRARY),AR,LD)   $1,=> $2)
+ ## Creating a directory (build).
+ # @param 1     Directory name.
+ MSG_MKDIR    ?= $(call MSG_L2,DIR  $1)
+ ## Cleaning.
+ MSG_CLEAN    ?= $(call MSG_L1,CLEAN)
+ ## Nothing.
+ MSG_NOTHING  ?= $(call MSG_L1,NOTHING $(CURDIR))
+ ## Installing a bldprog/lib/dll/program/sysmod target.
+ # @param 1     Target name.
+ # @param 2     The source filename.
+ # @param 3     The destination file name.
+ MSG_INST_TRG ?= $(call MSG_L1,INST $1,=> $2)
+ ## Installing a file (install target).
+ # @param 1     The source filename.
+ # @param 2     The destination filename.
+ MSG_INST_FILE?= $(call MSG_L1,IFIL $2,(<= $1))
+ ## Installing a symlink.
+ # @param 1     Symlink
+ # @param 2     Link target
+ MSG_INST_SYM ?= $(call MSG_L1,ISYM $1,=> $2)
+ ## Installing a directory.
+ # @param 1     Directory name.
+ MSG_INST_DIR ?= $(call MSG_L1,IDIR $1)
+
+else
+ $(error kBuild: Unknown message style: KBUILD_MSG_STYLE=$(KBUILD_MSG_STYLE))
+endif
+
+
+#
 # Message macros.
 #
@@ -723,34 +897,38 @@
 #
 ifdef KBUILD_QUIET
- # minimal output.
+ # No output
  QUIET := @
  QUIET2:= @
  MSG_L1	=
  MSG_L2 =
- MSG_L3 =
 else
  ifndef KBUILD_VERBOSE
-  ifneq ($(filter --pretty-command-printing,$(MAKEFLAGS)),)
-   export KBUILD_VERBOSE := 1
-  endif
- endif
- ifndef KBUILD_VERBOSE
-  QUIET := @
-  QUIET2:= @
-  MSG_L1 = @$(ECHO) "kBuild: $1"
-  MSG_L2 =
-  MSG_L3 =
+  # Default output level.
+  QUIET  := @
+  QUIET2 := @
+  MSG_L1 ?= @$(ECHO) "kBuild: $1"
+  MSG_L2  =
+ else ifeq ($(KBUILD_VERBOSE),1)
+  # A bit more output
+  QUIET  := @
+  QUIET2 := @
+  MSG_L1 ?= @$(ECHO) "kBuild: $1 $2"
+  MSG_L2  =
+ else ifeq ($(KBUILD_VERBOSE),2)
+  # Lot more output
+  QUIET  :=
+  QUIET2 := @
+  MSG_L1 ?= @$(ECHO) "kBuild: $1 $2"
+  MSG_L2 ?= @$(ECHO) "kBuild: $1"
  else
   # maximal output.
-  QUIET :=
-  MSG_L1 = @$(ECHO) "kBuild: $1 $2"
-  MSG_L2 = @$(ECHO) "kBuild: $1"
-  ifneq ($(KBUILD_VERBOSE),all)
-   QUIET2:= @
-  else
-   QUIET2:=
-  endif
- endif
-endif
+  QUIET  :=
+  QUIET2 :=
+  MSG_L1 ?= @$(ECHO) "kBuild: $1 $2"
+  MSG_L2 ?= @$(ECHO) "kBuild: $1"
+ endif
+endif
+
+
 
 # end-of-file-content
@@ -758,3 +936,2 @@
 endif # __header_kmk__
 
-
