88123
|
1 # Makefile -- Makefile to generate charset maps in etc/charsets.
|
|
2 # Copyright (C) 2003
|
|
3 # National Institute of Advanced Industrial Science and Technology (AIST)
|
|
4 # Registration Number H13PRO009
|
|
5 #
|
|
6 # This file is part of GNU Emacs.
|
|
7
|
|
8 # GNU Emacs is free software; you can redistribute it and/or modify
|
|
9 # it under the terms of the GNU General Public License as published by
|
|
10 # the Free Software Foundation; either version 2, or (at your option)
|
|
11 # any later version.
|
|
12
|
|
13 # GNU Emacs is distributed in the hope that it will be useful,
|
|
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16 # GNU General Public License for more details.
|
|
17
|
|
18 # You should have received a copy of the GNU General Public License
|
|
19 # along with GNU Emacs; see the file COPYING. If not, write to the
|
|
20 # Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
21 # Boston, MA 02111-1307, USA.
|
|
22
|
|
23 # Commentary
|
|
24
|
|
25 # At first, set these environment variables:
|
|
26 # GLIBC_CHARMAPS
|
|
27 # Directory of glibc-VERSION/localedate/charmaps.
|
|
28 # VERSION must be 2.3 or the later.
|
|
29 # MISC_CHARMAPS
|
|
30 # Direcory containing these charmap files:
|
|
31 # o bulgarian-mik.txt.gz
|
|
32 # provided at <http://czyborra.com/charsets/>
|
|
33 # o PTCP154
|
|
34 # provided at <http://www.iana.org/assignments/charset-reg/>
|
|
35 # o stdenc.txt and symbol.txt
|
|
36 # provided at <http://www.unicode.org/Public/MAPPINGS/>
|
|
37 # o Uni2JIS
|
|
38 # provided at <http://kanji.zinbun.kyoto-u.ac.jp/~yasuoka/CJK.html>
|
|
39 # o 720.htm and 858.htm
|
|
40 # provided at <http://www.microsoft.com/globaldev/reference/oem/>
|
|
41 # OLDEMACS
|
|
42 # emacs of version 21.3.50 or later
|
|
43 #
|
|
44 # Then, do this:
|
|
45 # % make install
|
|
46
|
|
47 CHARSETS = ${ISO8859} ${IBM} ${CODEPAGE} ${CJK} ${MISC} ${MULE}
|
|
48
|
|
49 # Note: We can not prepend "ISO-" to these map files because of file
|
|
50 # name limits on DOS.
|
|
51 ISO8859 = \
|
|
52 8859-2.map 8859-3.map 8859-4.map 8859-5.map 8859-6.map 8859-7.map \
|
|
53 8859-8.map 8859-9.map 8859-10.map 8859-11.map 8859-13.map 8859-14.map \
|
|
54 8859-15.map 8859-16.map
|
|
55
|
|
56 IBM = \
|
|
57 IBM037.map IBM038.map \
|
|
58 IBM256.map IBM273.map IBM274.map IBM275.map IBM277.map IBM278.map \
|
|
59 IBM280.map IBM281.map IBM284.map IBM285.map IBM290.map IBM297.map \
|
|
60 IBM420.map IBM423.map IBM424.map IBM437.map IBM500.map IBM850.map \
|
|
61 IBM851.map IBM852.map IBM855.map IBM856.map IBM857.map IBM860.map \
|
|
62 IBM861.map IBM862.map IBM863.map IBM864.map IBM865.map IBM866.map \
|
|
63 IBM868.map IBM869.map IBM870.map IBM871.map IBM874.map IBM875.map \
|
|
64 IBM880.map IBM891.map IBM903.map IBM904.map IBM905.map IBM918.map \
|
|
65 IBM1004.map IBM1026.map IBM1047.map
|
|
66
|
|
67 CODEPAGE = \
|
|
68 CP737.map CP775.map CP1125.map\
|
|
69 CP1250.map CP1251.map CP1252.map CP1253.map CP1254.map \
|
|
70 CP1255.map CP1256.map CP1257.map CP1258.map \
|
|
71 CP10007.map \
|
|
72 CP720.map CP858.map
|
|
73
|
|
74 CJK = GB2312.map GBK.map GB180302.map GB180304.map \
|
|
75 BIG5.map BIG5-HKSCS.map\
|
|
76 CNS-1.map CNS-2.map CNS-3.map CNS-4.map CNS-5.map CNS-6.map CNS-7.map \
|
|
77 CNS-F.map \
|
|
78 JISX0201.map JISX0208.map JISX0212.map JISX2131.map JISX2132.map \
|
|
79 JISC6226.map \
|
|
80 KSC5601.map KSC5636.map JOHAB.map
|
|
81
|
|
82 MISC = KOI-8.map KOI8-R.map KOI8-U.map KOI8-T.map ALTERNATIVNYJ.map \
|
|
83 MIK.map PTCP154.map \
|
|
84 TIS-620.map VISCII.map VSCII.map VSCII-2.map\
|
|
85 KA-PS.map KA-ACADEMY.map \
|
|
86 HP-ROMAN8.map NEXTSTEP.map MACINTOSH.map EBCDICUK.map EBCDICUS.map \
|
|
87 stdenc.map symbol.map \
|
|
88 CP949-2BYTE.map \
|
|
89 BIG5-1.map BIG5-2.map
|
|
90
|
|
91 # Emacs-mule charsets.
|
|
92 MULE = MULE-ethiopic.map MULE-ipa.map MULE-is13194.map \
|
|
93 MULE-sisheng.map MULE-tibetan.map \
|
|
94 MULE-lviscii.map MULE-uviscii.map
|
|
95
|
|
96 charsets: ${CHARSETS}
|
|
97
|
|
98 AWK = gawk
|
|
99
|
|
100 # Rules for each charset
|
|
101
|
|
102 VSCII.map: ${GLIBC_CHARMAPS}/TCVN5712-1 mapconv compact.awk
|
|
103 # Generating $@...
|
|
104 @mapconv $< '/^<.*[ ]\/x[0-9a-f].[ ]/' GLIBC-1 compact.awk > $@
|
|
105
|
|
106 VSCII-2.map: ${GLIBC_CHARMAPS}/TCVN5712-1 mapconv compact.awk
|
|
107 # Generating $@...
|
|
108 @mapconv $< '/^<.*[ ]\/x[2-7a-f].[ ]/' GLIBC-1 compact.awk \
|
|
109 | sed 's/0x20-0x7F.*/0x00-0x7F 0x0000/' > $@
|
|
110
|
|
111 ALTERNATIVNYJ.map: IBM866.map
|
|
112 # Generating $@...
|
|
113 @echo "# Modified from ibm866 according to the chart at" > $@
|
|
114 @echo "# http://www.cyrillic.com/ref/cyrillic/koi-8alt.html," >> $@
|
|
115 @echo "# with guesses for the Unicodes of the glyphs." >> $@
|
|
116 @sed -e '/0xF2/ s/ .*/ 0x2019/' \
|
|
117 -e '/0xF3/ s/ .*/ 0x2018/' \
|
|
118 -e '/0xF4/ s/ .*/ 0x0301/' \
|
|
119 -e '/0xF5/ s/ .*/ 0x0300/' \
|
|
120 -e '/0xF6/ s/ .*/ 0x203A/' \
|
|
121 -e '/0xF7/ s/ .*/ 0x2039/' \
|
|
122 -e '/0xF8/ s/ .*/ 0x2191/' \
|
|
123 -e '/0xF9/ s/ .*/ 0x2193/' \
|
|
124 -e '/0xFA/ s/ .*/ 0x00B1/' \
|
|
125 -e '/0xFB/ s/ .*/ 0x00F7/' < $< >> $@
|
|
126
|
|
127 MIK.map: ${MISC_CHARMAPS}/bulgarian-mik.txt.gz mapconv compact.awk
|
|
128 # Generating $@...
|
|
129 @mapconv $< '1,$$' CZYBORRA compact.awk > $@
|
|
130
|
|
131 PTCP154.map: ${MISC_CHARMAPS}/PTCP154 mapconv compact.awk
|
|
132 # Generating $@...
|
|
133 @mapconv $< '/^0x/' IANA compact.awk > $@
|
|
134
|
|
135 stdenc.map: ${MISC_CHARMAPS}/stdenc.txt mapconv compact.awk
|
|
136 # Generating $@...
|
|
137 @mapconv $< '/^[0-9A-Fa-f]/' UNICODE compact.awk > $@
|
|
138
|
|
139 symbol.map: ${MISC_CHARMAPS}/symbol.txt mapconv compact.awk
|
|
140 # Generating $@...
|
|
141 @mapconv $< '/^[0-9A-Fa-f]/' UNICODE compact.awk > $@
|
|
142
|
|
143 CP720.map: ${MISC_CHARMAPS}/720.htm mapconv compact.awk
|
|
144 # Generating $@...
|
|
145 @mapconv $< '/^[0-9A-F]/' MICROSOFT compact.awk > $@
|
|
146
|
|
147 CP858.map: ${MISC_CHARMAPS}/858.htm mapconv compact.awk
|
|
148 # Generating $@...
|
|
149 @mapconv $< '/^[0-9A-F]/' MICROSOFT compact.awk > $@
|
|
150
|
|
151 CP949-2BYTE.map: ${GLIBC_CHARMAPS}/CP949 mapconv compact.awk
|
|
152 # Generating $@...
|
|
153 @mapconv $< '/^<.*[ ]\/x[89a-f]/' GLIBC-2 compact.awk > $@
|
|
154
|
|
155 GB2312.map: ${GLIBC_CHARMAPS}/GB2312 mapconv compact.awk
|
|
156 # Generating $@...
|
|
157 @mapconv $< '/^<.*[ ]\/x[a-f]/' GLIBC-2-7 compact.awk > $@
|
|
158
|
|
159 GBK.map: ${GLIBC_CHARMAPS}/GBK mapconv compact.awk
|
|
160 # Generating $@...
|
|
161 @mapconv $< '/^<.*[ ]\/x[89a-f]/' GLIBC-2 compact.awk > $@
|
|
162
|
|
163 GB180302.map: ${GLIBC_CHARMAPS}/GB18030 mapconv gb180302.awk
|
|
164 # Generating $@...
|
|
165 @mapconv $< '/^<.*[ ]\/x..\/x..[ ]/' GLIBC-2 gb180302.awk > $@
|
|
166
|
|
167 GB180304.map: GB180302.map gb180304.awk
|
|
168 # Generating $@...
|
|
169 @$(AWK) -f gb180304.awk < $< > $@
|
|
170
|
|
171 JISX0201.map: ${GLIBC_CHARMAPS}/JIS_X0201 mapconv compact.awk
|
|
172 # Generating $@...
|
|
173 @mapconv $< '/^<.*[ ]\/x[0-9]/' GLIBC-1 compact.awk > $@
|
|
174 @echo "# Generated by hand" >> $@
|
|
175 @echo "0xA1-0xDF 0xFF61" >> $@
|
|
176
|
|
177 JISX0208.map: ${GLIBC_CHARMAPS}/EUC-JP mapconv
|
|
178 # Generating $@...
|
|
179 @mapconv $< '/^<.*[ ]\/x[a-f]/' GLIBC-2-7 > $@
|
|
180
|
|
181 JISX0212.map: ${GLIBC_CHARMAPS}/EUC-JP mapconv compact.awk
|
|
182 # Generating $@...
|
|
183 @mapconv $< '/^<.*[ ]\/x8f/ s,/x8f,,' GLIBC-2-7 compact.awk > $@
|
|
184
|
|
185 JISX2131.map: ${GLIBC_CHARMAPS}/EUC-JISX0213 mapconv
|
|
186 # Generating $@...
|
|
187 @mapconv $< '/^<.*[ ]\/x[a-f]/' GLIBC-2-7 > $@
|
|
188
|
|
189 JISX2132.map: ${GLIBC_CHARMAPS}/EUC-JISX0213 mapconv
|
|
190 # Generating $@...
|
|
191 @mapconv $< '/^<.*[ ]\/x8f/ s,/x8f,,' GLIBC-2-7 > $@
|
|
192
|
|
193 JISC6226.map : ${MISC_CHARMAPS}/Uni2JIS mapconv kuten.awk
|
|
194 # Generating $@...
|
|
195 @mapconv $< '/^[^#].*0-/' YASUOKA kuten.awk > $@
|
|
196
|
|
197 KSC5601.map: ${GLIBC_CHARMAPS}/EUC-KR mapconv compact.awk
|
|
198 # Generating $@...
|
|
199 @mapconv $< '/^<.*[ ]\/x[a-f]/' GLIBC-2-7 compact.awk > $@
|
|
200
|
|
201 BIG5.map: ${GLIBC_CHARMAPS}/BIG5 mapconv compact.awk
|
|
202 # Generating $@...
|
|
203 @mapconv $< '/^<.*[ ]\/x[a-f]/' GLIBC-2 > $@
|
|
204
|
|
205 BIG5-1.map: BIG5.map mapconv big5.awk
|
|
206 # Generating $@...
|
|
207 @echo "Generated from $<" > $@
|
|
208 @sed -n -e '/0xa140/,/0xc8fe/p' < $< | gawk -f big5.awk >> $@
|
|
209
|
|
210 BIG5-2.map: BIG5.map mapconv big5.awk
|
|
211 # Generating $@...
|
|
212 @echo "Generated from $<" > $@
|
|
213 @sed -n -e '/0xc940/,$$ p' < $< | gawk -f big5.awk >> $@
|
|
214
|
|
215 BIG5-HKSCS.map: ${GLIBC_CHARMAPS}/BIG5-HKSCS mapconv compact.awk
|
|
216 # Generating $@...
|
|
217 @mapconv $< '/^<.*[ ]\/x[89a-f].\//' GLIBC-2 compact.awk > $@
|
|
218
|
|
219 JOHAB.map: ${GLIBC_CHARMAPS}/JOHAB mapconv compact.awk
|
|
220 # Generating $@...
|
|
221 @mapconv $< '/^<.*[ ]\/x[89a-f]/' GLIBC-2 compact.awk > $@
|
|
222
|
|
223 CNS-1.map: ${GLIBC_CHARMAPS}/EUC-TW mapconv compact.awk
|
|
224 # Generating $@...
|
|
225 @mapconv $< '/^<.*[ ]\/x[a-f]/' GLIBC-2-7 compact.awk > $@
|
|
226
|
|
227 CNS-2.map: ${GLIBC_CHARMAPS}/EUC-TW mapconv compact.awk
|
|
228 # Generating $@...
|
|
229 @mapconv $< '/^<.*\/x8e\/xa2/s,/x8e/xa2,,' GLIBC-2-7 compact.awk > $@
|
|
230
|
|
231 CNS-3.map: ${GLIBC_CHARMAPS}/EUC-TW mapconv compact.awk
|
|
232 # Generating $@...
|
|
233 @mapconv $< '/^<.*\/x8e\/xa3/ s,/x8e/xa3,,' GLIBC-2-7 compact.awk > $@
|
|
234
|
|
235 CNS-4.map: ${GLIBC_CHARMAPS}/EUC-TW mapconv compact.awk
|
|
236 # Generating $@...
|
|
237 @mapconv $< '/^<.*\/x8e\/xa4/ s,/x8e/xa4,,' GLIBC-2-7 compact.awk > $@
|
|
238
|
|
239 CNS-5.map: ${GLIBC_CHARMAPS}/EUC-TW mapconv compact.awk
|
|
240 # Generating $@...
|
|
241 @mapconv $< '/^<.*\/x8e\/xa5/ s,/x8e/xa5,,' GLIBC-2-7 compact.awk > $@
|
|
242
|
|
243 CNS-6.map: ${GLIBC_CHARMAPS}/EUC-TW mapconv compact.awk
|
|
244 # Generating $@...
|
|
245 @mapconv $< '/^<.*\/x8e\/xa6/ s,/x8e/xa6,,' GLIBC-2-7 compact.awk > $@
|
|
246
|
|
247 CNS-7.map: ${GLIBC_CHARMAPS}/EUC-TW mapconv compact.awk
|
|
248 # Generating $@...
|
|
249 @mapconv $< '/^<.*\/x8e\/xa7/ s,/x8e/xa7,,' GLIBC-2-7 compact.awk > $@
|
|
250
|
|
251 CNS-F.map: ${GLIBC_CHARMAPS}/EUC-TW mapconv compact.awk
|
|
252 # Generating $@...
|
|
253 @mapconv $< '/^<.*\/x8e\/xaf/ s,/x8e/xaf,,' GLIBC-2-7 compact.awk > $@
|
|
254
|
|
255 # General target to produce map files for mule charsets.
|
|
256 MULE-%.map: mule-charsets.el
|
|
257 # Generating $@...
|
|
258 @${OLDEMACS} -batch -l ./mule-charsets.el $@
|
|
259
|
|
260 # General target to produce map files for ISO-8859, GEORGIAN, and
|
|
261 # EBCDIC charsets. We can not use the original file name because of
|
|
262 # file name limit on DOS. "KA" is ISO 639 language code for Georgian.
|
|
263
|
|
264 8859-%.map: ${GLIBC_CHARMAPS}/ISO-8859-% mapconv compact.awk
|
|
265 # Generating $@...
|
|
266 @mapconv $< '/^<.*[ ]\/x/' GLIBC-1 compact.awk > $@
|
|
267
|
|
268 KA-%.map: ${GLIBC_CHARMAPS}/GEORGIAN-% mapconv compact.awk
|
|
269 # Generating $@...
|
|
270 @mapconv $< '/^<.*[ ]\/x/' GLIBC-1 compact.awk > $@
|
|
271
|
|
272 EBCDIC%.map: ${GLIBC_CHARMAPS}/EBCDIC-% mapconv compact.awk
|
|
273 # Generating $@...
|
|
274 @mapconv $< '/^<.*[ ]\/x/' GLIBC-1 compact.awk > $@
|
|
275
|
|
276 # General target to produce map files for single-byte charsets.
|
|
277
|
|
278 %.map: ${GLIBC_CHARMAPS}/% mapconv compact.awk
|
|
279 # Generating $@...
|
|
280 @mapconv $< '/^<.*[ ]\/x/' GLIBC-1 compact.awk > $@
|
|
281
|
|
282 install: ${CHARSETS}
|
|
283 cp ${CHARSETS} ../../etc/charsets
|
|
284
|
|
285 # Clear files that are automatically generated.
|
|
286 clean:
|
|
287 rm -f ${CHARSETS}
|