Ignore:
Timestamp:
Dec 17, 2006, 9:12:30 AM (19 years ago)
Author:
bird
Message:

set PATH_target early (i.e. in subheader/subfooter).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kBuild/footer.kmk

    r741 r743  
    143143        $(TOOL) \
    144144        ))
    145 
    146 ## Removes the drive letter from a path (if it has one)
    147 # @param        $1              the path
    148 no-drive=$(word $(words $(subst :, ,$(1))),$(subst :, ,$(1)))
    149 
    150 ## Removes the root slash from a path (if it has one)
    151 # @param        $1              the path
    152 no-root-slash=$(patsubst /%,%,$(1))
    153 
    154 ifneq ($(filter abspathex,$(KMK_FEATURES)),abspathex) ## @todo Retire this to gnumake-header.kmk when it has been implemented.
    155 ## Converts an relative path to an absolute path using the given CWD.
    156 # @returns absolute path.
    157 # @param    $1      The path to fixup.
    158 # @param    $2      The CWD to use.
    159 abspathex = $(foreach _fix_path,$1\
    160 ,$(if $(subst :$(call no-root-slash,$(call no-drive,$(_fix_path))):,,:$(_fix_path):),$(_fix_path),$(abspath $2/$(_fix_path))))
    161 endif
    162 
    163 ## Figure out where to put object files.
    164 # @param    $1      real target name.
    165 # @param    $2      normalized main target
    166 _TARGET_BASE = $(PATH_TARGET)/$(2)/$(call no-root-slash,$(call no-drive,$(basename $(1))))
    167 
    168145
    169146## Figure out the actual name of an installed file.
     
    887864$(out): $(comp-vars _TARGET_$(target)_DIGEST_PREV,_TARGET_$(target)_DIGEST,FORCE) | $(call DIRDEP,$(inst))
    888865        $$(QUIET)$$(RM) -f $$@
    889         $$(call MSG_L1,$$(if $$(wildcard $(out).lst),$$(if $$(_TARGET_$(target)_DIGEST),Re-fetching,Removing),Fetching) $(target)...)
     866        $$(call MSG_L1,$$(if $$(_TARGET_$(target)_DIGEST),$$(if $$(wildcard $(out).lst),Re-fetching,Fetching),Removing) $(target)...)
    890867        $$(QUIET)$$(if $$(wildcard $(out).lst      ),$$(MAKE) -f $(MAKEFILE) --no-print-directory $(out)_unfetched)
    891868        $$(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 $$@))
     
    11721149$(error kBuild: Library target $(target) does not have a tool defined!)
    11731150endif
    1174 outbase     := $(call _TARGET_BASE,$(target),$(target))
    1175 PATH_$(target) := $(patsubst %/,%,$(dir $(outbase)))
     1151outbase     := $(call TARGET_BASE,$(target),$(target))
     1152ifndef PATH_$(target)
     1153 PATH_$(target) := $(patsubst %/,%,$(dir $(outbase)))
     1154else
     1155 ifneq ($(PATH_$(target)),$(patsubst %/,%,$(dir $(outbase))))
     1156  $(error kBuild internal error: PATH_$(target)=$(PATH_$(target)) expected $(patsubst %/,%,$(dir $(outbase))))
     1157 endif
     1158endif
    11761159suff        := $(firstword\
    11771160        $($(target)_LIBSUFF.$(bld_trg).$(bld_trg_arch))\
     
    11921175# library linking
    11931176tool        := $(call _TARGET_TOOL,$(target),AR)
    1194 outbase     := $(call _TARGET_BASE,$(target),$(target))
     1177outbase     := $(call TARGET_BASE,$(target),$(target))
    11951178flags       :=\
    11961179        $(TOOL_$(tool)_ARFLAGS)\
     
    12941277
    12951278tool        := $(call _TARGET_TOOL,$(target),LD)
    1296 outbase     := $(call _TARGET_BASE,$(target),$(target))
     1279outbase     := $(call TARGET_BASE,$(target),$(target))
     1280ifndef PATH_$(target)
     1281 PATH_$(target) := $(patsubst %/,%,$(dir $(outbase)))
     1282else
     1283 ifneq ($(PATH_$(target)),$(patsubst %/,%,$(dir $(outbase))))
     1284  $(error kBuild internal error: PATH_$(target)=$(PATH_$(target)) expected $(patsubst %/,%,$(dir $(outbase))))
     1285 endif
     1286endif
    12971287suff        := $(firstword \
    12981288        $($(target)_$(EXT)SUFF) \
     
    13011291        $($(EXTPRE)SUFF_$(EXT)))
    13021292out         := $(outbase)$(suff)
    1303 PATH_$(target)   := $(patsubst %/,%,$(dir $(outbase)))
    13041293TARGET_$(target) := $(out)
    13051294$(target)_OBJS_  :=
     
    13111300# more library stuff.
    13121301tool        := $(call _TARGET_TOOL,$(target),LD)
    1313 outbase     := $(call _TARGET_BASE,$(target),$(target))
     1302outbase     := $(call TARGET_BASE,$(target),$(target))
    13141303flags       :=\
    13151304        $(TOOL_$(tool)_LDFLAGS)\
Note: See TracChangeset for help on using the changeset viewer.