# # Copyright (c) 2005, 2012, 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. # # # This file defines rules to build the locales information for # resources in "sun.util.resources" & "sun.text.resources" packages # # Save the current FILES_java & FILES_compiled_properties variables FILES_java_orig := $(FILES_java) FILES_compiled_properties_orig := $(FILES_compiled_properties) # Since all the resources files are going to be compiled into class file format, # only FILES_java and FILES_compiled_properties variables will be picked up # # $(BUILDDIR)/java/util/FILES_java.gmk & $(BUILDDIR)/java/util/FILES_properties.gmk # contain "sun.util.resources" for EN language support include $(BUILDDIR)/java/util/FILES_java.gmk include $(BUILDDIR)/java/util/FILES_properties.gmk EN_Resources_java := $(FILES_java) EN_Resources_properties := $(FILES_compiled_properties) # $(BUILDDIR)/java/text/FILES_java.gmk contains the "sun.text.resources" for # EN language support include $(BUILDDIR)/java/text/base/FILES_java.gmk EN_Resources_java += $(FILES_java) FILES_compiled_properties= # $(BUILDDIR)/sun/text/FILES_java.gmk & $(BUILDDIR)/sun/text/FILES_properties.gmk # contain both resources for Non-EN language support include $(BUILDDIR)/sun/text/FILES_java.gmk include $(BUILDDIR)/sun/text/FILES_properties.gmk NonEN_Resources_java := $(FILES_java) NonEN_Resources_properties := $(FILES_compiled_properties) # Restore the orignal FILES_java & FILES_compiled_properties variables FILES_java := $(FILES_java_orig) FILES_compiled_properties := $(FILES_compiled_properties_orig) LocaleDataMetaInfo_Src=$(SHARE_SRC)/classes/sun/util/locale/provider/LocaleDataMetaInfo-XLocales.java.template LocaleDataMetaInfo_Dest=$(GENSRCDIR)/sun/util/locale/provider/LocaleDataMetaInfo.java LOCALEGEN_SH=localegen.sh RESOURCE_NAMES="FormatData CollationData TimeZoneNames LocaleNames CurrencyNames CalendarData" # On MacOSX sed does not enter a newline as it does on other platforms with the same pattern # Using awk instead ifeq ($(PLATFORM), macosx) $(LocaleDataMetaInfo_Dest):$(LocaleDataMetaInfo_Src) $(LOCALEGEN_SH) @$(RM) $@.tmp.en $@.tmp.nonen; @$(prep-target) @$(ECHO) $(EN_Resources_properties) | $(NAWK) 'gsub(/.properties/,"\n") {print}' > $@.tmp.en; @$(ECHO) $(EN_Resources_java) | $(NAWK) 'gsub(/.java/,"\n") {print}' >> $@.tmp.en; @$(ECHO) $(NonEN_Resources_properties) | $(NAWK) 'gsub(/.properties/,"\n") {print}' > $@.tmp.nonen; @$(ECHO) $(NonEN_Resources_java) | $(NAWK) 'gsub(/.java/,"\n") {print}' >> $@.tmp.nonen; NAWK="$(NAWK)" SED="$(SED)" SORT="$(SORT)" \ $(SH) $(LOCALEGEN_SH) $(RESOURCE_NAMES) $@.tmp.en \ $@.tmp.nonen $< $@ @$(RM) $@.tmp.en $@.tmp.nonen; else $(LocaleDataMetaInfo_Dest):$(LocaleDataMetaInfo_Src) $(LOCALEGEN_SH) @$(RM) $@.tmp.en $@.tmp.nonen; @$(prep-target) @$(ECHO) $(subst .properties,'\n',$(EN_Resources_properties)) > $@.tmp.en; @$(ECHO) $(subst .java,'\n',$(EN_Resources_java)) >> $@.tmp.en; @$(ECHO) $(subst .properties,'\n',$(NonEN_Resources_properties)) > $@.tmp.nonen; @$(ECHO) $(subst .java,'\n',$(NonEN_Resources_java)) >> $@.tmp.nonen; NAWK="$(NAWK)" SED="$(SED)" SORT="$(SORT)" \ $(SH) $(LOCALEGEN_SH) $(RESOURCE_NAMES) $@.tmp.en \ $@.tmp.nonen $< $@ @$(RM) $@.tmp.en $@.tmp.nonen; endif genlocales : $(LocaleDataMetaInfo_Dest) clean clobber:: $(RM) $(LocaleDataMetaInfo_Dest)