jdk/make/common/internal/Resources.gmk
author kvn
Wed, 05 Mar 2008 11:33:31 -0800
changeset 210 6da234892f4a
parent 2 90ce3da70b43
child 1820 04d22534971a
permissions -rw-r--r--
6671250: In Parse::do_if() old Cmp node 'c' should be replaced with new one after BoolNode transformation Summary: In Parse::do_if() 'c' (CmpNode) node may be changed during BoolNode transformation so 'c' may became dead but the node is referenced later in the code. Reviewed-by: never
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
     2
# Copyright 1997-2007 Sun Microsystems, Inc.  All Rights Reserved.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
# This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
# under the terms of the GNU General Public License version 2 only, as
90ce3da70b43 Initial load
duke
parents:
diff changeset
     7
# published by the Free Software Foundation.  Sun designates this
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
# particular file as subject to the "Classpath" exception as provided
90ce3da70b43 Initial load
duke
parents:
diff changeset
     9
# by Sun in the LICENSE file that accompanied this code.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
# This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
# version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
# accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
# You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
# 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    21
# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    22
# CA 95054 USA or visit www.sun.com if you need additional information or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    23
# have any questions.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
# 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
# Generic mechanism for installing properties files, resource bundles,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
#   and other resource files.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
# FILES_properties should be defined.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
# FILES_compiled_properties should be defined.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
# 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
# If COMPILED_PROPERTIES_SUPERCLASS is defined, ALL the FILES_properties
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
# files will be compiled into java with this super class.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
# You can add locales to LOCALE_SUFFIXES explicitly, or use the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
# LOCALE_SET_DEFINITION variable to add some pre-defined locale lists.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
# The LOCALE_SET_DEFINITION can have the value: jre, plugin, or jdk.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
# Resource bundles to be installed are identified using the following variables.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
# Note that only the file name of the base bundle is given; localized versions
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
# are added automatically. For Java files, use a format suitable for inclusion
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
# in the FILES_java list; dito for properties, all relative paths.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
#   NEW_RESOURCE_BUNDLES_JAVA        - new resource bundles implemented in
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
#                                      Java, not localized
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
#   NEW_RESOURCE_BUNDLES_PROPERTIES  - new resource bundles implemented as
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
#                                      properties files, not localized
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
#   RESOURCE_BUNDLES_JAVA            - resource bundles implemented in
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
#                                      Java, localized
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
#   RESOURCE_BUNDLES_PROPERTIES      - new resource bundles implemented as
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
#                                      properties files, localized
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
# The following variable is now used for most .properties files in the JDK. 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
# These properties files are converted into java and compiled with javac.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
# The resulting .class files are usually smaller and are always faster to load. 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
# The relative path to the properties file becomes a relative path to a
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
# java source file.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
#   RESOURCE_BUNDLES_COMPILED_PROPERTIES - resource bundles implemented as
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
#                                          properties files, localized
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
#   NEW_RESOURCE_BUNDLES_COMPILED_PROPERTIES - same as above, not localized
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
# Other properties files to be installed are identified using the variable:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
#   OTHER_PROPERTIES
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
# Compile properties files into java source?
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
ifdef COMPILED_PROPERTIES_SUPERCLASS
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
  # Add all properties files to the compiled properties list (all or nothing)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
  COMPILED_PROPERTIES += $(FILES_compiled_properties) $(FILES_properties)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
else
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
  COMPILED_PROPERTIES_SUPERCLASS = ListResourceBundle
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
  COMPILED_PROPERTIES += $(FILES_compiled_properties)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
# Determine the locale suffixes needed beyond the base bundle
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
ifeq ($(LOCALE_SET_DEFINITION), plugin)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
  LOCALE_SUFFIXES += $(PLUGIN_LOCALES)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
ifeq ($(LOCALE_SET_DEFINITION), jdk)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
  LOCALE_SUFFIXES += $(JDK_LOCALES)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
ifeq ($(LOCALE_SET_DEFINITION), jre)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
  LOCALE_SUFFIXES += $(JRE_LOCALES)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
# Java files get tacked onto the standard list of files to compile
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
RESOURCE_BUNDLE_FILES_java += $(NEW_RESOURCE_BUNDLES_JAVA)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
RESOURCE_BUNDLE_FILES_java += $(RESOURCE_BUNDLES_JAVA) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
    $(foreach file,$(RESOURCE_BUNDLES_JAVA), \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
       $(foreach locale,$(LOCALE_SUFFIXES), \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
	  $(basename $(file))_$(locale).java))
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
# Add to java sources list
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
FILES_java += $(RESOURCE_BUNDLE_FILES_java)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
# Compiled properties files are translated to .java.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
#   The .java files are generated into GENSRCDIR.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
COMPILED_PROPERTIES += $(NEW_RESOURCE_BUNDLES_COMPILED_PROPERTIES)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
COMPILED_PROPERTIES += $(RESOURCE_BUNDLES_COMPILED_PROPERTIES) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
    $(foreach file,$(RESOURCE_BUNDLES_COMPILED_PROPERTIES),\
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
      $(foreach locale,$(LOCALE_SUFFIXES),\
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
	 $(basename $(file))_$(locale)$(suffix $(file))))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
# Add to java sources list
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
FILES_java += $(COMPILED_PROPERTIES:%.properties=%.java)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
# Non-compiled files
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
PROPERTIES_FILES += $(NEW_RESOURCE_BUNDLES_PROPERTIES)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
PROPERTIES_FILES += $(RESOURCE_BUNDLES_PROPERTIES) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
    $(foreach file,$(RESOURCE_BUNDLES_PROPERTIES), \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
       $(foreach locale,$(LOCALE_SUFFIXES), \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
	  $(basename $(file))_$(locale)$(suffix $(file))))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
PROPERTIES_FILES += $(OTHER_PROPERTIES)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
# Compile Properties tool
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
COMPILEPROPERTIES_JARFILE = $(BUILDTOOLJARDIR)/compileproperties.jar
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
# Strip Properties tool
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
STRIPPROPERTIES_JARFILE = $(BUILDTOOLJARDIR)/stripproperties.jar
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
# Process and strip all non-compiled properties files (in a batch mode)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
STRIP_PROP_FILES = $(PROPERTIES_FILES:%=$(CLASSDESTDIR)/%)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
# To efficiently strip properties we use one run of StripProperties. 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
# This macro gathers an option for use later.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
STRIP_PROP_options=$(TEMPDIR)/strip_prop_options
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
define install-properties-file
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
$(install-file)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
$(CHMOD) a+rw $@
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
@$(ECHO) "# Adding to strip properties list: $@"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
$(ECHO) "$@" >> $(STRIP_PROP_options)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
endef
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
# Constructs command line options file
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
$(STRIP_PROP_options): $(STRIP_PROP_FILES)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
	@$(TOUCH) $@
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
strip_prop_options_clean:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
	@$(RM) $(STRIP_PROP_options)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
# Strip the properties files
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
strip_all_props: $(STRIPPROPERTIES_JARFILE) $(STRIP_PROP_options)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
	@if [ -s $(STRIP_PROP_options) ] ; then \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
          $(ECHO) "$(BOOT_JAVA_CMD) -jar $(STRIPPROPERTIES_JARFILE) -optionsfile $(STRIP_PROP_options)" ; \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
          $(BOOT_JAVA_CMD) -jar $(STRIPPROPERTIES_JARFILE) -optionsfile $(STRIP_PROP_options) ; \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
        fi
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
	@$(java-vm-cleanup)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
# Creates files in CLASSDESTDIR
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
# In some cases, we move files from package to resources subdir
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
$(CLASSDESTDIR)/$(PKGDIR)/resources/%.properties: \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
	     $(SHARE_SRC)/classes/$(PKGDIR)/%.properties
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
	$(install-properties-file)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
$(CLASSDESTDIR)/%.properties: $(SHARE_SRC)/classes/%.properties
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
	$(install-properties-file)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
$(CLASSDESTDIR)/%.res: $(SHARE_SRC)/classes/%.res
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
	$(install-file)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
$(CLASSDESTDIR)/%.dtd: $(SHARE_SRC)/classes/%.dtd
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
	$(install-file)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
$(CLASSDESTDIR)/%.xml: $(SHARE_SRC)/classes/%.xml
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
	$(install-file)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
$(CLASSDESTDIR)/%.prp: $(SHARE_SRC)/classes/%.prp
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
	$(install-file)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
# To efficiently compile properties into java sources we use one run
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
#   of compileproperties. This macro gathers an option for use later.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
#   Note: The properties file and java source name can be different
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
#         locales, e.g. zh_TW and zh_HK. The java source filename
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
#         determines the name of the class.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
COMPILE_PROP_options=$(TEMPDIR)/compile_prop_options
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
define add-property-java-file
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
@$(prep-target)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
@$(ECHO) "# Adding to compile properties list: $? -> $@"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
$(ECHO) "-compile $? $@ $(COMPILED_PROPERTIES_SUPERCLASS)" \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
   >> $(COMPILE_PROP_options)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
endef
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
$(GENSRCDIR)/%.java: $(PLATFORM_SRC)/classes/%.properties
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
	$(add-property-java-file)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
$(GENSRCDIR)/%.java: $(SHARE_SRC)/classes/%.properties
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
	$(add-property-java-file)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
$(GENSRCDIR)/%.java: $(GENSRCDIR)/%.properties
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
	$(add-property-java-file)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
ifndef OPENJDK
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
$(GENSRCDIR)/%.java: $(CLOSED_PLATFORM_SRC)/classes/%.properties
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
	$(add-property-java-file)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
$(GENSRCDIR)/%.java: $(CLOSED_SHARE_SRC)/classes/%.properties
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
	$(add-property-java-file)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
# Create HK java file from zh_TW (explicit resource bundles only)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
define create-hk-java-file
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
@$(prep-target)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
$(CAT) $< | $(SED) -e '/class/s/_zh_TW/_zh_HK/' > $@
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
endef
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
# Explicit resource bundles
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
$(GENSRCDIR)/%_zh_HK.java: $(PLATFORM_SRC)/classes/%_zh_TW.java
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
	$(create-hk-java-file)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
$(GENSRCDIR)/%_zh_HK.java: $(SHARE_SRC)/classes/%_zh_TW.java
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
	$(create-hk-java-file)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
# Compile of zh_HK properties just uses the zh_TW properties files
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
$(GENSRCDIR)/%_zh_HK.java: $(PLATFORM_SRC)/classes/%_zh_TW.properties
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
	$(add-property-java-file)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
$(GENSRCDIR)/%_zh_HK.java: $(SHARE_SRC)/classes/%_zh_TW.properties
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
	$(add-property-java-file)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
# Simple delivery of zh_HK properties files just copies zh_TW properties files
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
$(CLASSDESTDIR)/%_zh_HK.properties: \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
             $(PLATFORM_SRC)/classes/%_zh_TW.properties
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
	$(install-properties-file)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
$(CLASSDESTDIR)/%_zh_HK.properties: \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
             $(SHARE_SRC)/classes/%_zh_TW.properties
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
	$(install-properties-file)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
# List of java files converted from properties files needed
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
COMPILE_PROP_JAVA_FILES = $(COMPILED_PROPERTIES:%.properties=$(GENSRCDIR)/%.java)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
# Constructs command line options file
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
$(COMPILE_PROP_options): $(COMPILE_PROP_JAVA_FILES)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
	@$(TOUCH) $@
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
compile_prop_options_clean:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
	@$(RM) $(COMPILE_PROP_options)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
# Make sure all are compiled, one compiler run
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
compile_all_props: $(COMPILEPROPERTIES_JARFILE) $(COMPILE_PROP_options)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   240
	@if [ `$(CAT) $(COMPILE_PROP_options) | $(WC) -l` -ge 1 ] ; then \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   241
	  $(MKDIR) -p $(GENSRCDIR); \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   242
	  $(ECHO) "$(BOOT_JAVA_CMD) -jar $(COMPILEPROPERTIES_JARFILE) -optionsfile $(COMPILE_PROP_options)";\
90ce3da70b43 Initial load
duke
parents:
diff changeset
   243
	  $(BOOT_JAVA_CMD) -jar $(COMPILEPROPERTIES_JARFILE) -optionsfile $(COMPILE_PROP_options) ; \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   244
	  $(java-vm-cleanup); \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   245
	fi
90ce3da70b43 Initial load
duke
parents:
diff changeset
   246
90ce3da70b43 Initial load
duke
parents:
diff changeset
   247
# Make sure the build rule creates all the properties
90ce3da70b43 Initial load
duke
parents:
diff changeset
   248
resources:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   249
90ce3da70b43 Initial load
duke
parents:
diff changeset
   250
ifneq ($(PROPERTIES_FILES),)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   251
  resources: strip_prop_options_clean   strip_all_props
90ce3da70b43 Initial load
duke
parents:
diff changeset
   252
  clobber clean:: 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   253
	$(RM) $(STRIP_PROP_FILES) $(STRIP_PROP_options)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   254
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   255
90ce3da70b43 Initial load
duke
parents:
diff changeset
   256
ifneq ($(COMPILED_PROPERTIES),)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   257
  resources: compile_prop_options_clean compile_all_props
90ce3da70b43 Initial load
duke
parents:
diff changeset
   258
  clobber clean:: 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   259
	$(RM) $(COMPILE_PROP_JAVA_FILES) $(COMPILE_PROP_options)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   260
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   261
90ce3da70b43 Initial load
duke
parents:
diff changeset
   262
.PHONY: resources \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   263
	compile_prop_options_clean compile_all_props \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   264
	strip_prop_options_clean   strip_all_props
90ce3da70b43 Initial load
duke
parents:
diff changeset
   265