blob: 1ae71492ea6a7f56de68bdcf5c223a30df8346a2 [file] [log] [blame]
erikje78df742012-06-07 20:40:50 -07001#
2# Copyright (c) 2011, 2012, 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
26GENSRC_CHARSETCODER :=
27
ohairb71409c2012-10-26 14:23:29 -070028GENSRC_CHARSETCODER_TMP := $(JDK_OUTPUTDIR)/gensrc
29GENSRC_CHARSETCODER_DST := $(JDK_OUTPUTDIR)/gensrc/java/nio/charset
erikje78df742012-06-07 20:40:50 -070030
31GENSRC_CHARSETCODER_SRC := $(JDK_TOPDIR)/src/share/classes/java/nio
32
33GENSRC_CHARSETCODER_TEMPLATE := $(GENSRC_CHARSETCODER_SRC)/charset/Charset-X-Coder.java.template
34
35###
36
37$(GENSRC_CHARSETCODER_DST)/CharsetDecoder.java : $(GENSRC_CHARSETCODER_TEMPLATE)
38 $(MKDIR) -p $(@D)
ohair46fcac92012-09-18 11:29:24 -070039 -$(RM) $@.tmp
40 $(TOOL_SPP) < $< >$@.tmp \
erikje78df742012-06-07 20:40:50 -070041 -Kdecoder \
42 -DA='A' \
43 -Da='a' \
44 -DCode='Decode' \
45 -Dcode='decode' \
46 -DitypesPhrase='bytes in a specific charset' \
47 -DotypesPhrase='sixteen-bit Unicode characters' \
48 -Ditype='byte' \
49 -Dotype='character' \
50 -DItype='Byte' \
51 -DOtype='Char' \
52 -Dcoder='decoder' \
53 -DCoder='Decoder' \
54 -Dcoding='decoding' \
55 -DOtherCoder='Encoder' \
56 -DreplTypeName='string' \
57 -DdefaultRepl='"\\uFFFD"' \
58 -DdefaultReplName='<tt>"\&#92;uFFFD"<\/tt>' \
59 -DreplType='String' \
60 -DreplFQType='java.lang.String' \
61 -DreplLength='length()' \
62 -DItypesPerOtype='CharsPerByte' \
63 -DnotLegal='not legal for this charset' \
64 -Dotypes-per-itype='chars-per-byte' \
65 -DoutSequence='Unicode character'
ohair46fcac92012-09-18 11:29:24 -070066 $(MV) $@.tmp $@
erikje78df742012-06-07 20:40:50 -070067
68GENSRC_CHARSETCODER += $(GENSRC_CHARSETCODER_DST)/CharsetDecoder.java
69
70###
71
72$(GENSRC_CHARSETCODER_DST)/CharsetEncoder.java : $(GENSRC_CHARSETCODER_TEMPLATE)
73 $(MKDIR) -p $(@D)
ohair46fcac92012-09-18 11:29:24 -070074 -$(RM) $@.tmp
75 $(TOOL_SPP) < $< >$@.tmp \
erikje78df742012-06-07 20:40:50 -070076 -Kencoder \
77 -DA='An' \
78 -Da='an' \
79 -DCode='Encode' \
80 -Dcode='encode' \
81 -DitypesPhrase='sixteen-bit Unicode characters' \
82 -DotypesPhrase='bytes in a specific charset' \
83 -Ditype='character' \
84 -Dotype='byte' \
85 -DItype='Char' \
86 -DOtype='Byte' \
87 -Dcoder='encoder' \
88 -DCoder='Encoder' \
89 -Dcoding='encoding' \
90 -DOtherCoder='Decoder' \
91 -DreplTypeName='byte array' \
92 -DdefaultRepl='new byte[] { (byte)'"'"\\?"'"' }' \
93 -DdefaultReplName='<tt>{<\/tt>\&nbsp;<tt>(byte)'"'"\\?"'"'<\/tt>\&nbsp;<tt>}<\/tt>' \
94 -DreplType='byte[]' \
95 -DreplFQType='byte[]' \
96 -DreplLength='length' \
97 -DItypesPerOtype='BytesPerChar' \
98 -DnotLegal='not a legal sixteen-bit Unicode sequence' \
99 -Dotypes-per-itype='bytes-per-char' \
100 -DoutSequence='byte sequence in the given charset'
ohair46fcac92012-09-18 11:29:24 -0700101 $(MV) $@.tmp $@
erikje78df742012-06-07 20:40:50 -0700102
103GENSRC_CHARSETCODER += $(GENSRC_CHARSETCODER_DST)/CharsetEncoder.java
104
105###
106
107$(GENSRC_CHARSETCODER) : $(BUILD_TOOLS)