Changeset 530 for trunk/kBuild


Ignore:
Timestamp:
Sep 17, 2006, 10:38:57 PM (19 years ago)
Author:
bird
Message:

Added kBuild specific functions for speeding up source processing.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kBuild/footer.kmk

    r524 r530  
    2727ifndef __footer_kmk__
    2828# start-of-file-content
     29
     30#
     31# Make sure that the core variables we defined in recursive expansion mode
     32# up in header.kmk get expanded before we really start using them. The kBuild
     33# functions added to kmk to speed stuff up assumes that the variables are
     34# expanded here.
     35#
     36PATH_OBJ    := $(PATH_OBJ)
     37PATH_TARGET := $(PATH_TARGET)
     38PATH_INS    := $(PATH_INS)
     39PATH_BIN    := $(PATH_BIN)
     40PATH_DLL    := $(PATH_DLL)
     41PATH_SYS    := $(PATH_SYS)
     42PATH_LIB    := $(PATH_LIB)
     43PATH_DOC    := $(PATH_DOC)
    2944
    3045#
     
    109124        $($(target)_$(source)_TOOL.$(bld_trg)) \
    110125        $($(target)_$(source)_TOOL) \
     126        $($(source)_$(type)TOOL.$(bld_trg).$(bld_trg_arch)) \
     127        $($(source)_$(type)TOOL.$(bld_trg)) \
     128        $($(source)_$(type)TOOL) \
     129        $($(source)_TOOL.$(bld_trg).$(bld_trg_arch)) \
     130        $($(source)_TOOL.$(bld_trg)) \
     131        $($(source)_TOOL) \
    111132        $($(target)_$(type)TOOL.$(bld_trg).$(bld_trg_arch)) \
    112133        $($(target)_$(type)TOOL.$(bld_trg)) \
     
    115136        $($(target)_TOOL.$(bld_trg)) \
    116137        $($(target)_TOOL) \
    117         $($(source)_$(type)TOOL.$(bld_trg).$(bld_trg_arch)) \
    118         $($(source)_$(type)TOOL.$(bld_trg)) \
    119         $($(source)_$(type)TOOL) \
    120         $($(source)_TOOL.$(bld_trg).$(bld_trg_arch)) \
    121         $($(source)_TOOL.$(bld_trg)) \
    122         $($(source)_TOOL) \
    123138        $($(type)TOOL.$(bld_trg).$(bld_trg_arch)) \
    124139        $($(type)TOOL.$(bld_trg)) \
     
    480495## wrapper the compile command dependency check.
    481496ifndef NO_COMPILE_CMDS_DEPS
     497 ifdef NEW_KMK
     498_DEP_COMPILE_CMDS = $(comp-vars $(target)_$(source)_CMDS_PREV_,$(target)_$(source)_CMDS_,FORCE)
     499 else
    482500_DEP_COMPILE_CMDS = $(if $(subst $(strip $($(target)_$(source)_CMDS_PREV_)),,$(strip $($(target)_$(source)_CMDS_))),FORCE,)
     501 endif
    483502else
    484503_DEP_COMPILE_CMDS =
     
    577596# @param    bld_trg_cpu   Build target cpu.
    578597#
    579 # @remark   I've no clue why I've to $(eval ..) everything in this define. MAKE bug?
    580 # @remark       I now have a clue. Have to use $$ if not.
    581 define def_target_source_c_cpp_asm
     598define def_target_source_c_cpp_asm_old
    582599#$ (warning dbg: def_target_source_c_cpp_asm: source='$(source)' target='$(target)' type='$(type)')
    583600
     
    937954endef
    938955
     956## Generic macro for processing C, C++ and Assembly sources.
     957# @param    $(target)     Normalized target name.
     958# @param    $(source)     Source file name.
     959# @param    $(type)       Source type. {C,CXX,AS}
     960# @param    bld_type      Build type.
     961# @param    bld_trg       Build target.
     962# @param    bld_trg_arch  Build target arch.
     963# @param    bld_trg_cpu   Build target cpu.
     964#
     965#$ (warning dbg: def_target_source_c_cpp_asm: source='$(source)' target='$(target)' type='$(type)')
     966def_target_source_c_cpp_asm_new = $(kb-src-one x)
     967
     968ifdef NEW_KMK
     969def_target_source_c_cpp_asm_var = def_target_source_c_cpp_asm_new
     970else
     971def_target_source_c_cpp_asm_var = def_target_source_c_cpp_asm_old
     972endif
     973
    939974## Generic macro for processing all target sources.
    940975# @param    $(target)   Normalized target name.
     
    944979type := C
    945980$(foreach source, $(filter %.c             , $($(target)_SOURCES) $($(target)_SOURCES.$(bld_trg)) $($(target)_SOURCES.$(bld_trg).$(bld_trg_arch)) $($(target)_SOURCES.$(bld_trg_arch)) $($(target)_SOURCES.$(bld_trg_cpu)) $($(target)_SOURCES.$(bld_type)))\
    946         ,$(eval $(value def_target_source_c_cpp_asm)) )
     981   ,$(eval $(value $(def_target_source_c_cpp_asm_var))) )
    947982
    948983# C++ sources
    949984type := CXX
    950985$(foreach source, $(filter %.cpp %.cxx %.xx, $($(target)_SOURCES) $($(target)_SOURCES.$(bld_trg)) $($(target)_SOURCES.$(bld_trg).$(bld_trg_arch)) $($(target)_SOURCES.$(bld_trg_arch)) $($(target)_SOURCES.$(bld_trg_cpu)) $($(target)_SOURCES.$(bld_type)))\
    951         ,$(eval $(value def_target_source_c_cpp_asm)) )
     986        ,$(eval $(value $(def_target_source_c_cpp_asm_var))) )
    952987
    953988# ASM sources
    954989type := AS
    955990$(foreach source, $(filter %.asm %.s %.S   , $($(target)_SOURCES) $($(target)_SOURCES.$(bld_trg)) $($(target)_SOURCES.$(bld_trg).$(bld_trg_arch)) $($(target)_SOURCES.$(bld_trg_arch)) $($(target)_SOURCES.$(bld_trg_cpu)) $($(target)_SOURCES.$(bld_type)))\
    956         ,$(eval $(value def_target_source_c_cpp_asm)) )
     991        ,$(eval $(value $(def_target_source_c_cpp_asm_var))) )
    957992
    958993endef
Note: See TracChangeset for help on using the changeset viewer.