Apply GNU coding style to objc-mode as well as c-mode
[emacs.git] / admin / charsets / Makefile
blobb16e7ccd7483dd3a157605d9a14f7289660aded5
1 # Makefile -- Makefile to generate charset maps in etc/charsets.
2 # Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
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/>.
21 # Commentary:
23 # If your system doesn't have the directory /usr/share/i18n/charmaps,
24 # get the source of the latest glibc, gzip all the charmap files in
25 # the directory "localedate/charmaps", and set the variable
26 # GLIBC_CHARMAPS to that directory.
28 GLIBC_CHARMAPS=/usr/share/i18n/charmaps
30 CHARSETS = ${ISO8859} ${IBM} ${CODEPAGE} ${CJK} ${MISC} ${MULE}
32 # Note: We can not prepend "ISO-" to these map files because of file
33 # name limits on DOS.
34 ISO8859 = \
35 8859-2.map 8859-3.map 8859-4.map 8859-5.map 8859-6.map 8859-7.map \
36 8859-8.map 8859-9.map 8859-10.map 8859-11.map 8859-13.map 8859-14.map \
37 8859-15.map 8859-16.map
39 IBM = \
40 IBM037.map IBM038.map \
41 IBM256.map IBM273.map IBM274.map IBM275.map IBM277.map IBM278.map \
42 IBM280.map IBM281.map IBM284.map IBM285.map IBM290.map IBM297.map \
43 IBM420.map IBM423.map IBM424.map IBM437.map IBM500.map IBM850.map \
44 IBM851.map IBM852.map IBM855.map IBM856.map IBM857.map IBM860.map \
45 IBM861.map IBM862.map IBM863.map IBM864.map IBM865.map IBM866.map \
46 IBM868.map IBM869.map IBM870.map IBM871.map IBM874.map IBM875.map \
47 IBM880.map IBM891.map IBM903.map IBM904.map IBM905.map IBM918.map \
48 IBM1004.map IBM1026.map IBM1047.map
50 CODEPAGE = \
51 CP737.map CP775.map CP1125.map\
52 CP1250.map CP1251.map CP1252.map CP1253.map CP1254.map \
53 CP1255.map CP1256.map CP1257.map CP1258.map \
54 CP10007.map \
55 CP720.map CP858.map
57 CJK = GB2312.map GBK.map GB180302.map GB180304.map \
58 BIG5.map BIG5-HKSCS.map\
59 CNS-1.map CNS-2.map CNS-3.map CNS-4.map CNS-5.map CNS-6.map CNS-7.map \
60 CNS-F.map \
61 JISX0201.map JISX0208.map JISX0212.map JISX2131.map JISX2132.map \
62 JISC6226.map CP932-2BYTE.map JISX213A.map\
63 KSC5601.map KSC5636.map JOHAB.map
65 MISC = KOI-8.map KOI8-R.map KOI8-U.map KOI8-T.map ALTERNATIVNYJ.map \
66 MIK.map PTCP154.map \
67 TIS-620.map VISCII.map VSCII.map VSCII-2.map\
68 KA-PS.map KA-ACADEMY.map \
69 HP-ROMAN8.map NEXTSTEP.map MACINTOSH.map EBCDICUK.map EBCDICUS.map \
70 stdenc.map symbol.map \
71 CP949-2BYTE.map \
72 BIG5-1.map BIG5-2.map
74 # Emacs-mule charsets.
75 MULE = MULE-ethiopic.map MULE-ipa.map MULE-is13194.map \
76 MULE-sisheng.map MULE-tibetan.map \
77 MULE-lviscii.map MULE-uviscii.map
79 TRANS_TABLE = cp51932.el eucjp-ms.el
81 all: ${CHARSETS} ${TRANS_TABLE}
83 AWK = gawk
85 # Rules for each charset
87 VSCII.map: ${GLIBC_CHARMAPS}/TCVN5712-1.gz mapconv compact.awk
88 # Generating $@...
89 @mapconv $< '/^<.*[ ]\/x[0-9a-f].[ ]/' GLIBC-1 compact.awk > $@
91 VSCII-2.map: ${GLIBC_CHARMAPS}/TCVN5712-1.gz mapconv compact.awk
92 # Generating $@...
93 @mapconv $< '/^<.*[ ]\/x[2-7a-f].[ ]/' GLIBC-1 compact.awk \
94 | sed 's/0x20-0x7F.*/0x00-0x7F 0x0000/' > $@
96 ALTERNATIVNYJ.map: IBM866.map
97 # Generating $@...
98 @echo "# Modified from IBM866.map according to the chart at" > $@
99 @echo "# http://www.cyrillic.com/ref/cyrillic/koi-8alt.html," >> $@
100 @echo "# with guesses for the Unicodes of the glyphs." >> $@
101 @sed -e '1 d' \
102 -e '/0xF2/ s/ .*/ 0x2019/' \
103 -e '/0xF3/ s/ .*/ 0x2018/' \
104 -e '/0xF4/ s/ .*/ 0x0301/' \
105 -e '/0xF5/ s/ .*/ 0x0300/' \
106 -e '/0xF6/ s/ .*/ 0x203A/' \
107 -e '/0xF7/ s/ .*/ 0x2039/' \
108 -e '/0xF8/ s/ .*/ 0x2191/' \
109 -e '/0xF9/ s/ .*/ 0x2193/' \
110 -e '/0xFA/ s/ .*/ 0x00B1/' \
111 -e '/0xFB/ s/ .*/ 0x00F7/' < $< >> $@
113 MIK.map: mapfiles/bulgarian-mik.txt.gz mapconv compact.awk
114 # Generating $@...
115 @mapconv $< '1,$$' CZYBORRA compact.awk > $@
117 PTCP154.map: mapfiles/PTCP154.gz mapconv compact.awk
118 # Generating $@...
119 @mapconv $< '/^0x/' IANA compact.awk > $@
121 stdenc.map: mapfiles/stdenc.txt.gz mapconv compact.awk
122 # Generating $@...
123 @mapconv $< '/^[0-9A-Fa-f]/' UNICODE compact.awk > $@
125 symbol.map: mapfiles/symbol.txt.gz mapconv compact.awk
126 # Generating $@...
127 @mapconv $< '/^[0-9A-Fa-f]/' UNICODE compact.awk > $@
129 CP720.map: mapfiles/CP720.map.gz
130 # Generating $@...
131 @zcat $< > $@
133 CP858.map: mapfiles/CP858.map.gz
134 # Generating $@...
135 @zcat $< > $@
137 CP949-2BYTE.map: ${GLIBC_CHARMAPS}/CP949.gz mapconv compact.awk
138 # Generating $@...
139 @mapconv $< '/^<.*[ ]\/x[89a-f]/' GLIBC-2 compact.awk > $@
141 GB2312.map: ${GLIBC_CHARMAPS}/GB2312.gz mapconv compact.awk
142 # Generating $@...
143 @mapconv $< '/^<.*[ ]\/x[a-f]/' GLIBC-2-7 compact.awk > $@
145 GBK.map: ${GLIBC_CHARMAPS}/GBK.gz mapconv compact.awk
146 # Generating $@...
147 @mapconv $< '/^<.*[ ]\/x[89a-f]/' GLIBC-2 compact.awk > $@
149 GB180302.map: ${GLIBC_CHARMAPS}/GB18030.gz mapconv gb180302.awk
150 # Generating $@...
151 @mapconv $< '/^<.*[ ]\/x..\/x..[ ]/' GLIBC-2 gb180302.awk > $@
153 GB180304.map: GB180302.map gb180304.awk
154 # Generating $@...
155 @$(AWK) -f gb180304.awk < $< > $@
157 JISX0201.map: ${GLIBC_CHARMAPS}/JIS_X0201.gz mapconv compact.awk
158 # Generating $@...
159 @mapconv $< '/^<.*[ ]\/x[0-9]/' GLIBC-1 compact.awk > $@
160 @echo "# Generated by hand" >> $@
161 @echo "0xA1-0xDF 0xFF61" >> $@
163 JISX0208.map: ${GLIBC_CHARMAPS}/EUC-JP.gz mapconv
164 # Generating $@...
165 @mapconv $< '/^<.*[ ]\/x[a-f]/' GLIBC-2-7 \
166 | sed 's/0x2015/0x2014/' > $@
168 JISX0212.map: ${GLIBC_CHARMAPS}/EUC-JP.gz mapconv compact.awk
169 # Generating $@...
170 @mapconv $< '/^<.*[ ]\/x8f/ s,/x8f,,' GLIBC-2-7 compact.awk > $@
172 JISX2131.map: ${GLIBC_CHARMAPS}/EUC-JISX0213.gz mapconv
173 # Generating $@...
174 @mapconv $< '/^<.*[ ]\/x[a-f]/' GLIBC-2-7 \
175 | sed -e 's/0x2015/0x2014/' -e 's/0x2299/0x29BF/' > $@
177 JISX2132.map: ${GLIBC_CHARMAPS}/EUC-JISX0213.gz mapconv
178 # Generating $@...
179 @mapconv $< '/^<.*[ ]\/x8f/ s,/x8f,,' GLIBC-2-7 > $@
181 JISX213A.map: mapfiles/JISX213A.map.gz
182 # Generating $@
183 @zcat $< > $@
185 CP932-2BYTE.map: mapfiles/CP932.TXT.gz mapconv cp932.awk
186 # Generating $@...
187 @mapconv $< '/^0x[89A-F][0-9A-F][0-9A-F]/' UNICODE2 cp932.awk > $@
189 cp51932.el: CP932-2BYTE.map cp51932.awk
190 @$(AWK) -f cp51932.awk < CP932-2BYTE.map > $@
192 eucjp-ms.el: ${GLIBC_CHARMAPS}/EUC-JP-MS.gz eucjp-ms.awk
193 @zcat $< | $(AWK) -f eucjp-ms.awk > $@
195 JISC6226.map : mapfiles/Uni2JIS.gz mapconv kuten.awk
196 # Generating $@...
197 @mapconv $< '/^[^#].*0-/' YASUOKA kuten.awk > $@
199 KSC5601.map: ${GLIBC_CHARMAPS}/EUC-KR.gz mapconv compact.awk
200 # Generating $@...
201 @mapconv $< '/^<.*[ ]\/x[a-f]/' GLIBC-2-7 compact.awk > $@
203 BIG5.map: ${GLIBC_CHARMAPS}/BIG5.gz mapconv compact.awk
204 # Generating $@...
205 @mapconv $< '/^<.*[ ]\/x[a-f]/' GLIBC-2 > $@
207 BIG5-1.map: BIG5.map mapconv big5.awk
208 # Generating $@...
209 @echo "# Generated from $<" > $@
210 @sed -n -e '/0xa140/,/0xc8fe/p' < $< | gawk -f big5.awk >> $@
212 BIG5-2.map: BIG5.map mapconv big5.awk
213 # Generating $@...
214 @echo "# Generated from $<" > $@
215 @sed -n -e '/0xc940/,$$ p' < $< | gawk -f big5.awk >> $@
217 BIG5-HKSCS.map: ${GLIBC_CHARMAPS}/BIG5-HKSCS.gz mapconv compact.awk
218 # Generating $@...
219 @mapconv $< '/^<.*[ ]\/x[89a-f].\//' GLIBC-2 compact.awk > $@
221 JOHAB.map: ${GLIBC_CHARMAPS}/JOHAB.gz mapconv compact.awk
222 # Generating $@...
223 @mapconv $< '/^<.*[ ]\/x[89a-f]/' GLIBC-2 compact.awk > $@
225 CNS-1.map: ${GLIBC_CHARMAPS}/EUC-TW.gz mapconv compact.awk
226 # Generating $@...
227 @mapconv $< '/^<.*[ ]\/x[a-f]/' GLIBC-2-7 compact.awk > $@
229 # CNS-1.map: mapfiles/cns2ucsdkw.txt mapconv compact.awk
230 # # Generating $@...
231 # @mapconv $< '/^C1/' KANJI-DATABASE compact.awk > $@
233 CNS-2.map: mapfiles/cns2ucsdkw.txt.gz mapconv compact.awk
234 # Generating $@...
235 @mapconv $< '/^C2/' KANJI-DATABASE compact.awk > $@
237 CNS-3.map: mapfiles/cns2ucsdkw.txt.gz mapconv compact.awk
238 # Generating $@...
239 @mapconv $< '/^C3/' KANJI-DATABASE compact.awk > $@
241 CNS-4.map: mapfiles/cns2ucsdkw.txt.gz mapconv compact.awk
242 # Generating $@...
243 @mapconv $< '/^C4/' KANJI-DATABASE compact.awk > $@
245 CNS-5.map: mapfiles/cns2ucsdkw.txt.gz mapconv compact.awk
246 # Generating $@...
247 @mapconv $< '/^C5/' KANJI-DATABASE compact.awk > $@
249 CNS-6.map: mapfiles/cns2ucsdkw.txt.gz mapconv compact.awk
250 # Generating $@...
251 @mapconv $< '/^C6/' KANJI-DATABASE compact.awk > $@
253 CNS-7.map: mapfiles/cns2ucsdkw.txt.gz mapconv compact.awk
254 # Generating $@...
255 @mapconv $< '/^C7/' KANJI-DATABASE compact.awk > $@
257 CNS-F.map: ${GLIBC_CHARMAPS}/EUC-TW.gz mapconv compact.awk
258 # Generating $@...
259 @mapconv $< '/^<.*\/x8e\/xaf/ s,/x8e/xaf,,' GLIBC-2-7 compact.awk > $@
261 # General target to produce map files for mule charsets.
262 MULE-%.map: mapfiles/MULE-%.map.gz
263 # Generating $@...
264 @zcat $< > $@
266 # General target to produce map files for ISO-8859, GEORGIAN, and
267 # EBCDIC charsets. We can not use the original file name because of
268 # file name limit on DOS. "KA" is ISO 639 language code for Georgian.
270 8859-%.map: ${GLIBC_CHARMAPS}/ISO-8859-%.gz mapconv compact.awk
271 # Generating $@...
272 @mapconv $< '/^<.*[ ]\/x/' GLIBC-1 compact.awk > $@
274 KA-%.map: ${GLIBC_CHARMAPS}/GEORGIAN-%.gz mapconv compact.awk
275 # Generating $@...
276 @mapconv $< '/^<.*[ ]\/x/' GLIBC-1 compact.awk > $@
278 EBCDIC%.map: ${GLIBC_CHARMAPS}/EBCDIC-%.gz mapconv compact.awk
279 # Generating $@...
280 @mapconv $< '/^<.*[ ]\/x/' GLIBC-1 compact.awk > $@
282 # General target to produce map files for single-byte charsets.
284 %.map: ${GLIBC_CHARMAPS}/%.gz mapconv compact.awk
285 # Generating $@...
286 @mapconv $< '/^<.*[ ]\/x/' GLIBC-1 compact.awk > $@
288 install:
289 @for f in ${CHARSETS}; do \
290 if test -r $$f; then \
291 if ! cmp -s $$f ../../etc/charsets/$$f; then \
292 echo updating $$f; \
293 cp $$f ../../etc/charsets; \
294 fi; \
295 fi; \
296 done
297 @for f in ${TRANS_TABLE}; do \
298 if test -r $$f; then \
299 if ! cmp -s $$f ../../lisp/international/$$f; then \
300 echo updating $$f; \
301 cp $$f ../../lisp/international; \
302 fi; \
303 fi; \
304 done
306 # Clear files that are automatically generated.
307 clean:
308 rm -f ${CHARSETS} ${TRANS_TABLE}