Index: unk/kBuild/StampOutPredefines.kmk
===================================================================
--- /trunk/kBuild/StampOutPredefines.kmk	(revision 722)
+++ 	(revision )
@@ -1,151 +1,0 @@
-# $Id$
-## @file
-#
-# kBuild - Stamp out GNU Make predefines.
-#
-# Copyright (c) 2004 knut st. osmundsen <bird-srcspam@anduin.net>
-#
-#
-# This file is part of kBuild.
-#
-# kBuild is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# kBuild is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with kBuild; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-#
-#
-
-#
-# Default variables.
-#
-ifeq ($(MAKEFLAGS),$(MAKEFLAGS:R=x))
-# add the -R makeflag to avoid doing this for submakes
-MAKEFLAGS := R$(MAKEFLAGS)
-
-define def_undefine_default
-ifeq ($(origin $1), default)
-$1:=
-endif
-endef
-									
-_DEFAULT_VARIABLES := .LIBPATTERNS .VARIABLES AR ARFLAGS AS CC CHECKOUT,v CO COFLAGS COMPILE.C COMPILE.F COMPILE.S COMPILE.c COMPILE.cc COMPILE.cpp COMPILE.def COMPILE.f COMPILE.mod COMPILE.p COMPILE.r COMPILE.s CPP CTANGLE CWEAVE CXX F77 F77FLAGS FC GET LD LEX LEX.l LINK.C LINK.F LINK.S LINK.c LINK.cc LINK.cpp LINK.f LINK.o LINK.p LINK.r LINK.s LINT LINT.c M2C MAKEINFO OUTPUT_OPTION PC PREPROCESS.F PREPROCESS.S PREPROCESS.r RM TANGLE TEX TEXI2DVI WEAVE YACC YACC.y
-$(foreach i, $(_DEFAULT_VARIABLES), $(eval $(call def_undefine_default,$(i))))
-_DEFAULT_VARIABLES :=
-def_undefine_default :=
-endif
-
-#
-# Suffixes.
-#
-.SUFFIXES:
-SUFFIXES :=
-
-#
-# Implicit rules
-#
-ifeq ($(MAKEFLAGS),$(MAKEFLAGS:r=x))
-MAKEFLAGS := r$(MAKEFLAGS)
-# add the -r makeflag to avoid doing this for submakes
-
-%.C:
-%.F:
-%.S:
-%.a:
-%.c:
-%.c: %.l
-%.c: %.w
-%.c: %.w %.ch
-%.c: %.y
-%.cc:
-%.ch:
-%.cpp:
-%.def:
-%.dll:
-%.dvi:
-%.dvi: %.tex
-%.dvi: %.texi
-%.dvi: %.texinfo
-%.dvi: %.txinfo
-%.el:
-%.elc:
-%.exe:
-%.f:
-%.f: %.F
-%.f: %.r
-%.h:
-%.info:
-%.info: %.texi
-%.info: %.texinfo
-%.info: %.txinfo
-%.l:
-%.lib:
-%.ln:
-%.ln: %.c
-%.ln: %.l
-%.ln: %.y
-%.mod:
-%.o:
-%.o: %.C
-%.o: %.F
-%.o: %.S
-%.o: %.c
-%.o: %.cc
-%.o: %.cpp
-%.o: %.f
-%.o: %.mod
-%.o: %.p
-%.o: %.r
-%.o: %.s
-%.obj:
-%.out:
-%.out: %
-%.p:
-%.p: %.web
-%.r:
-%.r: %.l
-%.s:
-%.s: %.S
-%.sh:
-%.sym:
-%.sym: %.def
-%.tex:
-%.tex: %.w
-%.tex: %.w %.ch
-%.tex: %.web
-%.texi:
-%.texinfo:
-%.txinfo:
-%.w:
-%.web:
-%.y:
-%: %.C
-%: %.F
-%: %.S
-%: %.c
-%: %.cc
-%: %.cpp
-%: %.f
-%: %.mod
-%: %.o
-%: %.p
-%: %.r
-%: %.s
-%: %.sh
-%:: %,v
-%:: RCS/%
-%:: RCS/%,v
-%:: SCCS/s.%
-%:: s.%
-(%): %
-endif
-
-
Index: /trunk/kBuild/footer.kmk
===================================================================
--- /trunk/kBuild/footer.kmk	(revision 722)
+++ /trunk/kBuild/footer.kmk	(revision 723)
@@ -210,4 +210,13 @@
 
 #
+# Include the additional footer macros when bootstrapping kBuild. 
+#
+ifndef KMK_VERSION
+ include $(PATH_KBUILD)/gnumake-footer.kmk
+endif
+
+
+
+#
 # Check syntax which leads to weird syntax errors.
 #
@@ -1007,9 +1016,5 @@
 ## wrapper the compile command dependency check.
 ifndef NO_COMPILE_CMDS_DEPS
- ifneq ($(filter comp-vars,$(KMK_FEATURES)),)
 _DEP_COMPILE_CMDS = $(comp-vars $(target)_$(source)_CMDS_PREV_,$(target)_$(source)_CMDS_,FORCE)
- else
-_DEP_COMPILE_CMDS = $(if $(subst $(strip $($(target)_$(source)_CMDS_PREV_)),,$(strip $($(target)_$(source)_CMDS_))),FORCE,)
- endif
 else
 _DEP_COMPILE_CMDS =
@@ -1048,9 +1053,5 @@
 ## wrapper the link command dependency check.
 ifndef NO_COMPILE_CMDS_DEPS
- ifneq ($(filter comp-vars,$(KMK_FEATURES)),)
 _DEP_LINK_CMDS = $(comp-vars $(target)_CMDS_PREV_,$(target)_CMDS_,FORCE)
- else
-_DEP_LINK_CMDS = $(if $(subst $(strip $($(target)_CMDS_PREV_)),,$(strip $($(target)_CMDS_))),FORCE,)
- endif
 else
 _DEP_LINK_CMDS =
@@ -1109,5 +1110,4 @@
 
 
-
 ## Generic macro for processing C, C++ and Assembly sources.
 # @param    $(target)     Normalized target name.
@@ -1118,389 +1118,9 @@
 # @param    bld_trg_arch  Build target arch.
 # @param    bld_trg_cpu   Build target cpu.
-# @remark 	obsoleted by kBuild helpers in kmk. Only required for limited gmake compatbility.
-#
-define def_target_source_c_cpp_asm_rc_old
-#$ (warning dbg: def_target_source_c_cpp_asm_rc_old: source='$(source)' target='$(target)' type='$(type)')
-
-tool := $(call _SOURCE_TOOL,$(source),$(target),$(type))
-outbase     := $(call _OBJECT_BASE,$(source),$(target))
-PATH_$(target)_$(source) := $(patsubst %/,%,$(dir $(outbase)))
-dirdep      := $(call DIRDEP,$(dir $(outbase)))
-defs        :=\
-	$(TOOL_$(tool)_DEFS)\
-	$(TOOL_$(tool)_DEFS.$(bld_type))\
-	$(TOOL_$(tool)_DEFS.$(bld_trg))\
-	$(TOOL_$(tool)_DEFS.$(bld_trg_arch))\
-	$(TOOL_$(tool)_DEFS.$(bld_trg).$(bld_trg_arch))\
-	$(TOOL_$(tool)_DEFS.$(bld_trg_cpu))\
-	$(TOOL_$(tool)_$(type)DEFS)\
-	$(TOOL_$(tool)_$(type)DEFS.$(bld_type))\
-	$(foreach sdk, $(SDKS.$(bld_trg).$(bld_trg_arch)) \
-	               $(SDKS.$(bld_trg_arch)) \
-	               $(SDKS.$(bld_trg)) \
-	               $(SDKS.$(bld_type)) \
-	               $(SDKS),\
-		$(SDK_$(sdk)_DEFS)\
-		$(SDK_$(sdk)_DEFS.$(bld_type))\
-		$(SDK_$(sdk)_DEFS.$(bld_trg))\
-		$(SDK_$(sdk)_DEFS.$(bld_trg_arch))\
-		$(SDK_$(sdk)_DEFS.$(bld_trg).$(bld_trg_arch))\
-		$(SDK_$(sdk)_DEFS.$(bld_trg_cpu))\
-		$(SDK_$(sdk)_$(type)DEFS)\
-		$(SDK_$(sdk)_$(type)DEFS.$(bld_type))\
-		$(SDK_$(sdk)_$(type)DEFS.$(bld_trg))\
-		$(SDK_$(sdk)_$(type)DEFS.$(bld_trg_arch))\
-		$(SDK_$(sdk)_$(type)DEFS.$(bld_trg).$(bld_trg_arch))\
-		$(SDK_$(sdk)_$(type)DEFS.$(bld_trg_cpu)))\
-	$(DEFS)\
-	$(DEFS.$(bld_type))\
-	$(DEFS.$(bld_trg))\
-	$(DEFS.$(bld_trg_arch))\
-	$(DEFS.$(bld_trg).$(bld_trg_arch))\
-	$(DEFS.$(bld_trg_cpu))\
-	$($(type)DEFS)\
-	$($(type)DEFS.$(bld_type))\
-	$($(type)DEFS.$(bld_trg))\
-	$($(type)DEFS.$(bld_trg_arch))\
-	$($(type)DEFS.$(bld_trg).$(bld_trg_arch))\
-	$($(type)DEFS.$(bld_trg_cpu))\
-	$(foreach sdk, $($(target)_SDKS.$(bld_trg).$(bld_trg_arch)) \
-	               $($(target)_SDKS.$(bld_trg_arch)) \
-	               $($(target)_SDKS.$(bld_trg)) \
-	               $($(target)_SDKS.$(bld_type)) \
-	               $($(target)_SDKS),\
-		$(SDK_$(sdk)_DEFS)\
-		$(SDK_$(sdk)_DEFS.$(bld_type))\
-		$(SDK_$(sdk)_DEFS.$(bld_trg))\
-		$(SDK_$(sdk)_DEFS.$(bld_trg_arch))\
-		$(SDK_$(sdk)_DEFS.$(bld_trg).$(bld_trg_arch))\
-		$(SDK_$(sdk)_DEFS.$(bld_trg_cpu))\
-		$(SDK_$(sdk)_$(type)DEFS)\
-		$(SDK_$(sdk)_$(type)DEFS.$(bld_type))\
-		$(SDK_$(sdk)_$(type)DEFS.$(bld_trg))\
-		$(SDK_$(sdk)_$(type)DEFS.$(bld_trg_arch))\
-		$(SDK_$(sdk)_$(type)DEFS.$(bld_trg).$(bld_trg_arch))\
-		$(SDK_$(sdk)_$(type)DEFS.$(bld_trg_cpu)))\
-	$($(target)_DEFS)\
-	$($(target)_DEFS.$(bld_type))\
-	$($(target)_DEFS.$(bld_trg))\
-	$($(target)_DEFS.$(bld_trg_arch))\
-	$($(target)_DEFS.$(bld_trg).$(bld_trg_arch))\
-	$($(target)_DEFS.$(bld_trg_cpu))\
-	$($(target)_$(type)DEFS)\
-	$($(target)_$(type)DEFS.$(bld_type))\
-	$($(target)_$(type)DEFS.$(bld_trg))\
-	$($(target)_$(type)DEFS.$(bld_trg_arch))\
-	$($(target)_$(type)DEFS.$(bld_trg).$(bld_trg_arch))\
-	$($(target)_$(type)DEFS.$(bld_trg_cpu))\
-	$(foreach sdk, $($(source)_SDKS.$(bld_trg).$(bld_trg_arch)) \
-	               $($(source)_SDKS.$(bld_trg_arch)) \
-	               $($(source)_SDKS.$(bld_trg)) \
-	               $($(source)_SDKS.$(bld_type)) \
-	               $($(source)_SDKS),\
-		$(SDK_$(sdk)_DEFS)\
-		$(SDK_$(sdk)_DEFS.$(bld_type))\
-		$(SDK_$(sdk)_DEFS.$(bld_trg))\
-		$(SDK_$(sdk)_DEFS.$(bld_trg_arch))\
-		$(SDK_$(sdk)_DEFS.$(bld_trg).$(bld_trg_arch))\
-		$(SDK_$(sdk)_DEFS.$(bld_trg_cpu))\
-		$(SDK_$(sdk)_$(type)DEFS)\
-		$(SDK_$(sdk)_$(type)DEFS.$(bld_type))\
-		$(SDK_$(sdk)_$(type)DEFS.$(bld_trg))\
-		$(SDK_$(sdk)_$(type)DEFS.$(bld_trg_arch))\
-		$(SDK_$(sdk)_$(type)DEFS.$(bld_trg).$(bld_trg_arch))\
-		$(SDK_$(sdk)_$(type)DEFS.$(bld_trg_cpu)))\
-	$($(source)_DEFS)\
-	$($(source)_DEFS.$(bld_type))\
-	$($(source)_DEFS.$(bld_trg))\
-	$($(source)_DEFS.$(bld_trg_arch))\
-	$($(source)_DEFS.$(bld_trg).$(bld_trg_arch))\
-	$($(source)_DEFS.$(bld_trg_cpu))\
-	$($(source)_$(type)DEFS)\
-	$($(source)_$(type)DEFS.$(bld_type))\
-	$($(source)_$(type)DEFS.$(bld_trg))\
-	$($(source)_$(type)DEFS.$(bld_trg_arch))\
-	$($(source)_$(type)DEFS.$(bld_trg).$(bld_trg_arch))\
-	$($(source)_$(type)DEFS.$(bld_trg_cpu))\
-	$(foreach sdk, $($(target)_$(source)_SDKS.$(bld_trg).$(bld_trg_arch)) \
-	               $($(target)_$(source)_SDKS.$(bld_trg_arch)) \
-	               $($(target)_$(source)_SDKS.$(bld_trg)) \
-	               $($(target)_$(source)_SDKS.$(bld_type)) \
-	               $($(target)_$(source)_SDKS),\
-		$(SDK_$(sdk)_DEFS)\
-		$(SDK_$(sdk)_DEFS.$(bld_type))\
-		$(SDK_$(sdk)_DEFS.$(bld_trg))\
-		$(SDK_$(sdk)_DEFS.$(bld_trg_arch))\
-		$(SDK_$(sdk)_DEFS.$(bld_trg).$(bld_trg_arch))\
-		$(SDK_$(sdk)_DEFS.$(bld_trg_cpu))\
-		$(SDK_$(sdk)_$(type)DEFS)\
-		$(SDK_$(sdk)_$(type)DEFS.$(bld_type))\
-		$(SDK_$(sdk)_$(type)DEFS.$(bld_trg))\
-		$(SDK_$(sdk)_$(type)DEFS.$(bld_trg_arch))\
-		$(SDK_$(sdk)_$(type)DEFS.$(bld_trg).$(bld_trg_arch))\
-		$(SDK_$(sdk)_$(type)DEFS.$(bld_trg_cpu)))\
-	$($(target)_$(source)_DEFS)\
-	$($(target)_$(source)_DEFS.$(bld_type))\
-	$($(target)_$(source)_DEFS.$(bld_trg))\
-	$($(target)_$(source)_DEFS.$(bld_trg_arch))\
-	$($(target)_$(source)_DEFS.$(bld_trg).$(bld_trg_arch))\
-	$($(target)_$(source)_DEFS.$(bld_trg_cpu))\
-	$($(target)_$(source)_$(type)DEFS)\
-	$($(target)_$(source)_$(type)DEFS.$(bld_type))\
-	$($(target)_$(source)_$(type)DEFS.$(bld_trg))\
-	$($(target)_$(source)_$(type)DEFS.$(bld_trg_arch))\
-	$($(target)_$(source)_$(type)DEFS.$(bld_trg).$(bld_trg_arch))\
-	$($(target)_$(source)_$(type)DEFS.$(bld_trg_cpu))
-incs        :=\
-	$($(target)_$(source)_$(type)INCS.$(bld_trg_cpu))\
-	$($(target)_$(source)_$(type)INCS.$(bld_trg).$(bld_trg_arch))\
-	$($(target)_$(source)_$(type)INCS.$(bld_trg_arch))\
-	$($(target)_$(source)_$(type)INCS.$(bld_trg))\
-	$($(target)_$(source)_$(type)INCS.$(bld_type))\
-	$($(target)_$(source)_$(type)INCS)\
-	$($(target)_$(source)_INCS.$(bld_trg_cpu))\
-	$($(target)_$(source)_INCS.$(bld_trg).$(bld_trg_arch))\
-	$($(target)_$(source)_INCS.$(bld_trg_arch))\
-	$($(target)_$(source)_INCS.$(bld_trg))\
-	$($(target)_$(source)_INCS.$(bld_type))\
-	$($(target)_$(source)_INCS)\
-	$(foreach sdk, $($(target)_$(source)_SDKS.$(bld_trg).$(bld_trg_arch)) \
-	               $($(target)_$(source)_SDKS.$(bld_trg_arch)) \
-	               $($(target)_$(source)_SDKS.$(bld_trg)) \
-	               $($(target)_$(source)_SDKS.$(bld_type)) \
-	               $($(target)_$(source)_SDKS),\
-		$(SDK_$(sdk)_$(type)INCS.$(bld_trg_cpu))\
-		$(SDK_$(sdk)_$(type)INCS.$(bld_trg).$(bld_trg_arch))\
-		$(SDK_$(sdk)_$(type)INCS.$(bld_trg_arch))\
-		$(SDK_$(sdk)_$(type)INCS.$(bld_trg))\
-		$(SDK_$(sdk)_$(type)INCS.$(bld_type))\
-		$(SDK_$(sdk)_$(type)INCS)\
-		$(SDK_$(sdk)_INCS.$(bld_trg_cpu))\
-		$(SDK_$(sdk)_INCS.$(bld_trg).$(bld_trg_arch))\
-		$(SDK_$(sdk)_INCS.$(bld_trg_arch))\
-		$(SDK_$(sdk)_INCS.$(bld_trg))\
-		$(SDK_$(sdk)_INCS.$(bld_type))\
-		$(SDK_$(sdk)_INCS))\
-	$($(source)_$(type)INCS.$(bld_trg_cpu))\
-	$($(source)_$(type)INCS.$(bld_trg).$(bld_trg_arch))\
-	$($(source)_$(type)INCS.$(bld_trg_arch))\
-	$($(source)_$(type)INCS.$(bld_trg))\
-	$($(source)_$(type)INCS.$(bld_type))\
-	$($(source)_$(type)INCS)\
-	$($(source)_INCS.$(bld_trg_cpu))\
-	$($(source)_INCS.$(bld_trg).$(bld_trg_arch))\
-	$($(source)_INCS.$(bld_trg_arch))\
-	$($(source)_INCS.$(bld_trg))\
-	$($(source)_INCS.$(bld_type))\
-	$($(source)_INCS)\
-	$(foreach sdk, $($(source)_SDKS.$(bld_trg).$(bld_trg_arch)) \
-		       $($(source)_SDKS.$(bld_trg_arch)) \
-		       $($(source)_SDKS.$(bld_trg)) \
-		       $($(source)_SDKS.$(bld_type)) \
-		       $($(source)_SDKS),\
-		$(SDK_$(sdk)_$(type)INCS.$(bld_trg_cpu))\
-		$(SDK_$(sdk)_$(type)INCS.$(bld_trg).$(bld_trg_arch))\
-		$(SDK_$(sdk)_$(type)INCS.$(bld_trg_arch))\
-		$(SDK_$(sdk)_$(type)INCS.$(bld_trg))\
-		$(SDK_$(sdk)_$(type)INCS.$(bld_type))\
-		$(SDK_$(sdk)_$(type)INCS)\
-		$(SDK_$(sdk)_INCS.$(bld_trg_cpu))\
-		$(SDK_$(sdk)_INCS.$(bld_trg).$(bld_trg_arch))\
-		$(SDK_$(sdk)_INCS.$(bld_trg_arch))\
-		$(SDK_$(sdk)_INCS.$(bld_trg))\
-		$(SDK_$(sdk)_INCS.$(bld_type))\
-		$(SDK_$(sdk)_INCS))\
-	$($(target)_$(type)INCS.$(bld_trg_cpu))\
-	$($(target)_$(type)INCS.$(bld_trg).$(bld_trg_arch))\
-	$($(target)_$(type)INCS.$(bld_trg_arch))\
-	$($(target)_$(type)INCS.$(bld_trg))\
-	$($(target)_$(type)INCS.$(bld_type))\
-	$($(target)_$(type)INCS)\
-	$($(target)_INCS.$(bld_trg_cpu))\
-	$($(target)_INCS.$(bld_trg).$(bld_trg_arch))\
-	$($(target)_INCS.$(bld_trg_arch))\
-	$($(target)_INCS.$(bld_trg))\
-	$($(target)_INCS.$(bld_type))\
-	$($(target)_INCS)\
-	$(foreach sdk, $($(target)_SDKS.$(bld_trg).$(bld_trg_arch)) \
-		       $($(target)_SDKS.$(bld_trg_arch)) \
-		       $($(target)_SDKS.$(bld_trg)) \
-		       $($(target)_SDKS.$(bld_type)) \
-		       $($(target)_SDKS),\
-		$(SDK_$(sdk)_$(type)INCS.$(bld_trg_cpu))\
-		$(SDK_$(sdk)_$(type)INCS.$(bld_trg).$(bld_trg_arch))\
-		$(SDK_$(sdk)_$(type)INCS.$(bld_trg_arch))\
-		$(SDK_$(sdk)_$(type)INCS.$(bld_trg))\
-		$(SDK_$(sdk)_$(type)INCS.$(bld_type))\
-		$(SDK_$(sdk)_$(type)INCS)\
-		$(SDK_$(sdk)_INCS.$(bld_trg_cpu))\
-		$(SDK_$(sdk)_INCS.$(bld_trg).$(bld_trg_arch))\
-		$(SDK_$(sdk)_INCS.$(bld_trg_arch))\
-		$(SDK_$(sdk)_INCS.$(bld_trg))\
-		$(SDK_$(sdk)_INCS.$(bld_type))\
-		$(SDK_$(sdk)_INCS))\
-	$(INCS.$(bld_trg_cpu))\
-	$(INCS.$(bld_trg).$(bld_trg_arch))\
-	$(INCS.$(bld_trg_arch))\
-	$(INCS.$(bld_trg))\
-	$(INCS.$(bld_type))\
-	$(INCS)\
-	$(foreach sdk, $(SDKS.$(bld_trg).$(bld_trg_arch)) \
-	               $(SDKS.$(bld_trg_arch)) \
-	               $(SDKS.$(bld_trg)) \
-	               $(SDKS.$(bld_type)) \
-	               $(SDKS),\
-		$(SDK_$(sdk)_$(type)INCS.$(bld_trg_cpu))\
-		$(SDK_$(sdk)_$(type)INCS.$(bld_trg).$(bld_trg_arch))\
-		$(SDK_$(sdk)_$(type)INCS.$(bld_trg_arch))\
-		$(SDK_$(sdk)_$(type)INCS.$(bld_trg))\
-		$(SDK_$(sdk)_$(type)INCS.$(bld_type))\
-		$(SDK_$(sdk)_$(type)INCS)\
-		$(SDK_$(sdk)_INCS.$(bld_trg_cpu))\
-		$(SDK_$(sdk)_INCS.$(bld_trg).$(bld_trg_arch))\
-		$(SDK_$(sdk)_INCS.$(bld_trg_arch))\
-		$(SDK_$(sdk)_INCS.$(bld_trg))\
-		$(SDK_$(sdk)_INCS.$(bld_type))\
-		$(SDK_$(sdk)_INCS))\
-	$(TOOL_$(tool)_$(type)INCS.$(bld_trg_cpu))\
-	$(TOOL_$(tool)_$(type)INCS.$(bld_trg).$(bld_trg_arch))\
-	$(TOOL_$(tool)_$(type)INCS.$(bld_trg_arch))\
-	$(TOOL_$(tool)_$(type)INCS.$(bld_trg))\
-	$(TOOL_$(tool)_$(type)INCS.$(bld_type))\
-	$(TOOL_$(tool)_$(type)INCS)
-flags        :=\
-	$(TOOL_$(tool)_$(type)FLAGS)\
-	$(TOOL_$(tool)_$(type)FLAGS.$(bld_type))\
-	$(TOOL_$(tool)_$(type)FLAGS.$(bld_trg))\
-	$(TOOL_$(tool)_$(type)FLAGS.$(bld_trg_arch))\
-	$(TOOL_$(tool)_$(type)FLAGS.$(bld_trg).$(bld_trg_arch))\
-	$(TOOL_$(tool)_$(type)FLAGS.$(bld_trg_cpu))\
-	$($(type)FLAGS)\
-	$($(type)FLAGS.$(bld_type))\
-	$($(type)FLAGS.$(bld_trg))\
-	$($(type)FLAGS.$(bld_trg_arch))\
-	$($(type)FLAGS.$(bld_trg).$(bld_trg_arch))\
-	$($(type)FLAGS.$(bld_trg_cpu))\
-	$($(target)_$(type)FLAGS)\
-	$($(target)_$(type)FLAGS.$(bld_type))\
-	$($(target)_$(type)FLAGS.$(bld_trg))\
-	$($(target)_$(type)FLAGS.$(bld_trg_arch))\
-	$($(target)_$(type)FLAGS.$(bld_trg).$(bld_trg_arch))\
-	$($(target)_$(type)FLAGS.$(bld_trg_cpu))\
-	$($(source)_$(type)FLAGS)\
-	$($(source)_$(type)FLAGS.$(bld_type))\
-	$($(source)_$(type)FLAGS.$(bld_trg))\
-	$($(source)_$(type)FLAGS.$(bld_trg_arch))\
-	$($(source)_$(type)FLAGS.$(bld_trg).$(bld_trg_arch))\
-	$($(source)_$(type)FLAGS.$(bld_trg_cpu))\
-	$($(target)_$(source)_$(type)FLAGS)\
-	$($(target)_$(source)_$(type)FLAGS.$(bld_type))\
-	$($(target)_$(source)_$(type)FLAGS.$(bld_trg))\
-	$($(target)_$(source)_$(type)FLAGS.$(bld_trg_arch))\
-	$($(target)_$(source)_$(type)FLAGS.$(bld_trg).$(bld_trg_arch))\
-	$($(target)_$(source)_$(type)FLAGS.$(bld_trg_cpu))
-# this isn't 100% in sync with kBuild, but it doesn't matter as it's only for gmake now.
-objsuff     := $(firstword \
-	$($(target)_$(source)_OBJSUFF.$(bld_trg).$(bld_trg_arch))\
-	$($(target)_$(source)_OBJSUFF.$(bld_trg))\
-	$($(target)_$(source)_OBJSUFF)\
-	$($(source)_OBJSUFF.$(bld_trg).$(bld_trg_arch))\
-	$($(source)_OBJSUFF.$(bld_trg))\
-	$($(source)_OBJSUFF)\
-	$($(target)_OBJSUFF.$(bld_trg).$(bld_trg_arch))\
-	$($(target)_OBJSUFF.$(bld_trg))\
-	$($(target)_OBJSUFF)\
-	$(TOOL_$(tool)_$(type)OBJSUFF.$(bld_trg).$(bld_trg_arch))\
-	$(TOOL_$(tool)_$(type)OBJSUFF.$(bld_trg))\
-	$(TOOL_$(tool)_$(type)OBJSUFF)\
-	$(SUFF_OBJ))
-obj         := $(outbase)$(objsuff)
-deps        := \
-	$($(target)_$(source)_DEPS)\
-	$($(target)_$(source)_DEPS.$(bld_type))\
-	$($(target)_$(source)_DEPS.$(bld_trg))\
-	$($(target)_$(source)_DEPS.$(bld_trg_arch))\
-	$($(target)_$(source)_DEPS.$(bld_trg).$(bld_trg_arch))\
-	$($(target)_$(source)_DEPS.$(bld_trg_cpu))\
-	$($(source)_DEPS)\
-	$($(source)_DEPS.$(bld_type))\
-	$($(source)_DEPS.$(bld_trg))\
-	$($(source)_DEPS.$(bld_trg_arch))\
-	$($(source)_DEPS.$(bld_trg).$(bld_trg_arch))\
-	$($(source)_DEPS.$(bld_trg_cpu))\
-	$($(target)_DEPS)\
-	$($(target)_DEPS.$(bld_type))\
-	$($(target)_DEPS.$(bld_trg))\
-	$($(target)_DEPS.$(bld_trg_arch))\
-	$($(target)_DEPS.$(bld_trg).$(bld_trg_arch))\
-	$($(target)_DEPS.$(bld_trg_cpu))
-
-# dependencies
-dep         := $(obj)$(SUFF_DEP)
-ifndef NO_COMPILE_CMDS_DEPS
-_DEPFILES_INCLUDED += $(dep)
-$(if $(wildcard $(dep)),$(eval include $(dep)))
-endif
-
-#$ (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)_CMDS
-$(warning kBuild: tools: \
-	1 $($(target)_$(source)_$(type)TOOL.$(bld_trg).$(bld_trg_arch)) \
-	2 $($(target)_$(source)_$(type)TOOL.$(bld_trg)) \
-	3 $($(target)_$(source)_$(type)TOOL) \
-	4 $($(target)_$(source)_TOOL.$(bld_trg).$(bld_trg_arch)) \
-	5 $($(target)_$(source)_TOOL.$(bld_trg)) \
-	6 $($(target)_$(source)_TOOL) \
-	7 $($(target)_$(type)TOOL.$(bld_trg).$(bld_trg_arch)) \
-	8 $($(target)_$(type)TOOL.$(bld_trg)) \
-	9 $($(target)_$(type)TOOL) \
-	10 $($(target)_TOOL.$(bld_trg).$(bld_trg_arch)) \
-	11 $($(target)_TOOL.$(bld_trg)) \
-	12 $($(target)_TOOL) \
-	13 $($(source)_$(type)TOOL.$(bld_trg).$(bld_trg_arch)) \
-	14 $($(source)_$(type)TOOL.$(bld_trg)) \
-	15 $($(source)_$(type)TOOL) \
-	16 $($(source)_TOOL.$(bld_trg).$(bld_trg_arch)) \
-	17 $($(source)_TOOL.$(bld_trg)) \
-	18 $($(source)_TOOL) \
-	19 $($(type)TOOL.$(bld_trg).$(bld_trg_arch)) \
-	20 $($(type)TOOL.$(bld_trg)) \
-	21 $($(type)TOOL) \
-	22 $(TOOL.$(bld_trg).$(bld_trg_arch)) \
-	23 $(TOOL.$(bld_trg)) \
-	24 $(TOOL) )
-$(error kBuild: TOOL_$(tool)_COMPILE_$(type)_CMDS is not defined. source=$(source) target=$(target) )
-endif
-
-# call the tool
-$(target)_$(source)_CMDS_   := $(TOOL_$(tool)_COMPILE_$(type)_CMDS)
-$(target)_$(source)_OUTPUT_ := $(TOOL_$(tool)_COMPILE_$(type)_OUTPUT)
-$(target)_$(source)_DEPEND_ := $(TOOL_$(tool)_COMPILE_$(type)_DEPEND) $(deps) $(source)
-$(target)_$(source)_DEPORD_ := $(TOOL_$(tool)_COMPILE_$(type)_DEPORD) $(dirdep)
-
-# generate the compile rule.
-$(eval $(def_target_source_rule))
-
-_OUT_FILES      += $($(target)_$(source)_OUTPUT_)
-$(target)_OBJS_ += $(obj)
-
-endef
-
-## Generic macro for processing C, C++ and Assembly sources.
-# @param    $(target)     Normalized target name.
-# @param    $(source)     Source file name.
-# @param    $(type)       Source type. {C,CXX,AS}
-# @param    bld_type      Build type.
-# @param    bld_trg       Build target.
-# @param    bld_trg_arch  Build target arch.
-# @param    bld_trg_cpu   Build target cpu.
-#
-#$ (warning dbg: def_target_source_c_cpp_asm: source='$(source)' target='$(target)' type='$(type)')
 def_target_source_c_cpp_asm_rc_new = $(kb-src-one x)
-
 ifneq ($(filter kb-src-one,$(KMK_FEATURES)),)
-def_target_source_c_cpp_asm_rc_var = def_target_source_c_cpp_asm_rc_new
+ def_target_source_c_cpp_asm_rc_var = def_target_source_c_cpp_asm_rc_new
 else
-def_target_source_c_cpp_asm_rc_var = def_target_source_c_cpp_asm_rc_old
+ def_target_source_c_cpp_asm_rc_var = def_target_source_c_cpp_asm_rc_old
 endif
 
Index: /trunk/kBuild/gnumake-footer.kmk
===================================================================
--- /trunk/kBuild/gnumake-footer.kmk	(revision 723)
+++ /trunk/kBuild/gnumake-footer.kmk	(revision 723)
@@ -0,0 +1,404 @@
+# $Id$
+## @file
+#
+# kBuild - Additional footer for use when bootstrapping kBuild using Vanilla GNU Make.
+#
+# Copyright (c) 2004-2006 knut st. osmundsen <bird-srcspam@anduin.net>
+#
+#
+# This file is part of kBuild.
+#
+# kBuild is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# kBuild is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with kBuild; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+#
+#
+
+
+## Generic macro for processing C, C++ and Assembly sources.
+# @param    $(target)     Normalized target name.
+# @param    $(source)     Source file name.
+# @param    $(type)       Source type. {C,CXX,AS}
+# @param    bld_type      Build type.
+# @param    bld_trg       Build target.
+# @param    bld_trg_arch  Build target arch.
+# @param    bld_trg_cpu   Build target cpu.
+# @remark 	obsoleted by kBuild helpers in kmk. Only required for limited gmake compatbility.
+#
+define def_target_source_c_cpp_asm_rc_old
+#$ (warning dbg: def_target_source_c_cpp_asm_rc_old: source='$(source)' target='$(target)' type='$(type)')
+
+tool := $(call _SOURCE_TOOL,$(source),$(target),$(type))
+outbase     := $(call _OBJECT_BASE,$(source),$(target))
+PATH_$(target)_$(source) := $(patsubst %/,%,$(dir $(outbase)))
+dirdep      := $(call DIRDEP,$(dir $(outbase)))
+defs        :=\
+	$(TOOL_$(tool)_DEFS)\
+	$(TOOL_$(tool)_DEFS.$(bld_type))\
+	$(TOOL_$(tool)_DEFS.$(bld_trg))\
+	$(TOOL_$(tool)_DEFS.$(bld_trg_arch))\
+	$(TOOL_$(tool)_DEFS.$(bld_trg).$(bld_trg_arch))\
+	$(TOOL_$(tool)_DEFS.$(bld_trg_cpu))\
+	$(TOOL_$(tool)_$(type)DEFS)\
+	$(TOOL_$(tool)_$(type)DEFS.$(bld_type))\
+	$(foreach sdk, $(SDKS.$(bld_trg).$(bld_trg_arch)) \
+	               $(SDKS.$(bld_trg_arch)) \
+	               $(SDKS.$(bld_trg)) \
+	               $(SDKS.$(bld_type)) \
+	               $(SDKS),\
+		$(SDK_$(sdk)_DEFS)\
+		$(SDK_$(sdk)_DEFS.$(bld_type))\
+		$(SDK_$(sdk)_DEFS.$(bld_trg))\
+		$(SDK_$(sdk)_DEFS.$(bld_trg_arch))\
+		$(SDK_$(sdk)_DEFS.$(bld_trg).$(bld_trg_arch))\
+		$(SDK_$(sdk)_DEFS.$(bld_trg_cpu))\
+		$(SDK_$(sdk)_$(type)DEFS)\
+		$(SDK_$(sdk)_$(type)DEFS.$(bld_type))\
+		$(SDK_$(sdk)_$(type)DEFS.$(bld_trg))\
+		$(SDK_$(sdk)_$(type)DEFS.$(bld_trg_arch))\
+		$(SDK_$(sdk)_$(type)DEFS.$(bld_trg).$(bld_trg_arch))\
+		$(SDK_$(sdk)_$(type)DEFS.$(bld_trg_cpu)))\
+	$(DEFS)\
+	$(DEFS.$(bld_type))\
+	$(DEFS.$(bld_trg))\
+	$(DEFS.$(bld_trg_arch))\
+	$(DEFS.$(bld_trg).$(bld_trg_arch))\
+	$(DEFS.$(bld_trg_cpu))\
+	$($(type)DEFS)\
+	$($(type)DEFS.$(bld_type))\
+	$($(type)DEFS.$(bld_trg))\
+	$($(type)DEFS.$(bld_trg_arch))\
+	$($(type)DEFS.$(bld_trg).$(bld_trg_arch))\
+	$($(type)DEFS.$(bld_trg_cpu))\
+	$(foreach sdk, $($(target)_SDKS.$(bld_trg).$(bld_trg_arch)) \
+	               $($(target)_SDKS.$(bld_trg_arch)) \
+	               $($(target)_SDKS.$(bld_trg)) \
+	               $($(target)_SDKS.$(bld_type)) \
+	               $($(target)_SDKS),\
+		$(SDK_$(sdk)_DEFS)\
+		$(SDK_$(sdk)_DEFS.$(bld_type))\
+		$(SDK_$(sdk)_DEFS.$(bld_trg))\
+		$(SDK_$(sdk)_DEFS.$(bld_trg_arch))\
+		$(SDK_$(sdk)_DEFS.$(bld_trg).$(bld_trg_arch))\
+		$(SDK_$(sdk)_DEFS.$(bld_trg_cpu))\
+		$(SDK_$(sdk)_$(type)DEFS)\
+		$(SDK_$(sdk)_$(type)DEFS.$(bld_type))\
+		$(SDK_$(sdk)_$(type)DEFS.$(bld_trg))\
+		$(SDK_$(sdk)_$(type)DEFS.$(bld_trg_arch))\
+		$(SDK_$(sdk)_$(type)DEFS.$(bld_trg).$(bld_trg_arch))\
+		$(SDK_$(sdk)_$(type)DEFS.$(bld_trg_cpu)))\
+	$($(target)_DEFS)\
+	$($(target)_DEFS.$(bld_type))\
+	$($(target)_DEFS.$(bld_trg))\
+	$($(target)_DEFS.$(bld_trg_arch))\
+	$($(target)_DEFS.$(bld_trg).$(bld_trg_arch))\
+	$($(target)_DEFS.$(bld_trg_cpu))\
+	$($(target)_$(type)DEFS)\
+	$($(target)_$(type)DEFS.$(bld_type))\
+	$($(target)_$(type)DEFS.$(bld_trg))\
+	$($(target)_$(type)DEFS.$(bld_trg_arch))\
+	$($(target)_$(type)DEFS.$(bld_trg).$(bld_trg_arch))\
+	$($(target)_$(type)DEFS.$(bld_trg_cpu))\
+	$(foreach sdk, $($(source)_SDKS.$(bld_trg).$(bld_trg_arch)) \
+	               $($(source)_SDKS.$(bld_trg_arch)) \
+	               $($(source)_SDKS.$(bld_trg)) \
+	               $($(source)_SDKS.$(bld_type)) \
+	               $($(source)_SDKS),\
+		$(SDK_$(sdk)_DEFS)\
+		$(SDK_$(sdk)_DEFS.$(bld_type))\
+		$(SDK_$(sdk)_DEFS.$(bld_trg))\
+		$(SDK_$(sdk)_DEFS.$(bld_trg_arch))\
+		$(SDK_$(sdk)_DEFS.$(bld_trg).$(bld_trg_arch))\
+		$(SDK_$(sdk)_DEFS.$(bld_trg_cpu))\
+		$(SDK_$(sdk)_$(type)DEFS)\
+		$(SDK_$(sdk)_$(type)DEFS.$(bld_type))\
+		$(SDK_$(sdk)_$(type)DEFS.$(bld_trg))\
+		$(SDK_$(sdk)_$(type)DEFS.$(bld_trg_arch))\
+		$(SDK_$(sdk)_$(type)DEFS.$(bld_trg).$(bld_trg_arch))\
+		$(SDK_$(sdk)_$(type)DEFS.$(bld_trg_cpu)))\
+	$($(source)_DEFS)\
+	$($(source)_DEFS.$(bld_type))\
+	$($(source)_DEFS.$(bld_trg))\
+	$($(source)_DEFS.$(bld_trg_arch))\
+	$($(source)_DEFS.$(bld_trg).$(bld_trg_arch))\
+	$($(source)_DEFS.$(bld_trg_cpu))\
+	$($(source)_$(type)DEFS)\
+	$($(source)_$(type)DEFS.$(bld_type))\
+	$($(source)_$(type)DEFS.$(bld_trg))\
+	$($(source)_$(type)DEFS.$(bld_trg_arch))\
+	$($(source)_$(type)DEFS.$(bld_trg).$(bld_trg_arch))\
+	$($(source)_$(type)DEFS.$(bld_trg_cpu))\
+	$(foreach sdk, $($(target)_$(source)_SDKS.$(bld_trg).$(bld_trg_arch)) \
+	               $($(target)_$(source)_SDKS.$(bld_trg_arch)) \
+	               $($(target)_$(source)_SDKS.$(bld_trg)) \
+	               $($(target)_$(source)_SDKS.$(bld_type)) \
+	               $($(target)_$(source)_SDKS),\
+		$(SDK_$(sdk)_DEFS)\
+		$(SDK_$(sdk)_DEFS.$(bld_type))\
+		$(SDK_$(sdk)_DEFS.$(bld_trg))\
+		$(SDK_$(sdk)_DEFS.$(bld_trg_arch))\
+		$(SDK_$(sdk)_DEFS.$(bld_trg).$(bld_trg_arch))\
+		$(SDK_$(sdk)_DEFS.$(bld_trg_cpu))\
+		$(SDK_$(sdk)_$(type)DEFS)\
+		$(SDK_$(sdk)_$(type)DEFS.$(bld_type))\
+		$(SDK_$(sdk)_$(type)DEFS.$(bld_trg))\
+		$(SDK_$(sdk)_$(type)DEFS.$(bld_trg_arch))\
+		$(SDK_$(sdk)_$(type)DEFS.$(bld_trg).$(bld_trg_arch))\
+		$(SDK_$(sdk)_$(type)DEFS.$(bld_trg_cpu)))\
+	$($(target)_$(source)_DEFS)\
+	$($(target)_$(source)_DEFS.$(bld_type))\
+	$($(target)_$(source)_DEFS.$(bld_trg))\
+	$($(target)_$(source)_DEFS.$(bld_trg_arch))\
+	$($(target)_$(source)_DEFS.$(bld_trg).$(bld_trg_arch))\
+	$($(target)_$(source)_DEFS.$(bld_trg_cpu))\
+	$($(target)_$(source)_$(type)DEFS)\
+	$($(target)_$(source)_$(type)DEFS.$(bld_type))\
+	$($(target)_$(source)_$(type)DEFS.$(bld_trg))\
+	$($(target)_$(source)_$(type)DEFS.$(bld_trg_arch))\
+	$($(target)_$(source)_$(type)DEFS.$(bld_trg).$(bld_trg_arch))\
+	$($(target)_$(source)_$(type)DEFS.$(bld_trg_cpu))
+incs        :=\
+	$($(target)_$(source)_$(type)INCS.$(bld_trg_cpu))\
+	$($(target)_$(source)_$(type)INCS.$(bld_trg).$(bld_trg_arch))\
+	$($(target)_$(source)_$(type)INCS.$(bld_trg_arch))\
+	$($(target)_$(source)_$(type)INCS.$(bld_trg))\
+	$($(target)_$(source)_$(type)INCS.$(bld_type))\
+	$($(target)_$(source)_$(type)INCS)\
+	$($(target)_$(source)_INCS.$(bld_trg_cpu))\
+	$($(target)_$(source)_INCS.$(bld_trg).$(bld_trg_arch))\
+	$($(target)_$(source)_INCS.$(bld_trg_arch))\
+	$($(target)_$(source)_INCS.$(bld_trg))\
+	$($(target)_$(source)_INCS.$(bld_type))\
+	$($(target)_$(source)_INCS)\
+	$(foreach sdk, $($(target)_$(source)_SDKS.$(bld_trg).$(bld_trg_arch)) \
+	               $($(target)_$(source)_SDKS.$(bld_trg_arch)) \
+	               $($(target)_$(source)_SDKS.$(bld_trg)) \
+	               $($(target)_$(source)_SDKS.$(bld_type)) \
+	               $($(target)_$(source)_SDKS),\
+		$(SDK_$(sdk)_$(type)INCS.$(bld_trg_cpu))\
+		$(SDK_$(sdk)_$(type)INCS.$(bld_trg).$(bld_trg_arch))\
+		$(SDK_$(sdk)_$(type)INCS.$(bld_trg_arch))\
+		$(SDK_$(sdk)_$(type)INCS.$(bld_trg))\
+		$(SDK_$(sdk)_$(type)INCS.$(bld_type))\
+		$(SDK_$(sdk)_$(type)INCS)\
+		$(SDK_$(sdk)_INCS.$(bld_trg_cpu))\
+		$(SDK_$(sdk)_INCS.$(bld_trg).$(bld_trg_arch))\
+		$(SDK_$(sdk)_INCS.$(bld_trg_arch))\
+		$(SDK_$(sdk)_INCS.$(bld_trg))\
+		$(SDK_$(sdk)_INCS.$(bld_type))\
+		$(SDK_$(sdk)_INCS))\
+	$($(source)_$(type)INCS.$(bld_trg_cpu))\
+	$($(source)_$(type)INCS.$(bld_trg).$(bld_trg_arch))\
+	$($(source)_$(type)INCS.$(bld_trg_arch))\
+	$($(source)_$(type)INCS.$(bld_trg))\
+	$($(source)_$(type)INCS.$(bld_type))\
+	$($(source)_$(type)INCS)\
+	$($(source)_INCS.$(bld_trg_cpu))\
+	$($(source)_INCS.$(bld_trg).$(bld_trg_arch))\
+	$($(source)_INCS.$(bld_trg_arch))\
+	$($(source)_INCS.$(bld_trg))\
+	$($(source)_INCS.$(bld_type))\
+	$($(source)_INCS)\
+	$(foreach sdk, $($(source)_SDKS.$(bld_trg).$(bld_trg_arch)) \
+		       $($(source)_SDKS.$(bld_trg_arch)) \
+		       $($(source)_SDKS.$(bld_trg)) \
+		       $($(source)_SDKS.$(bld_type)) \
+		       $($(source)_SDKS),\
+		$(SDK_$(sdk)_$(type)INCS.$(bld_trg_cpu))\
+		$(SDK_$(sdk)_$(type)INCS.$(bld_trg).$(bld_trg_arch))\
+		$(SDK_$(sdk)_$(type)INCS.$(bld_trg_arch))\
+		$(SDK_$(sdk)_$(type)INCS.$(bld_trg))\
+		$(SDK_$(sdk)_$(type)INCS.$(bld_type))\
+		$(SDK_$(sdk)_$(type)INCS)\
+		$(SDK_$(sdk)_INCS.$(bld_trg_cpu))\
+		$(SDK_$(sdk)_INCS.$(bld_trg).$(bld_trg_arch))\
+		$(SDK_$(sdk)_INCS.$(bld_trg_arch))\
+		$(SDK_$(sdk)_INCS.$(bld_trg))\
+		$(SDK_$(sdk)_INCS.$(bld_type))\
+		$(SDK_$(sdk)_INCS))\
+	$($(target)_$(type)INCS.$(bld_trg_cpu))\
+	$($(target)_$(type)INCS.$(bld_trg).$(bld_trg_arch))\
+	$($(target)_$(type)INCS.$(bld_trg_arch))\
+	$($(target)_$(type)INCS.$(bld_trg))\
+	$($(target)_$(type)INCS.$(bld_type))\
+	$($(target)_$(type)INCS)\
+	$($(target)_INCS.$(bld_trg_cpu))\
+	$($(target)_INCS.$(bld_trg).$(bld_trg_arch))\
+	$($(target)_INCS.$(bld_trg_arch))\
+	$($(target)_INCS.$(bld_trg))\
+	$($(target)_INCS.$(bld_type))\
+	$($(target)_INCS)\
+	$(foreach sdk, $($(target)_SDKS.$(bld_trg).$(bld_trg_arch)) \
+		       $($(target)_SDKS.$(bld_trg_arch)) \
+		       $($(target)_SDKS.$(bld_trg)) \
+		       $($(target)_SDKS.$(bld_type)) \
+		       $($(target)_SDKS),\
+		$(SDK_$(sdk)_$(type)INCS.$(bld_trg_cpu))\
+		$(SDK_$(sdk)_$(type)INCS.$(bld_trg).$(bld_trg_arch))\
+		$(SDK_$(sdk)_$(type)INCS.$(bld_trg_arch))\
+		$(SDK_$(sdk)_$(type)INCS.$(bld_trg))\
+		$(SDK_$(sdk)_$(type)INCS.$(bld_type))\
+		$(SDK_$(sdk)_$(type)INCS)\
+		$(SDK_$(sdk)_INCS.$(bld_trg_cpu))\
+		$(SDK_$(sdk)_INCS.$(bld_trg).$(bld_trg_arch))\
+		$(SDK_$(sdk)_INCS.$(bld_trg_arch))\
+		$(SDK_$(sdk)_INCS.$(bld_trg))\
+		$(SDK_$(sdk)_INCS.$(bld_type))\
+		$(SDK_$(sdk)_INCS))\
+	$(INCS.$(bld_trg_cpu))\
+	$(INCS.$(bld_trg).$(bld_trg_arch))\
+	$(INCS.$(bld_trg_arch))\
+	$(INCS.$(bld_trg))\
+	$(INCS.$(bld_type))\
+	$(INCS)\
+	$(foreach sdk, $(SDKS.$(bld_trg).$(bld_trg_arch)) \
+	               $(SDKS.$(bld_trg_arch)) \
+	               $(SDKS.$(bld_trg)) \
+	               $(SDKS.$(bld_type)) \
+	               $(SDKS),\
+		$(SDK_$(sdk)_$(type)INCS.$(bld_trg_cpu))\
+		$(SDK_$(sdk)_$(type)INCS.$(bld_trg).$(bld_trg_arch))\
+		$(SDK_$(sdk)_$(type)INCS.$(bld_trg_arch))\
+		$(SDK_$(sdk)_$(type)INCS.$(bld_trg))\
+		$(SDK_$(sdk)_$(type)INCS.$(bld_type))\
+		$(SDK_$(sdk)_$(type)INCS)\
+		$(SDK_$(sdk)_INCS.$(bld_trg_cpu))\
+		$(SDK_$(sdk)_INCS.$(bld_trg).$(bld_trg_arch))\
+		$(SDK_$(sdk)_INCS.$(bld_trg_arch))\
+		$(SDK_$(sdk)_INCS.$(bld_trg))\
+		$(SDK_$(sdk)_INCS.$(bld_type))\
+		$(SDK_$(sdk)_INCS))\
+	$(TOOL_$(tool)_$(type)INCS.$(bld_trg_cpu))\
+	$(TOOL_$(tool)_$(type)INCS.$(bld_trg).$(bld_trg_arch))\
+	$(TOOL_$(tool)_$(type)INCS.$(bld_trg_arch))\
+	$(TOOL_$(tool)_$(type)INCS.$(bld_trg))\
+	$(TOOL_$(tool)_$(type)INCS.$(bld_type))\
+	$(TOOL_$(tool)_$(type)INCS)
+flags        :=\
+	$(TOOL_$(tool)_$(type)FLAGS)\
+	$(TOOL_$(tool)_$(type)FLAGS.$(bld_type))\
+	$(TOOL_$(tool)_$(type)FLAGS.$(bld_trg))\
+	$(TOOL_$(tool)_$(type)FLAGS.$(bld_trg_arch))\
+	$(TOOL_$(tool)_$(type)FLAGS.$(bld_trg).$(bld_trg_arch))\
+	$(TOOL_$(tool)_$(type)FLAGS.$(bld_trg_cpu))\
+	$($(type)FLAGS)\
+	$($(type)FLAGS.$(bld_type))\
+	$($(type)FLAGS.$(bld_trg))\
+	$($(type)FLAGS.$(bld_trg_arch))\
+	$($(type)FLAGS.$(bld_trg).$(bld_trg_arch))\
+	$($(type)FLAGS.$(bld_trg_cpu))\
+	$($(target)_$(type)FLAGS)\
+	$($(target)_$(type)FLAGS.$(bld_type))\
+	$($(target)_$(type)FLAGS.$(bld_trg))\
+	$($(target)_$(type)FLAGS.$(bld_trg_arch))\
+	$($(target)_$(type)FLAGS.$(bld_trg).$(bld_trg_arch))\
+	$($(target)_$(type)FLAGS.$(bld_trg_cpu))\
+	$($(source)_$(type)FLAGS)\
+	$($(source)_$(type)FLAGS.$(bld_type))\
+	$($(source)_$(type)FLAGS.$(bld_trg))\
+	$($(source)_$(type)FLAGS.$(bld_trg_arch))\
+	$($(source)_$(type)FLAGS.$(bld_trg).$(bld_trg_arch))\
+	$($(source)_$(type)FLAGS.$(bld_trg_cpu))\
+	$($(target)_$(source)_$(type)FLAGS)\
+	$($(target)_$(source)_$(type)FLAGS.$(bld_type))\
+	$($(target)_$(source)_$(type)FLAGS.$(bld_trg))\
+	$($(target)_$(source)_$(type)FLAGS.$(bld_trg_arch))\
+	$($(target)_$(source)_$(type)FLAGS.$(bld_trg).$(bld_trg_arch))\
+	$($(target)_$(source)_$(type)FLAGS.$(bld_trg_cpu))
+# this isn't 100% in sync with kBuild, but it doesn't matter as it's only for gmake now.
+objsuff     := $(firstword \
+	$($(target)_$(source)_OBJSUFF.$(bld_trg).$(bld_trg_arch))\
+	$($(target)_$(source)_OBJSUFF.$(bld_trg))\
+	$($(target)_$(source)_OBJSUFF)\
+	$($(source)_OBJSUFF.$(bld_trg).$(bld_trg_arch))\
+	$($(source)_OBJSUFF.$(bld_trg))\
+	$($(source)_OBJSUFF)\
+	$($(target)_OBJSUFF.$(bld_trg).$(bld_trg_arch))\
+	$($(target)_OBJSUFF.$(bld_trg))\
+	$($(target)_OBJSUFF)\
+	$(TOOL_$(tool)_$(type)OBJSUFF.$(bld_trg).$(bld_trg_arch))\
+	$(TOOL_$(tool)_$(type)OBJSUFF.$(bld_trg))\
+	$(TOOL_$(tool)_$(type)OBJSUFF)\
+	$(SUFF_OBJ))
+obj         := $(outbase)$(objsuff)
+deps        := \
+	$($(target)_$(source)_DEPS)\
+	$($(target)_$(source)_DEPS.$(bld_type))\
+	$($(target)_$(source)_DEPS.$(bld_trg))\
+	$($(target)_$(source)_DEPS.$(bld_trg_arch))\
+	$($(target)_$(source)_DEPS.$(bld_trg).$(bld_trg_arch))\
+	$($(target)_$(source)_DEPS.$(bld_trg_cpu))\
+	$($(source)_DEPS)\
+	$($(source)_DEPS.$(bld_type))\
+	$($(source)_DEPS.$(bld_trg))\
+	$($(source)_DEPS.$(bld_trg_arch))\
+	$($(source)_DEPS.$(bld_trg).$(bld_trg_arch))\
+	$($(source)_DEPS.$(bld_trg_cpu))\
+	$($(target)_DEPS)\
+	$($(target)_DEPS.$(bld_type))\
+	$($(target)_DEPS.$(bld_trg))\
+	$($(target)_DEPS.$(bld_trg_arch))\
+	$($(target)_DEPS.$(bld_trg).$(bld_trg_arch))\
+	$($(target)_DEPS.$(bld_trg_cpu))
+
+# dependencies
+dep         := $(obj)$(SUFF_DEP)
+ifndef NO_COMPILE_CMDS_DEPS
+_DEPFILES_INCLUDED += $(dep)
+$(if $(wildcard $(dep)),$(eval include $(dep)))
+endif
+
+#$ (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)_CMDS
+$(warning kBuild: tools: \
+	1 $($(target)_$(source)_$(type)TOOL.$(bld_trg).$(bld_trg_arch)) \
+	2 $($(target)_$(source)_$(type)TOOL.$(bld_trg)) \
+	3 $($(target)_$(source)_$(type)TOOL) \
+	4 $($(target)_$(source)_TOOL.$(bld_trg).$(bld_trg_arch)) \
+	5 $($(target)_$(source)_TOOL.$(bld_trg)) \
+	6 $($(target)_$(source)_TOOL) \
+	7 $($(target)_$(type)TOOL.$(bld_trg).$(bld_trg_arch)) \
+	8 $($(target)_$(type)TOOL.$(bld_trg)) \
+	9 $($(target)_$(type)TOOL) \
+	10 $($(target)_TOOL.$(bld_trg).$(bld_trg_arch)) \
+	11 $($(target)_TOOL.$(bld_trg)) \
+	12 $($(target)_TOOL) \
+	13 $($(source)_$(type)TOOL.$(bld_trg).$(bld_trg_arch)) \
+	14 $($(source)_$(type)TOOL.$(bld_trg)) \
+	15 $($(source)_$(type)TOOL) \
+	16 $($(source)_TOOL.$(bld_trg).$(bld_trg_arch)) \
+	17 $($(source)_TOOL.$(bld_trg)) \
+	18 $($(source)_TOOL) \
+	19 $($(type)TOOL.$(bld_trg).$(bld_trg_arch)) \
+	20 $($(type)TOOL.$(bld_trg)) \
+	21 $($(type)TOOL) \
+	22 $(TOOL.$(bld_trg).$(bld_trg_arch)) \
+	23 $(TOOL.$(bld_trg)) \
+	24 $(TOOL) )
+$(error kBuild: TOOL_$(tool)_COMPILE_$(type)_CMDS is not defined. source=$(source) target=$(target) )
+endif
+
+# call the tool
+$(target)_$(source)_CMDS_   := $(TOOL_$(tool)_COMPILE_$(type)_CMDS)
+$(target)_$(source)_OUTPUT_ := $(TOOL_$(tool)_COMPILE_$(type)_OUTPUT)
+$(target)_$(source)_DEPEND_ := $(TOOL_$(tool)_COMPILE_$(type)_DEPEND) $(deps) $(source)
+$(target)_$(source)_DEPORD_ := $(TOOL_$(tool)_COMPILE_$(type)_DEPORD) $(dirdep)
+
+# generate the compile rule.
+$(eval $(def_target_source_rule))
+
+_OUT_FILES      += $($(target)_$(source)_OUTPUT_)
+$(target)_OBJS_ += $(obj)
+
+endef
+
Index: /trunk/kBuild/gnumake-header.kmk
===================================================================
--- /trunk/kBuild/gnumake-header.kmk	(revision 723)
+++ /trunk/kBuild/gnumake-header.kmk	(revision 723)
@@ -0,0 +1,160 @@
+# $Id$
+## @file
+#
+# kBuild - Additional header for use when bootstrapping kBuild using Vanilla GNU Make.
+#
+# Copyright (c) 2004-2006 knut st. osmundsen <bird-srcspam@anduin.net>
+#
+#
+# This file is part of kBuild.
+#
+# kBuild is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# kBuild is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with kBuild; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+#
+#
+
+#
+# Disable some features to make it work.
+#
+NO_COMPILE_CMDS_DEPS := 1
+NO_LINK_CMDS_DEPS := 1
+sinclude $(PATH_KBUILD)/StampOutPredefines.kmk
+$(warning kBuild: Using vanilla GNU make isn't safe for anything but kBuild bootstrapping!)
+
+
+#
+# Default variables.
+#
+ifeq ($(MAKEFLAGS),$(MAKEFLAGS:R=x))
+# add the -R makeflag to avoid doing this for submakes
+MAKEFLAGS := R$(MAKEFLAGS)
+
+define def_undefine_default
+ifeq ($(origin $1), default)
+$1:=
+endif
+endef
+									
+_DEFAULT_VARIABLES := .LIBPATTERNS .VARIABLES AR ARFLAGS AS CC CHECKOUT,v CO COFLAGS COMPILE.C COMPILE.F COMPILE.S COMPILE.c COMPILE.cc COMPILE.cpp COMPILE.def COMPILE.f COMPILE.mod COMPILE.p COMPILE.r COMPILE.s CPP CTANGLE CWEAVE CXX F77 F77FLAGS FC GET LD LEX LEX.l LINK.C LINK.F LINK.S LINK.c LINK.cc LINK.cpp LINK.f LINK.o LINK.p LINK.r LINK.s LINT LINT.c M2C MAKEINFO OUTPUT_OPTION PC PREPROCESS.F PREPROCESS.S PREPROCESS.r RM TANGLE TEX TEXI2DVI WEAVE YACC YACC.y
+$(foreach i, $(_DEFAULT_VARIABLES), $(eval $(call def_undefine_default,$(i))))
+_DEFAULT_VARIABLES :=
+def_undefine_default :=
+endif
+
+#
+# Suffixes.
+#
+.SUFFIXES:
+SUFFIXES :=
+
+#
+# Implicit rules
+#
+ifeq ($(MAKEFLAGS),$(MAKEFLAGS:r=x))
+MAKEFLAGS := r$(MAKEFLAGS)
+# add the -r makeflag to avoid doing this for submakes
+
+%.C:
+%.F:
+%.S:
+%.a:
+%.c:
+%.c: %.l
+%.c: %.w
+%.c: %.w %.ch
+%.c: %.y
+%.cc:
+%.ch:
+%.cpp:
+%.def:
+%.dll:
+%.dvi:
+%.dvi: %.tex
+%.dvi: %.texi
+%.dvi: %.texinfo
+%.dvi: %.txinfo
+%.el:
+%.elc:
+%.exe:
+%.f:
+%.f: %.F
+%.f: %.r
+%.h:
+%.info:
+%.info: %.texi
+%.info: %.texinfo
+%.info: %.txinfo
+%.l:
+%.lib:
+%.ln:
+%.ln: %.c
+%.ln: %.l
+%.ln: %.y
+%.mod:
+%.o:
+%.o: %.C
+%.o: %.F
+%.o: %.S
+%.o: %.c
+%.o: %.cc
+%.o: %.cpp
+%.o: %.f
+%.o: %.mod
+%.o: %.p
+%.o: %.r
+%.o: %.s
+%.obj:
+%.out:
+%.out: %
+%.p:
+%.p: %.web
+%.r:
+%.r: %.l
+%.s:
+%.s: %.S
+%.sh:
+%.sym:
+%.sym: %.def
+%.tex:
+%.tex: %.w
+%.tex: %.w %.ch
+%.tex: %.web
+%.texi:
+%.texinfo:
+%.txinfo:
+%.w:
+%.web:
+%.y:
+%: %.C
+%: %.F
+%: %.S
+%: %.c
+%: %.cc
+%: %.cpp
+%: %.f
+%: %.mod
+%: %.o
+%: %.p
+%: %.r
+%: %.s
+%: %.sh
+%:: %,v
+%:: RCS/%
+%:: RCS/%,v
+%:: SCCS/s.%
+%:: s.%
+(%): %
+endif
+
+
Index: /trunk/kBuild/header.kmk
===================================================================
--- /trunk/kBuild/header.kmk	(revision 722)
+++ /trunk/kBuild/header.kmk	(revision 723)
@@ -217,11 +217,5 @@
  endif
 else 
- # Vanilla GNU Make. Only supported for kBuild bootstrapping. Disable some features to make it work.
- NO_COMPILE_CMDS_DEPS:= 1
- NO_LINK_CMDS_DEPS   := 1
- sinclude $(PATH_KBUILD)/StampOutPredefines.kmk
- ifndef IS_BOOTSTRAPPING_KBUILD_NOW
-  $(warning kBuild: Using vanilla GNU make isn't safe for anything but kBuild bootstrapping!)
- endif
+ include $(PATH_KBUILD)/gnumake-header.kmk
 endif
 
@@ -461,4 +455,40 @@
 endif
 
+
+ifneq ($(filter stack,$(KMK_FEATURES)),stack) ## @todo retire this to gnumake-header.kmk when all the programs have been recompiled.
+##
+# Pushes an item onto a 'stack' variable. 
+# @param    $1   The stack variable name
+# @param    $2   What to push.
+stack-push = $(eval $1 +=$2)
+
+##
+# Removes the top element from a 'stack' variable.
+# @returns  The popped element
+# @param    $1   The stack variable name
+stack-pop  = $(call stack-top,$1)$(call stack-popv,$1)
+
+##
+# Removes the top element from a 'stack' variable.
+# This does *NOT* return the top element, use 
+# @param    $1   The stack variable name
+# @remark This ain't very fast (that's why it's implemented in functions.c in kmk).
+define def_stack-popv_sub
+$1 :=$(__tmp)
+__tmp+=$(item)
+endef
+define def_stack-popv
+__tmp:=
+$(foreach item,$($1),$(eval $(value def_stack-popv_sub)))
+endef
+stack-popv = $(eval $(value def_stack-popv))
+
+##
+# Retrieves the top element from the 'stack' variable.
+# @param    $1   The stack variable name
+stack-top  = $(lastword $($1))
+endif
+
+
 #
 # Initialize some of the globals which the Config.kmk and
@@ -649,5 +679,5 @@
 # The passes that should be defined. This must include
 # all passes mentioned by DEFAULT_PASSES.
-PASSES := FETCHES PATCHES $(DEFAULT_PASSES) PACKING NOTHING CLEAN
+PASSES := FETCHES PATCHES $(DEFAULT_PASSES) NOTHING CLEAN
 
 
