VirtualBox

Changeset 859 in kBuild for trunk


Ignore:
Timestamp:
Mar 29, 2007 2:58:33 AM (18 years ago)
Author:
bird
Message:

Implemented PRE_CMDS and POST_CMDS for linking.

Location:
trunk/kBuild
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/kBuild/footer.kmk

    r854 r859  
    564564endef
    565565
    566 _SDKS := $(sort $(_SDKS)) 
     566_SDKS := $(sort $(_SDKS))
    567567$(foreach sdk, $(_SDKS), $(eval $(value def_sdks_include_one)))
    568568
     
    11801180        $$(call MSG_COMPILE,$(target),$(source),$$@,$(type))
    11811181        $$(QUIET)$$(RM) -f $(dep) $(obj) $($(target)_$(source)_OUTPUT_)
    1182         $(custom_pre)
    11831182
    11841183$($(target)_$(source)_CMDS_)
    11851184
    1186         $(custom_post)
     1185        $($(target)_$(source)_CMDS_)
    11871186ifndef NO_COMPILE_CMDS_DEPS
    11881187        $$(QUIET2)$$(APPEND) "$(dep)"
     
    12261225        $$(call MSG_LINK,$(target),$$@,$(tool_do))
    12271226        $$(QUIET)$$(RM) -f $(dep) $(out) $($(target)_OUTPUT_)
    1228         $(custom_pre)
    12291227
    12301228$($(target)_CMDS_)
    12311229
    1232         $(custom_post)
    12331230ifndef NO_LINK_CMDS_DEPS
    12341231        $$(QUIET2)$$(APPEND) "$(dep)" 'define $(target)_CMDS_PREV_'
     
    14231420endif
    14241421
     1422
     1423# Custom pre-link actions.
     1424ifdef $(target)_PRE_CMDS.$(bld_trg).$(bld_trg_arch).$(bld_type)
     1425 pre_cmds := $($(target)_PRE_CMDS.$(bld_trg).$(bld_trg_arch).$(bld_type))
     1426else ifdef $(target)_PRE_CMDS.$(bld_trg).$(bld_trg_arch)
     1427 pre_cmds := $($(target)_PRE_CMDS.$(bld_trg).$(bld_trg_arch))
     1428else ifdef $(target)_PRE_CMDS.$(bld_trg).$(bld_type)
     1429 pre_cmds := $($(target)_PRE_CMDS.$(bld_trg).$(bld_type))
     1430else ifdef $(target)_PRE_CMDS.$(bld_trg_arch)
     1431 pre_cmds := $($(target)_PRE_CMDS.$(bld_trg_arch))
     1432else ifdef $(target)_PRE_CMDS.$(bld_trg)
     1433 pre_cmds := $($(target)_PRE_CMDS.$(bld_trg))
     1434else ifdef $(target)_PRE_CMDS.$(bld_type)
     1435 pre_cmds := $($(target)_PRE_CMDS.$(bld_type))
     1436else ifdef $(target)_PRE_CMDS
     1437 pre_cmds := $($(target)_PRE_CMDS)
     1438else ifdef PRE_CMDS.$(bld_trg).$(bld_trg_arch).$(bld_type)
     1439 pre_cmds := $(PRE_CMDS.$(bld_trg).$(bld_trg_arch).$(bld_type))
     1440else ifdef PRE_CMDS.$(bld_trg).$(bld_trg_arch)
     1441 pre_cmds := $(PRE_CMDS.$(bld_trg).$(bld_trg_arch))
     1442else ifdef PRE_CMDS.$(bld_trg).$(bld_type)
     1443 pre_cmds := $(PRE_CMDS.$(bld_trg).$(bld_type))
     1444else ifdef PRE_CMDS.$(bld_trg_arch)
     1445 pre_cmds := $(PRE_CMDS.$(bld_trg_arch))
     1446else ifdef PRE_CMDS.$(bld_trg)
     1447 pre_cmds := $(PRE_CMDS.$(bld_trg))
     1448else ifdef PRE_CMDS.$(bld_type)
     1449 pre_cmds := $(PRE_CMDS.$(bld_type))
     1450else
     1451 pre_cmds := $(PRE_CMDS)
     1452endif
     1453
     1454# Custom post-link actions.
     1455ifdef $(target)_POST_CMDS.$(bld_trg).$(bld_trg_arch).$(bld_type)
     1456 post_cmds := $($(target)_POST_CMDS.$(bld_trg).$(bld_trg_arch).$(bld_type))
     1457else ifdef $(target)_POST_CMDS.$(bld_trg).$(bld_trg_arch)
     1458 post_cmds := $($(target)_POST_CMDS.$(bld_trg).$(bld_trg_arch))
     1459else ifdef $(target)_POST_CMDS.$(bld_trg).$(bld_type)
     1460 post_cmds := $($(target)_POST_CMDS.$(bld_trg).$(bld_type))
     1461else ifdef $(target)_POST_CMDS.$(bld_trg_arch)
     1462 post_cmds := $($(target)_POST_CMDS.$(bld_trg_arch))
     1463else ifdef $(target)_POST_CMDS.$(bld_trg)
     1464 post_cmds := $($(target)_POST_CMDS.$(bld_trg))
     1465else ifdef $(target)_POST_CMDS.$(bld_type)
     1466 post_cmds := $($(target)_POST_CMDS.$(bld_type))
     1467else ifdef $(target)_POST_CMDS
     1468 post_cmds := $($(target)_POST_CMDS)
     1469else ifdef POST_CMDS.$(bld_trg).$(bld_trg_arch).$(bld_type)
     1470 post_cmds := $(POST_CMDS.$(bld_trg).$(bld_trg_arch).$(bld_type))
     1471else ifdef POST_CMDS.$(bld_trg).$(bld_trg_arch)
     1472 post_cmds := $(POST_CMDS.$(bld_trg).$(bld_trg_arch))
     1473else ifdef POST_CMDS.$(bld_trg).$(bld_type)
     1474 post_cmds := $(POST_CMDS.$(bld_trg).$(bld_type))
     1475else ifdef POST_CMDS.$(bld_trg_arch)
     1476 post_cmds := $(POST_CMDS.$(bld_trg_arch))
     1477else ifdef POST_CMDS.$(bld_trg)
     1478 post_cmds := $(POST_CMDS.$(bld_trg))
     1479else ifdef POST_CMDS.$(bld_type)
     1480 post_cmds := $(POST_CMDS.$(bld_type))
     1481else
     1482 post_cmds := $(POST_CMDS)
     1483endif
     1484
    14251485# dependency file
    14261486dep := $(out)$(SUFF_DEP)
     
    14501510# call the tool
    14511511$(target)_CMDS_   := $(TOOL_$(tool)_LINK_LIBRARY_CMDS)
     1512ifneq ($(pre_cmds),)
     1513 $(target)_CMDS_  := $(TAB)$(pre_cmds)$(NL)$(TAB)$($(target)_CMDS_)
     1514endif
     1515ifneq ($(post_cmds),)
     1516 $(target)_CMDS_  := $($(target)_CMDS_)$(NL)$(TAB)$(post_cmds)
     1517endif
    14521518$(target)_OUTPUT_ := $(TOOL_$(tool)_LINK_LIBRARY_OUTPUT)
    14531519$(target)_DEPEND_ := $(TOOL_$(tool)_LINK_LIBRARY_DEPEND) $(deps) $(objs)
     
    14581524
    14591525# installing and globals
     1526$(eval $(value def_target_install_pluss))
     1527endef
     1528
     1529# Process libraries
    14601530definst := $(PATH_LIB)
    14611531typevar := _LIBS
    1462 $(eval $(value def_target_install_pluss))
    1463 endef
    1464 
    1465 # Process libraries
    14661532tool_do := LINK_LIBRARY
    14671533mode := 0644
     
    16421708endif
    16431709
    1644 ## @todo this stuff can't be working.
    1645 custom_pre := $(strip $(firstword \
    1646         $($(target)_CUSTOM_PRE.$(bld_trg).$(bld_trg_arch))\
    1647         $($(target)_CUSTOM_PRE.$(bld_trg).$(bld_type))\
    1648         $($(target)_CUSTOM_PRE.$(bld_trg))\
    1649         $($(target)_CUSTOM_PRE.$(bld_type))\
    1650         $($(target)_CUSTOM_PRE)\
    1651         $(CUSTOM_PRE.$(bld_trg).$(bld_trg_arch))\
    1652         $(CUSTOM_PRE.$(bld_trg).$(bld_type))\
    1653         $(CUSTOM_PRE.$(bld_trg))\
    1654         $(CUSTOM_PRE.$(bld_type))\
    1655         $(CUSTOM_PRE)\
    1656 ))
    1657 custom_post := $(strip $(firstword \
    1658         $($(target)_CUSTOM_POST.$(bld_trg).$(bld_trg_arch))\
    1659         $($(target)_CUSTOM_POST.$(bld_trg).$(bld_type))\
    1660         $($(target)_CUSTOM_POST.$(bld_trg))\
    1661         $($(target)_CUSTOM_POST.$(bld_type))\
    1662         $($(target)_CUSTOM_POST)\
    1663         $(CUSTOM_POST.$(bld_trg).$(bld_trg_arch))\
    1664         $(CUSTOM_POST.$(bld_trg).$(bld_type))\
    1665         $(CUSTOM_POST.$(bld_trg))\
    1666         $(CUSTOM_POST.$(bld_type))\
    1667         $(CUSTOM_POST)\
    1668 ))
     1710# Custom pre-link actions.
     1711ifdef $(target)_PRE_CMDS.$(bld_trg).$(bld_trg_arch).$(bld_type)
     1712 pre_cmds := $($(target)_PRE_CMDS.$(bld_trg).$(bld_trg_arch).$(bld_type))
     1713else ifdef $(target)_PRE_CMDS.$(bld_trg).$(bld_trg_arch)
     1714 pre_cmds := $($(target)_PRE_CMDS.$(bld_trg).$(bld_trg_arch))
     1715else ifdef $(target)_PRE_CMDS.$(bld_trg).$(bld_type)
     1716 pre_cmds := $($(target)_PRE_CMDS.$(bld_trg).$(bld_type))
     1717else ifdef $(target)_PRE_CMDS.$(bld_trg_arch)
     1718 pre_cmds := $($(target)_PRE_CMDS.$(bld_trg_arch))
     1719else ifdef $(target)_PRE_CMDS.$(bld_trg)
     1720 pre_cmds := $($(target)_PRE_CMDS.$(bld_trg))
     1721else ifdef $(target)_PRE_CMDS.$(bld_type)
     1722 pre_cmds := $($(target)_PRE_CMDS.$(bld_type))
     1723else ifdef $(target)_PRE_CMDS
     1724 pre_cmds := $($(target)_PRE_CMDS)
     1725else ifdef PRE_CMDS.$(bld_trg).$(bld_trg_arch).$(bld_type)
     1726 pre_cmds := $(PRE_CMDS.$(bld_trg).$(bld_trg_arch).$(bld_type))
     1727else ifdef PRE_CMDS.$(bld_trg).$(bld_trg_arch)
     1728 pre_cmds := $(PRE_CMDS.$(bld_trg).$(bld_trg_arch))
     1729else ifdef PRE_CMDS.$(bld_trg).$(bld_type)
     1730 pre_cmds := $(PRE_CMDS.$(bld_trg).$(bld_type))
     1731else ifdef PRE_CMDS.$(bld_trg_arch)
     1732 pre_cmds := $(PRE_CMDS.$(bld_trg_arch))
     1733else ifdef PRE_CMDS.$(bld_trg)
     1734 pre_cmds := $(PRE_CMDS.$(bld_trg))
     1735else ifdef PRE_CMDS.$(bld_type)
     1736 pre_cmds := $(PRE_CMDS.$(bld_type))
     1737else
     1738 pre_cmds := $(PRE_CMDS)
     1739endif
     1740
     1741# Custom post-link actions.
     1742ifdef $(target)_POST_CMDS.$(bld_trg).$(bld_trg_arch).$(bld_type)
     1743 post_cmds := $($(target)_POST_CMDS.$(bld_trg).$(bld_trg_arch).$(bld_type))
     1744else ifdef $(target)_POST_CMDS.$(bld_trg).$(bld_trg_arch)
     1745 post_cmds := $($(target)_POST_CMDS.$(bld_trg).$(bld_trg_arch))
     1746else ifdef $(target)_POST_CMDS.$(bld_trg).$(bld_type)
     1747 post_cmds := $($(target)_POST_CMDS.$(bld_trg).$(bld_type))
     1748else ifdef $(target)_POST_CMDS.$(bld_trg_arch)
     1749 post_cmds := $($(target)_POST_CMDS.$(bld_trg_arch))
     1750else ifdef $(target)_POST_CMDS.$(bld_trg)
     1751 post_cmds := $($(target)_POST_CMDS.$(bld_trg))
     1752else ifdef $(target)_POST_CMDS.$(bld_type)
     1753 post_cmds := $($(target)_POST_CMDS.$(bld_type))
     1754else ifdef $(target)_POST_CMDS
     1755 post_cmds := $($(target)_POST_CMDS)
     1756else ifdef POST_CMDS.$(bld_trg).$(bld_trg_arch).$(bld_type)
     1757 post_cmds := $(POST_CMDS.$(bld_trg).$(bld_trg_arch).$(bld_type))
     1758else ifdef POST_CMDS.$(bld_trg).$(bld_trg_arch)
     1759 post_cmds := $(POST_CMDS.$(bld_trg).$(bld_trg_arch))
     1760else ifdef POST_CMDS.$(bld_trg).$(bld_type)
     1761 post_cmds := $(POST_CMDS.$(bld_trg).$(bld_type))
     1762else ifdef POST_CMDS.$(bld_trg_arch)
     1763 post_cmds := $(POST_CMDS.$(bld_trg_arch))
     1764else ifdef POST_CMDS.$(bld_trg)
     1765 post_cmds := $(POST_CMDS.$(bld_trg))
     1766else ifdef POST_CMDS.$(bld_type)
     1767 post_cmds := $(POST_CMDS.$(bld_type))
     1768else
     1769 post_cmds := $(POST_CMDS)
     1770endif
    16691771
    16701772# installation targets
     
    17121814# call the tool
    17131815$(target)_CMDS_   := $(TOOL_$(tool)_$(tool_do)_CMDS)
     1816ifneq ($(pre_cmds),)
     1817 $(target)_CMDS_  := $(TAB)$(pre_cmds)$(NL)$(TAB)$($(target)_CMDS_)
     1818endif
     1819ifneq ($(post_cmds),)
     1820 $(target)_CMDS_  := $($(target)_CMDS_)$(NL)$(TAB)$(post_cmds)
     1821endif
    17141822$(target)_OUTPUT_ := $(TOOL_$(tool)_$(tool_do)_OUTPUT)
    17151823$(target)_DEPEND_ := $(TOOL_$(tool)_$(tool_do)_DEPEND) $(deps) $(objs)
  • trunk/kBuild/header.kmk

    r854 r859  
    549549# This list of non-accumulative target properties which are functions,
    550550# and thus should not be expanded until the very last moment.
    551 PROPS_DEFERRED := INSTFUN INSTALLER
     551PROPS_DEFERRED := INSTFUN INSTALLER PRE_CMDS POST_CMDS
    552552
    553553## PROPS_ACCUMULATE_R
Note: See TracChangeset for help on using the changeset viewer.

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