]> code.delx.au - gnu-emacs/blob - leim/Makefile.in
Merge from trunk; add Bug#.
[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 BUILT_EMACS = ../src/emacs
45
46 buildlisppath=${srcdir}/../lisp
47
48 # How to run Emacs.
49 RUN_EMACS = EMACSLOADPATH=$(buildlisppath) LC_ALL=C \
50 ${BUILT_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: ${BUILT_EMACS} ${SUBDIRS} leim-list.el compile-main
97
98 # To ensure that we can run Emacs. This target is ignored (never
99 # being hit) if a user changes default value of BUILT_EMACS.
100 ../src/emacs:
101 cd ../src; ${MAKE} ${MFLAGS} emacs
102
103 ${SUBDIRS}:
104 mkdir $@
105 touch stamp-subdir
106
107 TIT_SOURCES= \
108 ${srcdir}/CXTERM-DIC/4Corner.tit \
109 ${srcdir}/CXTERM-DIC/ARRAY30.tit \
110 ${srcdir}/CXTERM-DIC/CCDOSPY.tit \
111 ${srcdir}/CXTERM-DIC/ECDICT.tit \
112 ${srcdir}/CXTERM-DIC/ETZY.tit \
113 ${srcdir}/CXTERM-DIC/PY-b5.tit \
114 ${srcdir}/CXTERM-DIC/Punct-b5.tit \
115 ${srcdir}/CXTERM-DIC/Punct.tit \
116 ${srcdir}/CXTERM-DIC/QJ-b5.tit \
117 ${srcdir}/CXTERM-DIC/QJ.tit \
118 ${srcdir}/CXTERM-DIC/SW.tit \
119 ${srcdir}/CXTERM-DIC/TONEPY.tit \
120 ${srcdir}/CXTERM-DIC/ZOZY.tit
121
122 ${CHINESE_TIT}: changed.tit
123 @true
124
125 ## FIXME remove subdirs if poss - time-stamping.
126 ## Emacs should make the directory if it does not exist.
127 changed.tit: ${SUBDIRS} ${TIT_SOURCES}
128 ${RUN_EMACS} -l ${buildlisppath}/international/titdic-cnv \
129 -f batch-titdic-convert -dir quail ${srcdir}/CXTERM-DIC; \
130 echo "changed" > $@
131
132 MISC_SOURCES= \
133 ${srcdir}/MISC-DIC/CTLau-b5.html \
134 ${srcdir}/MISC-DIC/CTLau.html \
135 ${srcdir}/MISC-DIC/cangjie-table.b5 \
136 ${srcdir}/MISC-DIC/cangjie-table.cns \
137 ${srcdir}/MISC-DIC/pinyin.map \
138 ${srcdir}/MISC-DIC/ziranma.cin
139
140 ${MISC}: changed.misc
141 @true
142
143 changed.misc: ${SUBDIRS} ${MISC_SOURCES}
144 ${RUN_EMACS} -l ${buildlisppath}/international/titdic-cnv \
145 -f batch-miscdic-convert -dir quail ${srcdir}/MISC-DIC; \
146 echo "changed" > $@
147
148 leim-list.el: ${SUBDIRS} ${TIT_MISC} ${srcdir}/leim-ext.el
149 rm -f leim-list.el
150 if [ x`(cd ${srcdir} && /bin/pwd)` = x`(/bin/pwd)` ] ; then \
151 ${RUN_EMACS} -l ${buildlisppath}/international/quail \
152 --eval "(update-leim-list-file \".\")" ; \
153 else \
154 ${RUN_EMACS} -l ${buildlisppath}/international/quail \
155 --eval "(update-leim-list-file \".\" \"${srcdir}\")" ; \
156 fi
157 sed -n '/^[^;]/ p' < ${srcdir}/leim-ext.el >> $@
158
159 ## Following adapted from lisp/Makefile.in.
160 setwins=wins="${srcdir}/ja-dic quail"; \
161 [ `cd ${srcdir} && /bin/pwd` != `/bin/pwd` ] && \
162 wins="$$wins ${srcdir}/quail"
163
164 .PHONY: compile-targets
165 # TARGETS is set dynamically in the recursive call from `compile-main'.
166 compile-targets: $(TARGETS)
167
168 # Compile all the Elisp files that need it. Beware: it approximates
169 # `no-byte-compile', so watch out for false-positives!
170 compile-main: ${TIT_MISC}
171 @($(setwins); \
172 els=`echo "$$wins " | sed -e 's| |/*.el |g'`; \
173 for el in $$els; do \
174 test -f $$el || continue; \
175 test ! -f $${el}c && GREP_OPTIONS= grep '^;.*no-byte-compile: t' $$el > /dev/null && continue; \
176 echo "$${el}c"; \
177 done | xargs echo) | \
178 while read chunk; do \
179 $(MAKE) $(MFLAGS) compile-targets BUILT_EMACS="$(BUILT_EMACS)" TARGETS="$$chunk"; \
180 done
181
182 MV_DIRS = for i in $$dir; do rm -fr `basename "$$i"` ; mv "$$i" . ; done
183
184 install: all
185 if [ ! -d ${INSTALLDIR} ] ; then \
186 umask 022; ${srcdir}/../build-aux/install-sh -d ${INSTALLDIR}; \
187 else true; fi
188 if [ x`(cd ${INSTALLDIR} && /bin/pwd)` != x`(/bin/pwd)` ] ; then \
189 rm -f ${INSTALLDIR}/leim-list.el; \
190 rm -rf ${INSTALLDIR}/quail ${INSTALLDIR}/ja-dic ; \
191 echo "Copying leim files to ${INSTALLDIR} ..." ; \
192 if [ x`(cd ${srcdir} && /bin/pwd)` = x`(/bin/pwd)` ] ; then \
193 tar -chf - leim-list.el quail ja-dic \
194 | (cd ${INSTALLDIR}; umask 0; tar -xvf - && cat > /dev/null) ;\
195 else \
196 tar -chf - leim-list.el quail \
197 | (cd ${INSTALLDIR}; umask 0; tar -xvf - && cat > /dev/null) ;\
198 cd ${srcdir}; \
199 tar -chf - quail/* ja-dic \
200 | (cd ${INSTALLDIR}; umask 0; tar -xvf - && cat > /dev/null) ;\
201 fi; \
202 rm -f ${INSTALLDIR}/.gitignore ${INSTALLDIR}/*/.gitignore; \
203 rm -f ${INSTALLDIR}/.arch-inventory ${INSTALLDIR}/*/.arch-inventory; \
204 rm -f ${INSTALLDIR}/\#* ${INSTALLDIR}/*/\#* ; \
205 rm -f ${INSTALLDIR}/.\#* ${INSTALLDIR}/*/.\#* ; \
206 rm -f ${INSTALLDIR}/*~ ${INSTALLDIR}/*/*~ ; \
207 rm -f ${INSTALLDIR}/*.orig ${INSTALLDIR}/*/*.orig ; \
208 else true; fi
209 -unset CDPATH; \
210 if [ -n "${GZIP_PROG}" ]; \
211 then \
212 echo "Compressing *.el ..." ; \
213 (cd ${INSTALLDIR}; for f in `find . -name "*.elc" -print`; do \
214 ${GZIP_PROG} -9n `echo $$f|sed 's/.elc$$/.el/'` ; \
215 done) \
216 else true; fi
217 -chmod -R a+r ${INSTALLDIR}
218 for installuser in $${LOGNAME} $${USERNAME} $${USER} \
219 `id -un 2> /dev/null`; do \
220 [ -n "$${installuser}" ] && break ; \
221 done ; \
222 find ${INSTALLDIR} -exec chown $${installuser} '{}' ';'
223 if [ "${ns_appresdir}" != "" ]; then \
224 ( cd ${ns_appresdir} ; \
225 if test -d share/emacs ; then dir=share/emacs/*/*; $(MV_DIRS); fi;\
226 rm -fr share ) ; \
227 else true ; fi
228
229 clean mostlyclean:
230 rm -f ${TIT_MISC} ${TIT_MISC:.el=.elc} \
231 leim-list.el changed.tit changed.misc
232
233 # The following target is needed because the `clean' target only removes
234 # TIT-generated files and doesn't touch compiled Quail packages. But
235 # bootstrapping should not leave non-fresh .elc files behind.
236 bootstrap-clean: clean
237 $(setwins); for w in $$wins; do rm -f $$w/*.elc; done
238
239 distclean: clean
240 if test -f stamp-subdir; then rm -rf ${SUBDIRS} stamp-subdir; fi
241 rm -f Makefile
242
243 maintainer-clean: distclean bootstrap-clean
244
245 extraclean: maintainer-clean
246 -rm -f *~ \#* */*~ */\#*
247
248 .PHONY: check-declare
249
250 check-declare:
251 $(RUN_EMACS) -l $(buildlisppath)/emacs-lisp/check-declare \
252 --eval '(check-declare-directory "$(srcdir)")'