author | erikj |
Fri, 19 Sep 2014 09:59:36 +0200 | |
changeset 26717 | d65c07a65486 |
parent 25859 | 3317bb8137f4 |
child 27565 | 729f9700483a |
permissions | -rw-r--r-- |
12892 | 1 |
# |
22639
37f4508257fe
8033236: Update GensrcCharsetMapping.gmk to build-infra standards
ihse
parents:
21805
diff
changeset
|
2 |
# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. |
12892 | 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 |
||
26717
d65c07a65486
8055189: Cleanup gensrc after source code restructure
erikj
parents:
25859
diff
changeset
|
26 |
################################################################################ |
d65c07a65486
8055189: Cleanup gensrc after source code restructure
erikj
parents:
25859
diff
changeset
|
27 |
# |
d65c07a65486
8055189: Cleanup gensrc after source code restructure
erikj
parents:
25859
diff
changeset
|
28 |
# Generate files using the charsetmapping tool |
d65c07a65486
8055189: Cleanup gensrc after source code restructure
erikj
parents:
25859
diff
changeset
|
29 |
# |
22639
37f4508257fe
8033236: Update GensrcCharsetMapping.gmk to build-infra standards
ihse
parents:
21805
diff
changeset
|
30 |
CHARSET_DATA_DIR := $(JDK_TOPDIR)/make/data/charsetmapping |
25859 | 31 |
CHARSET_GENSRC_JAVA_DIR_BASE := $(JDK_OUTPUTDIR)/gensrc/java.base/sun/nio/cs |
32 |
CHARSET_DONE_BASE := $(CHARSET_GENSRC_JAVA_DIR_BASE)/_the.charsetmapping |
|
22639
37f4508257fe
8033236: Update GensrcCharsetMapping.gmk to build-infra standards
ihse
parents:
21805
diff
changeset
|
33 |
CHARSET_TEMPLATES := \ |
37f4508257fe
8033236: Update GensrcCharsetMapping.gmk to build-infra standards
ihse
parents:
21805
diff
changeset
|
34 |
$(CHARSET_DATA_DIR)/SingleByte-X.java.template \ |
37f4508257fe
8033236: Update GensrcCharsetMapping.gmk to build-infra standards
ihse
parents:
21805
diff
changeset
|
35 |
$(CHARSET_DATA_DIR)/DoubleByte-X.java.template |
37f4508257fe
8033236: Update GensrcCharsetMapping.gmk to build-infra standards
ihse
parents:
21805
diff
changeset
|
36 |
|
25859 | 37 |
$(CHARSET_DONE_BASE)-sbcs: $(CHARSET_DATA_DIR)/sbcs \ |
26717
d65c07a65486
8055189: Cleanup gensrc after source code restructure
erikj
parents:
25859
diff
changeset
|
38 |
$(CHARSET_TEMPLATES) $(BUILD_TOOLS_JDK) |
d65c07a65486
8055189: Cleanup gensrc after source code restructure
erikj
parents:
25859
diff
changeset
|
39 |
$(MKDIR) -p $(@D) |
25859 | 40 |
$(TOOL_CHARSETMAPPING) $(CHARSET_DATA_DIR) $(CHARSET_GENSRC_JAVA_DIR_BASE) sbcs |
22639
37f4508257fe
8033236: Update GensrcCharsetMapping.gmk to build-infra standards
ihse
parents:
21805
diff
changeset
|
41 |
$(TOUCH) '$@' |
37f4508257fe
8033236: Update GensrcCharsetMapping.gmk to build-infra standards
ihse
parents:
21805
diff
changeset
|
42 |
|
26717
d65c07a65486
8055189: Cleanup gensrc after source code restructure
erikj
parents:
25859
diff
changeset
|
43 |
GENSRC_JAVA_BASE += $(CHARSET_DONE_BASE)-sbcs |
12892 | 44 |
|
26717
d65c07a65486
8055189: Cleanup gensrc after source code restructure
erikj
parents:
25859
diff
changeset
|
45 |
################################################################################ |
d65c07a65486
8055189: Cleanup gensrc after source code restructure
erikj
parents:
25859
diff
changeset
|
46 |
# |
d65c07a65486
8055189: Cleanup gensrc after source code restructure
erikj
parents:
25859
diff
changeset
|
47 |
# Generate the sun/nio/cs/StandardCharsets.java file |
d65c07a65486
8055189: Cleanup gensrc after source code restructure
erikj
parents:
25859
diff
changeset
|
48 |
# |
22639
37f4508257fe
8033236: Update GensrcCharsetMapping.gmk to build-infra standards
ihse
parents:
21805
diff
changeset
|
49 |
CHARSET_STANDARD_GENSRC_DIR := $(JDK_OUTPUTDIR)/gensrc/standardcharsets |
37f4508257fe
8033236: Update GensrcCharsetMapping.gmk to build-infra standards
ihse
parents:
21805
diff
changeset
|
50 |
CHARSET_STANDARD_DATA := $(CHARSET_DATA_DIR)/standard-charsets |
37f4508257fe
8033236: Update GensrcCharsetMapping.gmk to build-infra standards
ihse
parents:
21805
diff
changeset
|
51 |
CHARSET_STANDARD_JAVA := sun/nio/cs/StandardCharsets.java |
12892 | 52 |
|
22639
37f4508257fe
8033236: Update GensrcCharsetMapping.gmk to build-infra standards
ihse
parents:
21805
diff
changeset
|
53 |
CHARSET_ALIASES_TABLES_AWK := ' \ |
37f4508257fe
8033236: Update GensrcCharsetMapping.gmk to build-infra standards
ihse
parents:
21805
diff
changeset
|
54 |
BEGIN { n = 1; m = 1; } \ |
37f4508257fe
8033236: Update GensrcCharsetMapping.gmk to build-infra standards
ihse
parents:
21805
diff
changeset
|
55 |
/^[ \t]*charset / { \ |
37f4508257fe
8033236: Update GensrcCharsetMapping.gmk to build-infra standards
ihse
parents:
21805
diff
changeset
|
56 |
csn = $$2; cln = $$3; \ |
37f4508257fe
8033236: Update GensrcCharsetMapping.gmk to build-infra standards
ihse
parents:
21805
diff
changeset
|
57 |
lcsn = tolower(csn); \ |
37f4508257fe
8033236: Update GensrcCharsetMapping.gmk to build-infra standards
ihse
parents:
21805
diff
changeset
|
58 |
lcsns[n++] = lcsn; \ |
37f4508257fe
8033236: Update GensrcCharsetMapping.gmk to build-infra standards
ihse
parents:
21805
diff
changeset
|
59 |
csns[lcsn] = csn; \ |
37f4508257fe
8033236: Update GensrcCharsetMapping.gmk to build-infra standards
ihse
parents:
21805
diff
changeset
|
60 |
classMap[lcsn] = cln; \ |
37f4508257fe
8033236: Update GensrcCharsetMapping.gmk to build-infra standards
ihse
parents:
21805
diff
changeset
|
61 |
if (n > 2) \ |
37f4508257fe
8033236: Update GensrcCharsetMapping.gmk to build-infra standards
ihse
parents:
21805
diff
changeset
|
62 |
printf " };\n\n"; \ |
37f4508257fe
8033236: Update GensrcCharsetMapping.gmk to build-infra standards
ihse
parents:
21805
diff
changeset
|
63 |
printf " static final String[] aliases_%s = new String[] {\n", cln; \ |
37f4508257fe
8033236: Update GensrcCharsetMapping.gmk to build-infra standards
ihse
parents:
21805
diff
changeset
|
64 |
} \ |
37f4508257fe
8033236: Update GensrcCharsetMapping.gmk to build-infra standards
ihse
parents:
21805
diff
changeset
|
65 |
/^[ \t]*alias / { \ |
37f4508257fe
8033236: Update GensrcCharsetMapping.gmk to build-infra standards
ihse
parents:
21805
diff
changeset
|
66 |
acsns[m++] = tolower($$2); \ |
37f4508257fe
8033236: Update GensrcCharsetMapping.gmk to build-infra standards
ihse
parents:
21805
diff
changeset
|
67 |
aliasMap[tolower($$2)] = lcsn; \ |
37f4508257fe
8033236: Update GensrcCharsetMapping.gmk to build-infra standards
ihse
parents:
21805
diff
changeset
|
68 |
printf " \"%s\",\n", $$2; \ |
37f4508257fe
8033236: Update GensrcCharsetMapping.gmk to build-infra standards
ihse
parents:
21805
diff
changeset
|
69 |
} \ |
37f4508257fe
8033236: Update GensrcCharsetMapping.gmk to build-infra standards
ihse
parents:
21805
diff
changeset
|
70 |
END { \ |
37f4508257fe
8033236: Update GensrcCharsetMapping.gmk to build-infra standards
ihse
parents:
21805
diff
changeset
|
71 |
printf " };\n\n"; \ |
37f4508257fe
8033236: Update GensrcCharsetMapping.gmk to build-infra standards
ihse
parents:
21805
diff
changeset
|
72 |
} ' |
12892 | 73 |
|
22639
37f4508257fe
8033236: Update GensrcCharsetMapping.gmk to build-infra standards
ihse
parents:
21805
diff
changeset
|
74 |
CHARSET_ALIASES_MAP_AWK := ' \ |
37f4508257fe
8033236: Update GensrcCharsetMapping.gmk to build-infra standards
ihse
parents:
21805
diff
changeset
|
75 |
/^[ \t]*charset / { \ |
37f4508257fe
8033236: Update GensrcCharsetMapping.gmk to build-infra standards
ihse
parents:
21805
diff
changeset
|
76 |
csn = $$2; \ |
37f4508257fe
8033236: Update GensrcCharsetMapping.gmk to build-infra standards
ihse
parents:
21805
diff
changeset
|
77 |
lcsn = tolower(csn); \ |
37f4508257fe
8033236: Update GensrcCharsetMapping.gmk to build-infra standards
ihse
parents:
21805
diff
changeset
|
78 |
} \ |
37f4508257fe
8033236: Update GensrcCharsetMapping.gmk to build-infra standards
ihse
parents:
21805
diff
changeset
|
79 |
/^[ \t]*alias / { \ |
37f4508257fe
8033236: Update GensrcCharsetMapping.gmk to build-infra standards
ihse
parents:
21805
diff
changeset
|
80 |
an = tolower($$2); \ |
37f4508257fe
8033236: Update GensrcCharsetMapping.gmk to build-infra standards
ihse
parents:
21805
diff
changeset
|
81 |
printf "%-20s \"%s\"\n", an, lcsn; \ |
37f4508257fe
8033236: Update GensrcCharsetMapping.gmk to build-infra standards
ihse
parents:
21805
diff
changeset
|
82 |
} ' |
12892 | 83 |
|
22639
37f4508257fe
8033236: Update GensrcCharsetMapping.gmk to build-infra standards
ihse
parents:
21805
diff
changeset
|
84 |
CHARSET_CLASSES_MAP_AWK := ' \ |
37f4508257fe
8033236: Update GensrcCharsetMapping.gmk to build-infra standards
ihse
parents:
21805
diff
changeset
|
85 |
/^[ \t]*charset / { \ |
37f4508257fe
8033236: Update GensrcCharsetMapping.gmk to build-infra standards
ihse
parents:
21805
diff
changeset
|
86 |
csn = $$2; cln = $$3; \ |
37f4508257fe
8033236: Update GensrcCharsetMapping.gmk to build-infra standards
ihse
parents:
21805
diff
changeset
|
87 |
lcsn = tolower(csn); \ |
37f4508257fe
8033236: Update GensrcCharsetMapping.gmk to build-infra standards
ihse
parents:
21805
diff
changeset
|
88 |
printf "%-20s \"%s\"\n", lcsn, cln; \ |
37f4508257fe
8033236: Update GensrcCharsetMapping.gmk to build-infra standards
ihse
parents:
21805
diff
changeset
|
89 |
} ' |
12892 | 90 |
|
22639
37f4508257fe
8033236: Update GensrcCharsetMapping.gmk to build-infra standards
ihse
parents:
21805
diff
changeset
|
91 |
# This target should be referenced using the order-only operator (|) |
37f4508257fe
8033236: Update GensrcCharsetMapping.gmk to build-infra standards
ihse
parents:
21805
diff
changeset
|
92 |
$(CHARSET_STANDARD_GENSRC_DIR): |
37f4508257fe
8033236: Update GensrcCharsetMapping.gmk to build-infra standards
ihse
parents:
21805
diff
changeset
|
93 |
$(MKDIR) -p '$@' |
37f4508257fe
8033236: Update GensrcCharsetMapping.gmk to build-infra standards
ihse
parents:
21805
diff
changeset
|
94 |
|
37f4508257fe
8033236: Update GensrcCharsetMapping.gmk to build-infra standards
ihse
parents:
21805
diff
changeset
|
95 |
$(CHARSET_STANDARD_GENSRC_DIR)/aliases-tables.java.snippet: $(CHARSET_STANDARD_DATA) \ |
37f4508257fe
8033236: Update GensrcCharsetMapping.gmk to build-infra standards
ihse
parents:
21805
diff
changeset
|
96 |
| $(CHARSET_STANDARD_GENSRC_DIR) |
37f4508257fe
8033236: Update GensrcCharsetMapping.gmk to build-infra standards
ihse
parents:
21805
diff
changeset
|
97 |
$(NAWK) < '$<' > '$@' $(CHARSET_ALIASES_TABLES_AWK) |
12892 | 98 |
|
22639
37f4508257fe
8033236: Update GensrcCharsetMapping.gmk to build-infra standards
ihse
parents:
21805
diff
changeset
|
99 |
$(CHARSET_STANDARD_GENSRC_DIR)/aliases-map: $(CHARSET_STANDARD_DATA) \ |
37f4508257fe
8033236: Update GensrcCharsetMapping.gmk to build-infra standards
ihse
parents:
21805
diff
changeset
|
100 |
| $(CHARSET_STANDARD_GENSRC_DIR) |
37f4508257fe
8033236: Update GensrcCharsetMapping.gmk to build-infra standards
ihse
parents:
21805
diff
changeset
|
101 |
$(NAWK) < '$<' > '$@' $(CHARSET_ALIASES_MAP_AWK) |
12892 | 102 |
|
22639
37f4508257fe
8033236: Update GensrcCharsetMapping.gmk to build-infra standards
ihse
parents:
21805
diff
changeset
|
103 |
$(CHARSET_STANDARD_GENSRC_DIR)/classes-map: $(CHARSET_STANDARD_DATA) \ |
37f4508257fe
8033236: Update GensrcCharsetMapping.gmk to build-infra standards
ihse
parents:
21805
diff
changeset
|
104 |
| $(CHARSET_STANDARD_GENSRC_DIR) |
37f4508257fe
8033236: Update GensrcCharsetMapping.gmk to build-infra standards
ihse
parents:
21805
diff
changeset
|
105 |
$(NAWK) < '$<' > '$@' $(CHARSET_CLASSES_MAP_AWK) |
12892 | 106 |
|
22639
37f4508257fe
8033236: Update GensrcCharsetMapping.gmk to build-infra standards
ihse
parents:
21805
diff
changeset
|
107 |
$(CHARSET_STANDARD_GENSRC_DIR)/aliases-map.java.snippet: $(CHARSET_STANDARD_GENSRC_DIR)/aliases-map \ |
25859 | 108 |
$(BUILD_TOOLS_JDK) | $(CHARSET_STANDARD_GENSRC_DIR) |
22639
37f4508257fe
8033236: Update GensrcCharsetMapping.gmk to build-infra standards
ihse
parents:
21805
diff
changeset
|
109 |
$(TOOL_HASHER) -i Aliases < '$<' > '$@' |
12892 | 110 |
|
22639
37f4508257fe
8033236: Update GensrcCharsetMapping.gmk to build-infra standards
ihse
parents:
21805
diff
changeset
|
111 |
$(CHARSET_STANDARD_GENSRC_DIR)/classes-map.java.snippet: $(CHARSET_STANDARD_GENSRC_DIR)/classes-map \ |
25859 | 112 |
$(BUILD_TOOLS_JDK) | $(CHARSET_STANDARD_GENSRC_DIR) |
22639
37f4508257fe
8033236: Update GensrcCharsetMapping.gmk to build-infra standards
ihse
parents:
21805
diff
changeset
|
113 |
$(TOOL_HASHER) -i Classes < '$<' > '$@' |
37f4508257fe
8033236: Update GensrcCharsetMapping.gmk to build-infra standards
ihse
parents:
21805
diff
changeset
|
114 |
|
37f4508257fe
8033236: Update GensrcCharsetMapping.gmk to build-infra standards
ihse
parents:
21805
diff
changeset
|
115 |
$(CHARSET_STANDARD_GENSRC_DIR)/cache-map.java.snippet: $(CHARSET_STANDARD_GENSRC_DIR)/classes-map \ |
25859 | 116 |
$(BUILD_TOOLS_JDK) | $(CHARSET_STANDARD_GENSRC_DIR) |
22639
37f4508257fe
8033236: Update GensrcCharsetMapping.gmk to build-infra standards
ihse
parents:
21805
diff
changeset
|
117 |
$(TOOL_HASHER) -i -e Cache -t Charset < '$<' > '$@' |
12892 | 118 |
|
22639
37f4508257fe
8033236: Update GensrcCharsetMapping.gmk to build-infra standards
ihse
parents:
21805
diff
changeset
|
119 |
$(eval $(call SetupTextFileProcessing, BUILD_CHARSET_STANDARD, \ |
25859 | 120 |
SOURCE_FILES := $(JDK_TOPDIR)/src/java.base/share/classes/$(CHARSET_STANDARD_JAVA).template, \ |
121 |
OUTPUT_FILE := $(JDK_OUTPUTDIR)/gensrc/java.base/$(CHARSET_STANDARD_JAVA), \ |
|
22639
37f4508257fe
8033236: Update GensrcCharsetMapping.gmk to build-infra standards
ihse
parents:
21805
diff
changeset
|
122 |
INCLUDES := \ |
37f4508257fe
8033236: Update GensrcCharsetMapping.gmk to build-infra standards
ihse
parents:
21805
diff
changeset
|
123 |
_INCLUDE_ALIASES_TABLES_ => $(CHARSET_STANDARD_GENSRC_DIR)/aliases-tables.java.snippet ; \ |
37f4508257fe
8033236: Update GensrcCharsetMapping.gmk to build-infra standards
ihse
parents:
21805
diff
changeset
|
124 |
_INCLUDE_ALIASES_MAP_ => $(CHARSET_STANDARD_GENSRC_DIR)/aliases-map.java.snippet ; \ |
37f4508257fe
8033236: Update GensrcCharsetMapping.gmk to build-infra standards
ihse
parents:
21805
diff
changeset
|
125 |
_INCLUDE_CLASSES_MAP_ => $(CHARSET_STANDARD_GENSRC_DIR)/classes-map.java.snippet ; \ |
37f4508257fe
8033236: Update GensrcCharsetMapping.gmk to build-infra standards
ihse
parents:
21805
diff
changeset
|
126 |
_INCLUDE_CACHE_MAP_ => $(CHARSET_STANDARD_GENSRC_DIR)/cache-map.java.snippet ; , \ |
37f4508257fe
8033236: Update GensrcCharsetMapping.gmk to build-infra standards
ihse
parents:
21805
diff
changeset
|
127 |
)) |
12892 | 128 |
|
22639
37f4508257fe
8033236: Update GensrcCharsetMapping.gmk to build-infra standards
ihse
parents:
21805
diff
changeset
|
129 |
# Processing of template depends on the snippets being generated first |
37f4508257fe
8033236: Update GensrcCharsetMapping.gmk to build-infra standards
ihse
parents:
21805
diff
changeset
|
130 |
$(BUILD_CHARSET_STANDARD): \ |
37f4508257fe
8033236: Update GensrcCharsetMapping.gmk to build-infra standards
ihse
parents:
21805
diff
changeset
|
131 |
$(CHARSET_STANDARD_GENSRC_DIR)/aliases-tables.java.snippet \ |
37f4508257fe
8033236: Update GensrcCharsetMapping.gmk to build-infra standards
ihse
parents:
21805
diff
changeset
|
132 |
$(CHARSET_STANDARD_GENSRC_DIR)/aliases-map.java.snippet \ |
37f4508257fe
8033236: Update GensrcCharsetMapping.gmk to build-infra standards
ihse
parents:
21805
diff
changeset
|
133 |
$(CHARSET_STANDARD_GENSRC_DIR)/classes-map.java.snippet \ |
37f4508257fe
8033236: Update GensrcCharsetMapping.gmk to build-infra standards
ihse
parents:
21805
diff
changeset
|
134 |
$(CHARSET_STANDARD_GENSRC_DIR)/cache-map.java.snippet |
37f4508257fe
8033236: Update GensrcCharsetMapping.gmk to build-infra standards
ihse
parents:
21805
diff
changeset
|
135 |
|
25859 | 136 |
GENSRC_JAVA_BASE += $(BUILD_CHARSET_STANDARD) |