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