jdk/make/gendata/GendataBreakIterator.gmk
author alundblad
Fri, 08 Jan 2016 17:10:45 +0100
changeset 34932 850b1bb595e3
parent 34330 4d5aa33be0a0
child 35241 075bbb8f2423
permissions -rw-r--r--
8144226: Sjavac's handling of include/exclude patterns is buggy, redundant and inconsistent Summary: Updated include/exclude pattern arguments for sjavac. Reviewed-by: erikj

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

#
# Make file for generating BreakIterator data files.
#

# input
#
# Notes: sun.text.resources.BreakIteratorRules no longer goes to runtime.
# They are used at JDK build phase in order to create $(BIFILES) which
# are used on runtime instead.
#
TEXT_SRCDIR := $(JDK_TOPDIR)/src/java.base/share/classes \
    $(JDK_TOPDIR)/src/jdk.localedata/share/classes
TEXT_PKG := sun/text/resources
TEXT_SOURCES := $(TEXT_PKG)/BreakIteratorRules.java \
    $(TEXT_PKG)/BreakIteratorInfo.java \
    $(TEXT_PKG)/th/BreakIteratorRules_th.java \
    $(TEXT_PKG)/th/BreakIteratorInfo_th.java

# Generate BreakIteratorData
BREAK_ITERATOR_CLASSES := $(BUILDTOOLS_OUTPUTDIR)/break_iterator_classes

# These two files should be moved out to a build tool!
$(eval $(call SetupJavaCompilation,BUILD_BREAKITERATOR, \
    SETUP := GENERATE_OLDBYTECODE, \
    SRC := $(TEXT_SRCDIR), \
    INCLUDE_FILES := $(TEXT_SOURCES), \
    BIN := $(BREAK_ITERATOR_CLASSES)))

# Generate data resource files.
# input
UNICODEDATA := $(JDK_TOPDIR)/make/data/unicodedata/UnicodeData.txt

# output
BASE_DATA_PKG_DIR := $(JDK_OUTPUTDIR)/modules/java.base/sun/text/resources
LD_DATA_PKG_DIR := $(JDK_OUTPUTDIR)/modules/jdk.localedata/sun/text/resources
BIFILES := $(BASE_DATA_PKG_DIR)/CharacterBreakIteratorData \
    $(BASE_DATA_PKG_DIR)/WordBreakIteratorData \
    $(BASE_DATA_PKG_DIR)/LineBreakIteratorData \
    $(BASE_DATA_PKG_DIR)/SentenceBreakIteratorData
BIFILES_TH := $(LD_DATA_PKG_DIR)/th/WordBreakIteratorData_th \
    $(LD_DATA_PKG_DIR)/th/LineBreakIteratorData_th

$(BIFILES): $(BASE_DATA_PKG_DIR)/_the.bifiles
$(BASE_DATA_PKG_DIR)/_the.bifiles: JAVA_FLAGS += -Xbootclasspath/p:$(BREAK_ITERATOR_CLASSES)
$(BASE_DATA_PKG_DIR)/_the.bifiles: $(BUILD_TOOLS) $(UNICODEDATA) $(BUILD_BREAKITERATOR)
	$(ECHO) $(LOG_INFO) "Generating BreakIteratorData"
	$(MKDIR) -p $(@D)
	$(RM) $(BIFILES)
	$(TOOL_GENERATEBREAKITERATORDATA) \
	    -o $(@D) \
	    -spec $(UNICODEDATA)
	$(TOUCH) $@

$(BIFILES_TH): $(LD_DATA_PKG_DIR)/_the.bifiles_th
$(LD_DATA_PKG_DIR)/_the.bifiles_th: JAVA_FLAGS += -Xbootclasspath/p:$(BREAK_ITERATOR_CLASSES)
$(LD_DATA_PKG_DIR)/_the.bifiles_th: $(BUILD_TOOLS) $(UNICODEDATA) $(BUILD_BREAKITERATOR)
	$(ECHO) $(LOG_INFO) "Generating BreakIteratorData_th"
	$(MKDIR) -p $(@D)/th
	$(RM) $(BIFILES_TH)
	$(TOOL_GENERATEBREAKITERATORDATA) \
	    -o $(@D) \
	    -spec $(UNICODEDATA) \
	    -language th
	$(TOUCH) $@

TARGETS += $(BIFILES) $(BIFILES_TH)