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.
44 BUILT_EMACS
= ..
/src
/emacs
46 buildlisppath
=${srcdir}/..
/lisp
49 RUN_EMACS
= EMACSLOADPATH
=$(buildlisppath
) LC_ALL
=C \
50 ${BUILT_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: ${BUILT_EMACS} ${SUBDIRS} leim-list.el compile-main
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.
101 cd ..
/src
; ${MAKE} ${MFLAGS} emacs
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
122 ${CHINESE_TIT}: changed.tit
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
; \
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
140 ${MISC}: changed.misc
143 changed.misc
: ${SUBDIRS} ${MISC_SOURCES}
144 ${RUN_EMACS} -l
${buildlisppath}/international
/titdic-cnv \
145 -f batch-miscdic-convert
-dir quail
${srcdir}/MISC-DIC
; \
148 leim-list.el
: ${SUBDIRS} ${TIT_MISC} ${srcdir}/leim-ext.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 \".\")" ; \
154 ${RUN_EMACS} -l
${buildlisppath}/international
/quail \
155 --eval
"(update-leim-list-file \".\" \"${srcdir}\")" ; \
157 sed
-n
'/^[^;]/ p' < ${srcdir}/leim-ext.el
>> $@
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"
164 .PHONY
: compile-targets
165 # TARGETS is set dynamically in the recursive call from `compile-main'.
166 compile-targets
: $(TARGETS
)
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}
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
; \
177 done | xargs echo
) | \
178 while read chunk
; do \
179 $(MAKE
) $(MFLAGS
) compile-targets BUILT_EMACS
="$(BUILT_EMACS)" TARGETS
="$$chunk"; \
182 MV_DIRS
= for i in
$$dir; do
rm -fr
`basename "$$i"` ; mv
"$$i" .
; done
185 if
[ ! -d
${INSTALLDIR} ] ; then \
186 umask
022; ${srcdir}/..
/build-aux
/install-sh
-d
${INSTALLDIR}; \
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
) ;\
196 tar -chf
- leim-list.el quail \
197 |
(cd
${INSTALLDIR}; umask
0; tar -xvf
- && cat
> /dev
/null
) ;\
199 tar -chf
- quail
/* ja-dic \
200 |
(cd
${INSTALLDIR}; umask
0; tar -xvf
- && cat
> /dev
/null
) ;\
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
; \
210 if
[ -n
"${GZIP_PROG}" ]; \
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/'` ; \
217 -chmod
-R a
+r
${INSTALLDIR}
218 for installuser in
$${LOGNAME} $${USERNAME} $${USER} \
219 `id -un 2> /dev/null`; do \
220 [ -n
"$${installuser}" ] && break
; \
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
;\
230 rm -f
${TIT_MISC} ${TIT_MISC
:.el
=.elc
} \
231 leim-list.el changed.tit changed.misc
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
240 if
test -f stamp-subdir
; then
rm -rf
${SUBDIRS} stamp-subdir
; fi
243 maintainer-clean
: distclean bootstrap-clean
245 extraclean
: maintainer-clean
246 -rm -f
*~ \
#* */*~ */\#*
248 .PHONY
: check-declare
251 $(RUN_EMACS
) -l
$(buildlisppath
)/emacs-lisp
/check-declare \
252 --eval
'(check-declare-directory "$(srcdir)")'