828a8ce5735e0ca7ed6cf68cedc8960044e3449d
[m17n/m17n-db.git] / Makefile.am
1 # Makefile.am -- Makefile for the m17n database
2 # Copyright (C) 2003, 2004
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 \
40         get-glibc.sh \
41         ${FORMATS}
42
43 CHARSETS = ${ISO8859} ${IBM} ${CODEPAGE} ${CJK} ${MISC}
44
45 ISO8859 = \
46         8859-2.map 8859-3.map 8859-4.map 8859-5.map 8859-6.map 8859-7.map \
47         8859-8.map 8859-9.map 8859-10.map 8859-11.map 8859-13.map 8859-14.map \
48         8859-15.map 8859-16.map
49
50 IBM = \
51         IBM037.map IBM038.map \
52         IBM256.map IBM273.map IBM274.map IBM275.map IBM277.map IBM278.map \
53         IBM280.map IBM281.map IBM284.map IBM285.map IBM290.map IBM297.map \
54         IBM420.map IBM423.map IBM424.map IBM437.map IBM500.map IBM850.map \
55         IBM851.map IBM852.map IBM855.map IBM857.map IBM860.map IBM861.map \
56         IBM862.map IBM863.map IBM864.map IBM865.map IBM866.map IBM868.map \
57         IBM869.map IBM870.map IBM871.map IBM874.map IBM875.map IBM880.map \
58         IBM891.map IBM903.map IBM904.map IBM905.map IBM918.map \
59         IBM1004.map IBM1026.map IBM1047.map
60
61 CODEPAGE = \
62         CP737.map CP775.map CP949-2BYTE.map \
63         CP1250.map CP1251.map CP1252.map CP1253.map CP1254.map \
64         CP1255.map CP1256.map CP1257.map CP1258.map \
65         CP10007.map
66
67 CJK =   GB_1988-80.map GB2312.map GBK.map GB180302.map GB180304.map \
68         BIG5.map BIG5-HKSCS.map\
69         CNS-1.map CNS-2.map CNS-3.map CNS-4.map CNS-5.map CNS-6.map CNS-7.map \
70         CNS-F.map \
71         JISX0201.map JISX0208.map JISX0212.map JISX2131.map JISX2132.map \
72         JISX213A.map \
73         KSC5601.map KSC5636.map JOHAB.map
74
75 MISC =  KOI-8.map KOI8-R.map KOI8-U.map KOI8-T.map \
76         TIS-620.map VISCII.map VSCII.map\
77         KA-PS.map KA-ACADEMY.map
78
79 CHAR_TABLE = \
80         NAME.tab SCRIPT.tab CASE-S.tab CASE-C.tab \
81         CATEGORY.tab COMBINE.tab BIDI.tab
82
83 FONT_LAYOUT_TABLE = \
84         ARAB.flt ARAB-OTF.flt \
85         BENG-OTF.flt \
86         DEVA-CDAC.flt DEVA-OTF.flt \
87         GUJR-OTF.flt \
88         GURU-OTF.flt \
89         HEBR.flt HEBR-FF.flt \
90         KHMR-MULE.flt KHMR-ANLONG.flt \
91         KNDA-OTF.flt \
92         LAOO-MULE.flt LAOO-ALICE.flt \
93         MLYM-CDAC.flt MLYM-OTF.flt MLYM-RACHANA.flt\
94         MYMR-MYAZEDI.flt \
95         ORYA-OTF.flt \
96         SINH-OTF.flt \
97         SYRC-OTF.flt \
98         TAML-CDAC.flt TAML-OTF.flt \
99         TELU-OTF.flt \
100         THAA-OTF.flt \
101         THAI-TIS620.flt THAI-NORASI.flt \
102         TIBT-MULE.flt TIBT-MTIB.flt TIBT-OTF.flt \
103         NO-CTL.flt
104
105 INPUT_METHOD = \
106         am-sera.mim \
107         ar-kbd.mim \
108         as-itrans.mim \
109         bn-itrans.mim \
110         bn-unijoy.mim \
111         bo-wylie.mim \
112         dv-phonetic.mim \
113         el-kbd.mim \
114         fa-isiri.mim \
115         gu-itrans.mim \
116         he-kbd.mim \
117         hi-itrans.mim \
118         hr-kbd.mim \
119         hy-kbd.mim \
120         ja-anthy.mim ja-tcode.mim \
121         ka-kbd.mim \
122         kk-kbd.mim kk-arabic.mim \
123         km-yannis.mim \
124         kn-itrans.mim \
125         ko-han2.mim ko-romaja.mim \
126         lo-lrt.mim \
127         ml-itrans.mim \
128         my-kbd.mim \
129         or-itrans.mim \
130         pa-itrans.mim \
131         ru-yawerty.mim \
132         si-samanala.mim \
133         sk-kbd.mim \
134         sr-kbd.mim \
135         sv-post.mim \
136         ta-itrans.mim \
137         te-itrans.mim \
138         th-kesmanee.mim \
139         vi-viqr.mim vi-telex.mim \
140         zh-py.mim zh-pinyin.mim zh-tonepy.mim \
141         latn-post.mim latn-pre.mim \
142         syrc-phonetic.mim \
143         bopo-kbd.mim \
144         unicode.mim rfc1345.mim \
145         ispell.mim
146
147 MISC_TABLE = \
148         LOCALE.cs LOCALE.ali \
149         default.fst xfont.fst truetype.fst FONTENC.tbl FONTSIZE.tbl \
150         CHARSET.tbl CODING.tbl im-cmd.tbl \
151         LINEBREAK.tab
152
153 UNIDATA = \
154         UNIDATA/README \
155         UNIDATA/UnicodeData.txt UNIDATA/Scripts.txt UNIDATA/CaseFolding.txt
156
157 FORMATS = \
158         FORMATS/README \
159         FORMATS/0General.txt FORMATS/CharsetList.txt FORMATS/CodingList.txt \
160         FORMATS/Dir.txt FORMATS/FontEncoding.txt FORMATS/Fontset.txt \
161         FORMATS/FLT.txt FORMATS/FontSize.txt FORMATS/IM.txt
162
163 all: ${CHARSETS} ${CHAR_TABLE}
164
165 # Rules for charsets
166
167 CHARMAPS = @CHARMAPS@
168 CHARMAP_EXT = @CHARMAP_EXT@
169 CHARMAP_CAT = @CHARMAP_CAT@
170
171 GB2312.map: ${CHARMAPS}/GB2312${CHARMAP_EXT} mapconv compact.awk
172         @echo "Generating $@..."
173         @sh mapconv $< '/^<.*[  ]\/x[a-f]/' 2 NOMSB compact > $@
174
175 GBK.map: ${CHARMAPS}/GBK${CHARMAP_EXT} mapconv compact.awk
176         @echo "Generating $@..."
177         @sh mapconv $< '/^<.*[  ]\/x[89a-f]/' 2 WITHMSB compact > $@
178
179 GB180302.map: ${CHARMAPS}/GB18030${CHARMAP_EXT} mapconv gb180302.awk
180         @echo "Generating $@..."
181         @sh mapconv $< '/^<.*[  ]\/x..\/x..[    ]/' 2 WITHMSB gb180302 > $@
182
183 GB180304.map: GB180302.map gb180304.awk
184         @echo "Generating $@..."
185         @$(AWK) -f gb180304.awk < $< > $@
186
187 JISX0201.map: ${CHARMAPS}/JIS_X0201${CHARMAP_EXT} mapconv compact.awk
188         @echo "Generating $@..."
189         @sh mapconv $< '/^<.*[  ]\/x[0-9]/' 1 WITHMSB compact > $@
190         @echo "# Generated by hand" >> $@
191         @echo "0x00A1-0x00DF 0xFF61" >> $@
192
193 JISX0208.map: ${CHARMAPS}/EUC-JP${CHARMAP_EXT} mapconv compact.awk
194         @echo "Generating $@..."
195         @sh mapconv $< '/^<.*[  ]\/x[a-f]/' 2 NOMSB compact \
196           | sed 's/0x2015/0x2014/' > $@> $@
197
198 JISX0212.map: ${CHARMAPS}/EUC-JP${CHARMAP_EXT} mapconv compact.awk
199         @echo "Generating $@..."
200         @sh mapconv $< '/^<.*[  ]\/x8f/ s,/x8f,,' 2 NOMSB compact > $@
201
202 JISX2131.map: ${CHARMAPS}/EUC-JISX0213${CHARMAP_EXT} mapconv
203         @echo "Generating $@..."
204         @sh mapconv $< '/^<.*[  ]\/x[a-f]/' 2 NOMSB \
205           | sed 's/0x2015/0x2014/' > $@> $@
206
207 JISX2132.map: ${CHARMAPS}/EUC-JISX0213${CHARMAP_EXT} mapconv
208         @echo "Generating $@..."
209         @sh mapconv $< '/^<.*[  ]\/x8f/ s,/x8f,,' 2 NOMSB > $@
210
211 JISX213A.map:
212         @echo "Generating $@"
213         @(echo "0x2E21 0x4FF1"; \
214           echo "0x2F7E 0x525D"; \
215           echo "0x4F54 0x20B9F"; \
216           echo "0x4F7E 0x541E"; \
217           echo "0x7427 0x5653"; \
218           echo "0x7E7A 0x59F8"; \
219           echo "0x7E7B 0x5C5B"; \
220           echo "0x7E7C 0x5E77"; \
221           echo "0x7E7D 0x7626"; \
222           echo "0x7E7E 0x7E6B") > $@
223
224 KSC5601.map: ${CHARMAPS}/EUC-KR${CHARMAP_EXT} mapconv compact.awk
225         @echo "Generating $@..."
226         @sh mapconv $< '/^<.*[  ]\/x[a-f]/' 2 NOMSB compact > $@
227
228 BIG5.map: ${CHARMAPS}/BIG5${CHARMAP_EXT} mapconv compact.awk
229         @echo "Generating $@..."
230         @sh mapconv $< '/^<.*[  ]\/x[a-f]/' 2 WITHMSB compact > $@
231
232 BIG5-HKSCS.map: ${CHARMAPS}/BIG5-HKSCS${CHARMAP_EXT} mapconv compact.awk
233         @echo "Generating $@..."
234         @sh mapconv $< '/^<.*[  ]\/x[89a-f].\//' 2 WITHMSB compact > $@
235
236 JOHAB.map: ${CHARMAPS}/JOHAB${CHARMAP_EXT} mapconv compact.awk
237         @echo "Generating $@..."
238         @sh mapconv $< '/^<.*[  ]\/x[89a-f]/' 2 WITHMSB compact > $@
239
240 CNS-1.map: ${CHARMAPS}/EUC-TW${CHARMAP_EXT} mapconv compact.awk
241         @echo "Generating $@..."
242         @sh mapconv $< '/^<.*[  ]\/x[a-f]/' 2 NOMSB compact > $@
243
244 CNS-2.map: ${CHARMAPS}/EUC-TW${CHARMAP_EXT} mapconv compact.awk
245         @echo "Generating $@..."
246         @sh mapconv $< '/^<.*\/x8e\/xa2/ s,/x8e/xa2,,' 2 NOMSB compact > $@
247
248 CNS-3.map: ${CHARMAPS}/EUC-TW${CHARMAP_EXT} mapconv compact.awk
249         @echo "Generating $@..."
250         @sh mapconv $< '/^<.*\/x8e\/xa3/ s,/x8e/xa3,,' 2 NOMSB compact > $@
251
252 CNS-4.map: ${CHARMAPS}/EUC-TW${CHARMAP_EXT} mapconv compact.awk
253         @echo "Generating $@..."
254         @sh mapconv $< '/^<.*\/x8e\/xa4/ s,/x8e/xa4,,' 2 NOMSB compact > $@
255
256 CNS-5.map: ${CHARMAPS}/EUC-TW${CHARMAP_EXT} mapconv compact.awk
257         @echo "Generating $@..."
258         @sh mapconv $< '/^<.*\/x8e\/xa5/ s,/x8e/xa5,,' 2 NOMSB compact > $@
259
260 CNS-6.map: ${CHARMAPS}/EUC-TW${CHARMAP_EXT} mapconv compact.awk
261         @echo "Generating $@..."
262         @sh mapconv $< '/^<.*\/x8e\/xa6/ s,/x8e/xa6,,' 2 NOMSB compact > $@
263
264 CNS-7.map: ${CHARMAPS}/EUC-TW${CHARMAP_EXT} mapconv compact.awk
265         @echo "Generating $@..."
266         @sh mapconv $< '/^<.*\/x8e\/xa7/ s,/x8e/xa7,,' 2 NOMSB compact > $@
267
268 CNS-F.map: ${CHARMAPS}/EUC-TW${CHARMAP_EXT} mapconv compact.awk
269         @echo "Generating $@..."
270         @sh mapconv $< '/^<.*\/x8e\/xaf/ s,/x8e/xaf,,' 2 NOMSB compact > $@
271
272 CP949-2BYTE.map: ${CHARMAPS}/CP949${CHARMAP_EXT} mapconv compact.awk
273         @echo "Generating $@..."
274         @sh mapconv $< '/^<.*[  ]\/x[89a-f]/' 2 WITHMSB compact > $@
275
276 VSCII.map: ${CHARMAPS}/TCVN5712-1${CHARMAP_EXT} mapconv compact.awk
277         @echo "Generating $@..."
278         @sh mapconv $< '/^<.*[  ]\/x[0-9a-f]. /' 1 WITHMSB compact > $@
279
280 # General target to produce map files for single-byte charsets.
281
282 8859-%.map: ${CHARMAPS}/ISO-8859-%${CHARMAP_EXT} mapconv compact.awk
283         @echo "Generating $@..."
284         @sh mapconv $< '/^<.*[  ]\/x/' 1 WITHMSB compact > $@
285
286 KA-%.map: ${CHARMAPS}/GEORGIAN-%${CHARMAP_EXT} mapconv compact.awk
287         @echo "Generating $@..."
288         @sh mapconv $< '/^<.*[  ]\/x/' 1 WITHMSB compact > $@
289
290 %.map: ${CHARMAPS}/%${CHARMAP_EXT} mapconv compact.awk
291         @echo "Generating $@..."
292         @sh mapconv $< '/^<.*[  ]\/x/' 1 WITHMSB compact > $@
293
294 # Rules for chartables
295
296 CASE-S.tab: UNIDATA/CaseFolding.txt Makefile
297         echo "# Generated from $<." > $@
298         @$(AWK) '/^[0-9A-Z]/ { \
299           if ($$2 == "F") print "0x"$$1,"0xFFFF"; \
300           else print "0x"$$1,"0x"$$3; }' FS="[; ][; ]*" $< >> $@
301
302 CASE-C.tab: UNIDATA/CaseFolding.txt Makefile
303         echo "# Generated from $<." > $@
304         @$(AWK) '/^[0-9A-Z]*; F/ { \
305           print "0x"$$1" "; \
306           for (i = 3; $$i != "#"; i++) \
307             print "\\x"$$i; \
308           print "\n"; }'  FS="[; ][; ]*" ORS="" $< >> $@
309
310 NAME.tab: UNIDATA/UnicodeData.txt NAME.awk
311         echo "# Generated from $<." > $@
312         @$(AWK) -f NAME.awk $< >> $@
313
314 SCRIPT.tab: UNIDATA/Scripts.txt Makefile
315         echo "# Generated from $<." > $@
316         @$(AWK) '/^[0-9A-F]/ { print "0x"$$1, $$3; }' $< | \
317           sed -e 's/\.\./-0x/' | \
318           tr '[:upper:]' '[:lower:]' >> $@
319
320 %.tab: UNIDATA/UnicodeData.txt CHARTAB.awk
321         echo "# Generated from $<." > $@
322         @$(AWK) -f CHARTAB.awk FIELD=$@ $< >>$@
323
324 pkgdatadir=$(datadir)/m17n
325
326 bin_SCRIPTS = m17n-db
327
328 # Clear files that are automatically generated.
329 clean:
330         rm -f ${CHARSETS} ${CHAR_TABLE}