Mercurial > emacs
annotate admin/charsets/Makefile @ 89751:a6bed93396e8
(TRANS_TABLE): New macro.
(JISX0208.map): Convert 0x2015 to 0x2014.
(cp51932.el): New target.
(eucjp-ms.el): New target.
(install): Include ${TRANS_TABLE}.
author | Kenichi Handa <handa@m17n.org> |
---|---|
date | Tue, 27 Jan 2004 02:02:55 +0000 |
parents | 09b8cb925c81 |
children | 95fd0085db37 |
rev | line source |
---|---|
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/> | |
89738
d00dd977bedf
(CJK): Include CP932-2BYTE.map
Kenichi Handa <handa@m17n.org>
parents:
88123
diff
changeset
|
37 # o cp932.txt |
d00dd977bedf
(CJK): Include CP932-2BYTE.map
Kenichi Handa <handa@m17n.org>
parents:
88123
diff
changeset
|
38 # provided at <http://www.unicode.org/Public/MAPPINGS/VENDERS> |
88123 | 39 # o Uni2JIS |
40 # provided at <http://kanji.zinbun.kyoto-u.ac.jp/~yasuoka/CJK.html> | |
41 # o 720.htm and 858.htm | |
42 # provided at <http://www.microsoft.com/globaldev/reference/oem/> | |
89751 | 43 # o eucJP-13th.txt, eucJP-udc.txt, eucJP-ibmext.txt |
44 # provided at <http://www.opengroup.or.jp/jvc/cde/> | |
88123 | 45 # OLDEMACS |
46 # emacs of version 21.3.50 or later | |
47 # | |
48 # Then, do this: | |
49 # % make install | |
50 | |
51 CHARSETS = ${ISO8859} ${IBM} ${CODEPAGE} ${CJK} ${MISC} ${MULE} | |
52 | |
53 # Note: We can not prepend "ISO-" to these map files because of file | |
54 # name limits on DOS. | |
55 ISO8859 = \ | |
56 8859-2.map 8859-3.map 8859-4.map 8859-5.map 8859-6.map 8859-7.map \ | |
57 8859-8.map 8859-9.map 8859-10.map 8859-11.map 8859-13.map 8859-14.map \ | |
58 8859-15.map 8859-16.map | |
59 | |
60 IBM = \ | |
61 IBM037.map IBM038.map \ | |
62 IBM256.map IBM273.map IBM274.map IBM275.map IBM277.map IBM278.map \ | |
63 IBM280.map IBM281.map IBM284.map IBM285.map IBM290.map IBM297.map \ | |
64 IBM420.map IBM423.map IBM424.map IBM437.map IBM500.map IBM850.map \ | |
65 IBM851.map IBM852.map IBM855.map IBM856.map IBM857.map IBM860.map \ | |
66 IBM861.map IBM862.map IBM863.map IBM864.map IBM865.map IBM866.map \ | |
67 IBM868.map IBM869.map IBM870.map IBM871.map IBM874.map IBM875.map \ | |
68 IBM880.map IBM891.map IBM903.map IBM904.map IBM905.map IBM918.map \ | |
69 IBM1004.map IBM1026.map IBM1047.map | |
70 | |
71 CODEPAGE = \ | |
72 CP737.map CP775.map CP1125.map\ | |
73 CP1250.map CP1251.map CP1252.map CP1253.map CP1254.map \ | |
74 CP1255.map CP1256.map CP1257.map CP1258.map \ | |
75 CP10007.map \ | |
76 CP720.map CP858.map | |
77 | |
78 CJK = GB2312.map GBK.map GB180302.map GB180304.map \ | |
79 BIG5.map BIG5-HKSCS.map\ | |
80 CNS-1.map CNS-2.map CNS-3.map CNS-4.map CNS-5.map CNS-6.map CNS-7.map \ | |
81 CNS-F.map \ | |
82 JISX0201.map JISX0208.map JISX0212.map JISX2131.map JISX2132.map \ | |
89738
d00dd977bedf
(CJK): Include CP932-2BYTE.map
Kenichi Handa <handa@m17n.org>
parents:
88123
diff
changeset
|
83 JISC6226.map CP932-2BYTE.map\ |
88123 | 84 KSC5601.map KSC5636.map JOHAB.map |
85 | |
86 MISC = KOI-8.map KOI8-R.map KOI8-U.map KOI8-T.map ALTERNATIVNYJ.map \ | |
87 MIK.map PTCP154.map \ | |
88 TIS-620.map VISCII.map VSCII.map VSCII-2.map\ | |
89 KA-PS.map KA-ACADEMY.map \ | |
90 HP-ROMAN8.map NEXTSTEP.map MACINTOSH.map EBCDICUK.map EBCDICUS.map \ | |
91 stdenc.map symbol.map \ | |
92 CP949-2BYTE.map \ | |
93 BIG5-1.map BIG5-2.map | |
94 | |
95 # Emacs-mule charsets. | |
96 MULE = MULE-ethiopic.map MULE-ipa.map MULE-is13194.map \ | |
97 MULE-sisheng.map MULE-tibetan.map \ | |
98 MULE-lviscii.map MULE-uviscii.map | |
99 | |
89751 | 100 TRANS_TABLE = cp51932.el eucjp-ms.el |
101 | |
88123 | 102 charsets: ${CHARSETS} |
103 | |
104 AWK = gawk | |
105 | |
106 # Rules for each charset | |
107 | |
108 VSCII.map: ${GLIBC_CHARMAPS}/TCVN5712-1 mapconv compact.awk | |
109 # Generating $@... | |
110 @mapconv $< '/^<.*[ ]\/x[0-9a-f].[ ]/' GLIBC-1 compact.awk > $@ | |
111 | |
112 VSCII-2.map: ${GLIBC_CHARMAPS}/TCVN5712-1 mapconv compact.awk | |
113 # Generating $@... | |
114 @mapconv $< '/^<.*[ ]\/x[2-7a-f].[ ]/' GLIBC-1 compact.awk \ | |
115 | sed 's/0x20-0x7F.*/0x00-0x7F 0x0000/' > $@ | |
116 | |
117 ALTERNATIVNYJ.map: IBM866.map | |
118 # Generating $@... | |
119 @echo "# Modified from ibm866 according to the chart at" > $@ | |
120 @echo "# http://www.cyrillic.com/ref/cyrillic/koi-8alt.html," >> $@ | |
121 @echo "# with guesses for the Unicodes of the glyphs." >> $@ | |
122 @sed -e '/0xF2/ s/ .*/ 0x2019/' \ | |
123 -e '/0xF3/ s/ .*/ 0x2018/' \ | |
124 -e '/0xF4/ s/ .*/ 0x0301/' \ | |
125 -e '/0xF5/ s/ .*/ 0x0300/' \ | |
126 -e '/0xF6/ s/ .*/ 0x203A/' \ | |
127 -e '/0xF7/ s/ .*/ 0x2039/' \ | |
128 -e '/0xF8/ s/ .*/ 0x2191/' \ | |
129 -e '/0xF9/ s/ .*/ 0x2193/' \ | |
130 -e '/0xFA/ s/ .*/ 0x00B1/' \ | |
131 -e '/0xFB/ s/ .*/ 0x00F7/' < $< >> $@ | |
132 | |
133 MIK.map: ${MISC_CHARMAPS}/bulgarian-mik.txt.gz mapconv compact.awk | |
134 # Generating $@... | |
135 @mapconv $< '1,$$' CZYBORRA compact.awk > $@ | |
136 | |
137 PTCP154.map: ${MISC_CHARMAPS}/PTCP154 mapconv compact.awk | |
138 # Generating $@... | |
139 @mapconv $< '/^0x/' IANA compact.awk > $@ | |
140 | |
141 stdenc.map: ${MISC_CHARMAPS}/stdenc.txt mapconv compact.awk | |
142 # Generating $@... | |
143 @mapconv $< '/^[0-9A-Fa-f]/' UNICODE compact.awk > $@ | |
144 | |
145 symbol.map: ${MISC_CHARMAPS}/symbol.txt mapconv compact.awk | |
146 # Generating $@... | |
147 @mapconv $< '/^[0-9A-Fa-f]/' UNICODE compact.awk > $@ | |
148 | |
149 CP720.map: ${MISC_CHARMAPS}/720.htm mapconv compact.awk | |
150 # Generating $@... | |
151 @mapconv $< '/^[0-9A-F]/' MICROSOFT compact.awk > $@ | |
152 | |
153 CP858.map: ${MISC_CHARMAPS}/858.htm mapconv compact.awk | |
154 # Generating $@... | |
155 @mapconv $< '/^[0-9A-F]/' MICROSOFT compact.awk > $@ | |
156 | |
157 CP949-2BYTE.map: ${GLIBC_CHARMAPS}/CP949 mapconv compact.awk | |
158 # Generating $@... | |
159 @mapconv $< '/^<.*[ ]\/x[89a-f]/' GLIBC-2 compact.awk > $@ | |
160 | |
161 GB2312.map: ${GLIBC_CHARMAPS}/GB2312 mapconv compact.awk | |
162 # Generating $@... | |
163 @mapconv $< '/^<.*[ ]\/x[a-f]/' GLIBC-2-7 compact.awk > $@ | |
164 | |
165 GBK.map: ${GLIBC_CHARMAPS}/GBK mapconv compact.awk | |
166 # Generating $@... | |
167 @mapconv $< '/^<.*[ ]\/x[89a-f]/' GLIBC-2 compact.awk > $@ | |
168 | |
169 GB180302.map: ${GLIBC_CHARMAPS}/GB18030 mapconv gb180302.awk | |
170 # Generating $@... | |
171 @mapconv $< '/^<.*[ ]\/x..\/x..[ ]/' GLIBC-2 gb180302.awk > $@ | |
172 | |
173 GB180304.map: GB180302.map gb180304.awk | |
174 # Generating $@... | |
175 @$(AWK) -f gb180304.awk < $< > $@ | |
176 | |
177 JISX0201.map: ${GLIBC_CHARMAPS}/JIS_X0201 mapconv compact.awk | |
178 # Generating $@... | |
179 @mapconv $< '/^<.*[ ]\/x[0-9]/' GLIBC-1 compact.awk > $@ | |
180 @echo "# Generated by hand" >> $@ | |
181 @echo "0xA1-0xDF 0xFF61" >> $@ | |
182 | |
183 JISX0208.map: ${GLIBC_CHARMAPS}/EUC-JP mapconv | |
184 # Generating $@... | |
89751 | 185 @mapconv $< '/^<.*[ ]\/x[a-f]/' GLIBC-2-7 \ |
186 | sed 's/0x2015/0x2014/' > $@ | |
88123 | 187 |
188 JISX0212.map: ${GLIBC_CHARMAPS}/EUC-JP mapconv compact.awk | |
189 # Generating $@... | |
190 @mapconv $< '/^<.*[ ]\/x8f/ s,/x8f,,' GLIBC-2-7 compact.awk > $@ | |
191 | |
192 JISX2131.map: ${GLIBC_CHARMAPS}/EUC-JISX0213 mapconv | |
193 # Generating $@... | |
194 @mapconv $< '/^<.*[ ]\/x[a-f]/' GLIBC-2-7 > $@ | |
195 | |
196 JISX2132.map: ${GLIBC_CHARMAPS}/EUC-JISX0213 mapconv | |
197 # Generating $@... | |
198 @mapconv $< '/^<.*[ ]\/x8f/ s,/x8f,,' GLIBC-2-7 > $@ | |
199 | |
89747
09b8cb925c81
(CP932-2BYTE.map): Call mapconv with cp932.awk.
Kenichi Handa <handa@m17n.org>
parents:
89738
diff
changeset
|
200 CP932-2BYTE.map: ${MISC_CHARMAPS}/cp932.txt mapconv cp932.awk |
89738
d00dd977bedf
(CJK): Include CP932-2BYTE.map
Kenichi Handa <handa@m17n.org>
parents:
88123
diff
changeset
|
201 # Generating $@... |
89747
09b8cb925c81
(CP932-2BYTE.map): Call mapconv with cp932.awk.
Kenichi Handa <handa@m17n.org>
parents:
89738
diff
changeset
|
202 @mapconv $< '/^0x[89A-F][0-9A-F][0-9A-F]/' UNICODE2 cp932.awk > $@ |
89738
d00dd977bedf
(CJK): Include CP932-2BYTE.map
Kenichi Handa <handa@m17n.org>
parents:
88123
diff
changeset
|
203 |
89751 | 204 cp51932.el: CP932-2BYTE.map cp51932.awk |
205 @$(AWK) -f cp51932.awk < CP932-2BYTE.map > $@ | |
206 | |
207 eucjp-ms.el: ${MISC_CHARMAPS}/eucJP-13th.txt ${MISC_CHARMAPS}/eucJP-udc.txt \ | |
208 ${MISC_CHARMAPS}/eucJP-ibmext.txt eucjp-ms.awk | |
209 @(cd ${MISC_CHARMAPS}; \ | |
210 cat eucJP-13th.txt eucJP-udc.txt eucJP-ibmext.txt) \ | |
211 | $(AWK) -f eucjp-ms.awk > $@ | |
212 | |
88123 | 213 JISC6226.map : ${MISC_CHARMAPS}/Uni2JIS mapconv kuten.awk |
214 # Generating $@... | |
215 @mapconv $< '/^[^#].*0-/' YASUOKA kuten.awk > $@ | |
216 | |
217 KSC5601.map: ${GLIBC_CHARMAPS}/EUC-KR mapconv compact.awk | |
218 # Generating $@... | |
219 @mapconv $< '/^<.*[ ]\/x[a-f]/' GLIBC-2-7 compact.awk > $@ | |
220 | |
221 BIG5.map: ${GLIBC_CHARMAPS}/BIG5 mapconv compact.awk | |
222 # Generating $@... | |
223 @mapconv $< '/^<.*[ ]\/x[a-f]/' GLIBC-2 > $@ | |
224 | |
225 BIG5-1.map: BIG5.map mapconv big5.awk | |
226 # Generating $@... | |
227 @echo "Generated from $<" > $@ | |
228 @sed -n -e '/0xa140/,/0xc8fe/p' < $< | gawk -f big5.awk >> $@ | |
229 | |
230 BIG5-2.map: BIG5.map mapconv big5.awk | |
231 # Generating $@... | |
232 @echo "Generated from $<" > $@ | |
233 @sed -n -e '/0xc940/,$$ p' < $< | gawk -f big5.awk >> $@ | |
234 | |
235 BIG5-HKSCS.map: ${GLIBC_CHARMAPS}/BIG5-HKSCS mapconv compact.awk | |
236 # Generating $@... | |
237 @mapconv $< '/^<.*[ ]\/x[89a-f].\//' GLIBC-2 compact.awk > $@ | |
238 | |
239 JOHAB.map: ${GLIBC_CHARMAPS}/JOHAB mapconv compact.awk | |
240 # Generating $@... | |
241 @mapconv $< '/^<.*[ ]\/x[89a-f]/' GLIBC-2 compact.awk > $@ | |
242 | |
243 CNS-1.map: ${GLIBC_CHARMAPS}/EUC-TW mapconv compact.awk | |
244 # Generating $@... | |
245 @mapconv $< '/^<.*[ ]\/x[a-f]/' GLIBC-2-7 compact.awk > $@ | |
246 | |
247 CNS-2.map: ${GLIBC_CHARMAPS}/EUC-TW mapconv compact.awk | |
248 # Generating $@... | |
249 @mapconv $< '/^<.*\/x8e\/xa2/s,/x8e/xa2,,' GLIBC-2-7 compact.awk > $@ | |
250 | |
251 CNS-3.map: ${GLIBC_CHARMAPS}/EUC-TW mapconv compact.awk | |
252 # Generating $@... | |
253 @mapconv $< '/^<.*\/x8e\/xa3/ s,/x8e/xa3,,' GLIBC-2-7 compact.awk > $@ | |
254 | |
255 CNS-4.map: ${GLIBC_CHARMAPS}/EUC-TW mapconv compact.awk | |
256 # Generating $@... | |
257 @mapconv $< '/^<.*\/x8e\/xa4/ s,/x8e/xa4,,' GLIBC-2-7 compact.awk > $@ | |
258 | |
259 CNS-5.map: ${GLIBC_CHARMAPS}/EUC-TW mapconv compact.awk | |
260 # Generating $@... | |
261 @mapconv $< '/^<.*\/x8e\/xa5/ s,/x8e/xa5,,' GLIBC-2-7 compact.awk > $@ | |
262 | |
263 CNS-6.map: ${GLIBC_CHARMAPS}/EUC-TW mapconv compact.awk | |
264 # Generating $@... | |
265 @mapconv $< '/^<.*\/x8e\/xa6/ s,/x8e/xa6,,' GLIBC-2-7 compact.awk > $@ | |
266 | |
267 CNS-7.map: ${GLIBC_CHARMAPS}/EUC-TW mapconv compact.awk | |
268 # Generating $@... | |
269 @mapconv $< '/^<.*\/x8e\/xa7/ s,/x8e/xa7,,' GLIBC-2-7 compact.awk > $@ | |
270 | |
271 CNS-F.map: ${GLIBC_CHARMAPS}/EUC-TW mapconv compact.awk | |
272 # Generating $@... | |
273 @mapconv $< '/^<.*\/x8e\/xaf/ s,/x8e/xaf,,' GLIBC-2-7 compact.awk > $@ | |
274 | |
275 # General target to produce map files for mule charsets. | |
276 MULE-%.map: mule-charsets.el | |
277 # Generating $@... | |
278 @${OLDEMACS} -batch -l ./mule-charsets.el $@ | |
279 | |
280 # General target to produce map files for ISO-8859, GEORGIAN, and | |
281 # EBCDIC charsets. We can not use the original file name because of | |
282 # file name limit on DOS. "KA" is ISO 639 language code for Georgian. | |
283 | |
284 8859-%.map: ${GLIBC_CHARMAPS}/ISO-8859-% mapconv compact.awk | |
285 # Generating $@... | |
286 @mapconv $< '/^<.*[ ]\/x/' GLIBC-1 compact.awk > $@ | |
287 | |
288 KA-%.map: ${GLIBC_CHARMAPS}/GEORGIAN-% mapconv compact.awk | |
289 # Generating $@... | |
290 @mapconv $< '/^<.*[ ]\/x/' GLIBC-1 compact.awk > $@ | |
291 | |
292 EBCDIC%.map: ${GLIBC_CHARMAPS}/EBCDIC-% mapconv compact.awk | |
293 # Generating $@... | |
294 @mapconv $< '/^<.*[ ]\/x/' GLIBC-1 compact.awk > $@ | |
295 | |
296 # General target to produce map files for single-byte charsets. | |
297 | |
298 %.map: ${GLIBC_CHARMAPS}/% mapconv compact.awk | |
299 # Generating $@... | |
300 @mapconv $< '/^<.*[ ]\/x/' GLIBC-1 compact.awk > $@ | |
301 | |
89751 | 302 install: ${CHARSETS} ${TRANS_TABLE} |
88123 | 303 cp ${CHARSETS} ../../etc/charsets |
89751 | 304 cp ${TRANS_TABLE} ../../lisp/international |
88123 | 305 |
306 # Clear files that are automatically generated. | |
307 clean: | |
308 rm -f ${CHARSETS} |