Merge changes made in Gnus trunk.
[bpt/emacs.git] / leim / Makefile.in
CommitLineData
dadbf673 1# Makefile for leim subdirectory in GNU Emacs.
73b0cd50 2# Copyright (C) 1997-2011
eda20bd8 3# Free Software Foundation, Inc.
6d344054 4# Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
d0981f82 5# 2006, 2007, 2008, 2009, 2010, 2011
eda20bd8
KH
6# National Institute of Advanced Industrial Science and Technology (AIST)
7# Registration Number H14PRO021
24b31c88 8
dadbf673
GM
9# This file is part of GNU Emacs.
10
d3fb0974 11# GNU Emacs is free software: you can redistribute it and/or modify
dadbf673 12# it under the terms of the GNU General Public License as published by
d3fb0974
GM
13# the Free Software Foundation, either version 3 of the License, or
14# (at your option) any later version.
15
dadbf673
GM
16# GNU Emacs is distributed in the hope that it will be useful,
17# but WITHOUT ANY WARRANTY; without even the implied warranty of
18# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19# GNU General Public License for more details.
d3fb0974 20
dadbf673 21# You should have received a copy of the GNU General Public License
d3fb0974
GM
22# along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
23
dadbf673
GM
24
25# Avoid trouble on systems where the `SHELL' variable might be
26# inherited from the environment.
27SHELL = /bin/sh
28
29# Here are the things that we expect ../configure to edit.
30version=@version@
31prefix=@prefix@
ca1cd89c 32datarootdir=@datarootdir@
dadbf673
GM
33datadir=@datadir@
34srcdir=@srcdir@
2a7973b6 35ns_appresdir=@ns_appresdir@
dadbf673
GM
36
37# Where to install LEIM files.
62ebf7d7 38INSTALLDIR=$(DESTDIR)${datadir}/emacs/${version}/leim
dadbf673 39
d95f329f 40GZIP_PROG = @GZIP_PROG@
7a7f042f 41
dadbf673
GM
42# Which Emacs to use to convert TIT files to Emacs Lisp files,
43# byte-compile Emacs Lisp files, and generate the file leim-list.el.
c1d05286 44BUILT-EMACS = ../src/emacs
dadbf673 45
c1d05286 46buildlisppath=${srcdir}/../lisp
dadbf673
GM
47
48# How to run Emacs.
dd6ab82f 49RUN-EMACS = EMACSLOADPATH=$(buildlisppath) LC_ALL=C \
e7a42417 50 ${BUILT-EMACS} -batch --no-site-file --no-site-lisp
dadbf673
GM
51
52# Subdirectories to be made if ${srcdir} is different from the current
53# directory.
54SUBDIRS=quail
55
56# Files generated from TIT dictionaries for Chinese GB character set.
57TIT-GB=\
dadbf673
GM
58 quail/CCDOSPY.elc \
59 quail/Punct.elc \
dadbf673
GM
60 quail/QJ.elc \
61 quail/SW.elc \
117348b8 62 quail/TONEPY.elc
dadbf673
GM
63
64# Files generated from TIT dictionaries for Chinese BIG5 character set.
65TIT-BIG5=\
66 quail/4Corner.elc \
67 quail/ARRAY30.elc \
dadbf673
GM
68 quail/ECDICT.elc \
69 quail/ETZY.elc \
70 quail/Punct-b5.elc \
71 quail/PY-b5.elc \
72 quail/QJ-b5.elc \
73 quail/ZOZY.elc
74
75CHINESE-TIT=${TIT-GB} ${TIT-BIG5}
76
77NON-TIT-GB=${srcdir}/quail/py-punct.elc
78
117348b8 79NON-TIT-BIG5=${srcdir}/quail/pypunct-b5.elc
dadbf673 80
117348b8 81CHINESE-NON-TIT=${NON-TIT-GB} ${NON-TIT-BIG5}
dadbf673
GM
82
83CHINESE-GB=${TIT-GB} ${NON-TIT-GB}
84
177c0ea7 85CHINESE-BIG5=${TIT-BIG5} ${NON-TIT-BIG5}
dadbf673 86
dadbf673
GM
87JAPANESE=${srcdir}/quail/japanese.elc ${srcdir}/ja-dic/ja-dic.elc
88
89KOREAN= ${srcdir}/quail/hangul.elc \
dadbf673 90 ${srcdir}/quail/hanja.elc \
a46d278b 91 ${srcdir}/quail/hanja3.elc \
dadbf673
GM
92 ${srcdir}/quail/hanja-jis.elc \
93 ${srcdir}/quail/symbol-ksc.elc
94
95THAI=${srcdir}/quail/thai.elc
96
54679108 97VIETNAMESE=${srcdir}/quail/viqr.elc ${srcdir}/quail/vntelex.elc
dadbf673
GM
98
99LAO=${srcdir}/quail/lao.elc ${srcdir}/quail/lrt.elc
100
afdc8040 101INDIAN=${srcdir}/quail/indian.elc
dadbf673
GM
102
103TIBETAN=${srcdir}/quail/tibetan.elc
104
e427747f
KH
105LATIN= ${srcdir}/quail/latin-pre.elc \
106 ${srcdir}/quail/latin-post.elc \
f8f96fe2 107 ${srcdir}/quail/latin-alt.elc \
0fcaf339
DL
108 ${srcdir}/quail/latin-ltx.elc \
109 ${srcdir}/quail/welsh.elc
110
111UNICODE=${srcdir}/quail/sgml-input.elc ${srcdir}/quail/rfc1345.elc \
112 ${srcdir}/quail/uni-input.elc
dadbf673
GM
113
114SLAVIC= \
115 ${srcdir}/quail/czech.elc \
98e99f6e 116 ${srcdir}/quail/croatian.elc \
dadbf673
GM
117 ${srcdir}/quail/slovak.elc
118
119GREEK=${srcdir}/quail/greek.elc
120
121RUSSIAN=${srcdir}/quail/cyrillic.elc ${srcdir}/quail/cyril-jis.elc
122
242a2def 123OTHERS= \
0bf80020 124 ${srcdir}/quail/arabic.elc \
dadbf673
GM
125 ${srcdir}/quail/ethiopic.elc \
126 ${srcdir}/quail/ipa.elc \
0fcaf339 127 ${srcdir}/quail/hebrew.elc \
f9f14309
KH
128 ${srcdir}/quail/georgian.elc \
129 ${srcdir}/quail/sisheng.elc
dadbf673 130
242a2def 131MISC= \
117348b8
KH
132 quail/tsang-b5.elc \
133 quail/quick-b5.elc \
134 quail/tsang-cns.elc \
135 quail/quick-cns.elc \
136 quail/PY.elc \
5156a15c
AC
137 quail/ZIRANMA.elc \
138 quail/CTLau.elc \
937fad9a 139 quail/CTLau-b5.elc
117348b8
KH
140
141CHINESE=${CHINESE-GB} ${CHINESE-BIG5}
dadbf673
GM
142EASTASIA=${CHINESE} ${JAPANESE} ${KOREAN}
143ASIA=${EASTASIA} ${THAI} ${VIETNAMESE} ${LAO} ${INDIAN} ${TIBETAN}
144EUROPEAN=${LATIN} ${SLAVIC} ${GREEK} ${RUSSIAN}
242a2def 145WORLD=${ASIA} ${EUROPEAN} ${OTHERS} ${MISC} ${UNICODE}
dadbf673 146
242a2def
KH
147TIT-MISC=${CHINESE-TIT} ${MISC}
148NON-TIT-MISC=${CHINESE-NON-TIT} ${JAPANESE} ${KOREAN} ${EUROPEAN} ${OTHERS}
dadbf673 149
e1e539ed
KH
150.SUFFIXES: .elc .el
151
dadbf673 152.el.elc:
8e0214ec
GM
153 @echo Compiling $<
154 @${RUN-EMACS} -f batch-byte-compile $<
dadbf673 155
9d820f1a 156all: ${BUILT-EMACS} ${SUBDIRS} leim-list.el ${WORLD}
dadbf673
GM
157
158# To ensure that we can run Emacs. This target is ignored (never
159# being hit) if a user changes default value of EMACS.
c1d05286 160../src/emacs:
dadbf673
GM
161 cd ../src; ${MAKE} ${MFLAGS} emacs
162
163${SUBDIRS}:
164 mkdir $@
165 touch stamp-subdir
166
242a2def 167TIT-SOURCES= \
2cd23d89
KH
168 ${srcdir}/CXTERM-DIC/4Corner.tit \
169 ${srcdir}/CXTERM-DIC/ARRAY30.tit \
170 ${srcdir}/CXTERM-DIC/CCDOSPY.tit \
171 ${srcdir}/CXTERM-DIC/ECDICT.tit \
172 ${srcdir}/CXTERM-DIC/ETZY.tit \
173 ${srcdir}/CXTERM-DIC/PY-b5.tit \
174 ${srcdir}/CXTERM-DIC/Punct-b5.tit \
175 ${srcdir}/CXTERM-DIC/Punct.tit \
176 ${srcdir}/CXTERM-DIC/QJ-b5.tit \
177 ${srcdir}/CXTERM-DIC/QJ.tit \
178 ${srcdir}/CXTERM-DIC/SW.tit \
179 ${srcdir}/CXTERM-DIC/TONEPY.tit \
180 ${srcdir}/CXTERM-DIC/ZOZY.tit
242a2def 181
4c603b0c
AS
182${CHINESE-TIT:.elc=.el}: changed.tit
183 @true
184
242a2def 185changed.tit: ${TIT-SOURCES}
026e4e51
EZ
186 ${RUN-EMACS} -l ${buildlisppath}/international/titdic-cnv \
187 -f batch-titdic-convert -dir quail ${srcdir}/CXTERM-DIC; \
188 echo "changed" > $@
242a2def
KH
189
190MISC-SOURCES= \
2cd23d89
KH
191 ${srcdir}/MISC-DIC/CTLau-b5.html \
192 ${srcdir}/MISC-DIC/CTLau.html \
193 ${srcdir}/MISC-DIC/cangjie-table.b5 \
194 ${srcdir}/MISC-DIC/cangjie-table.cns \
195 ${srcdir}/MISC-DIC/pinyin.map \
196 ${srcdir}/MISC-DIC/ziranma.cin
242a2def 197
4c603b0c
AS
198${MISC:.elc=.el}: changed.misc
199 @true
200
242a2def 201changed.misc: ${MISC-SOURCES}
026e4e51
EZ
202 ${RUN-EMACS} -l ${buildlisppath}/international/titdic-cnv \
203 -f batch-miscdic-convert -dir quail ${srcdir}/MISC-DIC; \
204 echo "changed" > $@
242a2def 205
90519dc8 206leim-list.el: ${SUBDIRS} ${TIT-MISC} changed.tit changed.misc ${srcdir}/leim-ext.el
7069bd16 207 rm -f leim-list.el
242a2def
KH
208 ${RUN-EMACS} -l ${buildlisppath}/international/quail \
209 -f batch-byte-compile-if-not-done ${TIT-MISC:.elc=.el}
dadbf673
GM
210 if [ x`(cd ${srcdir} && /bin/pwd)` = x`(/bin/pwd)` ] ; then \
211 ${RUN-EMACS} -l ${buildlisppath}/international/quail \
212 --eval "(update-leim-list-file \".\")" ; \
213 else \
214 ${RUN-EMACS} -l ${buildlisppath}/international/quail \
215 --eval "(update-leim-list-file \".\" \"${srcdir}\")" ; \
216 fi
8f34b40c 217 sed -n '/^[^;]/ p' < ${srcdir}/leim-ext.el >> $@
dadbf673 218
734dabe0 219MV_DIRS = for i in $$dir; do rm -fr `basename "$$i"` ; mv "$$i" . ; done
3fef330a 220
dadbf673 221install: all
94461c21 222 if [ ! -d ${INSTALLDIR} ] ; then \
c1d05286 223 umask 022; ${srcdir}/../mkinstalldirs ${INSTALLDIR}; \
94461c21 224 else true; fi
dadbf673 225 if [ x`(cd ${INSTALLDIR} && /bin/pwd)` != x`(/bin/pwd)` ] ; then \
7069bd16 226 rm -f ${INSTALLDIR}/leim-list.el; \
94461c21 227 rm -rf ${INSTALLDIR}/quail ${INSTALLDIR}/ja-dic ; \
dadbf673
GM
228 echo "Copying leim files to ${INSTALLDIR} ..." ; \
229 if [ x`(cd ${srcdir} && /bin/pwd)` = x`(/bin/pwd)` ] ; then \
05b54460 230 tar -chf - leim-list.el quail ja-dic \
dadbf673
GM
231 | (cd ${INSTALLDIR}; umask 0; tar -xvf - && cat > /dev/null) ;\
232 else \
05b54460 233 tar -chf - leim-list.el quail \
dadbf673
GM
234 | (cd ${INSTALLDIR}; umask 0; tar -xvf - && cat > /dev/null) ;\
235 cd ${srcdir}; \
05b54460 236 tar -chf - quail/* ja-dic \
dadbf673
GM
237 | (cd ${INSTALLDIR}; umask 0; tar -xvf - && cat > /dev/null) ;\
238 fi; \
5ae051fd 239 rm -f ${INSTALLDIR}/.gitignore ${INSTALLDIR}/*/.gitignore; \
792a05ba 240 rm -f ${INSTALLDIR}/.arch-inventory ${INSTALLDIR}/*/.arch-inventory; \
069e6098
AS
241 rm -f ${INSTALLDIR}/\#* ${INSTALLDIR}/*/\#* ; \
242 rm -f ${INSTALLDIR}/.\#* ${INSTALLDIR}/*/.\#* ; \
243 rm -f ${INSTALLDIR}/*~ ${INSTALLDIR}/*/*~ ; \
244 rm -f ${INSTALLDIR}/*.orig ${INSTALLDIR}/*/*.orig ; \
dadbf673 245 else true; fi
7a7f042f 246 -unset CDPATH; \
d95f329f 247 if [ -n "${GZIP_PROG}" ]; \
7a7f042f
RF
248 then \
249 echo "Compressing *.el ..." ; \
250 (cd ${INSTALLDIR}; for f in `find . -name "*.elc" -print`; do \
d95f329f 251 ${GZIP_PROG} -9n `echo $$f|sed 's/.elc$$/.el/'` ; \
7a7f042f
RF
252 done) \
253 else true; fi
dadbf673 254 -chmod -R a+r ${INSTALLDIR}
fe1ada9b
GM
255 for installuser in $${LOGNAME} $${USERNAME} $${USER} \
256 `id -un 2> /dev/null`; do \
257 [ -n "$${installuser}" ] && break ; \
258 done ; \
07131283 259 find ${INSTALLDIR} -exec chown $${installuser} '{}' ';'
2a7973b6
AR
260 if [ "${ns_appresdir}" != "" ]; then \
261 ( cd ${ns_appresdir} ; \
3fef330a 262 if test -d share/emacs ; then dir=share/emacs/*/*; $(MV_DIRS); fi;\
2a7973b6
AR
263 rm -fr share ) ; \
264 else true ; fi
dadbf673
GM
265
266clean mostlyclean:
7017c817 267 rm -f ${TIT-MISC} ${TIT-MISC:.elc=.el} \
242a2def 268 leim-list.el changed.tit changed.misc
dadbf673 269
9200c926
RF
270# The following target is needed because the `clean' target only removes
271# TIT-generated files and doesn't touch compiled Quail packages. But
272# bootstrapping should not leave non-fresh .elc files behind.
273bootstrap-clean: clean
274 rm -f ${WORLD}
cbeed5af
GM
275## FIXME some compiled files go to srcdir, some don't?
276# cd ${srcdir}; rm -f *.elc */*.elc
9200c926 277
e6f528ba 278distclean: clean
dadbf673
GM
279 if test -f stamp-subdir; then rm -rf ${SUBDIRS} stamp-subdir; fi
280 rm -f Makefile
a070e0b7 281
cbeed5af 282maintainer-clean: distclean bootstrap-clean
e6f528ba
KH
283
284extraclean: maintainer-clean
cbeed5af 285 -rm -f *~ \#* */*~ */\#*
63150f3c
GM
286
287.PHONY: check-declare
288
289check-declare:
290 $(RUN-EMACS) -l $(buildlisppath)/emacs-lisp/check-declare \
291 --eval '(check-declare-directory "$(srcdir)")'