Index: /trunk/kBuild/footer.kmk
===================================================================
--- /trunk/kBuild/footer.kmk	(revision 2476)
+++ /trunk/kBuild/footer.kmk	(revision 2477)
@@ -198,6 +198,6 @@
 # @param	$2		The target name.
 # @param	$3		The _INST value (can be empty).
-# @param	$4		The default directory to use when $3 is empty.
-_INSTALL_FILE = $(patsubst %/,%/$(notdir $(1)),$(if $(3),$(PATH_INS)/$(3),$(4)/))
+# @param	$4		The installation root directory.
+_INSTALL_FILE = $(patsubst %/,%/$(notdir $(1)),$(if $(3),$(4)/$(3),$(4)/))
 
 
@@ -3015,18 +3015,18 @@
 endif
 
-local stage    := $(firstword $($(srcsrc)_STAGE) $($(target)_1_STAGE))
+local stage    := $(firstword $($(srcsrc)_STAGE) $($(srcsrc)_INST) $($(target)_1_STAGE))
 ifneq ($(substr $(stage),-1),/)
  $(warning kBuild: File $(srcsrc) in install target $(target) has a STAGE property without a trailing slash.)
  local stage   := $(stage)/
 endif
-local stage    := $(stage)/$(dir $(srcdstdir))
+local stage    := $(stage)$(dir $(srcdstdir))
 local stagedst := $(call $(instfun),$(srcdst),$(target),$(stage),$(PATH_STAGE))
 
-local inst     := $(firstword $($(srcsrc)_STAGE) $($(target)_1_STAGE))
+local inst     := $(firstword $($(srcsrc)_INST) $($(target)_1_INST))
 ifneq ($(substr $(inst),-1),/)
  $(warning kBuild: File $(srcsrc) in install target $(target) has a INST property without a trailing slash.)
  local inst    := $(inst)/
 endif
-local inst     := $(inst)/$(dir $(srcdstdir))
+local inst     := $(inst)$(dir $(srcdstdir))
 local instdst  := $(call $(instfun),$(srcdst),$(target),$(inst),$(PATH_INS))
 
@@ -3106,5 +3106,11 @@
 
 # Adjust the source if we got a default PATH. (This must be done this late!)
-local defpath := $(firstword $($(target)_DEFPATH) $($(target)_PATH))
+ifdef $(target)_DEFPATH
+local defpath := $($(target)_DEFPATH)
+else ifdef $(target)_PATH
+local defpath := $($(target)_PATH)
+else
+local defpath :=
+endif
 ifneq ($(defpath),)
  local srcsrc := $(abspathex $(srcsrc),$(defpath))
@@ -3184,18 +3190,18 @@
 endif
 
-local stage    := $(firstword $($(symlnk)_STAGE) $($(target)_1_STAGE))
+local stage    := $(firstword $($(symlnk)_STAGE) $(symlnk)_INST) $($(target)_1_STAGE))
 ifneq ($(substr $(stage),-1),/)
  $(warning kBuild: Symlink $(symlnk) in install target $(target) has a STAGE property without a trailing slash.)
  local stage   := $(stage)/
 endif
-local stage    := $(stage)/$(dir $(srcdstdir))
+local stage    := $(stage)$(dir $(srcdstdir))
 local stagedst := $(call $(instfun),$(symlnk),$(target),$(stage),$(PATH_STAGE))
 
-local inst     := $(firstword $($(symlnk)_STAGE) $($(target)_1_STAGE))
+local inst     := $(firstword $($(symlnk)_INST) $($(target)_1_INST))
 ifneq ($(substr $(inst),-1),/)
  $(warning kBuild: Symlnk $(symlnk) in install target $(target) has a INST property without a trailing slash.)
  local inst    := $(inst)/
 endif
-local inst     := $(inst)/$(dir $(srcdstdir))
+local inst     := $(inst)$(dir $(srcdstdir))
 local instdst  := $(call $(instfun),$(symlnk),$(target),$(inst),$(PATH_INS))
 #$(warning symlnk=$(symlnk) symdst=$(symdst) instdst=$(instdst) stagedst=$(stagedst) instfun=$(instfun) inst=$(inst) stage='$(stage)')
@@ -3251,4 +3257,6 @@
 ifdef $(directory)_STAGE
  local stage := $($(directory)_STAGE)
+else ifdef $(directory)_INST
+ local stage := $($(directory)_INST)
 else
  local stage := $($(target)_1_STAGE)
@@ -3356,5 +3364,5 @@
  	$($(target)_IFFLAGS) \
  	$($(target)_IFFLAGS.$(bld_trg)) \
- 	$($(target)_IFFLAGS.$(bld_trg).$(bld_trg_arch)) \
+ 	$($(target)_IFFLAGS.$(bld_trg).$(bld_trg_arch))
  local top_idflags := \
  	$($(target)_IDFLAGS) \
