VirtualBox

Changeset 2488 in kBuild


Ignore:
Timestamp:
Jul 22, 2011 7:49:47 AM (14 years ago)
Author:
bird
Message:

footer.kmk,header.kmk: Fixed multile install/staging destinations for link targets (busted by recent changes).

Location:
trunk/kBuild
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/kBuild/footer.kmk

    r2483 r2488  
    13201320
    13211321if1of ($(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 )
    13381338 $(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)))
    13401340else
    13411341 $(target)_1_STAGE :=
     
    13451345
    13461346if1of ($(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 )
    13561356 $(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)))
    13581358else
    13591359 $(target)_1_INST :=
     
    15141514# Determine the actual INST and STAGE sub-dirs to use for this target.
    15151515if1of ($(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
    15321536 $(target)_1_STAGE := $(stage)
    15331537else
     
    15361540
    15371541if1of ($(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
    15471555 $(target)_1_INST := $(inst)
    15481556else
     
    21332141#                      pre_install_cmds, post_install_cmds
    21342142define def_link_install_rule
    2135 $($(target)_1_INST_TARGET): $(out) | $(dir $($(target)_1_INST_TARGET))
     2143$($(target)_1_INST_TARGET): $(out) | $$$$(dir $$$$@)
    21362144        %$$(call MSG_INST_TRG,$(target),$(out),$$@)
    21372145        $(pre_install_cmds)
     
    21392147        $$(QUIET)$$(INSTALL) $(if $(mode),-m $(mode)) $(if $(uid),-o $(uid)) $(if $(gid),-g $(gid)) -- $(out) $$@
    21402148        $(post_install_cmds)
    2141 
    21422149
    21432150endef
     
    21482155#                      pre_install_cmds, post_install_cmds
    21492156define def_link_stage_rule
    2150 $($(target)_1_STAGE_TARGET): $(out) | $(dir $($(target)_1_STAGE_TARGET))
     2157$($(target)_1_STAGE_TARGET): $(out) | $$$$(dir $$$$@)
    21512158        %$$(call MSG_INST_TRG,$(target),$(out),$$@)
    21522159        $(pre_install_cmds)
     
    22932300# @param        $(target)   Normalized target name.
    22942301# @param        $(out)      The output file.
    2295 # @param        $(definst)  The default _INST value.
    22962302# @param        $(typevar)  The name of the variable with all the root targets of its type.
    22972303# @param        $(target_type_mode) The default file mode implied by the target type.
  • trunk/kBuild/header.kmk

    r2485 r2488  
    742742# @param        $1              the path
    743743no-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.
     748define 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
     759endef
    744760
    745761## Figure out where to put object files.
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette