< prev index next >

make/gensrc/GensrcProperties.gmk

Print this page


   1 #
   2 # Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
   3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4 #
   5 # This code is free software; you can redistribute it and/or modify it
   6 # under the terms of the GNU General Public License version 2 only, as
   7 # published by the Free Software Foundation.  Oracle designates this
   8 # particular file as subject to the "Classpath" exception as provided
   9 # by Oracle in the LICENSE file that accompanied this code.
  10 #
  11 # This code is distributed in the hope that it will be useful, but WITHOUT
  12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13 # FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14 # version 2 for more details (a copy is included in the LICENSE file that
  15 # accompanied this code).
  16 #
  17 # You should have received a copy of the GNU General Public License version
  18 # 2 along with this work; if not, write to the Free Software Foundation,
  19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20 #
  21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22 # or visit www.oracle.com if you need additional information or have any


  51 ################################################################################
  52 # Setup make rules that runs CompileProperties on a set of properties files.
  53 #
  54 # Parameter 1 is the name of the rule. This name is used as variable prefix,
  55 # and the targets generated are listed in a variable by that name.
  56 #
  57 # Remaining parameters are named arguments. These include:
  58 # SRC_DIRS   Directories containing properties files to process.
  59 # EXCLUDE   Exclude files matching this pattern.
  60 # CLASS   The super class for the generated classes.
  61 # MODULE_PATH_ROOT   Module path root, defaults to $(TOPDIR)/src.
  62 # KEEP_ALL_TRANSLATIONS Set to true to skip filtering of excluded translations.
  63 SetupCompileProperties = $(NamedParamsMacroTemplate)
  64 define SetupCompilePropertiesBody
  65   # Set default value unless overridden
  66   ifeq ($$($1_MODULE_PATH_ROOT), )
  67     $1_MODULE_PATH_ROOT := $(TOPDIR)/src
  68   endif
  69 
  70   # Locate all properties files in the given source dirs.
  71   $1_SRC_FILES := $$(call FindFiles, $$($1_SRC_DIRS), *.properties)
  72 
  73   ifneq ($$($1_EXCLUDE), )
  74     $1_SRC_FILES := $$(filter-out $$($1_EXCLUDE), $$($1_SRC_FILES))
  75   endif
  76 
  77   # Filter out any excluded translations
  78   ifneq ($$($1_KEEP_ALL_TRANSLATIONS), true)
  79     $1_SRC_FILES := $$(call FilterExcludedTranslations, $$($1_SRC_FILES), .properties)
  80   endif
  81 
  82   # Convert .../src/<module>/share/classes/com/sun/tools/javac/resources/javac_zh_CN.properties
  83   # to .../support/gensrc/<module>/com/sun/tools/javac/resources/javac_zh_CN.java
  84   $1_JAVAS := $$(patsubst $$($1_MODULE_PATH_ROOT)/%, \
  85       $(SUPPORT_OUTPUTDIR)/gensrc/%, \
  86       $$(patsubst %.properties, %.java, \
  87       $$(subst /$(OPENJDK_TARGET_OS)/classes,, \
  88       $$(subst /$(OPENJDK_TARGET_OS_TYPE)/classes,, \
  89       $$(subst /share/classes,, $$($1_SRC_FILES))))))
  90 
  91   # Generate the package dirs for the to be generated java files. Sort to remove


   1 #
   2 # Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
   3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4 #
   5 # This code is free software; you can redistribute it and/or modify it
   6 # under the terms of the GNU General Public License version 2 only, as
   7 # published by the Free Software Foundation.  Oracle designates this
   8 # particular file as subject to the "Classpath" exception as provided
   9 # by Oracle in the LICENSE file that accompanied this code.
  10 #
  11 # This code is distributed in the hope that it will be useful, but WITHOUT
  12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13 # FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14 # version 2 for more details (a copy is included in the LICENSE file that
  15 # accompanied this code).
  16 #
  17 # You should have received a copy of the GNU General Public License version
  18 # 2 along with this work; if not, write to the Free Software Foundation,
  19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20 #
  21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22 # or visit www.oracle.com if you need additional information or have any


  51 ################################################################################
  52 # Setup make rules that runs CompileProperties on a set of properties files.
  53 #
  54 # Parameter 1 is the name of the rule. This name is used as variable prefix,
  55 # and the targets generated are listed in a variable by that name.
  56 #
  57 # Remaining parameters are named arguments. These include:
  58 # SRC_DIRS   Directories containing properties files to process.
  59 # EXCLUDE   Exclude files matching this pattern.
  60 # CLASS   The super class for the generated classes.
  61 # MODULE_PATH_ROOT   Module path root, defaults to $(TOPDIR)/src.
  62 # KEEP_ALL_TRANSLATIONS Set to true to skip filtering of excluded translations.
  63 SetupCompileProperties = $(NamedParamsMacroTemplate)
  64 define SetupCompilePropertiesBody
  65   # Set default value unless overridden
  66   ifeq ($$($1_MODULE_PATH_ROOT), )
  67     $1_MODULE_PATH_ROOT := $(TOPDIR)/src
  68   endif
  69 
  70   # Locate all properties files in the given source dirs.
  71   $1_SRC_FILES := $$(filter %.properties, $$(call CacheFind, $$($1_SRC_DIRS)))
  72 
  73   ifneq ($$($1_EXCLUDE), )
  74     $1_SRC_FILES := $$(filter-out $$($1_EXCLUDE), $$($1_SRC_FILES))
  75   endif
  76 
  77   # Filter out any excluded translations
  78   ifneq ($$($1_KEEP_ALL_TRANSLATIONS), true)
  79     $1_SRC_FILES := $$(call FilterExcludedTranslations, $$($1_SRC_FILES), .properties)
  80   endif
  81 
  82   # Convert .../src/<module>/share/classes/com/sun/tools/javac/resources/javac_zh_CN.properties
  83   # to .../support/gensrc/<module>/com/sun/tools/javac/resources/javac_zh_CN.java
  84   $1_JAVAS := $$(patsubst $$($1_MODULE_PATH_ROOT)/%, \
  85       $(SUPPORT_OUTPUTDIR)/gensrc/%, \
  86       $$(patsubst %.properties, %.java, \
  87       $$(subst /$(OPENJDK_TARGET_OS)/classes,, \
  88       $$(subst /$(OPENJDK_TARGET_OS_TYPE)/classes,, \
  89       $$(subst /share/classes,, $$($1_SRC_FILES))))))
  90 
  91   # Generate the package dirs for the to be generated java files. Sort to remove


< prev index next >