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 install_prefix
=$(DESTDIR
)${datadir}/emacs
/${version}
39 # Where to install LEIM files.
40 # For most builds, this is ${install_prefix}/leim.
41 # For self-contained ns builds, it is ${ns_appresdir}/leim.
42 LEIM_INSTALLDIR
=@LEIM_INSTALLDIR@
46 GZIP_PROG
= @GZIP_PROG@
48 # Which Emacs to use to convert TIT files to Emacs Lisp files,
49 # byte-compile Emacs Lisp files, and generate the file leim-list.el.
52 buildlisppath
=${srcdir}/..
/lisp
55 RUN_EMACS
= EMACSLOADPATH
=$(buildlisppath
) LC_ALL
=C \
56 ${EMACS} -batch
--no-site-file
--no-site-lisp
58 # Subdirectories to be made if ${srcdir} is different from the current
62 # Files generated from TIT dictionaries for Chinese GB character set.
70 # Files generated from TIT dictionaries for Chinese BIG5 character set.
81 CHINESE_TIT
=${TIT_GB} ${TIT_BIG5}
93 ## The generated .el files.
94 TIT_MISC
=${CHINESE_TIT} ${MISC}
100 @
${RUN_EMACS} -l
${buildlisppath}/international
/quail
-f batch-byte-compile
$<
102 all: ${SUBDIRS} leim-list.el compile-main
109 ${srcdir}/CXTERM-DIC
/4Corner.tit \
110 ${srcdir}/CXTERM-DIC
/ARRAY30.tit \
111 ${srcdir}/CXTERM-DIC
/CCDOSPY.tit \
112 ${srcdir}/CXTERM-DIC
/ECDICT.tit \
113 ${srcdir}/CXTERM-DIC
/ETZY.tit \
114 ${srcdir}/CXTERM-DIC
/PY-b5.tit \
115 ${srcdir}/CXTERM-DIC
/Punct-b5.tit \
116 ${srcdir}/CXTERM-DIC
/Punct.tit \
117 ${srcdir}/CXTERM-DIC
/QJ-b5.tit \
118 ${srcdir}/CXTERM-DIC
/QJ.tit \
119 ${srcdir}/CXTERM-DIC
/SW.tit \
120 ${srcdir}/CXTERM-DIC
/TONEPY.tit \
121 ${srcdir}/CXTERM-DIC
/ZOZY.tit
123 ${CHINESE_TIT}: changed.tit
126 ## FIXME remove subdirs if poss - time-stamping.
127 ## Emacs should make the directory if it does not exist.
128 changed.tit
: ${SUBDIRS} ${TIT_SOURCES}
129 ${RUN_EMACS} -l
${buildlisppath}/international
/titdic-cnv \
130 -f batch-titdic-convert
-dir quail
${srcdir}/CXTERM-DIC
; \
134 ${srcdir}/MISC-DIC
/CTLau-b5.html \
135 ${srcdir}/MISC-DIC
/CTLau.html \
136 ${srcdir}/MISC-DIC
/cangjie-table.b5 \
137 ${srcdir}/MISC-DIC
/cangjie-table.cns \
138 ${srcdir}/MISC-DIC
/pinyin.map \
139 ${srcdir}/MISC-DIC
/ziranma.cin
141 ${MISC}: changed.misc
144 changed.misc
: ${SUBDIRS} ${MISC_SOURCES}
145 ${RUN_EMACS} -l
${buildlisppath}/international
/titdic-cnv \
146 -f batch-miscdic-convert
-dir quail
${srcdir}/MISC-DIC
; \
149 leim-list.el
: ${SUBDIRS} ${TIT_MISC} ${srcdir}/leim-ext.el
151 if
[ x
`(cd ${srcdir} && /bin/pwd)` = x
`(/bin/pwd)` ] ; then \
152 ${RUN_EMACS} -l
${buildlisppath}/international
/quail \
153 --eval
"(update-leim-list-file \".\")" ; \
155 ${RUN_EMACS} -l
${buildlisppath}/international
/quail \
156 --eval
"(update-leim-list-file \".\" \"${srcdir}\")" ; \
158 sed
-n
'/^[^;]/ p' < ${srcdir}/leim-ext.el
>> $@
160 ## Following adapted from lisp/Makefile.in.
161 setwins
=wins
="${srcdir}/ja-dic quail"; \
162 [ `cd ${srcdir} && /bin/pwd` != `/bin/pwd` ] && \
163 wins
="$$wins ${srcdir}/quail"
165 .PHONY
: compile-targets
166 # TARGETS is set dynamically in the recursive call from `compile-main'.
167 compile-targets
: $(TARGETS
)
169 # Compile all the Elisp files that need it. Beware: it approximates
170 # `no-byte-compile', so watch out for false-positives!
171 compile-main
: ${TIT_MISC}
173 els
=`echo "$$wins " | sed -e 's| |/*.el |g'`; \
174 for el in
$$els; do \
175 test -f
$$el || continue
; \
176 test ! -f
$${el}c
&& GREP_OPTIONS
= grep
'^;.*no-byte-compile: t' $$el > /dev
/null
&& continue
; \
178 done | xargs echo
) | \
179 while read chunk
; do \
180 $(MAKE
) $(MFLAGS
) compile-targets EMACS
="$(EMACS)" TARGETS
="$$chunk"; \
184 umask
022; ${MKDIR_P} ${LEIM_INSTALLDIR}
185 if
[ x
`(cd ${LEIM_INSTALLDIR} && /bin/pwd)` != x
`(/bin/pwd)` ] ; then \
186 rm -f
${LEIM_INSTALLDIR}/leim-list.el
; \
187 rm -rf
${LEIM_INSTALLDIR}/quail
${LEIM_INSTALLDIR}/ja-dic
; \
188 echo
"Copying leim files to ${LEIM_INSTALLDIR} ..." ; \
189 if
[ x
`(cd ${srcdir} && /bin/pwd)` = x
`(/bin/pwd)` ] ; then \
190 tar -chf
- leim-list.el quail ja-dic \
191 |
(cd
${LEIM_INSTALLDIR}; umask
0; tar -xvf
- && cat
> /dev
/null
) ;\
193 tar -chf
- leim-list.el quail \
194 |
(cd
${LEIM_INSTALLDIR}; umask
0; tar -xvf
- && cat
> /dev
/null
) ;\
196 tar -chf
- quail
/* ja-dic \
197 |
(cd
${LEIM_INSTALLDIR}; umask
0; tar -xvf
- && cat
> /dev
/null
) ;\
199 rm -f
${LEIM_INSTALLDIR}/.gitignore
${LEIM_INSTALLDIR}/*/.gitignore
; \
200 rm -f
${LEIM_INSTALLDIR}/.arch-inventory
${LEIM_INSTALLDIR}/*/.arch-inventory
; \
201 rm -f
${LEIM_INSTALLDIR}/\
#* ${LEIM_INSTALLDIR}/*/\#* ; \
202 rm -f
${LEIM_INSTALLDIR}/.\
#* ${LEIM_INSTALLDIR}/*/.\#* ; \
203 rm -f
${LEIM_INSTALLDIR}/*~
${LEIM_INSTALLDIR}/*/*~
; \
204 rm -f
${LEIM_INSTALLDIR}/*.orig
${LEIM_INSTALLDIR}/*/*.orig
; \
207 if
[ -n
"${GZIP_PROG}" ]; \
209 echo
"Compressing *.el ..." ; \
210 (cd
${LEIM_INSTALLDIR}; for f in
`find . -name "*.elc" -print`; do \
211 ${GZIP_PROG} -9n
`echo $$f|sed 's/.elc$$/.el/'` ; \
214 -chmod
-R a
+r
${LEIM_INSTALLDIR}
215 for installuser in
$${LOGNAME} $${USERNAME} $${USER} \
216 `id -un 2> /dev/null`; do \
217 [ -n
"$${installuser}" ] && break
; \
219 find
${LEIM_INSTALLDIR} -exec chown
$${installuser} '{}' ';'
222 rm -f
${TIT_MISC} ${TIT_MISC
:.el
=.elc
} \
223 leim-list.el changed.tit changed.misc
225 # The following target is needed because the `clean' target only removes
226 # TIT-generated files and doesn't touch compiled Quail packages. But
227 # bootstrapping should not leave non-fresh .elc files behind.
228 bootstrap-clean
: clean
229 $(setwins
); for w in
$$wins; do
rm -f
$$w/*.elc
; done
232 if
test -f stamp-subdir
; then
rm -rf
${SUBDIRS} stamp-subdir
; fi
235 maintainer-clean
: distclean bootstrap-clean
237 extraclean
: maintainer-clean
238 -rm -f
*~ \
#* */*~ */\#*
240 .PHONY
: check-declare
243 $(RUN_EMACS
) -l
$(buildlisppath
)/emacs-lisp
/check-declare \
244 --eval
'(check-declare-directory "$(srcdir)")'