Changeset 725 for trunk/kBuild/footer.kmk
- Timestamp:
- Dec 15, 2006, 6:18:47 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kBuild/footer.kmk
r723 r725 185 185 no-root-slash=$(patsubst /%,%,$(1)) 186 186 187 ifneq ($(filter abspathex,$(KMK_FEATURES)),abspathex) ## @todo Retire this to gnumake-header.kmk when it has been implemented. 188 ## Converts an relative path to an absolute path using the given CWD. 189 # @returns absolute path. 190 # @param $1 The path to fixup. 191 # @param $2 The CWD to use. 192 abspathex = $(foreach _fix_path,$1\ 193 ,$(if $(subst :$(call no-root-slash,$(call no-drive,$(_fix_path))):,,:$(_fix_path):),$(_fix_path),$(abspath $2/$(_fix_path)))) 194 endif 195 187 196 ## Figure out where to put object files. 188 197 # @param $1 source file … … 1127 1136 ## Generic macro for processing all target sources. 1128 1137 # @param $(target) Normalized target name. 1138 # @param $(defpath) 1139 # @param much-more... 1129 1140 define def_target_sources 1141 1142 # Apply any default path on the sources first. 1143 ifneq ($(defpath),) 1144 ifdef $(target)_SOURCES 1145 $(target)_SOURCES := $(call abspathex,$($(target)_SOURCES),$(defpath)) 1146 endif 1147 ifdef $(target)_SOURCES.$(bld_trg) 1148 $(target)_SOURCES.$(bld_trg) := $(call abspathex,$($(target)_SOURCES.$(bld_trg)),$(defpath)) 1149 endif 1150 ifdef $(target)_SOURCES.$(bld_trg).$(bld_trg_arch) 1151 $(target)_SOURCES.$(bld_trg).$(bld_trg_arch) := $(call abspathex,$($(target)_SOURCES.$(bld_trg).$(bld_trg_arch)),$(defpath)) 1152 endif 1153 ifdef $(target)_SOURCES.$(bld_trg_arch) 1154 $(target)_SOURCES.$(bld_trg_arch) := $(call abspathex,$($(target)_SOURCES.$(bld_trg_arch)),$(defpath)) 1155 endif 1156 ifdef $(target)_SOURCES.$(bld_trg_cpu) 1157 $(target)_SOURCES.$(bld_trg_cpu) := $(call abspathex,$($(target)_SOURCES.$(bld_trg_cpu)),$(defpath)) 1158 endif 1159 ifdef $(target)_SOURCES.$(bld_type) 1160 $(target)_SOURCES.$(bld_type) := $(call abspathex,$($(target)_SOURCES.$(bld_type)),$(defpath)) 1161 endif 1162 endif 1163 1130 1164 #$ (warning def_target_sources) 1131 1165 # C sources … … 1217 1251 TARGET_$(target) := $(out) 1218 1252 $(target)_OBJS_ := 1253 defpath := $($(target)_PATH) 1219 1254 1220 1255 # source -> object … … 1254 1289 deps := $($(target)_DEPS) 1255 1290 1291 # Adjust paths if we got a default path. 1292 ifneq ($(defpath),) 1293 objs := $(call abspathex,$(objs),$(defpath)) 1294 deps := $(call abspathex,$(deps),$(defpath)) 1295 endif 1296 1256 1297 # dependency file 1257 1298 dep := $(out)$(SUFF_DEP) … … 1328 1369 TARGET_$(target) := $(out) 1329 1370 $(target)_OBJS_ := 1371 defpath := $($(target)_PATH) 1330 1372 1331 1373 # source -> object … … 1455 1497 deps := $($(target)_DEPS) 1456 1498 1499 # Adjust paths if we got a default path. 1500 ifneq ($(defpath),) 1501 libpath := $(call abspathex,$(libpath)def $(target)_PATH) 1502 objs := $(call abspathex,$(objs),$(defpath)) 1503 deps := $(call abspathex,$(deps),$(defpath)) 1504 # libs are not subject to this because of the the -l<lib> stuff. Use $(<target>_PATH)/lib if relative to current dir! 1505 endif 1506 1457 1507 ## @todo this stuff can't be working. 1458 1508 custom_pre := $(strip $(firstword \ … … 1662 1712 # _INSTFUN 1663 1713 ifdef $(srcsrc)_INSTFUN 1664 instfun := $(srcsrc)_INSTFUN1714 instfun := $(srcsrc)_INSTFUN 1665 1715 else 1666 ifdef $(target)_INSTFUN1667 instfun := $(target)_INSTFUN1668 else1669 instfun := _INSTALL_FILE1670 endif1716 ifdef $(target)_INSTFUN 1717 instfun := $(target)_INSTFUN 1718 else 1719 instfun := _INSTALL_FILE 1720 endif 1671 1721 endif 1672 1722 1673 1723 # _INST 1674 1724 ifdef $(srcsrc)_INST 1675 inst := $(patsubst %/,%,$($(srcsrc)_INST))/$(dir $(srcdstdir))1725 inst := $(patsubst %/,%,$($(srcsrc)_INST))/$(dir $(srcdstdir)) 1676 1726 else 1677 ifdef $(target)_INST1678 inst := $(patsubst %/,%,$($(target)_INST))/$(dir $(srcdstdir))1679 else1680 inst := $(dir $(srcdstdir))1681 endif1727 ifdef $(target)_INST 1728 inst := $(patsubst %/,%,$($(target)_INST))/$(dir $(srcdstdir)) 1729 else 1730 inst := $(dir $(srcdstdir)) 1731 endif 1682 1732 endif 1683 1733 … … 1736 1786 $($(target)_GID)) 1737 1787 1788 1789 # Adjust the source if we got a default PATH. (This must be done this late!) 1790 ifdef $(target)_PATH 1791 srcsrc := $(call abspathex,$(srcsrc),$($(target)_PATH)) 1792 endif 1793 1738 1794 # create the command 1739 1795 ifdef $(srcsrc)_INSTALLER 1740 inscmd := $(call $(srcsrc)_INSTALLER,$(srcsrc),$(insdst),$(target))1796 inscmd := $(call $(srcsrc)_INSTALLER,$(srcsrc),$(insdst),$(target)) 1741 1797 else 1742 ifdef $(target)_INSTALLER1743 inscmd := $(call $(target)_INSTALLER,$(srcsrc),$(insdst),$(target))1744 else1745 inscmd := $$(INSTALL)\1798 ifdef $(target)_INSTALLER 1799 inscmd := $(call $(target)_INSTALLER,$(srcsrc),$(insdst),$(target)) 1800 else 1801 inscmd := $$(INSTALL)\ 1746 1802 $(if $(uid),-o $(uid))\ 1747 1803 $(if $(gid),-g $(gid))\ 1748 1804 $(if $(mode),-m $(mode))\ 1749 1805 $(srcsrc) $(insdst) 1750 endif1806 endif 1751 1807 endif 1752 1808 … … 1788 1844 # _INST 1789 1845 ifdef $(symlnk)_INST 1790 inst := $(patsubst %/,%,$($(symlnk)_INST))/$(dir $(symlnk))1846 inst := $(patsubst %/,%,$($(symlnk)_INST))/$(dir $(symlnk)) 1791 1847 else 1792 ifdef $(target)_INST1793 inst := $(patsubst %/,%,$($(target)_INST))/$(dir $(symlnk))1794 else1795 inst := $(dir $(symlnk))1796 endif1848 ifdef $(target)_INST 1849 inst := $(patsubst %/,%,$($(target)_INST))/$(dir $(symlnk)) 1850 else 1851 inst := $(dir $(symlnk)) 1852 endif 1797 1853 endif 1798 1854 … … 1828 1884 # _INST 1829 1885 ifdef $(directory)_INST 1830 inst := $(PATH_INS)/$(patsubst %/,%,$($(directory)_INST))1886 inst := $(PATH_INS)/$(patsubst %/,%,$($(directory)_INST)) 1831 1887 else 1832 ifdef $(target)_INST1833 inst := $(PATH_INS)/$(patsubst %/,%,$($(target)_INST))1834 else1835 inst := $(PATH_INS)1836 endif1888 ifdef $(target)_INST 1889 inst := $(PATH_INS)/$(patsubst %/,%,$($(target)_INST)) 1890 else 1891 inst := $(PATH_INS) 1892 endif 1837 1893 endif 1838 1894 … … 2142 2198 endif # __footer_kmk__ 2143 2199 2200
Note:
See TracChangeset
for help on using the changeset viewer.