1 # Makefile -- Makefile to generate charset maps in etc/charsets.
2 # Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008
3 # National Institute of Advanced Industrial Science and Technology (AIST)
4 # Registration Number H13PRO009
6 # This file is part of GNU Emacs.
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 3 of the License, or
11 # (at your option) any later version.
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.
18 # You should have received a copy of the GNU General Public License
19 # along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
23 # At first, set these environment variables:
25 # Directory of glibc-VERSION/localedate/charmaps.
26 # VERSION must be 2.3 or the later.
28 # Direcory containing these charmap files:
29 # o bulgarian-mik.txt.gz
30 # provided at <http://czyborra.com/charsets/>
32 # provided at <http://www.iana.org/assignments/charset-reg/>
33 # o stdenc.txt and symbol.txt
34 # provided at <http://www.unicode.org/Public/MAPPINGS/>
36 # provided at <http://www.unicode.org/Public/MAPPINGS/VENDERS>
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 # o eucJP-13th.txt, eucJP-udc.txt, eucJP-ibmext.txt
42 # provided at <http://www.opengroup.or.jp/jvc/cde/>
45 # % cvs -d :pserver:anonymous@cvs.kanji-database.sourceforge.net:\
46 # /cvsroot/kanji-database login
47 # % cvs -d :pserver:anonymous@cvs.kanji-database.sourceforge.net:\
48 # /cvsroot/kanji-database co kanji-database
50 # emacs of version 21.3.50 or later
53 # % make XXX.map (or make all)
56 CHARSETS
= ${ISO8859} ${IBM} ${CODEPAGE} ${CJK} ${MISC} ${MULE}
58 # Note: We can not prepend "ISO-" to these map files because of file
61 8859-2.map
8859-3.map
8859-4.map
8859-5.map
8859-6.map
8859-7.map \
62 8859-8.map
8859-9.map
8859-10.map
8859-11.map
8859-13.map
8859-14.map \
63 8859-15.map
8859-16.map
66 IBM037.map IBM038.map \
67 IBM256.map IBM273.map IBM274.map IBM275.map IBM277.map IBM278.map \
68 IBM280.map IBM281.map IBM284.map IBM285.map IBM290.map IBM297.map \
69 IBM420.map IBM423.map IBM424.map IBM437.map IBM500.map IBM850.map \
70 IBM851.map IBM852.map IBM855.map IBM856.map IBM857.map IBM860.map \
71 IBM861.map IBM862.map IBM863.map IBM864.map IBM865.map IBM866.map \
72 IBM868.map IBM869.map IBM870.map IBM871.map IBM874.map IBM875.map \
73 IBM880.map IBM891.map IBM903.map IBM904.map IBM905.map IBM918.map \
74 IBM1004.map IBM1026.map IBM1047.map
77 CP737.map CP775.map CP1125.map\
78 CP1250.map CP1251.map CP1252.map CP1253.map CP1254.map \
79 CP1255.map CP1256.map CP1257.map CP1258.map \
83 CJK
= GB2312.map GBK.map GB180302.map GB180304.map \
84 BIG5.map BIG5-HKSCS.map\
85 CNS-1.map CNS-2.map CNS-3.map CNS-4.map CNS-5.map CNS-6.map CNS-7.map \
87 JISX0201.map JISX0208.map JISX0212.map JISX2131.map JISX2132.map \
88 JISC6226.map CP932-2BYTE.map JISX213A.map\
89 KSC5601.map KSC5636.map JOHAB.map
91 MISC
= KOI-8.map KOI8-R.map KOI8-U.map KOI8-T.map ALTERNATIVNYJ.map \
93 TIS-620.map VISCII.map VSCII.map VSCII-2.map\
94 KA-PS.map KA-ACADEMY.map \
95 HP-ROMAN8.map NEXTSTEP.map MACINTOSH.map EBCDICUK.map EBCDICUS.map \
96 stdenc.map symbol.map \
100 # Emacs-mule charsets.
101 MULE
= MULE-ethiopic.map MULE-ipa.map MULE-is13194.map \
102 MULE-sisheng.map MULE-tibetan.map \
103 MULE-lviscii.map MULE-uviscii.map
105 TRANS_TABLE
= cp51932.el eucjp-ms.el
107 all: ${CHARSETS} ${TRANS_TABLE}
111 # Rules for each charset
113 VSCII.map
: ${GLIBC_CHARMAPS}/TCVN5712-1 mapconv compact.awk
115 @mapconv
$< '/^<.*[ ]\/x[0-9a-f].[ ]/' GLIBC-1 compact.awk
> $@
117 VSCII-2.map
: ${GLIBC_CHARMAPS}/TCVN5712-1 mapconv compact.awk
119 @mapconv
$< '/^<.*[ ]\/x[2-7a-f].[ ]/' GLIBC-1 compact.awk \
120 | sed
's/0x20-0x7F.*/0x00-0x7F 0x0000/' > $@
122 ALTERNATIVNYJ.map
: IBM866.map
124 @echo
"# Modified from ibm866 according to the chart at" > $@
125 @echo
"# http://www.cyrillic.com/ref/cyrillic/koi-8alt.html," >> $@
126 @echo
"# with guesses for the Unicodes of the glyphs." >> $@
127 @sed
-e
'/0xF2/ s/ .*/ 0x2019/' \
128 -e
'/0xF3/ s/ .*/ 0x2018/' \
129 -e
'/0xF4/ s/ .*/ 0x0301/' \
130 -e
'/0xF5/ s/ .*/ 0x0300/' \
131 -e
'/0xF6/ s/ .*/ 0x203A/' \
132 -e
'/0xF7/ s/ .*/ 0x2039/' \
133 -e
'/0xF8/ s/ .*/ 0x2191/' \
134 -e
'/0xF9/ s/ .*/ 0x2193/' \
135 -e
'/0xFA/ s/ .*/ 0x00B1/' \
136 -e
'/0xFB/ s/ .*/ 0x00F7/' < $< >> $@
138 MIK.map
: ${MISC_CHARMAPS}/bulgarian-mik.txt.gz mapconv compact.awk
140 @mapconv
$< '1,$$' CZYBORRA compact.awk
> $@
142 PTCP154.map
: ${MISC_CHARMAPS}/PTCP154 mapconv compact.awk
144 @mapconv
$< '/^0x/' IANA compact.awk
> $@
146 stdenc.map
: ${MISC_CHARMAPS}/stdenc.txt mapconv compact.awk
148 @mapconv
$< '/^[0-9A-Fa-f]/' UNICODE compact.awk
> $@
150 symbol.map
: ${MISC_CHARMAPS}/symbol.txt mapconv compact.awk
152 @mapconv
$< '/^[0-9A-Fa-f]/' UNICODE compact.awk
> $@
154 CP720.map
: ${MISC_CHARMAPS}/720.htm mapconv compact.awk
156 @mapconv
$< '/^[0-9A-F]/' MICROSOFT compact.awk
> $@
158 CP858.map
: ${MISC_CHARMAPS}/858.htm mapconv compact.awk
160 @mapconv
$< '/^[0-9A-F]/' MICROSOFT compact.awk
> $@
162 CP949-2BYTE.map
: ${GLIBC_CHARMAPS}/CP949 mapconv compact.awk
164 @mapconv
$< '/^<.*[ ]\/x[89a-f]/' GLIBC-2 compact.awk
> $@
166 GB2312.map
: ${GLIBC_CHARMAPS}/GB2312 mapconv compact.awk
168 @mapconv
$< '/^<.*[ ]\/x[a-f]/' GLIBC-2-7 compact.awk
> $@
170 GBK.map
: ${GLIBC_CHARMAPS}/GBK mapconv compact.awk
172 @mapconv
$< '/^<.*[ ]\/x[89a-f]/' GLIBC-2 compact.awk
> $@
174 GB180302.map
: ${GLIBC_CHARMAPS}/GB18030 mapconv gb180302.awk
176 @mapconv
$< '/^<.*[ ]\/x..\/x..[ ]/' GLIBC-2 gb180302.awk
> $@
178 GB180304.map
: GB180302.map gb180304.awk
180 @
$(AWK
) -f gb180304.awk
< $< > $@
182 JISX0201.map
: ${GLIBC_CHARMAPS}/JIS_X0201 mapconv compact.awk
184 @mapconv
$< '/^<.*[ ]\/x[0-9]/' GLIBC-1 compact.awk
> $@
185 @echo
"# Generated by hand" >> $@
186 @echo
"0xA1-0xDF 0xFF61" >> $@
188 JISX0208.map
: ${GLIBC_CHARMAPS}/EUC-JP mapconv
190 @mapconv
$< '/^<.*[ ]\/x[a-f]/' GLIBC-2-7 \
191 | sed
's/0x2015/0x2014/' > $@
193 JISX0212.map
: ${GLIBC_CHARMAPS}/EUC-JP mapconv compact.awk
195 @mapconv
$< '/^<.*[ ]\/x8f/ s,/x8f,,' GLIBC-2-7 compact.awk
> $@
197 JISX2131.map
: ${GLIBC_CHARMAPS}/EUC-JISX0213 mapconv
199 @mapconv
$< '/^<.*[ ]\/x[a-f]/' GLIBC-2-7 \
200 | sed
-e
's/0x2015/0x2014/' -e
's/0x2299/0x29BF/' > $@
202 JISX2132.map
: ${GLIBC_CHARMAPS}/EUC-JISX0213 mapconv
204 @mapconv
$< '/^<.*[ ]\/x8f/ s,/x8f,,' GLIBC-2-7
> $@
208 @
(echo
"0x2E21 0x4FF1"; \
209 echo
"0x2F7E 0x525D"; \
210 echo
"0x4F54 0x20B9F"; \
211 echo
"0x4F7E 0x541E"; \
212 echo
"0x7427 0x5653"; \
213 echo
"0x7E7A 0x59F8"; \
214 echo
"0x7E7B 0x5C5B"; \
215 echo
"0x7E7C 0x5E77"; \
216 echo
"0x7E7D 0x7626"; \
217 echo
"0x7E7E 0x7E6B") > $@
219 CP932-2BYTE.map
: ${MISC_CHARMAPS}/cp932.txt mapconv cp932.awk
221 @mapconv
$< '/^0x[89A-F][0-9A-F][0-9A-F]/' UNICODE2 cp932.awk
> $@
223 cp51932.el
: CP932-2BYTE.map cp51932.awk
224 @
$(AWK
) -f cp51932.awk
< CP932-2BYTE.map
> $@
226 eucjp-ms.el
: ${MISC_CHARMAPS}/eucJP-13th.txt
${MISC_CHARMAPS}/eucJP-udc.txt \
227 ${MISC_CHARMAPS}/eucJP-ibmext.txt eucjp-ms.awk
228 @
(cd
${MISC_CHARMAPS}; \
229 cat eucJP-13th.txt eucJP-udc.txt eucJP-ibmext.txt
) \
230 |
$(AWK
) -f eucjp-ms.awk
> $@
232 JISC6226.map
: ${MISC_CHARMAPS}/Uni2JIS mapconv kuten.awk
234 @mapconv
$< '/^[^#].*0-/' YASUOKA kuten.awk
> $@
236 KSC5601.map
: ${GLIBC_CHARMAPS}/EUC-KR mapconv compact.awk
238 @mapconv
$< '/^<.*[ ]\/x[a-f]/' GLIBC-2-7 compact.awk
> $@
240 BIG5.map
: ${GLIBC_CHARMAPS}/BIG5 mapconv compact.awk
242 @mapconv
$< '/^<.*[ ]\/x[a-f]/' GLIBC-2
> $@
244 BIG5-1.map
: BIG5.map mapconv big5.awk
246 @echo
"Generated from $<" > $@
247 @sed
-n
-e
'/0xa140/,/0xc8fe/p' < $< | gawk
-f big5.awk
>> $@
249 BIG5-2.map
: BIG5.map mapconv big5.awk
251 @echo
"Generated from $<" > $@
252 @sed
-n
-e
'/0xc940/,$$ p' < $< | gawk
-f big5.awk
>> $@
254 BIG5-HKSCS.map
: ${GLIBC_CHARMAPS}/BIG5-HKSCS mapconv compact.awk
256 @mapconv
$< '/^<.*[ ]\/x[89a-f].\//' GLIBC-2 compact.awk
> $@
258 JOHAB.map
: ${GLIBC_CHARMAPS}/JOHAB mapconv compact.awk
260 @mapconv
$< '/^<.*[ ]\/x[89a-f]/' GLIBC-2 compact.awk
> $@
262 CNS-1.map
: ${GLIBC_CHARMAPS}/EUC-TW mapconv compact.awk
264 @mapconv
$< '/^<.*[ ]\/x[a-f]/' GLIBC-2-7 compact.awk
> $@
266 # CNS-1.map: ${MISC_CHARMAPS}/cns2ucsdkw.txt mapconv compact.awk
268 # @mapconv $< '/^C1/' KANJI-DATABASE compact.awk > $@
270 CNS-2.map
: ${MISC_CHARMAPS}/cns2ucsdkw.txt mapconv compact.awk
272 @mapconv
$< '/^C2/' KANJI-DATABASE compact.awk
> $@
274 CNS-3.map
: ${MISC_CHARMAPS}/cns2ucsdkw.txt mapconv compact.awk
276 @mapconv
$< '/^C3/' KANJI-DATABASE compact.awk
> $@
278 CNS-4.map
: ${MISC_CHARMAPS}/cns2ucsdkw.txt mapconv compact.awk
280 @mapconv
$< '/^C4/' KANJI-DATABASE compact.awk
> $@
282 CNS-5.map
: ${MISC_CHARMAPS}/cns2ucsdkw.txt mapconv compact.awk
284 @mapconv
$< '/^C5/' KANJI-DATABASE compact.awk
> $@
286 CNS-6.map
: ${MISC_CHARMAPS}/cns2ucsdkw.txt mapconv compact.awk
288 @mapconv
$< '/^C6/' KANJI-DATABASE compact.awk
> $@
290 CNS-7.map
: ${MISC_CHARMAPS}/cns2ucsdkw.txt mapconv compact.awk
292 @mapconv
$< '/^C7/' KANJI-DATABASE compact.awk
> $@
294 CNS-F.map
: ${GLIBC_CHARMAPS}/EUC-TW mapconv compact.awk
296 @mapconv
$< '/^<.*\/x8e\/xaf/ s,/x8e/xaf,,' GLIBC-2-7 compact.awk
> $@
298 # General target to produce map files for mule charsets.
299 MULE-
%.map
: mule-charsets.el
301 @
${OLDEMACS} -batch
-l .
/mule-charsets.el
$@
303 # General target to produce map files for ISO-8859, GEORGIAN, and
304 # EBCDIC charsets. We can not use the original file name because of
305 # file name limit on DOS. "KA" is ISO 639 language code for Georgian.
307 8859-%.map
: ${GLIBC_CHARMAPS}/ISO-8859-
% mapconv compact.awk
309 @mapconv
$< '/^<.*[ ]\/x/' GLIBC-1 compact.awk
> $@
311 KA-
%.map
: ${GLIBC_CHARMAPS}/GEORGIAN-
% mapconv compact.awk
313 @mapconv
$< '/^<.*[ ]\/x/' GLIBC-1 compact.awk
> $@
315 EBCDIC
%.map
: ${GLIBC_CHARMAPS}/EBCDIC-
% mapconv compact.awk
317 @mapconv
$< '/^<.*[ ]\/x/' GLIBC-1 compact.awk
> $@
319 # General target to produce map files for single-byte charsets.
321 %.map
: ${GLIBC_CHARMAPS}/% mapconv compact.awk
323 @mapconv
$< '/^<.*[ ]\/x/' GLIBC-1 compact.awk
> $@
326 @for f in
${CHARSETS}; do \
327 if
test -r
$$f; then \
328 if
! cmp
-s
$$f ..
/..
/etc
/charsets
/$$f; then \
330 cp
$$f ..
/..
/etc
/charsets
; \
334 @for f in
${TRANS_TABLE}; do \
335 if
test -r
$$f; then \
336 if
! cmp
-s
$$f ..
/..
/lisp
/international
/$$f; then \
338 cp
$$f ..
/..
/lisp
/international
; \
343 # Clear files that are automatically generated.
345 rm -f
${CHARSETS} ${TRANS_TABLE}
347 # arch-tag: 90b3bf30-1fef-45bf-b30c-665c30c22310