1 # Makefile for leim subdirectory in GNU Emacs.
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
9 # This file is part of GNU Emacs.
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.
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.
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/>.
25 # Avoid trouble on systems where the `SHELL' variable might be
26 # inherited from the environment.
29 # Here are the things that we expect ../configure to edit.
32 datarootdir
=@datarootdir@
35 ns_appresdir
=@ns_appresdir@
37 # Where to install LEIM files.
38 INSTALLDIR
=$(DESTDIR
)${datadir}/emacs
/${version}/leim
40 GZIP_PROG
= @GZIP_PROG@
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.
46 buildlisppath
=${srcdir}/..
/lisp
49 RUN_EMACS
= EMACSLOADPATH
=$(buildlisppath
) LC_ALL
=C \
50 ${EMACS} -batch
--no-site-file
--no-site-lisp
52 # Subdirectories to be made if ${srcdir} is different from the current
56 # Files generated from TIT dictionaries for Chinese GB character set.
64 # Files generated from TIT dictionaries for Chinese BIG5 character set.
75 CHINESE_TIT
=${TIT_GB} ${TIT_BIG5}
87 ## The generated .el files.
88 TIT_MISC
=${CHINESE_TIT} ${MISC}
94 @
${RUN_EMACS} -l
${buildlisppath}/international
/quail
-f batch-byte-compile
$<
96 all: ${SUBDIRS} leim-list.el compile-main
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
117 ${CHINESE_TIT}: changed.tit
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
; \
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
135 ${MISC}: changed.misc
138 changed.misc
: ${SUBDIRS} ${MISC_SOURCES}
139 ${RUN_EMACS} -l
${buildlisppath}/international
/titdic-cnv \
140 -f batch-miscdic-convert
-dir quail
${srcdir}/MISC-DIC
; \
143 leim-list.el
: ${SUBDIRS} ${TIT_MISC} ${srcdir}/leim-ext.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 \".\")" ; \
149 ${RUN_EMACS} -l
${buildlisppath}/international
/quail \
150 --eval
"(update-leim-list-file \".\" \"${srcdir}\")" ; \
152 sed
-n
'/^[^;]/ p' < ${srcdir}/leim-ext.el
>> $@
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"
159 .PHONY
: compile-targets
160 # TARGETS is set dynamically in the recursive call from `compile-main'.
161 compile-targets
: $(TARGETS
)
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}
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
; \
172 done | xargs echo
) | \
173 while read chunk
; do \
174 $(MAKE
) $(MFLAGS
) compile-targets EMACS
="$(EMACS)" TARGETS
="$$chunk"; \
177 MV_DIRS
= for i in
$$dir; do
rm -fr
`basename "$$i"` ; mv
"$$i" .
; done
180 if
[ ! -d
${INSTALLDIR} ] ; then \
181 umask
022; ${srcdir}/..
/build-aux
/install-sh
-d
${INSTALLDIR}; \
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
) ;\
191 tar -chf
- leim-list.el quail \
192 |
(cd
${INSTALLDIR}; umask
0; tar -xvf
- && cat
> /dev
/null
) ;\
194 tar -chf
- quail
/* ja-dic \
195 |
(cd
${INSTALLDIR}; umask
0; tar -xvf
- && cat
> /dev
/null
) ;\
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
; \
205 if
[ -n
"${GZIP_PROG}" ]; \
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/'` ; \
212 -chmod
-R a
+r
${INSTALLDIR}
213 for installuser in
$${LOGNAME} $${USERNAME} $${USER} \
214 `id -un 2> /dev/null`; do \
215 [ -n
"$${installuser}" ] && break
; \
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
;\
225 rm -f
${TIT_MISC} ${TIT_MISC
:.el
=.elc
} \
226 leim-list.el changed.tit changed.misc
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
235 if
test -f stamp-subdir
; then
rm -rf
${SUBDIRS} stamp-subdir
; fi
238 maintainer-clean
: distclean bootstrap-clean
240 extraclean
: maintainer-clean
241 -rm -f
*~ \
#* */*~ */\#*
243 .PHONY
: check-declare
246 $(RUN_EMACS
) -l
$(buildlisppath
)/emacs-lisp
/check-declare \
247 --eval
'(check-declare-directory "$(srcdir)")'