VirtualBox

Changeset 34566 in vbox


Ignore:
Timestamp:
Dec 1, 2010 1:01:11 PM (14 years ago)
Author:
vboxsync
Message:

Config.kmk: Added VBOX_EDIT_VERSION_RULE_FN and VBOX_EDIT_VERSION_CMD_FN for doing version string replacements in files.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Config.kmk

    r34511 r34566  
    18021802endif
    18031803
     1804
    18041805#
    18051806# The X11 headers.
     
    18141815VBOX_PATH_X11_XORG_1_6  = $(VBOX_PATH_X11_ROOT)/1.6
    18151816
    1816 #
    1817 # Various other variables.
    1818 #
    18191817
    18201818#
     
    20262024 endif
    20272025endif
     2026
     2027
     2028#
     2029# Edit macros.
     2030#
     2031
     2032##
     2033# Edits VirtualBox version, vendor and package strings in a text file.
     2034#
     2035# The rule using this must list $(VBOX_SVN_REV_KMK) as a prerequisite.
     2036#
     2037# @param    1        The input filename.
     2038# @param    2        The output filename.
     2039#
     2040VBOX_EDIT_VERSION_CMD_FN = $(SED) \
     2041        -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \
     2042        -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \
     2043        -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \
     2044        -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \
     2045        -e 's/@VBOX_SVN_REV@/$(VBOX_SVN_REV)/g' \
     2046        -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \
     2047        -e 's/@VBOX_VENDOR_SHORT@/$(VBOX_VENDOR_SHORT)/g' \
     2048        -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \
     2049        -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \
     2050        -e 's/@VBOX_PACKAGE_STRING@/$(VBOX_PACKAGE_STRING)/g' \
     2051        --output $(2) $(1)
     2052
     2053##
     2054# Generates a rule for editing a file using VBOX_EDIT_VERSION_CMD_FN.
     2055#
     2056# @param    1        The target name.
     2057# @param    2        The input filename relative to the current sub-makefile.
     2058# @param    3        The output filename relative to the target output dir.
     2059#                    Optional, defaults to 2.
     2060#
     2061VBOX_EDIT_VERSION_RULE_FN = $(eval $(value VBOX_EDIT_VERSION_RULE_DEF))
     2062define VBOX_EDIT_VERSION_RULE_DEF
     2063$$($(1)_0_OUTDIR)/$(if $(3),$(3),$(2)): $(PATH_SUB_CURRENT)/$(2) $(VBOX_SVN_REV_KMK) | $$(dir $$@)
     2064        $(call MSG_GENERATE,$(1),$@,$<)
     2065        $(QUIET)$(call VBOX_EDIT_VERSION_CMD_FN,$<,$@)
     2066endef
     2067
    20282068
    20292069#
     
    44664506# Subversion tree revision.
    44674507#
    4468 # The VBOX_SVN_REV contains our best guess. Use svn info on the
    4469 # root of the treeto determin this it if .svn/entries is found,
    4470 # otherwise fall back on the Config.kmk revision.
     4508# The VBOX_SVN_REV contains our best guess.  Use svn info on the root of the
     4509# tree to determin this it if .svn/entries is found, otherwise fall back on
     4510# the Config.kmk revision.
     4511#
     4512# Makefile rules using this information shall list $(VBOX_SVN_REV_KMK) as a
     4513# prerequisite.
    44714514#
    44724515SVN                    ?= svn$(HOSTSUFF_EXE)
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