Changeset 743 for trunk/kBuild/footer.kmk
- Timestamp:
- Dec 17, 2006, 9:12:30 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kBuild/footer.kmk
r741 r743 143 143 $(TOOL) \ 144 144 )) 145 146 ## Removes the drive letter from a path (if it has one)147 # @param $1 the path148 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 path152 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 endif162 163 ## Figure out where to put object files.164 # @param $1 real target name.165 # @param $2 normalized main target166 _TARGET_BASE = $(PATH_TARGET)/$(2)/$(call no-root-slash,$(call no-drive,$(basename $(1))))167 168 145 169 146 ## Figure out the actual name of an installed file. … … 887 864 $(out): $(comp-vars _TARGET_$(target)_DIGEST_PREV,_TARGET_$(target)_DIGEST,FORCE) | $(call DIRDEP,$(inst)) 888 865 $$(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)...) 890 867 $$(QUIET)$$(if $$(wildcard $(out).lst ),$$(MAKE) -f $(MAKEFILE) --no-print-directory $(out)_unfetched) 891 868 $$(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 $$@)) … … 1172 1149 $(error kBuild: Library target $(target) does not have a tool defined!) 1173 1150 endif 1174 outbase := $(call _TARGET_BASE,$(target),$(target)) 1175 PATH_$(target) := $(patsubst %/,%,$(dir $(outbase))) 1151 outbase := $(call TARGET_BASE,$(target),$(target)) 1152 ifndef PATH_$(target) 1153 PATH_$(target) := $(patsubst %/,%,$(dir $(outbase))) 1154 else 1155 ifneq ($(PATH_$(target)),$(patsubst %/,%,$(dir $(outbase)))) 1156 $(error kBuild internal error: PATH_$(target)=$(PATH_$(target)) expected $(patsubst %/,%,$(dir $(outbase)))) 1157 endif 1158 endif 1176 1159 suff := $(firstword\ 1177 1160 $($(target)_LIBSUFF.$(bld_trg).$(bld_trg_arch))\ … … 1192 1175 # library linking 1193 1176 tool := $(call _TARGET_TOOL,$(target),AR) 1194 outbase := $(call _TARGET_BASE,$(target),$(target))1177 outbase := $(call TARGET_BASE,$(target),$(target)) 1195 1178 flags :=\ 1196 1179 $(TOOL_$(tool)_ARFLAGS)\ … … 1294 1277 1295 1278 tool := $(call _TARGET_TOOL,$(target),LD) 1296 outbase := $(call _TARGET_BASE,$(target),$(target)) 1279 outbase := $(call TARGET_BASE,$(target),$(target)) 1280 ifndef PATH_$(target) 1281 PATH_$(target) := $(patsubst %/,%,$(dir $(outbase))) 1282 else 1283 ifneq ($(PATH_$(target)),$(patsubst %/,%,$(dir $(outbase)))) 1284 $(error kBuild internal error: PATH_$(target)=$(PATH_$(target)) expected $(patsubst %/,%,$(dir $(outbase)))) 1285 endif 1286 endif 1297 1287 suff := $(firstword \ 1298 1288 $($(target)_$(EXT)SUFF) \ … … 1301 1291 $($(EXTPRE)SUFF_$(EXT))) 1302 1292 out := $(outbase)$(suff) 1303 PATH_$(target) := $(patsubst %/,%,$(dir $(outbase)))1304 1293 TARGET_$(target) := $(out) 1305 1294 $(target)_OBJS_ := … … 1311 1300 # more library stuff. 1312 1301 tool := $(call _TARGET_TOOL,$(target),LD) 1313 outbase := $(call _TARGET_BASE,$(target),$(target))1302 outbase := $(call TARGET_BASE,$(target),$(target)) 1314 1303 flags :=\ 1315 1304 $(TOOL_$(tool)_LDFLAGS)\
Note:
See TracChangeset
for help on using the changeset viewer.