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
6 # This file is part of the m17n database; a sub-part of the m17n
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.
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.
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
27 ${FONT_LAYOUT_TABLE} \
33 ${FONT_LAYOUT_TABLE} \
38 mapconv compact.awk gb180302.awk gb180304.awk \
39 CHARTAB.awk NAME.awk \
43 CHARSETS = ${ISO8859} ${IBM} ${CODEPAGE} ${CJK} ${MISC}
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
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
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 \
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 \
71 JISX0201.map JISX0208.map JISX0212.map JISX2131.map JISX2132.map \
73 KSC5601.map KSC5636.map JOHAB.map
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
80 NAME.tab SCRIPT.tab CASE-S.tab CASE-C.tab \
81 CATEGORY.tab COMBINE.tab BIDI.tab
84 ARAB.flt ARAB-OTF.flt \
86 DEVA-CDAC.flt DEVA-OTF.flt \
89 HEBR.flt HEBR-FF.flt \
90 KHMR-MULE.flt KHMR-ANLONG.flt \
92 LAOO-MULE.flt LAOO-ALICE.flt \
93 MLYM-CDAC.flt MLYM-OTF.flt MLYM-RACHANA.flt\
98 TAML-CDAC.flt TAML-OTF.flt \
101 THAI-TIS620.flt THAI-NORASI.flt \
102 TIBT-MULE.flt TIBT-MTIB.flt TIBT-OTF.flt \
120 ja-anthy.mim ja-tcode.mim \
122 kk-kbd.mim kk-arabic.mim \
125 ko-han2.mim ko-romaja.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 \
144 unicode.mim rfc1345.mim \
148 LOCALE.cs LOCALE.ali \
149 default.fst xfont.fst truetype.fst FONTENC.tbl FONTSIZE.tbl \
150 CHARSET.tbl CODING.tbl im-cmd.tbl \
155 UNIDATA/UnicodeData.txt UNIDATA/Scripts.txt UNIDATA/CaseFolding.txt
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
163 all: ${CHARSETS} ${CHAR_TABLE}
167 CHARMAPS = @CHARMAPS@
168 CHARMAP_EXT = @CHARMAP_EXT@
169 CHARMAP_CAT = @CHARMAP_CAT@
171 GB2312.map: ${CHARMAPS}/GB2312${CHARMAP_EXT} mapconv compact.awk
172 @echo "Generating $@..."
173 @sh mapconv $< '/^<.*[ ]\/x[a-f]/' 2 NOMSB compact > $@
175 GBK.map: ${CHARMAPS}/GBK${CHARMAP_EXT} mapconv compact.awk
176 @echo "Generating $@..."
177 @sh mapconv $< '/^<.*[ ]\/x[89a-f]/' 2 WITHMSB compact > $@
179 GB180302.map: ${CHARMAPS}/GB18030${CHARMAP_EXT} mapconv gb180302.awk
180 @echo "Generating $@..."
181 @sh mapconv $< '/^<.*[ ]\/x..\/x..[ ]/' 2 WITHMSB gb180302 > $@
183 GB180304.map: GB180302.map gb180304.awk
184 @echo "Generating $@..."
185 @$(AWK) -f gb180304.awk < $< > $@
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" >> $@
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/' > $@> $@
198 JISX0212.map: ${CHARMAPS}/EUC-JP${CHARMAP_EXT} mapconv compact.awk
199 @echo "Generating $@..."
200 @sh mapconv $< '/^<.*[ ]\/x8f/ s,/x8f,,' 2 NOMSB compact > $@
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/' > $@> $@
207 JISX2132.map: ${CHARMAPS}/EUC-JISX0213${CHARMAP_EXT} mapconv
208 @echo "Generating $@..."
209 @sh mapconv $< '/^<.*[ ]\/x8f/ s,/x8f,,' 2 NOMSB > $@
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") > $@
224 KSC5601.map: ${CHARMAPS}/EUC-KR${CHARMAP_EXT} mapconv compact.awk
225 @echo "Generating $@..."
226 @sh mapconv $< '/^<.*[ ]\/x[a-f]/' 2 NOMSB compact > $@
228 BIG5.map: ${CHARMAPS}/BIG5${CHARMAP_EXT} mapconv compact.awk
229 @echo "Generating $@..."
230 @sh mapconv $< '/^<.*[ ]\/x[a-f]/' 2 WITHMSB compact > $@
232 BIG5-HKSCS.map: ${CHARMAPS}/BIG5-HKSCS${CHARMAP_EXT} mapconv compact.awk
233 @echo "Generating $@..."
234 @sh mapconv $< '/^<.*[ ]\/x[89a-f].\//' 2 WITHMSB compact > $@
236 JOHAB.map: ${CHARMAPS}/JOHAB${CHARMAP_EXT} mapconv compact.awk
237 @echo "Generating $@..."
238 @sh mapconv $< '/^<.*[ ]\/x[89a-f]/' 2 WITHMSB compact > $@
240 CNS-1.map: ${CHARMAPS}/EUC-TW${CHARMAP_EXT} mapconv compact.awk
241 @echo "Generating $@..."
242 @sh mapconv $< '/^<.*[ ]\/x[a-f]/' 2 NOMSB compact > $@
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 > $@
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 > $@
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 > $@
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 > $@
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 > $@
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 > $@
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 > $@
272 CP949-2BYTE.map: ${CHARMAPS}/CP949${CHARMAP_EXT} mapconv compact.awk
273 @echo "Generating $@..."
274 @sh mapconv $< '/^<.*[ ]\/x[89a-f]/' 2 WITHMSB compact > $@
276 VSCII.map: ${CHARMAPS}/TCVN5712-1${CHARMAP_EXT} mapconv compact.awk
277 @echo "Generating $@..."
278 @sh mapconv $< '/^<.*[ ]\/x[0-9a-f]. /' 1 WITHMSB compact > $@
280 # General target to produce map files for single-byte charsets.
282 8859-%.map: ${CHARMAPS}/ISO-8859-%${CHARMAP_EXT} mapconv compact.awk
283 @echo "Generating $@..."
284 @sh mapconv $< '/^<.*[ ]\/x/' 1 WITHMSB compact > $@
286 KA-%.map: ${CHARMAPS}/GEORGIAN-%${CHARMAP_EXT} mapconv compact.awk
287 @echo "Generating $@..."
288 @sh mapconv $< '/^<.*[ ]\/x/' 1 WITHMSB compact > $@
290 %.map: ${CHARMAPS}/%${CHARMAP_EXT} mapconv compact.awk
291 @echo "Generating $@..."
292 @sh mapconv $< '/^<.*[ ]\/x/' 1 WITHMSB compact > $@
294 # Rules for chartables
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="[; ][; ]*" $< >> $@
302 CASE-C.tab: UNIDATA/CaseFolding.txt Makefile
303 echo "# Generated from $<." > $@
304 @$(AWK) '/^[0-9A-Z]*; F/ { \
306 for (i = 3; $$i != "#"; i++) \
308 print "\n"; }' FS="[; ][; ]*" ORS="" $< >> $@
310 NAME.tab: UNIDATA/UnicodeData.txt NAME.awk
311 echo "# Generated from $<." > $@
312 @$(AWK) -f NAME.awk $< >> $@
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:]' >> $@
320 %.tab: UNIDATA/UnicodeData.txt CHARTAB.awk
321 echo "# Generated from $<." > $@
322 @$(AWK) -f CHARTAB.awk FIELD=$@ $< >>$@
324 pkgdatadir=$(datadir)/m17n
326 bin_SCRIPTS = m17n-db
328 # Clear files that are automatically generated.
330 rm -f ${CHARSETS} ${CHAR_TABLE}