Merge from emacs-24 branch; up to 2012-05-01T18:47:23Z!rgm@gnu.org
[bpt/emacs.git] / 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 srcdir=@srcdir@
31
32 # Which Emacs to use to convert TIT files to Emacs Lisp files,
33 # byte-compile Emacs Lisp files, and generate the file leim-list.el.
34 EMACS = ../src/emacs
35
36 buildlisppath=${srcdir}/../lisp
37
38 # How to run Emacs.
39 RUN_EMACS = EMACSLOADPATH=$(buildlisppath) LC_ALL=C \
40 ${EMACS} -batch --no-site-file --no-site-lisp
41
42 MKDIR_P = @MKDIR_P@
43
44 # Files generated from TIT dictionaries for Chinese GB character set.
45 TIT_GB=\
46 quail/CCDOSPY.el \
47 quail/Punct.el \
48 quail/QJ.el \
49 quail/SW.el \
50 quail/TONEPY.el
51
52 # Files generated from TIT dictionaries for Chinese BIG5 character set.
53 TIT_BIG5=\
54 quail/4Corner.el \
55 quail/ARRAY30.el \
56 quail/ECDICT.el \
57 quail/ETZY.el \
58 quail/Punct-b5.el \
59 quail/PY-b5.el \
60 quail/QJ-b5.el \
61 quail/ZOZY.el
62
63 CHINESE_TIT=${TIT_GB} ${TIT_BIG5}
64
65 MISC= \
66 quail/tsang-b5.el \
67 quail/quick-b5.el \
68 quail/tsang-cns.el \
69 quail/quick-cns.el \
70 quail/PY.el \
71 quail/ZIRANMA.el \
72 quail/CTLau.el \
73 quail/CTLau-b5.el
74
75 ## The generated .el files.
76 TIT_MISC=${CHINESE_TIT} ${MISC}
77
78 .SUFFIXES: .elc .el
79
80 .el.elc:
81 @echo Compiling $<
82 @${RUN_EMACS} -l ${buildlisppath}/international/quail -f batch-byte-compile $<
83
84 all: leim-list.el compile-main
85
86 TIT_SOURCES= \
87 ${srcdir}/CXTERM-DIC/4Corner.tit \
88 ${srcdir}/CXTERM-DIC/ARRAY30.tit \
89 ${srcdir}/CXTERM-DIC/CCDOSPY.tit \
90 ${srcdir}/CXTERM-DIC/ECDICT.tit \
91 ${srcdir}/CXTERM-DIC/ETZY.tit \
92 ${srcdir}/CXTERM-DIC/PY-b5.tit \
93 ${srcdir}/CXTERM-DIC/Punct-b5.tit \
94 ${srcdir}/CXTERM-DIC/Punct.tit \
95 ${srcdir}/CXTERM-DIC/QJ-b5.tit \
96 ${srcdir}/CXTERM-DIC/QJ.tit \
97 ${srcdir}/CXTERM-DIC/SW.tit \
98 ${srcdir}/CXTERM-DIC/TONEPY.tit \
99 ${srcdir}/CXTERM-DIC/ZOZY.tit
100
101 ${CHINESE_TIT}: changed.tit
102 @true
103
104 ## The changed.* files act to serialize this part of the build.
105 ## A single Emacs invocation creates all the CHINESE_TIT files.
106 ## Otherwise in a parallel build multiple Emacs instances could
107 ## interfere with each other. If we used GNU make we could probably
108 ## parallelize this without the need for an explicit rule for each
109 ## file. Something like the pattern rule:
110 ## quail/%.el: CXTERM-DIC/%.tit
111 ## It doesn't seem possible to do this with VPATH and suffix rules.
112 changed.tit: ${TIT_SOURCES}
113 @${MKDIR_P} quail
114 ${RUN_EMACS} -l ${buildlisppath}/international/titdic-cnv \
115 -f batch-titdic-convert -dir quail ${srcdir}/CXTERM-DIC; \
116 echo "changed" > $@
117
118 MISC_SOURCES= \
119 ${srcdir}/MISC-DIC/CTLau-b5.html \
120 ${srcdir}/MISC-DIC/CTLau.html \
121 ${srcdir}/MISC-DIC/cangjie-table.b5 \
122 ${srcdir}/MISC-DIC/cangjie-table.cns \
123 ${srcdir}/MISC-DIC/pinyin.map \
124 ${srcdir}/MISC-DIC/ziranma.cin
125
126 ${MISC}: changed.misc
127 @true
128
129 changed.misc: ${MISC_SOURCES}
130 @${MKDIR_P} quail
131 ${RUN_EMACS} -l ${buildlisppath}/international/titdic-cnv \
132 -f batch-miscdic-convert -dir quail ${srcdir}/MISC-DIC; \
133 echo "changed" > $@
134
135 leim-list.el: ${TIT_MISC} ${srcdir}/leim-ext.el
136 rm -f leim-list.el
137 if [ x`cd ${srcdir} && /bin/pwd` = x`/bin/pwd` ] ; then \
138 ${RUN_EMACS} -l ${buildlisppath}/international/quail \
139 --eval "(update-leim-list-file \".\")" ; \
140 else \
141 ${RUN_EMACS} -l ${buildlisppath}/international/quail \
142 --eval "(update-leim-list-file \".\" \"${srcdir}\")" ; \
143 fi
144 sed -n '/^[^;]/ p' < ${srcdir}/leim-ext.el >> $@
145
146 ## Following adapted from lisp/Makefile.in.
147 setwins=wins="${srcdir}/ja-dic quail"; \
148 [ `cd ${srcdir} && /bin/pwd` != `/bin/pwd` ] && \
149 wins="$$wins ${srcdir}/quail"
150
151 .PHONY: compile-targets
152 # TARGETS is set dynamically in the recursive call from `compile-main'.
153 compile-targets: $(TARGETS)
154
155 # Compile all the Elisp files that need it. Beware: it approximates
156 # `no-byte-compile', so watch out for false-positives!
157 compile-main: ${TIT_MISC}
158 @($(setwins); \
159 els=`echo "$$wins " | sed -e 's| |/*.el |g'`; \
160 for el in $$els; do \
161 test -f $$el || continue; \
162 test ! -f $${el}c && GREP_OPTIONS= grep '^;.*no-byte-compile: t' $$el > /dev/null && continue; \
163 echo "$${el}c"; \
164 done | xargs echo) | \
165 while read chunk; do \
166 $(MAKE) $(MFLAGS) compile-targets EMACS="$(EMACS)" TARGETS="$$chunk"; \
167 done
168
169 clean mostlyclean:
170 rm -f ${TIT_MISC} ${TIT_MISC:.el=.elc} \
171 leim-list.el changed.tit changed.misc
172
173 # The following target is needed because the `clean' target only removes
174 # TIT-generated files and doesn't touch compiled Quail packages. But
175 # bootstrapping should not leave non-fresh .elc files behind.
176 bootstrap-clean: clean
177 $(setwins); for w in $$wins; do rm -f $$w/*.elc; done
178
179 distclean: clean
180 -[ `cd ${srcdir} && /bin/pwd` != `/bin/pwd` ] && rm -rf quail
181 rm -f Makefile
182
183 maintainer-clean: distclean bootstrap-clean
184
185 extraclean: maintainer-clean
186 -rm -f *~ \#* */*~ */\#*
187
188 .PHONY: check-declare
189
190 check-declare:
191 $(RUN_EMACS) -l $(buildlisppath)/emacs-lisp/check-declare \
192 --eval '(check-declare-directory "$(srcdir)")'