Commit | Line | Data |
---|---|---|
dadbf673 | 1 | # Makefile for leim subdirectory in GNU Emacs. |
95df8112 | 2 | |
acaf905b | 3 | # Copyright (C) 1997-2012 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. | |
27 | SHELL = /bin/sh | |
28 | ||
29 | # Here are the things that we expect ../configure to edit. | |
30 | version=@version@ | |
31 | prefix=@prefix@ | |
ca1cd89c | 32 | datarootdir=@datarootdir@ |
dadbf673 GM |
33 | datadir=@datadir@ |
34 | srcdir=@srcdir@ | |
2a7973b6 | 35 | ns_appresdir=@ns_appresdir@ |
dadbf673 GM |
36 | |
37 | # Where to install LEIM files. | |
62ebf7d7 | 38 | INSTALLDIR=$(DESTDIR)${datadir}/emacs/${version}/leim |
dadbf673 | 39 | |
d95f329f | 40 | GZIP_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. | |
68b5f855 | 44 | BUILT_EMACS = ../src/emacs |
dadbf673 | 45 | |
c1d05286 | 46 | buildlisppath=${srcdir}/../lisp |
dadbf673 GM |
47 | |
48 | # How to run Emacs. | |
68b5f855 PE |
49 | RUN_EMACS = EMACSLOADPATH=$(buildlisppath) LC_ALL=C \ |
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. | |
54 | SUBDIRS=quail | |
55 | ||
56 | # Files generated from TIT dictionaries for Chinese GB character set. | |
68b5f855 | 57 | TIT_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. | |
acb8e1dd | 65 | TIT_BIG5=\ |
dadbf673 GM |
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 | ||
68b5f855 | 75 | CHINESE_TIT=${TIT_GB} ${TIT_BIG5} |
dadbf673 | 76 | |
68b5f855 | 77 | NON_TIT_GB=${srcdir}/quail/py-punct.elc |
dadbf673 | 78 | |
68b5f855 | 79 | NON_TIT_BIG5=${srcdir}/quail/pypunct-b5.elc |
dadbf673 | 80 | |
68b5f855 | 81 | CHINESE_NON_TIT=${NON_TIT_GB} ${NON_TIT_BIG5} |
dadbf673 | 82 | |
68b5f855 | 83 | CHINESE_GB=${TIT_GB} ${NON_TIT_GB} |
dadbf673 | 84 | |
68b5f855 | 85 | CHINESE_BIG5=${TIT_BIG5} ${NON_TIT_BIG5} |
dadbf673 | 86 | |
dadbf673 GM |
87 | JAPANESE=${srcdir}/quail/japanese.elc ${srcdir}/ja-dic/ja-dic.elc |
88 | ||
89 | KOREAN= ${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 | ||
95 | THAI=${srcdir}/quail/thai.elc | |
96 | ||
54679108 | 97 | VIETNAMESE=${srcdir}/quail/viqr.elc ${srcdir}/quail/vntelex.elc |
dadbf673 GM |
98 | |
99 | LAO=${srcdir}/quail/lao.elc ${srcdir}/quail/lrt.elc | |
100 | ||
afdc8040 | 101 | INDIAN=${srcdir}/quail/indian.elc |
dadbf673 GM |
102 | |
103 | TIBETAN=${srcdir}/quail/tibetan.elc | |
104 | ||
e427747f KH |
105 | LATIN= ${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 | ||
111 | UNICODE=${srcdir}/quail/sgml-input.elc ${srcdir}/quail/rfc1345.elc \ | |
112 | ${srcdir}/quail/uni-input.elc | |
dadbf673 GM |
113 | |
114 | SLAVIC= \ | |
115 | ${srcdir}/quail/czech.elc \ | |
98e99f6e | 116 | ${srcdir}/quail/croatian.elc \ |
dadbf673 GM |
117 | ${srcdir}/quail/slovak.elc |
118 | ||
119 | GREEK=${srcdir}/quail/greek.elc | |
120 | ||
121 | RUSSIAN=${srcdir}/quail/cyrillic.elc ${srcdir}/quail/cyril-jis.elc | |
122 | ||
242a2def | 123 | OTHERS= \ |
0bf80020 | 124 | ${srcdir}/quail/arabic.elc \ |
dadbf673 GM |
125 | ${srcdir}/quail/ethiopic.elc \ |
126 | ${srcdir}/quail/ipa.elc \ | |
f624176f | 127 | ${srcdir}/quail/ipa-praat.elc \ |
0fcaf339 | 128 | ${srcdir}/quail/hebrew.elc \ |
f9f14309 | 129 | ${srcdir}/quail/georgian.elc \ |
d0ce9f8c | 130 | $(srcdir)/quail/persian.elc \ |
f9f14309 | 131 | ${srcdir}/quail/sisheng.elc |
dadbf673 | 132 | |
242a2def | 133 | MISC= \ |
117348b8 KH |
134 | quail/tsang-b5.elc \ |
135 | quail/quick-b5.elc \ | |
136 | quail/tsang-cns.elc \ | |
137 | quail/quick-cns.elc \ | |
138 | quail/PY.elc \ | |
5156a15c AC |
139 | quail/ZIRANMA.elc \ |
140 | quail/CTLau.elc \ | |
937fad9a | 141 | quail/CTLau-b5.elc |
117348b8 | 142 | |
68b5f855 | 143 | CHINESE=${CHINESE_GB} ${CHINESE_BIG5} |
dadbf673 GM |
144 | EASTASIA=${CHINESE} ${JAPANESE} ${KOREAN} |
145 | ASIA=${EASTASIA} ${THAI} ${VIETNAMESE} ${LAO} ${INDIAN} ${TIBETAN} | |
146 | EUROPEAN=${LATIN} ${SLAVIC} ${GREEK} ${RUSSIAN} | |
242a2def | 147 | WORLD=${ASIA} ${EUROPEAN} ${OTHERS} ${MISC} ${UNICODE} |
dadbf673 | 148 | |
68b5f855 PE |
149 | TIT_MISC=${CHINESE_TIT} ${MISC} |
150 | NON_TIT_MISC=${CHINESE_NON_TIT} ${JAPANESE} ${KOREAN} ${EUROPEAN} ${OTHERS} | |
dadbf673 | 151 | |
e1e539ed KH |
152 | .SUFFIXES: .elc .el |
153 | ||
dadbf673 | 154 | .el.elc: |
8e0214ec | 155 | @echo Compiling $< |
68b5f855 | 156 | @${RUN_EMACS} -f batch-byte-compile $< |
dadbf673 | 157 | |
68b5f855 | 158 | all: ${BUILT_EMACS} ${SUBDIRS} leim-list.el ${WORLD} |
dadbf673 GM |
159 | |
160 | # To ensure that we can run Emacs. This target is ignored (never | |
161 | # being hit) if a user changes default value of EMACS. | |
c1d05286 | 162 | ../src/emacs: |
dadbf673 GM |
163 | cd ../src; ${MAKE} ${MFLAGS} emacs |
164 | ||
165 | ${SUBDIRS}: | |
166 | mkdir $@ | |
167 | touch stamp-subdir | |
168 | ||
68b5f855 | 169 | TIT_SOURCES= \ |
2cd23d89 KH |
170 | ${srcdir}/CXTERM-DIC/4Corner.tit \ |
171 | ${srcdir}/CXTERM-DIC/ARRAY30.tit \ | |
172 | ${srcdir}/CXTERM-DIC/CCDOSPY.tit \ | |
173 | ${srcdir}/CXTERM-DIC/ECDICT.tit \ | |
174 | ${srcdir}/CXTERM-DIC/ETZY.tit \ | |
175 | ${srcdir}/CXTERM-DIC/PY-b5.tit \ | |
176 | ${srcdir}/CXTERM-DIC/Punct-b5.tit \ | |
177 | ${srcdir}/CXTERM-DIC/Punct.tit \ | |
178 | ${srcdir}/CXTERM-DIC/QJ-b5.tit \ | |
179 | ${srcdir}/CXTERM-DIC/QJ.tit \ | |
180 | ${srcdir}/CXTERM-DIC/SW.tit \ | |
181 | ${srcdir}/CXTERM-DIC/TONEPY.tit \ | |
182 | ${srcdir}/CXTERM-DIC/ZOZY.tit | |
242a2def | 183 | |
68b5f855 | 184 | ${CHINESE_TIT:.elc=.el}: changed.tit |
4c603b0c AS |
185 | @true |
186 | ||
68b5f855 PE |
187 | changed.tit: ${TIT_SOURCES} |
188 | ${RUN_EMACS} -l ${buildlisppath}/international/titdic-cnv \ | |
026e4e51 EZ |
189 | -f batch-titdic-convert -dir quail ${srcdir}/CXTERM-DIC; \ |
190 | echo "changed" > $@ | |
242a2def | 191 | |
68b5f855 | 192 | MISC_SOURCES= \ |
2cd23d89 KH |
193 | ${srcdir}/MISC-DIC/CTLau-b5.html \ |
194 | ${srcdir}/MISC-DIC/CTLau.html \ | |
195 | ${srcdir}/MISC-DIC/cangjie-table.b5 \ | |
196 | ${srcdir}/MISC-DIC/cangjie-table.cns \ | |
197 | ${srcdir}/MISC-DIC/pinyin.map \ | |
198 | ${srcdir}/MISC-DIC/ziranma.cin | |
242a2def | 199 | |
4c603b0c AS |
200 | ${MISC:.elc=.el}: changed.misc |
201 | @true | |
202 | ||
68b5f855 PE |
203 | changed.misc: ${MISC_SOURCES} |
204 | ${RUN_EMACS} -l ${buildlisppath}/international/titdic-cnv \ | |
026e4e51 EZ |
205 | -f batch-miscdic-convert -dir quail ${srcdir}/MISC-DIC; \ |
206 | echo "changed" > $@ | |
242a2def | 207 | |
68b5f855 | 208 | leim-list.el: ${SUBDIRS} ${TIT_MISC} changed.tit changed.misc ${srcdir}/leim-ext.el |
7069bd16 | 209 | rm -f leim-list.el |
68b5f855 PE |
210 | ${RUN_EMACS} -l ${buildlisppath}/international/quail \ |
211 | -f batch-byte-compile-if-not-done ${TIT_MISC:.elc=.el} | |
dadbf673 | 212 | if [ x`(cd ${srcdir} && /bin/pwd)` = x`(/bin/pwd)` ] ; then \ |
68b5f855 | 213 | ${RUN_EMACS} -l ${buildlisppath}/international/quail \ |
dadbf673 GM |
214 | --eval "(update-leim-list-file \".\")" ; \ |
215 | else \ | |
68b5f855 | 216 | ${RUN_EMACS} -l ${buildlisppath}/international/quail \ |
dadbf673 GM |
217 | --eval "(update-leim-list-file \".\" \"${srcdir}\")" ; \ |
218 | fi | |
8f34b40c | 219 | sed -n '/^[^;]/ p' < ${srcdir}/leim-ext.el >> $@ |
dadbf673 | 220 | |
734dabe0 | 221 | MV_DIRS = for i in $$dir; do rm -fr `basename "$$i"` ; mv "$$i" . ; done |
3fef330a | 222 | |
dadbf673 | 223 | install: all |
94461c21 | 224 | if [ ! -d ${INSTALLDIR} ] ; then \ |
24e0f6b1 | 225 | umask 022; ${srcdir}/../build-aux/install-sh -d ${INSTALLDIR}; \ |
94461c21 | 226 | else true; fi |
dadbf673 | 227 | if [ x`(cd ${INSTALLDIR} && /bin/pwd)` != x`(/bin/pwd)` ] ; then \ |
7069bd16 | 228 | rm -f ${INSTALLDIR}/leim-list.el; \ |
94461c21 | 229 | rm -rf ${INSTALLDIR}/quail ${INSTALLDIR}/ja-dic ; \ |
dadbf673 GM |
230 | echo "Copying leim files to ${INSTALLDIR} ..." ; \ |
231 | if [ x`(cd ${srcdir} && /bin/pwd)` = x`(/bin/pwd)` ] ; then \ | |
05b54460 | 232 | tar -chf - leim-list.el quail ja-dic \ |
dadbf673 GM |
233 | | (cd ${INSTALLDIR}; umask 0; tar -xvf - && cat > /dev/null) ;\ |
234 | else \ | |
05b54460 | 235 | tar -chf - leim-list.el quail \ |
dadbf673 GM |
236 | | (cd ${INSTALLDIR}; umask 0; tar -xvf - && cat > /dev/null) ;\ |
237 | cd ${srcdir}; \ | |
05b54460 | 238 | tar -chf - quail/* ja-dic \ |
dadbf673 GM |
239 | | (cd ${INSTALLDIR}; umask 0; tar -xvf - && cat > /dev/null) ;\ |
240 | fi; \ | |
5ae051fd | 241 | rm -f ${INSTALLDIR}/.gitignore ${INSTALLDIR}/*/.gitignore; \ |
792a05ba | 242 | rm -f ${INSTALLDIR}/.arch-inventory ${INSTALLDIR}/*/.arch-inventory; \ |
069e6098 AS |
243 | rm -f ${INSTALLDIR}/\#* ${INSTALLDIR}/*/\#* ; \ |
244 | rm -f ${INSTALLDIR}/.\#* ${INSTALLDIR}/*/.\#* ; \ | |
245 | rm -f ${INSTALLDIR}/*~ ${INSTALLDIR}/*/*~ ; \ | |
246 | rm -f ${INSTALLDIR}/*.orig ${INSTALLDIR}/*/*.orig ; \ | |
dadbf673 | 247 | else true; fi |
7a7f042f | 248 | -unset CDPATH; \ |
d95f329f | 249 | if [ -n "${GZIP_PROG}" ]; \ |
7a7f042f RF |
250 | then \ |
251 | echo "Compressing *.el ..." ; \ | |
252 | (cd ${INSTALLDIR}; for f in `find . -name "*.elc" -print`; do \ | |
d95f329f | 253 | ${GZIP_PROG} -9n `echo $$f|sed 's/.elc$$/.el/'` ; \ |
7a7f042f RF |
254 | done) \ |
255 | else true; fi | |
dadbf673 | 256 | -chmod -R a+r ${INSTALLDIR} |
fe1ada9b GM |
257 | for installuser in $${LOGNAME} $${USERNAME} $${USER} \ |
258 | `id -un 2> /dev/null`; do \ | |
259 | [ -n "$${installuser}" ] && break ; \ | |
260 | done ; \ | |
07131283 | 261 | find ${INSTALLDIR} -exec chown $${installuser} '{}' ';' |
2a7973b6 AR |
262 | if [ "${ns_appresdir}" != "" ]; then \ |
263 | ( cd ${ns_appresdir} ; \ | |
3fef330a | 264 | if test -d share/emacs ; then dir=share/emacs/*/*; $(MV_DIRS); fi;\ |
2a7973b6 AR |
265 | rm -fr share ) ; \ |
266 | else true ; fi | |
dadbf673 GM |
267 | |
268 | clean mostlyclean: | |
68b5f855 | 269 | rm -f ${TIT_MISC} ${TIT_MISC:.elc=.el} \ |
242a2def | 270 | leim-list.el changed.tit changed.misc |
dadbf673 | 271 | |
9200c926 RF |
272 | # The following target is needed because the `clean' target only removes |
273 | # TIT-generated files and doesn't touch compiled Quail packages. But | |
274 | # bootstrapping should not leave non-fresh .elc files behind. | |
275 | bootstrap-clean: clean | |
276 | rm -f ${WORLD} | |
cbeed5af GM |
277 | ## FIXME some compiled files go to srcdir, some don't? |
278 | # cd ${srcdir}; rm -f *.elc */*.elc | |
9200c926 | 279 | |
e6f528ba | 280 | distclean: clean |
dadbf673 GM |
281 | if test -f stamp-subdir; then rm -rf ${SUBDIRS} stamp-subdir; fi |
282 | rm -f Makefile | |
a070e0b7 | 283 | |
cbeed5af | 284 | maintainer-clean: distclean bootstrap-clean |
e6f528ba KH |
285 | |
286 | extraclean: maintainer-clean | |
cbeed5af | 287 | -rm -f *~ \#* */*~ */\#* |
63150f3c GM |
288 | |
289 | .PHONY: check-declare | |
290 | ||
291 | check-declare: | |
68b5f855 | 292 | $(RUN_EMACS) -l $(buildlisppath)/emacs-lisp/check-declare \ |
63150f3c | 293 | --eval '(check-declare-directory "$(srcdir)")' |