VirtualBox

Changeset 3030 in kBuild


Ignore:
Timestamp:
Apr 20, 2017 7:05:15 PM (8 years ago)
Author:
bird
Message:

header.kmk: Constructed a half-simple way of creating command dependencies for custom recipes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kBuild/header.kmk

    r2971 r3030  
    944944 KB_FN_ASSERT_ABSPATH :=
    945945endif
     946
     947
     948#
     949# Somewhat simple solution for automatic command dependencies.
     950#
     951
     952##
     953# Advanced version of KB_FN_AUTO_CMD_DEPS_COMMANDS_EX where you set
     954# the dependency file name yourself.
     955#
     956# After or before the recipe do $(call KB_FN_AUTO_CMD_DEPS_EX,<recipe-target>,<dep-file>).
     957#
     958# @param 1    dep file.
     959define KB_FN_AUTO_CMD_DEPS_COMMANDS_EX
     960        %$(QUIET2)$(RM) -f -- "$1"
     961       %$(QUIET2)$(APPEND) "$1" 'define AUTO_CMD_DEP_$(translate $@,:,_)_PREV_CMDS'
     962       %$(QUIET2)$(APPEND) -c "$1"  '$@'
     963       %$(QUIET2)$(APPEND) "$1" 'endef'
     964endef
     965
     966##
     967# Advanced version of KB_FN_AUTO_CMD_DEPS
     968#
     969# @param 1     recipe name
     970# @param 2     dep file.
     971KB_FN_AUTO_CMD_DEPS_EX = $(eval includedep $2)$(eval _DEPFILES_INCLUDED += $2)$1: .MUST_MAKE = $$(comp-cmds-ex $$(AUTO_CMD_DEP_$(translate $1,:,_)_PREV_CMDS),$$(commands $1),FORCE)
     972
     973##
     974# $(call KB_FN_AUTO_CMD_DEPS_COMMANDS) as the first command in a recipe to
     975# automatically generate command dependencies.
     976# After or before the recipe do $(call KB_FN_AUTO_CMD_DEPS,<recipe-target>).
     977define KB_FN_AUTO_CMD_DEPS_COMMANDS
     978        %$(QUIET2)$(RM) -f -- "[email protected]"
     979       %$(QUIET2)$(APPEND) "[email protected]" 'define AUTO_CMD_DEP_$(translate $@,:,_)_PREV_CMDS'
     980       %$(QUIET2)$(APPEND) -c "[email protected]"  '$@'
     981       %$(QUIET2)$(APPEND) "[email protected]" 'endef'
     982endef
     983
     984##
     985# Call before or after defining a recipe that you want automatic command
     986# dependencies on. The recipe must start off by $(call KB_FN_AUTO_CMD_DEPS_COMMANDS).
     987#
     988# @param 1     recipe name
     989KB_FN_AUTO_CMD_DEPS = $(call KB_FN_AUTO_CMD_DEPS_EX,$1,$1.auto-dep)
    946990
    947991
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