Makefile 4.4 KB
Newer Older
1
#
2
# Copyright (c) 1996, 2011, Oracle and/or its affiliates. All rights reserved.
3 4 5 6
# 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
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 12 13 14 15 16 17 18 19 20
#
# 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.
#
21 22 23
# 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.
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
#

#
# Makefile for character converters.
#

BUILDDIR = ../../..

# charsets should be separated from nio module 
PACKAGE = sun.nio
PRODUCT = sun

# This re-directs all the class files to a separate location
CLASSDESTDIR = $(TEMPDIR)/classes

39 40 41
JAVAC_MAX_WARNINGS = false
JAVAC_LINT_OPTIONS = -Xlint:all,-deprecation
JAVAC_WARNINGS_FATAL = true
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
include $(BUILDDIR)/common/Defs.gmk

#
# Files
#
include FILES_java.gmk
AUTO_FILES_JAVA_DIRS = sun/nio/cs/ext

# For Cygwin, command line arguments that are paths must be converted to
# windows style paths. These paths cannot be used as targets, however, because 
# the ":" in them  will interfere with GNU Make rules, generating "multiple
# target pattern" errors.

# this define is for the rule:
CHARSETS_JAR = $(LIBDIR)/charsets.jar

# extcs
FILES_genout_extcs = $(FILES_gen_extcs:%.java=$(GENSRCDIR)/%.java)

61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
#
# These sun.awt charsets use sun/nio/cs/ext charsets that only exist
# in JDK7 charsets.jar, which causes problem when build the symbol
# table for rt.jar in Release.gmk. They are now removed from the
# rt.jar when building jdk/jre image (in Release.gmk), so add them
# into charsets.jar here
#
ifeq ($(PLATFORM), windows)
FILES_src += \
	sun/awt/HKSCS.java
else
# Solaris/Linux
FILES_src += \
	sun/awt/HKSCS.java \
	sun/awt/motif/X11GB2312.java \
	sun/awt/motif/X11GBK.java \
	sun/awt/motif/X11KSC5601.java
endif # PLATFORM

80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115
#
# Rules
#
include $(BUILDDIR)/common/Classes.gmk

build: $(FILES_genout_extcs) $(CHARSETS_JAR)

#
# Extra rules to build character converters.

SERVICE_DESCRIPTION = java.nio.charset.spi.CharsetProvider
SERVICE_DESCRIPTION_PATH = META-INF/services/$(SERVICE_DESCRIPTION)

GENCSDATASRC = $(BUILDDIR)/tools/CharsetMapping
GENCSSRCDIR = $(BUILDDIR)/tools/src/build/tools/charsetmapping
GENCSEXT = $(GENSRCDIR)/sun/nio/cs/ext

FILES_MAP = $(GENCSDATASRC)/sjis0213.map
FILES_DAT = $(CLASSDESTDIR)/sun/nio/cs/ext/sjis0213.dat
CHARSETMAPPING_JARFILE = $(BUILDTOOLJARDIR)/charsetmapping.jar

$(FILES_DAT): $(FILES_MAP)
	@$(prep-target)
	$(BOOT_JAVA_CMD) -jar $(CHARSETMAPPING_JARFILE) \
		$(FILES_MAP) $(FILES_DAT) sjis0213


$(FILES_genout_extcs): \
                $(GENCSDATASRC)/SingleByte-X.java.template  \
		$(GENCSDATASRC)/DoubleByte-X.java.template \
		$(GENCSDATASRC)/extsbcs $(GENCSDATASRC)/dbcs
	@$(prep-target)
	$(RM) -r $(GENCSEXT)
	$(MKDIR) -p $(GENCSEXT)
	$(BOOT_JAVA_CMD) -jar $(CHARSETMAPPING_JARFILE)	$(GENCSDATASRC) $(GENCSEXT) extsbcs
	$(BOOT_JAVA_CMD) -jar $(CHARSETMAPPING_JARFILE) $(GENCSDATASRC) $(GENCSEXT) euctw \
116 117 118
		$(GENCSSRCDIR)/EUC_TW.java
	$(BOOT_JAVA_CMD) -jar $(CHARSETMAPPING_JARFILE) $(GENCSDATASRC) $(GENCSEXT) hkscs \
		$(GENCSSRCDIR)/HKSCS.java
119 120 121 122 123 124
	$(BOOT_JAVA_CMD) -jar $(CHARSETMAPPING_JARFILE) $(GENCSDATASRC) $(GENCSEXT) dbcs

$(CLASSDESTDIR)/$(SERVICE_DESCRIPTION_PATH): \
  $(SHARE_SRC)/classes/sun/nio/cs/ext/$(SERVICE_DESCRIPTION_PATH)
	$(install-file)

125 126 127 128 129 130 131
# no compression unless requested
ifndef COMPRESS_JARS
  CREATE_JAR_OPTS_NOMANIFEST = cf0
else
  CREATE_JAR_OPTS_NOMANIFEST = cf
endif

132
$(CHARSETS_JAR): $(FILES_class) $(CLASSDESTDIR)/$(SERVICE_DESCRIPTION_PATH) $(FILES_DAT)
133
	$(BOOT_JAR_CMD) $(CREATE_JAR_OPTS_NOMANIFEST) $(CHARSETS_JAR) \
134 135 136 137 138 139 140 141
	      -C $(CLASSDESTDIR) sun \
	      -C $(CLASSDESTDIR) $(SERVICE_DESCRIPTION_PATH)  \
	      $(BOOT_JAR_JFLAGS)
	@$(java-vm-cleanup)

clean::
	$(RM) -r $(CLASSDESTDIR)
	$(RM) $(CHARSETS_JAR)