jdk/make/common/internal/Resources.gmk
author ohair
Tue, 10 Apr 2012 08:22:03 -0700
changeset 12317 9670c1610c53
parent 7668 d4a77089c587
child 12656 6028fff5b8f7
permissions -rw-r--r--
7074397: Build infrastructure changes (makefile re-write) Summary: New makefiles transition, old and new living side by side for now. Reviewed-by: ohair, jjg, dholmes, ohrstrom, erikj, ihse, tgranat, ykantser Contributed-by: ohrstrom <fredrik.ohrstrom@oracle.com>, erikj <erik.joelsson@oracle.com>, ihse <magnus.ihse.bursie@oracle.com>, tgranat <torbjorn.granat@oracle.com>, ykantser <yekaterina.kantserova@oracle.com>
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
#
7668
d4a77089c587 6962318: Update copyright year
ohair
parents: 6785
diff changeset
     2
# Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
2
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
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 4665
diff changeset
     7
# published by the Free Software Foundation.  Oracle designates this
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
# particular file as subject to the "Classpath" exception as provided
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 4665
diff changeset
     9
# by Oracle in the LICENSE file that accompanied this code.
2
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
#
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 4665
diff changeset
    21
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 4665
diff changeset
    22
# or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 4665
diff changeset
    23
# questions.
2
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
#   RESOURCE_BUNDLES_JAVA            - resource bundles implemented in
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
#                                      Java, localized
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
# The following variable is now used for most .properties files in the JDK. 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
# These properties files are converted into java and compiled with javac.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
# The resulting .class files are usually smaller and are always faster to load. 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
# The relative path to the properties file becomes a relative path to a
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
# java source file.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
#   RESOURCE_BUNDLES_COMPILED_PROPERTIES - resource bundles implemented as
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
#                                          properties files, localized
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
#   NEW_RESOURCE_BUNDLES_COMPILED_PROPERTIES - same as above, not localized
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
#
1820
04d22534971a 6793429: Use compiled properties instead of plain properties for resource file
mchung
parents: 2
diff changeset
    60
# For non-compiled properties files, use the following variables:
04d22534971a 6793429: Use compiled properties instead of plain properties for resource file
mchung
parents: 2
diff changeset
    61
#
04d22534971a 6793429: Use compiled properties instead of plain properties for resource file
mchung
parents: 2
diff changeset
    62
#   NEW_RESOURCE_BUNDLES_UNCOMPILED_PROPERTIES  - new resource bundles implemented as
04d22534971a 6793429: Use compiled properties instead of plain properties for resource file
mchung
parents: 2
diff changeset
    63
#                                      properties files, not localized
04d22534971a 6793429: Use compiled properties instead of plain properties for resource file
mchung
parents: 2
diff changeset
    64
#   RESOURCE_BUNDLES_UNCOMPILED_PROPERTIES      - resource bundles implemented as
04d22534971a 6793429: Use compiled properties instead of plain properties for resource file
mchung
parents: 2
diff changeset
    65
#                                      properties files, localized
04d22534971a 6793429: Use compiled properties instead of plain properties for resource file
mchung
parents: 2
diff changeset
    66
#
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
# Other properties files to be installed are identified using the variable:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
#   OTHER_PROPERTIES
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
# Compile properties files into java source?
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
ifdef COMPILED_PROPERTIES_SUPERCLASS
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
  # Add all properties files to the compiled properties list (all or nothing)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
  COMPILED_PROPERTIES += $(FILES_compiled_properties) $(FILES_properties)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
else
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
  COMPILED_PROPERTIES_SUPERCLASS = ListResourceBundle
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
  COMPILED_PROPERTIES += $(FILES_compiled_properties)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
# Determine the locale suffixes needed beyond the base bundle
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
ifeq ($(LOCALE_SET_DEFINITION), plugin)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
  LOCALE_SUFFIXES += $(PLUGIN_LOCALES)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
ifeq ($(LOCALE_SET_DEFINITION), jdk)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
  LOCALE_SUFFIXES += $(JDK_LOCALES)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
ifeq ($(LOCALE_SET_DEFINITION), jre)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
  LOCALE_SUFFIXES += $(JRE_LOCALES)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
# Java files get tacked onto the standard list of files to compile
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
RESOURCE_BUNDLE_FILES_java += $(NEW_RESOURCE_BUNDLES_JAVA)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
RESOURCE_BUNDLE_FILES_java += $(RESOURCE_BUNDLES_JAVA) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
    $(foreach file,$(RESOURCE_BUNDLES_JAVA), \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
       $(foreach locale,$(LOCALE_SUFFIXES), \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
	  $(basename $(file))_$(locale).java))
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
# Add to java sources list
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
FILES_java += $(RESOURCE_BUNDLE_FILES_java)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
# Compiled properties files are translated to .java.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
#   The .java files are generated into GENSRCDIR.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
COMPILED_PROPERTIES += $(NEW_RESOURCE_BUNDLES_COMPILED_PROPERTIES)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
COMPILED_PROPERTIES += $(RESOURCE_BUNDLES_COMPILED_PROPERTIES) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
    $(foreach file,$(RESOURCE_BUNDLES_COMPILED_PROPERTIES),\
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
      $(foreach locale,$(LOCALE_SUFFIXES),\
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
	 $(basename $(file))_$(locale)$(suffix $(file))))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
# Add to java sources list
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
FILES_java += $(COMPILED_PROPERTIES:%.properties=%.java)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
# Non-compiled files
1820
04d22534971a 6793429: Use compiled properties instead of plain properties for resource file
mchung
parents: 2
diff changeset
   115
PROPERTIES_FILES += $(NEW_RESOURCE_BUNDLES_UNCOMPILED_PROPERTIES)
04d22534971a 6793429: Use compiled properties instead of plain properties for resource file
mchung
parents: 2
diff changeset
   116
PROPERTIES_FILES += $(RESOURCE_BUNDLES_UNCOMPILED_PROPERTIES) \
04d22534971a 6793429: Use compiled properties instead of plain properties for resource file
mchung
parents: 2
diff changeset
   117
    $(foreach file,$(RESOURCE_BUNDLES_UNCOMPILED_PROPERTIES), \
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
       $(foreach locale,$(LOCALE_SUFFIXES), \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
	  $(basename $(file))_$(locale)$(suffix $(file))))
1820
04d22534971a 6793429: Use compiled properties instead of plain properties for resource file
mchung
parents: 2
diff changeset
   120
# other properties
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
PROPERTIES_FILES += $(OTHER_PROPERTIES)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
# Compile Properties tool
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
COMPILEPROPERTIES_JARFILE = $(BUILDTOOLJARDIR)/compileproperties.jar
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
# Strip Properties tool
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
STRIPPROPERTIES_JARFILE = $(BUILDTOOLJARDIR)/stripproperties.jar
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
# Process and strip all non-compiled properties files (in a batch mode)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
STRIP_PROP_FILES = $(PROPERTIES_FILES:%=$(CLASSDESTDIR)/%)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
# To efficiently strip properties we use one run of StripProperties. 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
# This macro gathers an option for use later.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
STRIP_PROP_options=$(TEMPDIR)/strip_prop_options
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
define install-properties-file
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
$(install-file)
4665
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 1820
diff changeset
   142
$(call chmod-file, a+rw)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
@$(ECHO) "# Adding to strip properties list: $@"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
$(ECHO) "$@" >> $(STRIP_PROP_options)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
endef
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
# Constructs command line options file
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
$(STRIP_PROP_options): $(STRIP_PROP_FILES)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
	@$(TOUCH) $@
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
strip_prop_options_clean:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
	@$(RM) $(STRIP_PROP_options)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
# Strip the properties files
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
strip_all_props: $(STRIPPROPERTIES_JARFILE) $(STRIP_PROP_options)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
	@if [ -s $(STRIP_PROP_options) ] ; then \
12317
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents: 7668
diff changeset
   156
          $(ECHO) "$(BOOT_JAVA_CMD) -jar $(STRIPPROPERTIES_JARFILE) @$(STRIP_PROP_options)" ; \
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents: 7668
diff changeset
   157
          $(BOOT_JAVA_CMD) -jar $(STRIPPROPERTIES_JARFILE) @$(STRIP_PROP_options) ; \
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
        fi
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
	@$(java-vm-cleanup)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
# Creates files in CLASSDESTDIR
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
# In some cases, we move files from package to resources subdir
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
$(CLASSDESTDIR)/$(PKGDIR)/resources/%.properties: \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
	     $(SHARE_SRC)/classes/$(PKGDIR)/%.properties
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
	$(install-properties-file)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
$(CLASSDESTDIR)/%.properties: $(SHARE_SRC)/classes/%.properties
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
	$(install-properties-file)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
$(CLASSDESTDIR)/%.res: $(SHARE_SRC)/classes/%.res
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
	$(install-file)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
$(CLASSDESTDIR)/%.dtd: $(SHARE_SRC)/classes/%.dtd
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
	$(install-file)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
$(CLASSDESTDIR)/%.xml: $(SHARE_SRC)/classes/%.xml
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
	$(install-file)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
$(CLASSDESTDIR)/%.prp: $(SHARE_SRC)/classes/%.prp
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
	$(install-file)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
# To efficiently compile properties into java sources we use one run
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
#   of compileproperties. This macro gathers an option for use later.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
#   Note: The properties file and java source name can be different
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
#         locales, e.g. zh_TW and zh_HK. The java source filename
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
#         determines the name of the class.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
COMPILE_PROP_options=$(TEMPDIR)/compile_prop_options
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
define add-property-java-file
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
@$(prep-target)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
@$(ECHO) "# Adding to compile properties list: $? -> $@"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
$(ECHO) "-compile $? $@ $(COMPILED_PROPERTIES_SUPERCLASS)" \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
   >> $(COMPILE_PROP_options)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
endef
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
$(GENSRCDIR)/%.java: $(PLATFORM_SRC)/classes/%.properties
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
	$(add-property-java-file)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
$(GENSRCDIR)/%.java: $(SHARE_SRC)/classes/%.properties
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
	$(add-property-java-file)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
$(GENSRCDIR)/%.java: $(GENSRCDIR)/%.properties
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
	$(add-property-java-file)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
ifndef OPENJDK
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
$(GENSRCDIR)/%.java: $(CLOSED_PLATFORM_SRC)/classes/%.properties
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
	$(add-property-java-file)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
$(GENSRCDIR)/%.java: $(CLOSED_SHARE_SRC)/classes/%.properties
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
	$(add-property-java-file)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
# Create HK java file from zh_TW (explicit resource bundles only)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
define create-hk-java-file
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
@$(prep-target)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
$(CAT) $< | $(SED) -e '/class/s/_zh_TW/_zh_HK/' > $@
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
endef
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
# Explicit resource bundles
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
$(GENSRCDIR)/%_zh_HK.java: $(PLATFORM_SRC)/classes/%_zh_TW.java
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
	$(create-hk-java-file)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
$(GENSRCDIR)/%_zh_HK.java: $(SHARE_SRC)/classes/%_zh_TW.java
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
	$(create-hk-java-file)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
# Compile of zh_HK properties just uses the zh_TW properties files
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
$(GENSRCDIR)/%_zh_HK.java: $(PLATFORM_SRC)/classes/%_zh_TW.properties
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
	$(add-property-java-file)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
$(GENSRCDIR)/%_zh_HK.java: $(SHARE_SRC)/classes/%_zh_TW.properties
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
	$(add-property-java-file)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
# Simple delivery of zh_HK properties files just copies zh_TW properties files
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
$(CLASSDESTDIR)/%_zh_HK.properties: \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
             $(PLATFORM_SRC)/classes/%_zh_TW.properties
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
	$(install-properties-file)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
$(CLASSDESTDIR)/%_zh_HK.properties: \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
             $(SHARE_SRC)/classes/%_zh_TW.properties
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
	$(install-properties-file)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
# List of java files converted from properties files needed
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
COMPILE_PROP_JAVA_FILES = $(COMPILED_PROPERTIES:%.properties=$(GENSRCDIR)/%.java)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
# Constructs command line options file
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
$(COMPILE_PROP_options): $(COMPILE_PROP_JAVA_FILES)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
	@$(TOUCH) $@
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
compile_prop_options_clean:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   240
	@$(RM) $(COMPILE_PROP_options)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   241
90ce3da70b43 Initial load
duke
parents:
diff changeset
   242
# Make sure all are compiled, one compiler run
90ce3da70b43 Initial load
duke
parents:
diff changeset
   243
compile_all_props: $(COMPILEPROPERTIES_JARFILE) $(COMPILE_PROP_options)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   244
	@if [ `$(CAT) $(COMPILE_PROP_options) | $(WC) -l` -ge 1 ] ; then \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   245
	  $(MKDIR) -p $(GENSRCDIR); \
12317
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents: 7668
diff changeset
   246
	  $(ECHO) "$(BOOT_JAVA_CMD) -jar $(COMPILEPROPERTIES_JARFILE) @$(COMPILE_PROP_options)";\
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents: 7668
diff changeset
   247
	  $(BOOT_JAVA_CMD) -jar $(COMPILEPROPERTIES_JARFILE) @$(COMPILE_PROP_options) ; \
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   248
	  $(java-vm-cleanup); \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   249
	fi
90ce3da70b43 Initial load
duke
parents:
diff changeset
   250
90ce3da70b43 Initial load
duke
parents:
diff changeset
   251
# Make sure the build rule creates all the properties
90ce3da70b43 Initial load
duke
parents:
diff changeset
   252
resources:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   253
6785
8c33458fc946 6976516: Add support for compiling deploy ws without compiling j2se
igor
parents: 5506
diff changeset
   254
ifneq ($(strip $(PROPERTIES_FILES)),)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   255
  resources: strip_prop_options_clean   strip_all_props
90ce3da70b43 Initial load
duke
parents:
diff changeset
   256
  clobber clean:: 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   257
	$(RM) $(STRIP_PROP_FILES) $(STRIP_PROP_options)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   258
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   259
6785
8c33458fc946 6976516: Add support for compiling deploy ws without compiling j2se
igor
parents: 5506
diff changeset
   260
ifneq ($(strip $(COMPILED_PROPERTIES)),)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   261
  resources: compile_prop_options_clean compile_all_props
90ce3da70b43 Initial load
duke
parents:
diff changeset
   262
  clobber clean:: 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   263
	$(RM) $(COMPILE_PROP_JAVA_FILES) $(COMPILE_PROP_options)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   264
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   265
90ce3da70b43 Initial load
duke
parents:
diff changeset
   266
.PHONY: resources \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   267
	compile_prop_options_clean compile_all_props \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   268
	strip_prop_options_clean   strip_all_props
90ce3da70b43 Initial load
duke
parents:
diff changeset
   269