VirtualBox

Changeset 827 in kBuild


Ignore:
Timestamp:
Feb 3, 2007 1:08:29 AM (18 years ago)
Author:
bird
Message:

New property 'ORDERDEPS' for listing order-only dependencies.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/kBuild/footer.kmk

    r782 r827  
    110110_SYSMODS  :=
    111111_INSTALLS :=
     112_INSTALLS_FILES :=
    112113_INSTALLS_DIRS :=
    113114_OTHERS   :=
     
    708709        $($(srcname)_DEPS)\
    709710        $($(target)_DEPS)
     711orderdeps := \
     712        $($(target)_$(source)_ORDERDEPS)\
     713        $($(target)_$(srcname)_ORDERDEPS)\
     714        $($(source)_ORDERDEPS)\
     715        $($(srcname)_ORDERDEPS)\
     716        $($(target)_ORDERDEPS)
    710717md5 := $(firstword \
    711718        $($(target)_$(source)_MD5)\
     
    774781$(target)_$(srcname)_FETCH_OUTPUT_ := $(TOOL_$(tool)_FETCH_OUTPUT)
    775782$(target)_$(srcname)_FETCH_DEPEND_ := $(TOOL_$(tool)_FETCH_DEPEND) $(deps)
    776 $(target)_$(srcname)_FETCH_DEPORD_ := $(TOOL_$(tool)_FETCH_DEPORD) $(dirdep)
     783$(target)_$(srcname)_FETCH_DEPORD_ := $(TOOL_$(tool)_FETCH_DEPORD) $(dirdep) $(orderdeps)
    777784
    778785# generate the fetch rule.
     
    832839$(target)_$(srcname)_UNPACK_OUTPUT_ := $(TOOL_$(tool)_UNPACK_OUTPUT)
    833840$(target)_$(srcname)_UNPACK_DEPEND_ := $(TOOL_$(tool)_UNPACK_DEPEND) $(deps)
    834 $(target)_$(srcname)_UNPACK_DEPORD_ := $(TOOL_$(tool)_UNPACK_DEPORD) $(dirdep)
     841$(target)_$(srcname)_UNPACK_DEPORD_ := $(TOOL_$(tool)_UNPACK_DEPORD) $(dirdep) $(orderdeps)
    835842
    836843# generate the fetch rule.
     
    11231130$(eval $(def_link_install_rule))
    11241131
    1125 _INSTALLS += $(INSTARGET_$(target))
     1132_INSTALLS_FILES += $(INSTARGET_$(target))
    11261133
    11271134ifdef KBUILD_DO_AUTO_INSTALL
     
    12131220    $($(target)_OBJS_)
    12141221dirdep      := $(call DIRDEP,$(dir $(out)))
    1215 ## @todo fix dependencies on makefiles an such
    12161222deps        := $($(target)_DEPS)
     1223orderdeps   := $($(target)_ORDERDEPS)
    12171224
    12181225# Adjust paths if we got a default path.
     
    12201227 objs := $(call abspathex,$(objs),$(defpath))
    12211228 deps := $(call abspathex,$(deps),$(defpath))
     1229 orderdeps := $(call abspathex,$(orderdeps),$(defpath))
    12221230 othersrc := $(call abspathex,$(othersrc),$(defpath))
    12231231endif
     
    12521260$(target)_OUTPUT_ := $(TOOL_$(tool)_LINK_LIBRARY_OUTPUT)
    12531261$(target)_DEPEND_ := $(TOOL_$(tool)_LINK_LIBRARY_DEPEND) $(deps) $(objs)
    1254 $(target)_DEPORD_ := $(TOOL_$(tool)_LINK_LIBRARY_DEPORD) $(dirdep)
     1262$(target)_DEPORD_ := $(TOOL_$(tool)_LINK_LIBRARY_DEPORD) $(dirdep) $(orderdeps)
    12551263
    12561264# generate the link rule.
     
    14291437        $(TOOL_$(tool)_LIBPATH)
    14301438dirdep      := $(call DIRDEP,$(dir $(out)))
    1431 ## @todo fix dependencies
    14321439deps        := $($(target)_DEPS)
     1440orderdeps   := $($(target)_ORDERDEPS)
    14331441
    14341442# Adjust paths if we got a default path.
     
    14371445 objs := $(call abspathex,$(objs),$(defpath))
    14381446 deps := $(call abspathex,$(deps),$(defpath))
     1447 orderdeps := $(call abspathex,$(orderdeps),$(defpath))
    14391448 othersrc := $(call abspathex,$(othersrc),$(defpath))
    14401449 # libs are not subject to this because of the the -l<lib> stuff. Use $(<target>_PATH)/lib if relative to current dir!
     
    14421451
    14431452## @todo this stuff can't be working.
    1444 custom_pre  := $(strip $(firstword \
     1453custom_pre := $(strip $(firstword \
    14451454        $($(target)_CUSTOM_PRE.$(bld_trg).$(bld_trg_arch))\
    14461455        $($(target)_CUSTOM_PRE.$(bld_trg).$(bld_type))\
     
    14541463        $(CUSTOM_PRE)\
    14551464))
    1456 custom_post    := $(strip $(firstword \
     1465custom_post := $(strip $(firstword \
    14571466        $($(target)_CUSTOM_POST.$(bld_trg).$(bld_trg_arch))\
    14581467        $($(target)_CUSTOM_POST.$(bld_trg).$(bld_type))\
     
    15131522$(target)_OUTPUT_ := $(TOOL_$(tool)_$(tool_do)_OUTPUT)
    15141523$(target)_DEPEND_ := $(TOOL_$(tool)_$(tool_do)_DEPEND) $(deps) $(objs)
    1515 $(target)_DEPORD_ := $(TOOL_$(tool)_$(tool_do)_DEPORD) $(dirdep)
     1524$(target)_DEPORD_ := $(TOOL_$(tool)_$(tool_do)_DEPORD) $(dirdep) $(orderdeps)
    15161525
    15171526# generate the link rule.
     
    15231532_OUT_FILES += $($(target)_OUTPUT_) $(out)
    15241533_CLEAN_FILES += $($(target)_CLEAN)
    1525 _INSTALLS += $(INSTARGET_$(target))
     1534_INSTALLS_FILES += $(INSTARGET_$(target))
    15261535
    15271536endef
     
    17691778# _INSTFUN
    17701779ifdef $(symlnk)_INSTFUN
    1771 instfun := $(symlnk)_INSTFUN
    1772 else
    1773 ifdef $(target)_INSTFUN
     1780 instfun := $(symlnk)_INSTFUN
     1781else ifdef $(target)_INSTFUN
    17741782instfun := $(target)_INSTFUN
    17751783else
    1776 instfun := _INSTALL_FILE
    1777 endif
     1784 instfun := _INSTALL_FILE
    17781785endif
    17791786
     
    17811788ifdef $(symlnk)_INST
    17821789 inst := $(patsubst %/,%,$($(symlnk)_INST))/$(dir $(symlnk))
     1790else ifdef $(target)_INST
     1791 inst := $(patsubst %/,%,$($(target)_INST))/$(dir $(symlnk))
    17831792else
    1784  ifdef $(target)_INST
    1785   inst := $(patsubst %/,%,$($(target)_INST))/$(dir $(symlnk))
    1786  else
    1787   inst := $(dir $(symlnk))
    1788  endif
     1793 inst := $(dir $(symlnk))
    17891794endif
    17901795
     
    18211826ifdef $(directory)_INST
    18221827 inst := $(PATH_INS)/$(patsubst %/,%,$($(directory)_INST))
     1828else ifdef $(target)_INST
     1829 inst := $(PATH_INS)/$(patsubst %/,%,$($(target)_INST))
    18231830else
    1824  ifdef $(target)_INST
    1825   inst := $(PATH_INS)/$(patsubst %/,%,$($(target)_INST))
    1826  else
    1827   inst := $(PATH_INS)
    1828  endif
     1831 inst := $(PATH_INS)
    18291832endif
    18301833
     
    18781881bld_trg_cpu := $(firstword $($(target)_BLD_TRG_CPU)  $(BUILD_TARGET_CPU))
    18791882
    1880 INSTARGET_$(target) :=
     1883INSTARGET_$(target) := $($(target)_GOALS)
    18811884INSTARGET_DIRS_$(target) :=
    18821885
     
    18901893        $(eval $(value def_install_symlink)))
    18911894
    1892 _INSTALLS += $(INSTARGET_$(target)) $($(target)_GOALS)
     1895# the collection target
     1896TARGET_$(target) := $(PATH_TARGET)/$(target).ins
     1897$(TARGET_$(target)): $(INSTARGET_$(target)) | $(INSTARGET_DIRS_$(target))
     1898        @$(QUIET2)$(APPEND) $@
     1899
     1900$(target): $(TARGET_$(target))
     1901
     1902_INSTALLS += $(TARGET_$(target))
     1903_INSTALLS_FILES += $(INSTARGET_$(target))
    18931904_INSTALLS_DIRS += $(INSTARGET_DIRS_$(target))
    18941905endef
     
    19131924# DIRECTORIES
    19141925#
    1915 _DIR_ALL := $(sort $(addsuffix /,$(patsubst %/,%,$(_DIRS))) $(dir $(_OUT_FILES) $(_OBJS) $(_INSTALLS)))
     1926_DIR_ALL := $(sort $(addsuffix /,$(patsubst %/,%,$(_DIRS))) $(dir $(_OUT_FILES) $(_OBJS) $(_INSTALLS_FILES)))
    19161927$(foreach directory,$(_INSTALLS_DIRS), $(eval _DIR_ALL := $(filter-out $(directory),$(_DIR_ALL))))
    19171928
     
    20782089# @todo make this a non-default pass!
    20792090uninstall:
    2080         $(RM) -f $(_INSTALLS)
     2091        $(RM) -f $(_INSTALLS_FILES)
    20812092
    20822093install: pass_installs
     
    20912102sysmods:   $(_SYSMODS)
    20922103others:    $(_OTHERS)
    2093 installs:  $(_INSTALLS_DIRS) $(_INSTALLS)
     2104installs:  $(_INSTALLS)
    20942105
    20952106
  • trunk/src/gmake/kbuild.c

    r813 r827  
    13351335    struct variable *pOutBase   = kbuild_get_object_base(pTarget, pSource, "outbase");
    13361336    struct variable *pObjSuff   = kbuild_get_object_suffix(pTarget, pSource, pTool, pType, pBldTrg, pBldTrgArch, "objsuff");
    1337     struct variable *pDefs, *pIncs, *pFlags, *pDeps, *pDirDep, *pDep, *pVar, *pOutput;
     1337    struct variable *pDefs, *pIncs, *pFlags, *pDeps, *pOrderDeps, *pDirDep, *pDep, *pVar, *pOutput;
    13381338    struct variable *pObj       = kbuild_set_object_name_and_dep_and_dirdep_and_PATH_target_source(pTarget, pSource, pOutBase, pObjSuff, "obj", &pDep, &pDirDep);
    13391339    char *pszDstVar, *pszDst, *pszSrcVar, *pszSrc, *pszVal, *psz;
     
    13501350    if (pDefPath && !pDefPath->value_length)
    13511351        pDefPath = NULL;
    1352     pDefs  = kbuild_collect_source_prop(pTarget, pSource, pTool, &Sdks, pType, pBldType, pBldTrg, pBldTrgArch, pBldTrgCpu, NULL,
    1353                                         "DEFS", "defs", 1/* left-to-right */);
    1354     pIncs  = kbuild_collect_source_prop(pTarget, pSource, pTool, &Sdks, pType, pBldType, pBldTrg, pBldTrgArch, pBldTrgCpu, pDefPath,
    1355                                         "INCS", "incs", -1/* right-to-left */);
    1356     pFlags = kbuild_collect_source_prop(pTarget, pSource, pTool, &Sdks, pType, pBldType, pBldTrg, pBldTrgArch, pBldTrgCpu, NULL,
    1357                                         "FLAGS", "flags", 1/* left-to-right */);
    1358     pDeps  = kbuild_collect_source_prop(pTarget, pSource, pTool, &Sdks, pType, pBldType, pBldTrg, pBldTrgArch, pBldTrgCpu, pDefPath,
    1359                                         "DEPS", "deps", 1/* left-to-right */);
     1352    pDefs      = kbuild_collect_source_prop(pTarget, pSource, pTool, &Sdks, pType, pBldType, pBldTrg, pBldTrgArch, pBldTrgCpu, NULL,
     1353                                            "DEFS", "defs", 1/* left-to-right */);
     1354    pIncs      = kbuild_collect_source_prop(pTarget, pSource, pTool, &Sdks, pType, pBldType, pBldTrg, pBldTrgArch, pBldTrgCpu, pDefPath,
     1355                                            "INCS", "incs", -1/* right-to-left */);
     1356    pFlags     = kbuild_collect_source_prop(pTarget, pSource, pTool, &Sdks, pType, pBldType, pBldTrg, pBldTrgArch, pBldTrgCpu, NULL,
     1357                                            "FLAGS", "flags", 1/* left-to-right */);
     1358    pDeps      = kbuild_collect_source_prop(pTarget, pSource, pTool, &Sdks, pType, pBldType, pBldTrg, pBldTrgArch, pBldTrgCpu, pDefPath,
     1359                                            "DEPS", "deps", 1/* left-to-right */);
     1360    pOrderDeps = kbuild_collect_source_prop(pTarget, pSource, pTool, &Sdks, pType, pBldType, pBldTrg, pBldTrgArch, pBldTrgCpu, pDefPath,
     1361                                            "ORDERDEPS", "orderdeps", 1/* left-to-right */);
    13601362
    13611363    /*
     
    14291431    memcpy(pszDst, "_DEPORD_", sizeof("_DEPORD_"));
    14301432    pVar = kbuild_get_recursive_variable(pszSrcVar);
    1431     psz = pszVal = xmalloc(pVar->value_length + 1 + pDirDep->value_length + 1);
     1433    psz = pszVal = xmalloc(pVar->value_length + 1 + pDirDep->value_length + 1 + pOrderDeps->value_length + 1);
    14321434    memcpy(psz, pVar->value, pVar->value_length);       psz += pVar->value_length;
    14331435    *psz++ = ' ';
    1434     memcpy(psz, pDirDep->value, pDirDep->value_length + 1);
     1436    memcpy(psz, pDirDep->value, pDirDep->value_length); psz += pDirDep->value_length;
     1437    *psz++ = ' ';
     1438    memcpy(psz, pOrderDeps->value, pOrderDeps->value_length + 1);
    14351439    do_variable_definition(NILF, pszDstVar, pszVal, o_file, f_simple, 0 /* !target_var */);
    14361440    free(pszVal);
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