2
# Copyright (c) 2011, 2022, Oracle and/or its affiliates. All rights reserved.
3
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
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.
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).
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.
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
27
# Make file for generating BreakIterator data files.
32
# Notes: sun.text.resources.BreakIteratorRules no longer goes to runtime.
33
# They are used at JDK build phase in order to create $(BIFILES) which
34
# are used on runtime instead.
36
TEXT_PKG := sun/text/resources
37
TEXT_PKG_LD := $(TEXT_PKG)/ext
38
TEXT_SOURCES := $(TEXT_PKG)/BreakIteratorRules.java \
39
$(TEXT_PKG)/BreakIteratorInfo.java \
40
$(TEXT_PKG_LD)/BreakIteratorRules_th.java \
41
$(TEXT_PKG_LD)/BreakIteratorInfo_th.java
43
# Generate BreakIteratorData
44
BREAK_ITERATOR_CLASSES := $(BUILDTOOLS_OUTPUTDIR)/break_iterator_classes
46
# These two files should be moved out to a build tool!
47
$(eval $(call SetupJavaCompilation, BUILD_BREAKITERATOR_BASE, \
48
TARGET_RELEASE := $(TARGET_RELEASE_BOOTJDK), \
49
SRC := $(TOPDIR)/src/java.base/share/classes, \
51
$(TEXT_PKG)/BreakIteratorRules.java \
52
$(TEXT_PKG)/BreakIteratorInfo.java, \
53
BIN := $(BREAK_ITERATOR_CLASSES)/java.base, \
54
DISABLED_WARNINGS := options, \
57
$(eval $(call SetupJavaCompilation, BUILD_BREAKITERATOR_LD, \
58
TARGET_RELEASE := $(TARGET_RELEASE_BOOTJDK), \
59
SRC := $(TOPDIR)/src/jdk.localedata/share/classes, \
61
$(TEXT_PKG_LD)/BreakIteratorRules_th.java \
62
$(TEXT_PKG_LD)/BreakIteratorInfo_th.java, \
63
BIN := $(BREAK_ITERATOR_CLASSES)/jdk.localedata, \
64
DISABLED_WARNINGS := options, \
67
BREAK_ITERATOR_BOOTCLASSPATH := \
68
--patch-module java.base=$(BREAK_ITERATOR_CLASSES)/java.base \
69
--patch-module jdk.localedata=$(BREAK_ITERATOR_CLASSES)/jdk.localedata \
70
--add-exports java.base/sun.text=ALL-UNNAMED \
71
--add-exports java.base/sun.text.resources=ALL-UNNAMED \
72
--add-exports jdk.localedata/sun.text.resources.ext=ALL-UNNAMED \
75
# Generate data resource files.
77
UNICODEDATA := $(MODULE_SRC)/share/data/unicodedata/UnicodeData.txt
80
BASE_DATA_PKG_DIR := $(JDK_OUTPUTDIR)/modules/java.base/sun/text/resources
81
LD_DATA_PKG_DIR := $(JDK_OUTPUTDIR)/modules/jdk.localedata/sun/text/resources/ext
82
BIFILES := $(BASE_DATA_PKG_DIR)/CharacterBreakIteratorData \
83
$(BASE_DATA_PKG_DIR)/WordBreakIteratorData \
84
$(BASE_DATA_PKG_DIR)/LineBreakIteratorData \
85
$(BASE_DATA_PKG_DIR)/SentenceBreakIteratorData
86
BIFILES_TH := $(LD_DATA_PKG_DIR)/WordBreakIteratorData_th \
87
$(LD_DATA_PKG_DIR)/LineBreakIteratorData_th
89
$(BIFILES): $(BASE_DATA_PKG_DIR)/_the.bifiles
90
$(BASE_DATA_PKG_DIR)/_the.bifiles: JAVA_FLAGS += $(BREAK_ITERATOR_BOOTCLASSPATH)
91
$(BASE_DATA_PKG_DIR)/_the.bifiles: $(BUILD_TOOLS_JDK) $(UNICODEDATA) \
92
$(BUILD_BREAKITERATOR_BASE) $(BUILD_BREAKITERATOR_LD)
93
$(call LogInfo, Generating BreakIteratorData)
94
$(call MakeDir, $(@D))
96
$(TOOL_GENERATEBREAKITERATORDATA) \
101
$(BIFILES_TH): $(LD_DATA_PKG_DIR)/_the.bifiles_th
102
$(LD_DATA_PKG_DIR)/_the.bifiles_th: JAVA_FLAGS += $(BREAK_ITERATOR_BOOTCLASSPATH)
103
$(LD_DATA_PKG_DIR)/_the.bifiles_th: $(BUILD_TOOLS_JDK) $(UNICODEDATA) \
104
$(BUILD_BREAKITERATOR_BASE) $(BUILD_BREAKITERATOR_LD)
105
$(call LogInfo, Generating BreakIteratorData_th)
107
$(TOOL_GENERATEBREAKITERATORDATA) \
109
-spec $(UNICODEDATA) \
113
TARGETS += $(BIFILES) $(BIFILES_TH)