Changeset 2488 in kBuild
- Timestamp:
- Jul 22, 2011 7:49:47 AM (14 years ago)
- Location:
- trunk/kBuild
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kBuild/footer.kmk
r2483 r2488 1320 1320 1321 1321 if1of ($(insttype), stage both) 1322 local stage := $( strip $(firstword\1323 $( $(target)_STAGE.$(bld_trg).$(bld_trg_arch).$(bld_type)) \1324 $( $(target)_INST.$(bld_trg).$(bld_trg_arch).$(bld_type)) \1325 $( $(target)_STAGE.$(bld_trg).$(bld_trg_arch)) \1326 $( $(target)_INST.$(bld_trg).$(bld_trg_arch)) \1327 $( $(target)_STAGE.$(bld_trg).$(bld_type)) \1328 $( $(target)_INST.$(bld_trg).$(bld_type)) \1329 $( $(target)_STAGE.$(bld_trg_arch)) \1330 $( $(target)_INST.$(bld_trg_arch)) \1331 $( $(target)_STAGE.$(bld_trg)) \1332 $( $(target)_INST.$(bld_trg)) \1333 $( $(target)_STAGE.$(bld_type)) \1334 $( $(target)_INST.$(bld_type)) \1335 $( $(target)_STAGE)\1336 $( $(target)_INST)\1337 $(definst) ))1322 local stage := $(evalcall FIRST-DEFINED-VAR, \ 1323 $(target)_STAGE.$(bld_trg).$(bld_trg_arch).$(bld_type) \ 1324 $(target)_INST.$(bld_trg).$(bld_trg_arch).$(bld_type) \ 1325 $(target)_STAGE.$(bld_trg).$(bld_trg_arch) \ 1326 $(target)_INST.$(bld_trg).$(bld_trg_arch) \ 1327 $(target)_STAGE.$(bld_trg).$(bld_type) \ 1328 $(target)_INST.$(bld_trg).$(bld_type) \ 1329 $(target)_STAGE.$(bld_trg_arch) \ 1330 $(target)_INST.$(bld_trg_arch) \ 1331 $(target)_STAGE.$(bld_trg) \ 1332 $(target)_INST.$(bld_trg) \ 1333 $(target)_STAGE.$(bld_type) \ 1334 $(target)_INST.$(bld_type) \ 1335 $(target)_STAGE \ 1336 $(target)_INST \ 1337 definst ) 1338 1338 $(target)_1_STAGE := $(stage) 1339 $(target)_1_STAGE_TARGET := $( PATH_STAGE)/$(stage)$(notdir $(out))1339 $(target)_1_STAGE_TARGET := $(addprefix $(PATH_STAGE)/,$(addsuffix $(notdir $(out)),$(stage))) 1340 1340 else 1341 1341 $(target)_1_STAGE := … … 1345 1345 1346 1346 if1of ($(insttype), both) 1347 local inst := $( strip $(firstword\1348 $( $(target)_INST.$(bld_trg).$(bld_trg_arch).$(bld_type)) \1349 $( $(target)_INST.$(bld_trg).$(bld_trg_arch)) \1350 $( $(target)_INST.$(bld_trg).$(bld_type)) \1351 $( $(target)_INST.$(bld_trg_arch)) \1352 $( $(target)_INST.$(bld_trg)) \1353 $( $(target)_INST.$(bld_type)) \1354 $( $(target)_INST)\1355 $(definst) ))1347 local inst := $(evalcall FIRST-DEFINED-VAR, \ 1348 $(target)_INST.$(bld_trg).$(bld_trg_arch).$(bld_type) \ 1349 $(target)_INST.$(bld_trg).$(bld_trg_arch) \ 1350 $(target)_INST.$(bld_trg).$(bld_type) \ 1351 $(target)_INST.$(bld_trg_arch) \ 1352 $(target)_INST.$(bld_trg) \ 1353 $(target)_INST.$(bld_type) \ 1354 $(target)_INST \ 1355 definst ) 1356 1356 $(target)_1_INST := $(inst) 1357 $(target)_1_INST_TARGET := $( PATH_INS)/$(inst)$(notdir $(out))1357 $(target)_1_INST_TARGET := $(addprefix $(PATH_INS)/,$(addsuffix $(notdir $(out)),$(stage))) 1358 1358 else 1359 1359 $(target)_1_INST := … … 1514 1514 # Determine the actual INST and STAGE sub-dirs to use for this target. 1515 1515 if1of ($(insttype), stage both) 1516 local stage := $(strip $(firstword \ 1517 $($(target)_STAGE.$(bld_trg).$(bld_trg_arch).$(bld_type)) \ 1518 $($(target)_INST.$(bld_trg).$(bld_trg_arch).$(bld_type)) \ 1519 $($(target)_STAGE.$(bld_trg).$(bld_trg_arch)) \ 1520 $($(target)_INST.$(bld_trg).$(bld_trg_arch)) \ 1521 $($(target)_STAGE.$(bld_trg).$(bld_type)) \ 1522 $($(target)_INST.$(bld_trg).$(bld_type)) \ 1523 $($(target)_STAGE.$(bld_trg_arch)) \ 1524 $($(target)_INST.$(bld_trg_arch)) \ 1525 $($(target)_STAGE.$(bld_trg)) \ 1526 $($(target)_INST.$(bld_trg)) \ 1527 $($(target)_STAGE.$(bld_type)) \ 1528 $($(target)_INST.$(bld_type)) \ 1529 $($(target)_STAGE) \ 1530 $($(target)_INST) \ 1531 $(definst) )) 1516 local stage := $(evalcall FIRST-DEFINED-VAR, \ 1517 $(target)_STAGE.$(bld_trg).$(bld_trg_arch).$(bld_type) \ 1518 $(target)_INST.$(bld_trg).$(bld_trg_arch).$(bld_type) \ 1519 $(target)_STAGE.$(bld_trg).$(bld_trg_arch) \ 1520 $(target)_INST.$(bld_trg).$(bld_trg_arch) \ 1521 $(target)_STAGE.$(bld_trg).$(bld_type) \ 1522 $(target)_INST.$(bld_trg).$(bld_type) \ 1523 $(target)_STAGE.$(bld_trg_arch) \ 1524 $(target)_INST.$(bld_trg_arch) \ 1525 $(target)_STAGE.$(bld_trg) \ 1526 $(target)_INST.$(bld_trg) \ 1527 $(target)_STAGE.$(bld_type) \ 1528 $(target)_INST.$(bld_type) \ 1529 $(target)_STAGE \ 1530 $(target)_INST \ 1531 definst ) 1532 if $(words $(stage)) > 1 1533 $(warning kBuild: The STAGE/INST property of install '$(target)' specifies multiple location, that is not supported.) 1534 local stage := $(word 1, $(stage)) 1535 endif 1532 1536 $(target)_1_STAGE := $(stage) 1533 1537 else … … 1536 1540 1537 1541 if1of ($(insttype), both) 1538 local inst := $(strip $(firstword \ 1539 $($(target)_INST.$(bld_trg).$(bld_trg_arch).$(bld_type)) \ 1540 $($(target)_INST.$(bld_trg).$(bld_trg_arch)) \ 1541 $($(target)_INST.$(bld_trg).$(bld_type)) \ 1542 $($(target)_INST.$(bld_trg_arch)) \ 1543 $($(target)_INST.$(bld_trg)) \ 1544 $($(target)_INST.$(bld_type)) \ 1545 $($(target)_INST) \ 1546 $(definst) )) 1542 local inst := $(evalcall FIRST-DEFINED-VAR, \ 1543 $(target)_INST.$(bld_trg).$(bld_trg_arch).$(bld_type) \ 1544 $(target)_INST.$(bld_trg).$(bld_trg_arch) \ 1545 $(target)_INST.$(bld_trg).$(bld_type) \ 1546 $(target)_INST.$(bld_trg_arch) \ 1547 $(target)_INST.$(bld_trg) \ 1548 $(target)_INST.$(bld_type) \ 1549 $(target)_INST \ 1550 definst ) 1551 if $(words $(inst)) > 1 1552 $(warning kBuild: The INST property of install '$(target)' specifies multiple location, that is not supported.) 1553 local inst := $(word 1, $(inst)) 1554 endif 1547 1555 $(target)_1_INST := $(inst) 1548 1556 else … … 2133 2141 # pre_install_cmds, post_install_cmds 2134 2142 define def_link_install_rule 2135 $($(target)_1_INST_TARGET): $(out) | $ (dir $($(target)_1_INST_TARGET))2143 $($(target)_1_INST_TARGET): $(out) | $$$$(dir $$$$@) 2136 2144 %$$(call MSG_INST_TRG,$(target),$(out),$$@) 2137 2145 $(pre_install_cmds) … … 2139 2147 $$(QUIET)$$(INSTALL) $(if $(mode),-m $(mode)) $(if $(uid),-o $(uid)) $(if $(gid),-g $(gid)) -- $(out) $$@ 2140 2148 $(post_install_cmds) 2141 2142 2149 2143 2150 endef … … 2148 2155 # pre_install_cmds, post_install_cmds 2149 2156 define def_link_stage_rule 2150 $($(target)_1_STAGE_TARGET): $(out) | $ (dir $($(target)_1_STAGE_TARGET))2157 $($(target)_1_STAGE_TARGET): $(out) | $$$$(dir $$$$@) 2151 2158 %$$(call MSG_INST_TRG,$(target),$(out),$$@) 2152 2159 $(pre_install_cmds) … … 2293 2300 # @param $(target) Normalized target name. 2294 2301 # @param $(out) The output file. 2295 # @param $(definst) The default _INST value.2296 2302 # @param $(typevar) The name of the variable with all the root targets of its type. 2297 2303 # @param $(target_type_mode) The default file mode implied by the target type. -
trunk/kBuild/header.kmk
r2485 r2488 742 742 # @param $1 the path 743 743 no-root-slash = $(patsubst /%,%,$(1)) 744 745 ## 746 # Similar to firstword, except it returns the value of first defined variable. 747 # @param $1 list of variables to probe. 748 define FIRST-DEFINED-VAR 749 if "$1" != "" 750 local var := $(word 1,$1) 751 ifdef $(var) 752 local .RETURN := $(strip $($(var))) 753 else 754 local .RETURN := $(evalcall FIRST-DEFINED-VAR, $(wordlist 2,32,$1)) 755 endif 756 else 757 local .RETURN := 758 endif 759 endef 744 760 745 761 ## Figure out where to put object files.
Note:
See TracChangeset
for help on using the changeset viewer.