jdk/make/gensrc/GensrcLocaleDataMetaInfo.gmk
author serb
Fri, 18 Apr 2014 20:10:39 +0400
changeset 24521 97047c850d31
parent 23010 6dadb192ad81
child 25859 3317bb8137f4
permissions -rw-r--r--
8026252: [macosx] Change AWT_DEBUG_BUG_REPORT_MESSAGE for macosx platform Reviewed-by: azvegint, pchelko
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
12317
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
     1
#
23010
6dadb192ad81 8029235: Update copyright year to match last edit in jdk8 jdk repository for 2013
lana
parents: 22989
diff changeset
     2
# Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
12317
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
     3
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
     4
#
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
     5
# This code is free software; you can redistribute it and/or modify it
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
     6
# under the terms of the GNU General Public License version 2 only, as
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
     7
# published by the Free Software Foundation.  Oracle designates this
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
     8
# particular file as subject to the "Classpath" exception as provided
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
     9
# by Oracle in the LICENSE file that accompanied this code.
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    10
#
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    11
# This code is distributed in the hope that it will be useful, but WITHOUT
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    12
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    13
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    14
# version 2 for more details (a copy is included in the LICENSE file that
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    15
# accompanied this code).
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    16
#
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    17
# You should have received a copy of the GNU General Public License version
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    18
# 2 along with this work; if not, write to the Free Software Foundation,
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    19
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    20
#
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    21
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    22
# or visit www.oracle.com if you need additional information or have any
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    23
# questions.
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    24
#
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    25
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    26
# Scan for all locale resources and extract for which locales there exists
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    27
# resources. Then put this meta information about exiting (supported?) locales
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    28
# into LocaleDataMetaInfo.java
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    29
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    30
# First go look for all locale files
20547
453837141fac 8001931: The new build system whitespace cleanup
ihse
parents: 19837
diff changeset
    31
LOCALE_FILES := $(shell $(FIND) $(JDK_TOPDIR)/src/share/classes \
453837141fac 8001931: The new build system whitespace cleanup
ihse
parents: 19837
diff changeset
    32
    -name "FormatData_*.java" -o -name "FormatData_*.properties" -o \
453837141fac 8001931: The new build system whitespace cleanup
ihse
parents: 19837
diff changeset
    33
    -name "CollationData_*.java" -o -name "CollationData_*.properties" -o \
453837141fac 8001931: The new build system whitespace cleanup
ihse
parents: 19837
diff changeset
    34
    -name "TimeZoneNames_*.java" -o -name "TimeZoneNames_*.properties" -o \
453837141fac 8001931: The new build system whitespace cleanup
ihse
parents: 19837
diff changeset
    35
    -name "LocaleNames_*.java" -o -name "LocaleNames_*.properties" -o \
453837141fac 8001931: The new build system whitespace cleanup
ihse
parents: 19837
diff changeset
    36
    -name "CurrencyNames_*.java" -o -name "CurrencyNames_*.properties" -o \
453837141fac 8001931: The new build system whitespace cleanup
ihse
parents: 19837
diff changeset
    37
    -name "CalendarData_*.java" -o -name "CalendarData_*.properties")
12317
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    38
20547
453837141fac 8001931: The new build system whitespace cleanup
ihse
parents: 19837
diff changeset
    39
# Then translate the locale files into for example: FormatData_sv
453837141fac 8001931: The new build system whitespace cleanup
ihse
parents: 19837
diff changeset
    40
LOCALE_RESOURCES := $(sort $(subst .properties,,$(subst .java,,$(notdir $(LOCALE_FILES)))))
12317
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    41
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    42
# Include the list of resources found during the previous compile.
14231
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents: 13583
diff changeset
    43
-include $(JDK_OUTPUTDIR)/gensrc/_the.locale_resources
12317
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    44
20547
453837141fac 8001931: The new build system whitespace cleanup
ihse
parents: 19837
diff changeset
    45
MISSING_RESOURCES := $(filter-out $(LOCALE_RESOURCES), $(PREV_LOCALE_RESOURCES))
453837141fac 8001931: The new build system whitespace cleanup
ihse
parents: 19837
diff changeset
    46
NEW_RESOURCES := $(filter-out $(PREV_LOCALE_RESOURCES), $(LOCALE_RESOURCES))
12317
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    47
20547
453837141fac 8001931: The new build system whitespace cleanup
ihse
parents: 19837
diff changeset
    48
ifneq (, $(MISSING_RESOURCES)$(NEW_RESOURCES))
453837141fac 8001931: The new build system whitespace cleanup
ihse
parents: 19837
diff changeset
    49
  # There is a difference in the number of supported resources. Trigger a regeneration.
453837141fac 8001931: The new build system whitespace cleanup
ihse
parents: 19837
diff changeset
    50
  $(shell $(RM) $(JDK_OUTPUTDIR)/gensrc/sun/util/locale/provider/LocaleDataMetaInfo.java)
12317
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    51
endif
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    52
19837
6f1c611fb72c 8024332: sun/util/resources/en split between rt.jar and localedata.jar
naoto
parents: 14427
diff changeset
    53
# The EN locales
20547
453837141fac 8001931: The new build system whitespace cleanup
ihse
parents: 19837
diff changeset
    54
EN_LOCALES := en%
12317
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    55
22627
93f110be9439 8030696: Norwegian locales nb_NO and nn_NO should be available locales
naoto
parents: 21805
diff changeset
    56
# Locales that don't have any resource files should be included here.
93f110be9439 8030696: Norwegian locales nb_NO and nn_NO should be available locales
naoto
parents: 21805
diff changeset
    57
ALL_NON_EN_LOCALES := ja-JP-JP nb-NO nn-NO th-TH-TH
12317
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    58
20547
453837141fac 8001931: The new build system whitespace cleanup
ihse
parents: 19837
diff changeset
    59
SED_ARGS := -e 's|$(HASH)warn This file is preprocessed before being compiled|// -- This file was mechanically generated: Do not edit! -- //|g'
13583
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents: 12892
diff changeset
    60
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents: 12892
diff changeset
    61
# This macro creates a sed expression that substitues for example:
19837
6f1c611fb72c 8024332: sun/util/resources/en split between rt.jar and localedata.jar
naoto
parents: 14427
diff changeset
    62
# #FormatData_ENLocales# with: en% locales.
13583
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents: 12892
diff changeset
    63
define CaptureLocale
20547
453837141fac 8001931: The new build system whitespace cleanup
ihse
parents: 19837
diff changeset
    64
  $1_LOCALES := $$(subst _,-,$$(filter-out $1, $$(subst $1_,,$$(filter $1_%, $(LOCALE_RESOURCES)))))
453837141fac 8001931: The new build system whitespace cleanup
ihse
parents: 19837
diff changeset
    65
  $1_EN_LOCALES := $$(filter $(EN_LOCALES), $$($1_LOCALES))
453837141fac 8001931: The new build system whitespace cleanup
ihse
parents: 19837
diff changeset
    66
  $1_NON_EN_LOCALES := $$(filter-out $(EN_LOCALES), $$($1_LOCALES))
13583
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents: 12892
diff changeset
    67
22989
2d6804cfdc0e 8027289: [Windows zh_CN] NumberFormat: Incorrect sequence of loading currency symbol
naoto
parents: 22627
diff changeset
    68
  # Special handling for Chinese locales to include implicit scripts
2d6804cfdc0e 8027289: [Windows zh_CN] NumberFormat: Incorrect sequence of loading currency symbol
naoto
parents: 22627
diff changeset
    69
  $1_NON_EN_LOCALES := $$(subst zh-CN,zh-CN$$(SPACE)zh-Hans-CN, $$($1_NON_EN_LOCALES))
2d6804cfdc0e 8027289: [Windows zh_CN] NumberFormat: Incorrect sequence of loading currency symbol
naoto
parents: 22627
diff changeset
    70
  $1_NON_EN_LOCALES := $$(subst zh-SG,zh-SG$$(SPACE)zh-Hans-SG, $$($1_NON_EN_LOCALES))
2d6804cfdc0e 8027289: [Windows zh_CN] NumberFormat: Incorrect sequence of loading currency symbol
naoto
parents: 22627
diff changeset
    71
  $1_NON_EN_LOCALES := $$(subst zh-HK,zh-HK$$(SPACE)zh-Hant-HK, $$($1_NON_EN_LOCALES))
2d6804cfdc0e 8027289: [Windows zh_CN] NumberFormat: Incorrect sequence of loading currency symbol
naoto
parents: 22627
diff changeset
    72
  $1_NON_EN_LOCALES := $$(subst zh-MO,zh-MO$$(SPACE)zh-Hant-MO, $$($1_NON_EN_LOCALES))
2d6804cfdc0e 8027289: [Windows zh_CN] NumberFormat: Incorrect sequence of loading currency symbol
naoto
parents: 22627
diff changeset
    73
  $1_NON_EN_LOCALES := $$(subst zh-TW,zh-TW$$(SPACE)zh-Hant-TW, $$($1_NON_EN_LOCALES))
2d6804cfdc0e 8027289: [Windows zh_CN] NumberFormat: Incorrect sequence of loading currency symbol
naoto
parents: 22627
diff changeset
    74
20547
453837141fac 8001931: The new build system whitespace cleanup
ihse
parents: 19837
diff changeset
    75
  ALL_EN_LOCALES += $$($1_EN_LOCALES)
453837141fac 8001931: The new build system whitespace cleanup
ihse
parents: 19837
diff changeset
    76
  ALL_NON_EN_LOCALES += $$($1_NON_EN_LOCALES)
13583
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents: 12892
diff changeset
    77
20547
453837141fac 8001931: The new build system whitespace cleanup
ihse
parents: 19837
diff changeset
    78
  # Don't sed in a space if there are no locales.
453837141fac 8001931: The new build system whitespace cleanup
ihse
parents: 19837
diff changeset
    79
  SED_ARGS += -e 's/$$(HASH)$1_ENLocales$$(HASH)/$$(if $$($1_EN_LOCALES),$$(SPACE)$$($1_EN_LOCALES),)/g'
453837141fac 8001931: The new build system whitespace cleanup
ihse
parents: 19837
diff changeset
    80
  SED_ARGS += -e 's/$$(HASH)$1_NonENLocales$$(HASH)/$$(if $$($1_NON_EN_LOCALES),$$(SPACE)$$($1_NON_EN_LOCALES),)/g'
13583
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents: 12892
diff changeset
    81
endef
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents: 12892
diff changeset
    82
12317
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    83
#sun.text.resources.FormatData
13583
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents: 12892
diff changeset
    84
$(eval $(call CaptureLocale,FormatData))
12317
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    85
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    86
#sun.text.resources.CollationData
13583
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents: 12892
diff changeset
    87
$(eval $(call CaptureLocale,CollationData))
12317
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    88
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    89
#sun.util.resources.TimeZoneNames
13583
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents: 12892
diff changeset
    90
$(eval $(call CaptureLocale,TimeZoneNames))
12317
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    91
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    92
#sun.util.resources.LocaleNames
13583
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents: 12892
diff changeset
    93
$(eval $(call CaptureLocale,LocaleNames))
12317
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    94
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    95
#sun.util.resources.CurrencyNames
13583
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents: 12892
diff changeset
    96
$(eval $(call CaptureLocale,CurrencyNames))
12317
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    97
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    98
#sun.util.resources.CalendarData
13583
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents: 12892
diff changeset
    99
$(eval $(call CaptureLocale,CalendarData))
12317
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
   100
20547
453837141fac 8001931: The new build system whitespace cleanup
ihse
parents: 19837
diff changeset
   101
SED_ARGS += -e 's/$(HASH)AvailableLocales_ENLocales$(HASH)/$(sort $(ALL_EN_LOCALES))/g'
453837141fac 8001931: The new build system whitespace cleanup
ihse
parents: 19837
diff changeset
   102
SED_ARGS += -e 's/$(HASH)AvailableLocales_NonENLocales$(HASH)/$(sort $(ALL_NON_EN_LOCALES))/g'
13583
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents: 12892
diff changeset
   103
14231
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents: 13583
diff changeset
   104
$(JDK_OUTPUTDIR)/gensrc/sun/util/locale/provider/LocaleDataMetaInfo.java: \
20547
453837141fac 8001931: The new build system whitespace cleanup
ihse
parents: 19837
diff changeset
   105
    $(JDK_TOPDIR)/src/share/classes/sun/util/locale/provider/LocaleDataMetaInfo-XLocales.java.template
12892
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents: 12317
diff changeset
   106
	$(MKDIR) -p $(@D)
12317
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
   107
	$(ECHO) Creating sun/util/LocaleDataMetaInfo.java from $(words $(LOCALE_RESOURCES)) found resources.
14231
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents: 13583
diff changeset
   108
	$(PRINTF) "PREV_LOCALE_RESOURCES:=$(LOCALE_RESOURCES)" > $(JDK_OUTPUTDIR)/gensrc/_the.locale_resources
13583
dc0017b1a452 6336885: RFE: Locale Data Deployment Enhancements
naoto
parents: 12892
diff changeset
   109
	$(SED) $(SED_ARGS) $< > $@
12317
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
   110
20547
453837141fac 8001931: The new build system whitespace cleanup
ihse
parents: 19837
diff changeset
   111
GENSRC_LOCALEDATAMETAINFO := $(JDK_OUTPUTDIR)/gensrc/sun/util/locale/provider/LocaleDataMetaInfo.java
12892
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents: 12317
diff changeset
   112
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents: 12317
diff changeset
   113
###
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents: 12317
diff changeset
   114
14231
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents: 13583
diff changeset
   115
GENSRC_CRBC_DST := $(JDK_OUTPUTDIR)/gensrc/sun/util/CoreResourceBundleControl.java
21805
c7d7946239de 8027566: Remove the old build system
ihse
parents: 20549
diff changeset
   116
GENSRC_CRBC_CMD := $(JDK_TOPDIR)/make/scripts/localelist.sh
12892
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents: 12317
diff changeset
   117
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents: 12317
diff changeset
   118
JRE_NONEXIST_LOCALES := en en_US de_DE es_ES fr_FR it_IT ja_JP ko_KR sv_SE zh
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents: 12317
diff changeset
   119
20547
453837141fac 8001931: The new build system whitespace cleanup
ihse
parents: 19837
diff changeset
   120
$(GENSRC_CRBC_DST): $(JDK_TOPDIR)/src/share/classes/sun/util/CoreResourceBundleControl-XLocales.java.template \
453837141fac 8001931: The new build system whitespace cleanup
ihse
parents: 19837
diff changeset
   121
    $(GENSRC_CRBC_CMD)
12892
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents: 12317
diff changeset
   122
	$(MKDIR) -p $(@D)
20547
453837141fac 8001931: The new build system whitespace cleanup
ihse
parents: 19837
diff changeset
   123
	NAWK="$(NAWK)" SED="$(SED)" $(SH) $(GENSRC_CRBC_CMD) "$(JRE_NONEXIST_LOCALES)" $< $@
12892
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents: 12317
diff changeset
   124
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents: 12317
diff changeset
   125
GENSRC_LOCALEDATAMETAINFO += $(GENSRC_CRBC_DST)
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents: 12317
diff changeset
   126
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents: 12317
diff changeset
   127
###