]> code.delx.au - gnu-emacs/blob - leim/Makefile.in
Merge from emacs-24 branch
[gnu-emacs] / leim / Makefile.in
1 # Makefile for leim subdirectory in GNU Emacs.
2
3 # Copyright (C) 1997-2012 Free Software Foundation, Inc.
4 # Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
5 # 2006, 2007, 2008, 2009, 2010, 2011
6 # National Institute of Advanced Industrial Science and Technology (AIST)
7 # Registration Number H14PRO021
8
9 # This file is part of GNU Emacs.
10
11 # GNU Emacs is free software: you can redistribute it and/or modify
12 # it under the terms of the GNU General Public License as published by
13 # the Free Software Foundation, either version 3 of the License, or
14 # (at your option) any later version.
15
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.
20
21 # You should have received a copy of the GNU General Public License
22 # along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
23
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@
32 datarootdir=@datarootdir@
33 datadir=@datadir@
34 srcdir=@srcdir@
35 ns_appresdir=@ns_appresdir@
36
37 # Where to install LEIM files.
38 INSTALLDIR=$(DESTDIR)${datadir}/emacs/${version}/leim
39
40 GZIP_PROG = @GZIP_PROG@
41
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.
44 EMACS = ../src/emacs
45
46 buildlisppath=${srcdir}/../lisp
47
48 # How to run Emacs.
49 RUN_EMACS = EMACSLOADPATH=$(buildlisppath) LC_ALL=C \
50 ${EMACS} -batch --no-site-file --no-site-lisp
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.
57 TIT_GB=\
58 quail/CCDOSPY.el \
59 quail/Punct.el \
60 quail/QJ.el \
61 quail/SW.el \
62 quail/TONEPY.el
63
64 # Files generated from TIT dictionaries for Chinese BIG5 character set.
65 TIT_BIG5=\
66 quail/4Corner.el \
67 quail/ARRAY30.el \
68 quail/ECDICT.el \
69 quail/ETZY.el \
70 quail/Punct-b5.el \
71 quail/PY-b5.el \
72 quail/QJ-b5.el \
73 quail/ZOZY.el
74
75 CHINESE_TIT=${TIT_GB} ${TIT_BIG5}
76
77 MISC= \
78 quail/tsang-b5.el \
79 quail/quick-b5.el \
80 quail/tsang-cns.el \
81 quail/quick-cns.el \
82 quail/PY.el \
83 quail/ZIRANMA.el \
84 quail/CTLau.el \
85 quail/CTLau-b5.el
86
87 ## The generated .el files.
88 TIT_MISC=${CHINESE_TIT} ${MISC}
89
90 .SUFFIXES: .elc .el
91
92 .el.elc:
93 @echo Compiling $<
94 @${RUN_EMACS} -l ${buildlisppath}/international/quail -f batch-byte-compile $<
95
96 all: ${SUBDIRS} leim-list.el compile-main
97
98 ${SUBDIRS}:
99 mkdir $@
100 touch stamp-subdir
101
102 TIT_SOURCES= \
103 ${srcdir}/CXTERM-DIC/4Corner.tit \
104 ${srcdir}/CXTERM-DIC/ARRAY30.tit \
105 ${srcdir}/CXTERM-DIC/CCDOSPY.tit \
106 ${srcdir}/CXTERM-DIC/ECDICT.tit \
107 ${srcdir}/CXTERM-DIC/ETZY.tit \
108 ${srcdir}/CXTERM-DIC/PY-b5.tit \
109 ${srcdir}/CXTERM-DIC/Punct-b5.tit \
110 ${srcdir}/CXTERM-DIC/Punct.tit \
111 ${srcdir}/CXTERM-DIC/QJ-b5.tit \
112 ${srcdir}/CXTERM-DIC/QJ.tit \
113 ${srcdir}/CXTERM-DIC/SW.tit \
114 ${srcdir}/CXTERM-DIC/TONEPY.tit \
115 ${srcdir}/CXTERM-DIC/ZOZY.tit
116
117 ${CHINESE_TIT}: changed.tit
118 @true
119
120 ## FIXME remove subdirs if poss - time-stamping.
121 ## Emacs should make the directory if it does not exist.
122 changed.tit: ${SUBDIRS} ${TIT_SOURCES}
123 ${RUN_EMACS} -l ${buildlisppath}/international/titdic-cnv \
124 -f batch-titdic-convert -dir quail ${srcdir}/CXTERM-DIC; \
125 echo "changed" > $@
126
127 MISC_SOURCES= \
128 ${srcdir}/MISC-DIC/CTLau-b5.html \
129 ${srcdir}/MISC-DIC/CTLau.html \
130 ${srcdir}/MISC-DIC/cangjie-table.b5 \
131 ${srcdir}/MISC-DIC/cangjie-table.cns \
132 ${srcdir}/MISC-DIC/pinyin.map \
133 ${srcdir}/MISC-DIC/ziranma.cin
134
135 ${MISC}: changed.misc
136 @true
137
138 changed.misc: ${SUBDIRS} ${MISC_SOURCES}
139 ${RUN_EMACS} -l ${buildlisppath}/international/titdic-cnv \
140 -f batch-miscdic-convert -dir quail ${srcdir}/MISC-DIC; \
141 echo "changed" > $@
142
143 leim-list.el: ${SUBDIRS} ${TIT_MISC} ${srcdir}/leim-ext.el
144 rm -f leim-list.el
145 if [ x`(cd ${srcdir} && /bin/pwd)` = x`(/bin/pwd)` ] ; then \
146 ${RUN_EMACS} -l ${buildlisppath}/international/quail \
147 --eval "(update-leim-list-file \".\")" ; \
148 else \
149 ${RUN_EMACS} -l ${buildlisppath}/international/quail \
150 --eval "(update-leim-list-file \".\" \"${srcdir}\")" ; \
151 fi
152 sed -n '/^[^;]/ p' < ${srcdir}/leim-ext.el >> $@
153
154 ## Following adapted from lisp/Makefile.in.
155 setwins=wins="${srcdir}/ja-dic quail"; \
156 [ `cd ${srcdir} && /bin/pwd` != `/bin/pwd` ] && \
157 wins="$$wins ${srcdir}/quail"
158
159 .PHONY: compile-targets
160 # TARGETS is set dynamically in the recursive call from `compile-main'.
161 compile-targets: $(TARGETS)
162
163 # Compile all the Elisp files that need it. Beware: it approximates
164 # `no-byte-compile', so watch out for false-positives!
165 compile-main: ${TIT_MISC}
166 @($(setwins); \
167 els=`echo "$$wins " | sed -e 's| |/*.el |g'`; \
168 for el in $$els; do \
169 test -f $$el || continue; \
170 test ! -f $${el}c && GREP_OPTIONS= grep '^;.*no-byte-compile: t' $$el > /dev/null && continue; \
171 echo "$${el}c"; \
172 done | xargs echo) | \
173 while read chunk; do \
174 $(MAKE) $(MFLAGS) compile-targets EMACS="$(EMACS)" TARGETS="$$chunk"; \
175 done
176
177 MV_DIRS = for i in $$dir; do rm -fr `basename "$$i"` ; mv "$$i" . ; done
178
179 install: all
180 if [ ! -d ${INSTALLDIR} ] ; then \
181 umask 022; ${srcdir}/../build-aux/install-sh -d ${INSTALLDIR}; \
182 else true; fi
183 if [ x`(cd ${INSTALLDIR} && /bin/pwd)` != x`(/bin/pwd)` ] ; then \
184 rm -f ${INSTALLDIR}/leim-list.el; \
185 rm -rf ${INSTALLDIR}/quail ${INSTALLDIR}/ja-dic ; \
186 echo "Copying leim files to ${INSTALLDIR} ..." ; \
187 if [ x`(cd ${srcdir} && /bin/pwd)` = x`(/bin/pwd)` ] ; then \
188 tar -chf - leim-list.el quail ja-dic \
189 | (cd ${INSTALLDIR}; umask 0; tar -xvf - && cat > /dev/null) ;\
190 else \
191 tar -chf - leim-list.el quail \
192 | (cd ${INSTALLDIR}; umask 0; tar -xvf - && cat > /dev/null) ;\
193 cd ${srcdir}; \
194 tar -chf - quail/* ja-dic \
195 | (cd ${INSTALLDIR}; umask 0; tar -xvf - && cat > /dev/null) ;\
196 fi; \
197 rm -f ${INSTALLDIR}/.gitignore ${INSTALLDIR}/*/.gitignore; \
198 rm -f ${INSTALLDIR}/.arch-inventory ${INSTALLDIR}/*/.arch-inventory; \
199 rm -f ${INSTALLDIR}/\#* ${INSTALLDIR}/*/\#* ; \
200 rm -f ${INSTALLDIR}/.\#* ${INSTALLDIR}/*/.\#* ; \
201 rm -f ${INSTALLDIR}/*~ ${INSTALLDIR}/*/*~ ; \
202 rm -f ${INSTALLDIR}/*.orig ${INSTALLDIR}/*/*.orig ; \
203 else true; fi
204 -unset CDPATH; \
205 if [ -n "${GZIP_PROG}" ]; \
206 then \
207 echo "Compressing *.el ..." ; \
208 (cd ${INSTALLDIR}; for f in `find . -name "*.elc" -print`; do \
209 ${GZIP_PROG} -9n `echo $$f|sed 's/.elc$$/.el/'` ; \
210 done) \
211 else true; fi
212 -chmod -R a+r ${INSTALLDIR}
213 for installuser in $${LOGNAME} $${USERNAME} $${USER} \
214 `id -un 2> /dev/null`; do \
215 [ -n "$${installuser}" ] && break ; \
216 done ; \
217 find ${INSTALLDIR} -exec chown $${installuser} '{}' ';'
218 if [ "${ns_appresdir}" != "" ]; then \
219 ( cd ${ns_appresdir} ; \
220 if test -d share/emacs ; then dir=share/emacs/*/*; $(MV_DIRS); fi;\
221 rm -fr share ) ; \
222 else true ; fi
223
224 clean mostlyclean:
225 rm -f ${TIT_MISC} ${TIT_MISC:.el=.elc} \
226 leim-list.el changed.tit changed.misc
227
228 # The following target is needed because the `clean' target only removes
229 # TIT-generated files and doesn't touch compiled Quail packages. But
230 # bootstrapping should not leave non-fresh .elc files behind.
231 bootstrap-clean: clean
232 $(setwins); for w in $$wins; do rm -f $$w/*.elc; done
233
234 distclean: clean
235 if test -f stamp-subdir; then rm -rf ${SUBDIRS} stamp-subdir; fi
236 rm -f Makefile
237
238 maintainer-clean: distclean bootstrap-clean
239
240 extraclean: maintainer-clean
241 -rm -f *~ \#* */*~ */\#*
242
243 .PHONY: check-declare
244
245 check-declare:
246 $(RUN_EMACS) -l $(buildlisppath)/emacs-lisp/check-declare \
247 --eval '(check-declare-directory "$(srcdir)")'