Add input-method and descrition elements.
[m17n/m17n-db.git] / Makefile.am
1 # Makefile.am -- Makefile for the m17n database
2 # Copyright (C) 2003, 2004, 2005
3 #   National Institute of Advanced Industrial Science and Technology (AIST)
4 #   Registration Number H15PRO112
5
6 # This file is part of the m17n database; a sub-part of the m17n
7 # library.
8
9 # The m17n library is free software; you can redistribute it and/or
10 # modify it under the terms of the GNU Lesser General Public License
11 # as published by the Free Software Foundation; either version 2.1 of
12 # the License, or (at your option) any later version.
13
14 # The m17n library is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17 # Lesser General Public License for more details.
18
19 # You should have received a copy of the GNU Lesser General Public
20 # License along with the m17n library; if not, write to the Free
21 # Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
22 # 02111-1307, USA.
23
24 pkgdata_DATA = \
25         ${CHARSETS} \
26         ${CHAR_TABLE} \
27         ${FONT_LAYOUT_TABLE} \
28         ${INPUT_METHOD} \
29         ${MISC_TABLE} \
30         mdb.dir
31
32 EXTRA_DIST = \
33         ${FONT_LAYOUT_TABLE} \
34         ${INPUT_METHOD} \
35         ${MISC_TABLE} \
36         mdb.dir \
37         ${UNIDATA} \
38         mapconv compact.awk gb180302.awk gb180304.awk \
39         CHARTAB.awk NAME.awk LINEBREAK.awk \
40         CASED.awk CASE-MAPPING.awk \
41         get-glibc.sh \
42         ${FORMATS}
43
44 CHARSETS = ${ISO8859} ${IBM} ${CODEPAGE} ${CJK} ${MISC}
45
46 ISO8859 = \
47         8859-2.map 8859-3.map 8859-4.map 8859-5.map 8859-6.map 8859-7.map \
48         8859-8.map 8859-9.map 8859-10.map 8859-11.map 8859-13.map 8859-14.map \
49         8859-15.map 8859-16.map
50
51 IBM = \
52         IBM037.map IBM038.map \
53         IBM256.map IBM273.map IBM274.map IBM275.map IBM277.map IBM278.map \
54         IBM280.map IBM281.map IBM284.map IBM285.map IBM290.map IBM297.map \
55         IBM420.map IBM423.map IBM424.map IBM437.map IBM500.map IBM850.map \
56         IBM851.map IBM852.map IBM855.map IBM857.map IBM860.map IBM861.map \
57         IBM862.map IBM863.map IBM864.map IBM865.map IBM866.map IBM868.map \
58         IBM869.map IBM870.map IBM871.map IBM874.map IBM875.map IBM880.map \
59         IBM891.map IBM903.map IBM904.map IBM905.map IBM918.map \
60         IBM1004.map IBM1026.map IBM1047.map
61
62 CODEPAGE = \
63         CP737.map CP775.map CP949-2BYTE.map \
64         CP1250.map CP1251.map CP1252.map CP1253.map CP1254.map \
65         CP1255.map CP1256.map CP1257.map CP1258.map \
66         CP10007.map
67
68 CJK =   GB_1988-80.map GB2312.map GBK.map GB180302.map GB180304.map \
69         BIG5.map BIG5-HKSCS.map\
70         CNS-1.map CNS-2.map CNS-3.map CNS-4.map CNS-5.map CNS-6.map CNS-7.map \
71         CNS-F.map \
72         JISX0201.map JISX0208.map JISX0212.map JISX2131.map JISX2132.map \
73         JISX213A.map \
74         KSC5601.map KSC5636.map JOHAB.map
75
76 MISC =  KOI-8.map KOI8-R.map KOI8-U.map KOI8-T.map \
77         TIS-620.map VISCII.map VSCII.map\
78         KA-PS.map KA-ACADEMY.map
79
80 CHAR_TABLE = \
81         NAME.tab SCRIPT.tab CASE-S.tab CASE-C.tab \
82         CATEGORY.tab COMBINE.tab BIDI.tab LINEBREAK.tab \
83         CASED.tab SOFT-DOTTED.tab CASE-MAPPING.tab
84
85 FONT_LAYOUT_TABLE = \
86         ARAB.flt ARAB-OTF.flt ARAB-OTF-NO-GPOS.flt \
87         BENG-OTF.flt \
88         DEVA-CDAC.flt DEVA-OTF.flt \
89         GUJR-OTF.flt \
90         GURU-OTF.flt \
91         HEBR.flt HEBR-FF.flt \
92         KHMR-MULE.flt KHMR-ANLONG.flt KHMR-OTF.flt \
93         KNDA-OTF.flt \
94         LAOO-MULE.flt LAOO-ALICE.flt LAOO-GENERIC.flt \
95         MLYM-CDAC.flt MLYM-OTF.flt MLYM-RACHANA.flt \
96         MYMR-MYAZEDI.flt \
97         ORYA-OTF.flt \
98         SINH-OTF.flt \
99         SYRC-OTF.flt \
100         TAML-CDAC.flt TAML-OTF.flt \
101         TELU-OTF.flt \
102         THAA-OTF.flt \
103         THAI-TIS620.flt THAI-NORASI.flt THAI-GENERIC.flt \
104         TIBT-MULE.flt TIBT-MTIB.flt TIBT-OTF.flt \
105         NO-CTL.flt
106
107 INPUT_METHOD = \
108         am-sera.mim \
109         ar-kbd.mim \
110         as-itrans.mim \
111         bn-itrans.mim \
112         bn-unijoy.mim \
113         bo-wylie.mim \
114         dv-phonetic.mim \
115         el-kbd.mim \
116         fa-isiri.mim \
117         gu-itrans.mim \
118         he-kbd.mim \
119         hi-itrans.mim \
120         hr-kbd.mim \
121         hy-kbd.mim \
122         ja-anthy.mim ja-tcode.mim \
123         ka-kbd.mim \
124         kk-kbd.mim kk-arabic.mim \
125         km-yannis.mim \
126         kn-itrans.mim \
127         ko-han2.mim ko-romaja.mim \
128         lo-lrt.mim \
129         ml-itrans.mim \
130         my-kbd.mim \
131         or-itrans.mim \
132         pa-itrans.mim \
133         ru-yawerty.mim \
134         si-samanala.mim \
135         sk-kbd.mim \
136         sr-kbd.mim \
137         sv-post.mim \
138         ta-itrans.mim \
139         te-itrans.mim \
140         th-kesmanee.mim \
141         vi-viqr.mim vi-telex.mim vi-vni.mim \
142         zh-py.mim zh-py-gb.mim zh-py-b5.mim zh-pinyin.mim zh-tonepy.mim \
143         latn-post.mim latn-pre.mim \
144         syrc-phonetic.mim \
145         bopo-kbd.mim \
146         unicode.mim rfc1345.mim cjk-util.mim \
147         ispell.mim
148
149 MISC_TABLE = \
150         LOCALE.cs LOCALE.ali \
151         default.fst xfont.fst truetype.fst generic.fst \
152         FONTENC.tbl FONTSIZE.tbl \
153         CHARSET.tbl CODING.tbl im-cmd.tbl \
154         LANGUAGE.tbl SCRIPT-OTF.tbl SCRIPT-LANGUAGE.tbl
155
156 UNIDATA = \
157         UNIDATA/README \
158         UNIDATA/UnicodeData.txt UNIDATA/Scripts.txt UNIDATA/CaseFolding.txt \
159         UNIDATA/LineBreak.txt \
160         UNIDATA/PropList.txt UNIDATA/WordBreakProperty.txt \
161         UNIDATA/SpecialCasing.txt
162
163 FORMATS = \
164         FORMATS/README \
165         FORMATS/0General.txt FORMATS/CharsetList.txt FORMATS/CodingList.txt \
166         FORMATS/Dir.txt FORMATS/FontEncoding.txt FORMATS/Fontset.txt \
167         FORMATS/FLT.txt FORMATS/FontSize.txt FORMATS/IM.txt
168
169 all: ${CHARSETS} ${CHAR_TABLE}
170
171 # Rules for charsets
172
173 CHARMAPS = @CHARMAPS@
174 CHARMAP_EXT = @CHARMAP_EXT@
175 CHARMAP_CAT = @CHARMAP_CAT@
176
177 GB2312.map: ${CHARMAPS}/GB2312${CHARMAP_EXT} mapconv compact.awk
178         @echo "Generating $@..."
179         @sh mapconv $< '/^<.*[  ]\/x[a-f]/' 2 NOMSB compact > $@
180
181 GBK.map: ${CHARMAPS}/GBK${CHARMAP_EXT} mapconv compact.awk
182         @echo "Generating $@..."
183         @sh mapconv $< '/^<.*[  ]\/x[89a-f]/' 2 WITHMSB compact > $@
184
185 GB180302.map: ${CHARMAPS}/GB18030${CHARMAP_EXT} mapconv gb180302.awk
186         @echo "Generating $@..."
187         @sh mapconv $< '/^<.*[  ]\/x..\/x..[    ]/' 2 WITHMSB gb180302 > $@
188
189 GB180304.map: GB180302.map gb180304.awk
190         @echo "Generating $@..."
191         @$(AWK) -f gb180304.awk < $< > $@
192
193 JISX0201.map: ${CHARMAPS}/JIS_X0201${CHARMAP_EXT} mapconv compact.awk
194         @echo "Generating $@..."
195         @sh mapconv $< '/^<.*[  ]\/x[0-9]/' 1 WITHMSB compact > $@
196         @echo "# Generated by hand" >> $@
197         @echo "0x00A1-0x00DF 0xFF61" >> $@
198
199 JISX0208.map: ${CHARMAPS}/EUC-JP${CHARMAP_EXT} mapconv compact.awk
200         @echo "Generating $@..."
201         @sh mapconv $< '/^<.*[  ]\/x[a-f]/' 2 NOMSB compact \
202           | sed 's/0x2015/0x2014/' > $@> $@
203
204 JISX0212.map: ${CHARMAPS}/EUC-JP${CHARMAP_EXT} mapconv compact.awk
205         @echo "Generating $@..."
206         @sh mapconv $< '/^<.*[  ]\/x8f/ s,/x8f,,' 2 NOMSB compact > $@
207
208 JISX2131.map: ${CHARMAPS}/EUC-JISX0213${CHARMAP_EXT} mapconv
209         @echo "Generating $@..."
210         @sh mapconv $< '/^<.*[  ]\/x[a-f]/' 2 NOMSB \
211           | sed 's/0x2015/0x2014/' > $@> $@
212
213 JISX2132.map: ${CHARMAPS}/EUC-JISX0213${CHARMAP_EXT} mapconv
214         @echo "Generating $@..."
215         @sh mapconv $< '/^<.*[  ]\/x8f/ s,/x8f,,' 2 NOMSB > $@
216
217 JISX213A.map:
218         @echo "Generating $@"
219         @(echo "0x2E21 0x4FF1"; \
220           echo "0x2F7E 0x525D"; \
221           echo "0x4F54 0x20B9F"; \
222           echo "0x4F7E 0x541E"; \
223           echo "0x7427 0x5653"; \
224           echo "0x7E7A 0x59F8"; \
225           echo "0x7E7B 0x5C5B"; \
226           echo "0x7E7C 0x5E77"; \
227           echo "0x7E7D 0x7626"; \
228           echo "0x7E7E 0x7E6B") > $@
229
230 KSC5601.map: ${CHARMAPS}/EUC-KR${CHARMAP_EXT} mapconv compact.awk
231         @echo "Generating $@..."
232         @sh mapconv $< '/^<.*[  ]\/x[a-f]/' 2 NOMSB compact > $@
233
234 BIG5.map: ${CHARMAPS}/BIG5${CHARMAP_EXT} mapconv compact.awk
235         @echo "Generating $@..."
236         @sh mapconv $< '/^<.*[  ]\/x[a-f]/' 2 WITHMSB compact > $@
237
238 BIG5-HKSCS.map: ${CHARMAPS}/BIG5-HKSCS${CHARMAP_EXT} mapconv compact.awk
239         @echo "Generating $@..."
240         @sh mapconv $< '/^<.*[  ]\/x[89a-f].\//' 2 WITHMSB compact > $@
241
242 JOHAB.map: ${CHARMAPS}/JOHAB${CHARMAP_EXT} mapconv compact.awk
243         @echo "Generating $@..."
244         @sh mapconv $< '/^<.*[  ]\/x[89a-f]/' 2 WITHMSB compact > $@
245
246 CNS-1.map: ${CHARMAPS}/EUC-TW${CHARMAP_EXT} mapconv compact.awk
247         @echo "Generating $@..."
248         @sh mapconv $< '/^<.*[  ]\/x[a-f]/' 2 NOMSB compact > $@
249
250 CNS-2.map: ${CHARMAPS}/EUC-TW${CHARMAP_EXT} mapconv compact.awk
251         @echo "Generating $@..."
252         @sh mapconv $< '/^<.*\/x8e\/xa2/ s,/x8e/xa2,,' 2 NOMSB compact > $@
253
254 CNS-3.map: ${CHARMAPS}/EUC-TW${CHARMAP_EXT} mapconv compact.awk
255         @echo "Generating $@..."
256         @sh mapconv $< '/^<.*\/x8e\/xa3/ s,/x8e/xa3,,' 2 NOMSB compact > $@
257
258 CNS-4.map: ${CHARMAPS}/EUC-TW${CHARMAP_EXT} mapconv compact.awk
259         @echo "Generating $@..."
260         @sh mapconv $< '/^<.*\/x8e\/xa4/ s,/x8e/xa4,,' 2 NOMSB compact > $@
261
262 CNS-5.map: ${CHARMAPS}/EUC-TW${CHARMAP_EXT} mapconv compact.awk
263         @echo "Generating $@..."
264         @sh mapconv $< '/^<.*\/x8e\/xa5/ s,/x8e/xa5,,' 2 NOMSB compact > $@
265
266 CNS-6.map: ${CHARMAPS}/EUC-TW${CHARMAP_EXT} mapconv compact.awk
267         @echo "Generating $@..."
268         @sh mapconv $< '/^<.*\/x8e\/xa6/ s,/x8e/xa6,,' 2 NOMSB compact > $@
269
270 CNS-7.map: ${CHARMAPS}/EUC-TW${CHARMAP_EXT} mapconv compact.awk
271         @echo "Generating $@..."
272         @sh mapconv $< '/^<.*\/x8e\/xa7/ s,/x8e/xa7,,' 2 NOMSB compact > $@
273
274 CNS-F.map: ${CHARMAPS}/EUC-TW${CHARMAP_EXT} mapconv compact.awk
275         @echo "Generating $@..."
276         @sh mapconv $< '/^<.*\/x8e\/xaf/ s,/x8e/xaf,,' 2 NOMSB compact > $@
277
278 CP949-2BYTE.map: ${CHARMAPS}/CP949${CHARMAP_EXT} mapconv compact.awk
279         @echo "Generating $@..."
280         @sh mapconv $< '/^<.*[  ]\/x[89a-f]/' 2 WITHMSB compact > $@
281
282 VSCII.map: ${CHARMAPS}/TCVN5712-1${CHARMAP_EXT} mapconv compact.awk
283         @echo "Generating $@..."
284         @sh mapconv $< '/^<.*[  ]\/x[0-9a-f]. /' 1 WITHMSB compact > $@
285
286 # General target to produce map files for single-byte charsets.
287
288 8859-%.map: ${CHARMAPS}/ISO-8859-%${CHARMAP_EXT} mapconv compact.awk
289         @echo "Generating $@..."
290         @sh mapconv $< '/^<.*[  ]\/x/' 1 WITHMSB compact > $@
291
292 KA-%.map: ${CHARMAPS}/GEORGIAN-%${CHARMAP_EXT} mapconv compact.awk
293         @echo "Generating $@..."
294         @sh mapconv $< '/^<.*[  ]\/x/' 1 WITHMSB compact > $@
295
296 %.map: ${CHARMAPS}/%${CHARMAP_EXT} mapconv compact.awk
297         @echo "Generating $@..."
298         @sh mapconv $< '/^<.*[  ]\/x/' 1 WITHMSB compact > $@
299
300 # Rules for chartables
301
302 CASE-S.tab: UNIDATA/CaseFolding.txt Makefile
303         echo "# Generated from $<." > $@
304         @$(AWK) '/^[0-9A-Z]/ { \
305           if ($$2 == "F") print "0x"$$1,"0xFFFF"; \
306           else print "0x"$$1,"0x"$$3; }' FS="[; ][; ]*" $< >> $@
307
308 CASE-C.tab: UNIDATA/CaseFolding.txt Makefile
309         echo "# Generated from $<." > $@
310         @$(AWK) '/^[0-9A-Z]*; F/ { \
311           print "0x"$$1" "; \
312           for (i = 3; $$i != "#"; i++) \
313             print "\\x"$$i; \
314           print "\n"; }'  FS="[; ][; ]*" ORS="" $< >> $@
315
316 NAME.tab: UNIDATA/UnicodeData.txt NAME.awk
317         echo "# Generated from $<." > $@
318         @$(AWK) -f NAME.awk $< >> $@
319
320 SCRIPT.tab: UNIDATA/Scripts.txt Makefile
321         echo "# Generated from $<." > $@
322         @echo "0x0-0x3FFFFF common" >> $@
323         @sed '/; Common / d' $< | \
324           $(AWK) '/^[0-9A-F]/ { print "0x"$$1, $$3; }' | \
325           sed -e 's/\.\./-0x/' | \
326           tr '[:upper:]' '[:lower:]' >> $@
327
328 CASED.tab: UNIDATA/UnicodeData.txt UNIDATA/PropList.txt UNIDATA/WordBreakProperty.txt CASED.awk
329         echo "# Generated from UNIDATA/UnicodeData.txt, UNIDATA/PropList.txt, and UNIDATA/WordBreakProperty.txt." > $@
330         @$(AWK) -f CASED.awk UNIDATA/UnicodeData.txt UNIDATA/PropList.txt UNIDATA/WordBreakProperty.txt >> $@
331
332 SOFT-DOTTED.tab: UNIDATA/PropList.txt Makefile
333         echo "# Generated from $<." > $@
334         @$(AWK) '/^[^#;]+; *Soft_Dotted/ { \
335           if (index ($$1, ".")) { \
336             split ($$1, A, "\\.\\."); \
337             print "0x"A[1]"-0x"A[2]" t"; } \
338           else print "0x"$$1" t"; }' \
339           $< >> $@
340
341 CASE-MAPPING.tab: UNIDATA/SpecialCasing.txt UNIDATA/UnicodeData.txt CASE-MAPPING.awk
342         echo "# Generated from UNIDATA/SpecialCasing.txt and UNIDATA/UnicodeData.txt." > $@
343         @$(AWK) -f CASE-MAPPING.awk UNIDATA/SpecialCasing.txt UNIDATA/UnicodeData.txt >> $@
344
345 LINEBREAK.tab: UNIDATA/LineBreak.txt LINEBREAK.awk
346         echo "# Generated from $<." > $@
347         @$(AWK) -f LINEBREAK.awk $< >> $@
348
349 %.tab: UNIDATA/UnicodeData.txt CHARTAB.awk
350         echo "# Generated from $<." > $@
351         @$(AWK) -f CHARTAB.awk FIELD=$@ $< >>$@
352
353 pkgdatadir=$(datadir)/m17n
354
355 bin_SCRIPTS = m17n-db
356
357 # Clear files that are automatically generated.
358 clean:
359         rm -f ${CHARSETS} ${CHAR_TABLE}