1 # 2 # Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. 3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 # 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. 10 # 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). 16 # 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. 20 # 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 23 # questions. 24 # 25 26 # 27 # Make file for generating BreakIterator data files. 28 # 29 30 # input 31 # 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. 35 # 36 TEXT_SRCDIR = $(JDK_TOPDIR)/src/java.base/share/classes \ 37 $(JDK_TOPDIR)/src/jdk.localedata/share/classes 38 TEXT_PKG = sun/text/resources 39 TEXT_SOURCES = $(TEXT_PKG)/BreakIteratorRules.java \ 40 $(TEXT_PKG)/BreakIteratorInfo.java \ 41 $(TEXT_PKG)/th/BreakIteratorRules_th.java \ 42 $(TEXT_PKG)/th/BreakIteratorInfo_th.java 43 44 # Generate BreakIteratorData 45 BREAK_ITERATOR_DIR = $(JDK_OUTPUTDIR)/break_iterator 46 BREAK_ITERATOR_CLASSES = $(BREAK_ITERATOR_DIR)/classes 47 48 # JAVAC_SOURCE_PATH_OVERRIDE is set to isolate the compile to just those 49 # two files in that directory and not get anything implicit from 50 # surrounding directories which aren't jdk N-1 compatible. 51 # Because we are targeting jdk N-1, but the surrounding source code is jdk N. 52 # These two files should be moved out to a build tool! We have to disable 53 # sjavac here as well. 54 $(eval $(call SetupJavaCompilation,BUILD_BREAKITERATOR, \ 55 SETUP := GENERATE_OLDBYTECODE, \ 56 SRC := $(TEXT_SRCDIR), \ 57 DISABLE_SJAVAC := true, \ 58 JAVAC_SOURCE_PATH_OVERRIDE := $(patsubst %, %/$(TEXT_PKG), $(TEXT_SRCDIR)), \ 59 INCLUDES := $(TEXT_PKG), \ 60 INCLUDE_FILES := $(TEXT_SOURCES), \ 61 BIN := $(BREAK_ITERATOR_CLASSES))) 62 63 # Generate data resource files. 64 # input 65 UNICODEDATA = $(JDK_TOPDIR)/make/data/unicodedata/UnicodeData.txt 66 67 # output 68 BASE_DATA_PKG_DIR = $(JDK_OUTPUTDIR)/modules/java.base/sun/text/resources 69 SL_DATA_PKG_DIR = $(JDK_OUTPUTDIR)/modules/jdk.localedata/sun/text/resources 70 BIFILES = $(BASE_DATA_PKG_DIR)/CharacterBreakIteratorData \ 71 $(BASE_DATA_PKG_DIR)/WordBreakIteratorData \ 72 $(BASE_DATA_PKG_DIR)/LineBreakIteratorData \ 73 $(BASE_DATA_PKG_DIR)/SentenceBreakIteratorData 74 BIFILES_TH = $(SA_DATA_PKG_DIR)/th/WordBreakIteratorData_th \ 75 $(SA_DATA_PKG_DIR)/th/LineBreakIteratorData_th 76 77 $(BIFILES): $(BASE_DATA_PKG_DIR)/_the.bifiles 78 $(BASE_DATA_PKG_DIR)/_the.bifiles: JAVA_FLAGS += -Xbootclasspath/p:$(BREAK_ITERATOR_CLASSES) 79 $(BASE_DATA_PKG_DIR)/_the.bifiles: $(BUILD_TOOLS) $(UNICODEDATA) $(BUILD_BREAKITERATOR) 80 $(ECHO) $(LOG_INFO) "Generating BreakIteratorData" 81 $(MKDIR) -p $(@D) 82 $(RM) $(BIFILES) 83 $(TOOL_GENERATEBREAKITERATORDATA) \ 84 -o $(@D) \ 85 -spec $(UNICODEDATA) 86 $(TOUCH) $@ 87 88 $(BIFILES_TH): $(SL_DATA_PKG_DIR)/_the.bifiles_th 89 $(SL_DATA_PKG_DIR)/_the.bifiles_th: JAVA_FLAGS += -Xbootclasspath/p:$(BREAK_ITERATOR_CLASSES) 90 $(SL_DATA_PKG_DIR)/_the.bifiles_th: $(BUILD_TOOLS) $(UNICODEDATA) $(BUILD_BREAKITERATOR) 91 $(ECHO) $(LOG_INFO) "Generating BreakIteratorData_th" 92 $(MKDIR) -p $(@D)/th 93 $(RM) $(BIFILES_TH) 94 $(TOOL_GENERATEBREAKITERATORDATA) \ 95 -o $(@D) \ 96 -spec $(UNICODEDATA) \ 97 -language th 98 $(TOUCH) $@ 99 100 101 BREAK_ITERATOR += $(BIFILES) $(BIFILES_TH)