Changeset 3160


Ignore:
Timestamp:
Mar 19, 2018, 11:39:19 PM (7 years ago)
Author:
bird
Message:

kBuild//*.kmk: Use optimized kmk_builtin_append when availble.

Location:
trunk/kBuild
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/kBuild/footer-pass2-compiling-targets.kmk

    r3135 r3160  
    4747else
    4848 _DEP_COMPILE_CMDS =
    49 endif
    50 
    51 
    52 ## Temporary for the compile rule below.
    53 if "$(KBUILD_KMK_REVISION)" >= 3134
    54  KBUILD_HAVE_OPTIMIZED_APPEND := 1
    5549endif
    5650
  • trunk/kBuild/header.kmk

    r3121 r3160  
    971971#
    972972
     973## Temporary for the compile rule below.
     974if "$(KBUILD_KMK_REVISION)" >= 3134
     975 KBUILD_HAVE_OPTIMIZED_APPEND := 1
     976endif
     977
    973978##
    974979# Advanced version of KB_FN_AUTO_CMD_DEPS_COMMANDS_EX where you set
     
    978983#
    979984# @param 1    dep file.
     985ifdef KBUILD_HAVE_OPTIMIZED_APPEND
     986define KB_FN_AUTO_CMD_DEPS_COMMANDS_EX
     987        %$(QUIET2)$(APPEND) -tin "$1" \
     988                'define AUTO_CMD_DEP_$(translate $@,:,_)_PREV_CMDS' \
     989        '--insert-command=$@' \
     990        'endef'
     991endef
     992else
    980993define KB_FN_AUTO_CMD_DEPS_COMMANDS_EX
    981994        %$(QUIET2)$(RM) -f -- "$1"
    982        %$(QUIET2)$(APPEND) "$1" 'define AUTO_CMD_DEP_$(translate $@,:,_)_PREV_CMDS'
    983        %$(QUIET2)$(APPEND) -c "$1"  '$@'
    984        %$(QUIET2)$(APPEND) "$1" 'endef'
     995        %$(QUIET2)$(APPEND) "$1" 'define AUTO_CMD_DEP_$(translate $@,:,_)_PREV_CMDS'
     996        %$(QUIET2)$(APPEND) -c "$1"  '$@'
     997        %$(QUIET2)$(APPEND) "$1" 'endef'
    985998endef
     999endif
    9861000
    9871001##
     
    9961010# automatically generate command dependencies.
    9971011# After or before the recipe do $(call KB_FN_AUTO_CMD_DEPS,<recipe-target>).
     1012ifdef KBUILD_HAVE_OPTIMIZED_APPEND
     1013define KB_FN_AUTO_CMD_DEPS_COMMANDS
     1014        %$(QUIET2)$(APPEND) -tni "$@.auto-dep" \
     1015                'define AUTO_CMD_DEP_$(translate $@,:,_)_PREV_CMDS' \
     1016                '--insert-command="$@" \
     1017                'endef'
     1018endef
     1019else
    9981020define KB_FN_AUTO_CMD_DEPS_COMMANDS
    9991021        %$(QUIET2)$(RM) -f -- "$@.auto-dep"
     
    10021024       %$(QUIET2)$(APPEND) "$@.auto-dep" 'endef'
    10031025endef
     1026endif
    10041027
    10051028##
  • trunk/kBuild/units/dtrace.kmk

    r3121 r3160  
    7676
    7777ifndef NO_COMPILE_CMDS_DEPS
     78ifdef KBUILD_HAVE_OPTIMIZED_APPEND
     79        %$$(QUIET2)$$(APPEND) -ni '$(dep)' \
     80                'define $(target)_$(subst :,_,$(source))_DTRACE_HDR_CMDS_PREV_' \
     81                '--insert-command=$(out)' \
     82                'endef'
     83else
    7884        %$$(QUIET2)$$(APPEND) '$(dep)'
    7985        %$$(QUIET2)$$(APPEND) '$(dep)' 'define $(target)_$(subst :,_,$(source))_DTRACE_HDR_CMDS_PREV_'
    8086        %$$(QUIET2)$$(APPEND) -c '$(dep)' '$(out)'
    8187        %$$(QUIET2)$$(APPEND) '$(dep)' 'endef'
     88endif
    8289endif
    8390
     
    110117
    111118ifndef NO_COMPILE_CMDS_DEPS
     119ifdef KBUILD_HAVE_OPTIMIZED_APPEND
     120        %$$(QUIET2)$$(APPEND) -ni '$(dep)' \
     121                'define $(target)_$(subst :,_,$(source))_DTRACE_OBJ_CMDS_PREV_' \
     122                '--insert-command=$(out)' \
     123                'endef'
     124else
    112125        %$$(QUIET2)$$(APPEND) '$(dep)'
    113126        %$$(QUIET2)$$(APPEND) '$(dep)' 'define $(target)_$(subst :,_,$(source))_DTRACE_OBJ_CMDS_PREV_'
    114127        %$$(QUIET2)$$(APPEND) -c '$(dep)' '$(out)'
    115128        %$$(QUIET2)$$(APPEND) '$(dep)' 'endef'
     129endif
    116130endif
    117131
  • trunk/kBuild/units/lex.kmk

    r3121 r3160  
    7272
    7373ifndef NO_COMPILE_CMDS_DEPS
     74ifdef KBUILD_HAVE_OPTIMIZED_APPEND
     75        %$$(QUIET2)$$(APPEND) -ni '$(dep)' \
     76                'define $(target)_$(subst :,_,$(source))_LEX_CMDS_PREV_' \
     77                '--insert-command=$(out)' \
     78                'endef'
     79else
    7480        %$$(QUIET2)$$(APPEND) '$(dep)'
    7581        %$$(QUIET2)$$(APPEND) '$(dep)' 'define $(target)_$(subst :,_,$(source))_LEX_CMDS_PREV_'
    7682        %$$(QUIET2)$$(APPEND) -c '$(dep)' '$(out)'
    7783        %$$(QUIET2)$$(APPEND) '$(dep)' 'endef'
     84endif
    7885endif
    7986
  • trunk/kBuild/units/qt5.kmk

    r3121 r3160  
    455455                -o $(out)\
    456456                $(source)
    457         $(QUIET2)$(APPEND) $(dep) '\'
    458         $(QUIET2)$(APPEND) $(dep) '$(out): \'
    459         $(QUIET2)$(APPEND) $(dep) '$(source) \'
     457        $(QUIET2)$(APPEND) -n $(dep) '\' \
     458                '$(out): \' \
     459                '$(source) \'
    460460        $(QUIET2)$(SED) \
    461461                -e '/^[[:blank:]]*<file[[:blank:]][^>]*>/!d' \
     
    533533
    534534ifndef NO_COMPILE_CMDS_DEPS
     535ifdef KBUILD_HAVE_OPTIMIZED_APPEND
     536        %$$(QUIET2)$$(APPEND) -ni '$(dep)' \
     537                'define $(target)_$(subst :,_,$(source))_QT5_LRC_CMDS_PREV_' \
     538                '--insert-command=$(out)' \
     539                'endef'
     540else
    535541        %$$(QUIET2)$$(APPEND) '$(dep)'
    536542        %$$(QUIET2)$$(APPEND) '$(dep)' 'define $(target)_$(subst :,_,$(source))_QT5_LRC_CMDS_PREV_'
    537543        %$$(QUIET2)$$(APPEND) -c '$(dep)' '$(out)'
    538544        %$$(QUIET2)$$(APPEND) '$(dep)' 'endef'
     545endif
    539546endif
    540547
     
    621628        $(QUIET)$(CP) --changed -f $(out) $(realout)
    622629ifndef NO_COMPILE_CMDS_DEPS
     630ifdef KBUILD_HAVE_OPTIMIZED_APPEND
     631        %$$(QUIET2)$$(APPEND) -ni '$(dep)' \
     632                'define $(target)_$(subst :,_,$(source))_QT5_RCC_CMDS_PREV_' \
     633                '--insert-command=$(out)' \
     634                'endef'
     635else
    623636        %$$(QUIET2)$$(APPEND) '$(dep)'
    624637        %$$(QUIET2)$$(APPEND) '$(dep)' 'define $(target)_$(subst :,_,$(source))_QT5_RCC_CMDS_PREV_'
    625638        %$$(QUIET2)$$(APPEND) -c '$(dep)' '$(out)'
    626639        %$$(QUIET2)$$(APPEND) '$(dep)' 'endef'
     640endif
    627641endif
    628642
     
    708722        $(QUIET)$(CP) --changed -f $(out) $(realout)
    709723ifndef NO_COMPILE_CMDS_DEPS
     724ifdef KBUILD_HAVE_OPTIMIZED_APPEND
     725        %$$(QUIET2)$$(APPEND) -ni '$(dep)' \
     726                'define $(target)_$(subst :,_,$(source))_QT5_UIC_CMDS_PREV_' \
     727                '--insert-command=$(out)' \
     728                'endef'
     729else
    710730        %$$(QUIET2)$$(APPEND) '$(dep)'
    711731        %$$(QUIET2)$$(APPEND) '$(dep)' 'define $(target)_$(subst :,_,$(source))_QT5_UIC_CMDS_PREV_'
    712732        %$$(QUIET2)$$(APPEND) -c '$(dep)' '$(out)'
    713733        %$$(QUIET2)$$(APPEND) '$(dep)' 'endef'
     734endif
    714735endif
    715736
     
    794815        $(QUIET)$(CP) --changed -f $(out) $(realout)
    795816ifndef NO_COMPILE_CMDS_DEPS
     817ifdef KBUILD_HAVE_OPTIMIZED_APPEND
     818        %$$(QUIET2)$$(APPEND) -ni '$(dep)' \
     819                'define $(target)_$(subst :,_,$(source))_QT5_MOC_HPP_CMDS_PREV_' \
     820                '--insert-command=$(out)' \
     821                'endef'
     822else
    796823        %$$(QUIET2)$$(APPEND) '$(dep)'
    797824        %$$(QUIET2)$$(APPEND) '$(dep)' 'define $(target)_$(subst :,_,$(source))_QT5_MOC_HPP_CMDS_PREV_'
    798825        %$$(QUIET2)$$(APPEND) -c '$(dep)' '$(out)'
    799826        %$$(QUIET2)$$(APPEND) '$(dep)' 'endef'
     827endif
    800828endif
    801829
     
    887915        $(QUIET)$(CP) --changed -f $(out) $(realout)
    888916ifndef NO_COMPILE_CMDS_DEPS
     917ifdef KBUILD_HAVE_OPTIMIZED_APPEND
     918        %$$(QUIET2)$$(APPEND) -ni '$(dep)' \
     919                'define $(target)_$(subst :,_,$(source))_QT5_MOC_CPP_CMDS_PREV_' \
     920                '--insert-command=$(out)' \
     921                'endef'
     922else
    889923        %$$(QUIET2)$$(APPEND) '$(dep)'
    890924        %$$(QUIET2)$$(APPEND) '$(dep)' 'define $(target)_$(subst :,_,$(source))_QT5_MOC_CPP_CMDS_PREV_'
    891925        %$$(QUIET2)$$(APPEND) -c '$(dep)' '$(out)'
    892926        %$$(QUIET2)$$(APPEND) '$(dep)' 'endef'
     927endif
    893928endif
    894929
Note: See TracChangeset for help on using the changeset viewer.