]> code.delx.au - gnu-emacs/blob - leim/Makefile.in
Don't use build-aux/install-sh -d directly
[gnu-emacs] / 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 version=@version@
31 prefix=@prefix@
32 datarootdir=@datarootdir@
33 datadir=@datadir@
34 srcdir=@srcdir@
35 ns_appresdir=@ns_appresdir@
36
37 install_prefix=$(DESTDIR)${datadir}/emacs/${version}
38
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@
43
44 MKDIR_P = @MKDIR_P@
45
46 GZIP_PROG = @GZIP_PROG@
47
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.
50 EMACS = ../src/emacs
51
52 buildlisppath=${srcdir}/../lisp
53
54 # How to run Emacs.
55 RUN_EMACS = EMACSLOADPATH=$(buildlisppath) LC_ALL=C \
56 ${EMACS} -batch --no-site-file --no-site-lisp
57
58 # Subdirectories to be made if ${srcdir} is different from the current
59 # directory.
60 SUBDIRS=quail
61
62 # Files generated from TIT dictionaries for Chinese GB character set.
63 TIT_GB=\
64 quail/CCDOSPY.el \
65 quail/Punct.el \
66 quail/QJ.el \
67 quail/SW.el \
68 quail/TONEPY.el
69
70 # Files generated from TIT dictionaries for Chinese BIG5 character set.
71 TIT_BIG5=\
72 quail/4Corner.el \
73 quail/ARRAY30.el \
74 quail/ECDICT.el \
75 quail/ETZY.el \
76 quail/Punct-b5.el \
77 quail/PY-b5.el \
78 quail/QJ-b5.el \
79 quail/ZOZY.el
80
81 CHINESE_TIT=${TIT_GB} ${TIT_BIG5}
82
83 MISC= \
84 quail/tsang-b5.el \
85 quail/quick-b5.el \
86 quail/tsang-cns.el \
87 quail/quick-cns.el \
88 quail/PY.el \
89 quail/ZIRANMA.el \
90 quail/CTLau.el \
91 quail/CTLau-b5.el
92
93 ## The generated .el files.
94 TIT_MISC=${CHINESE_TIT} ${MISC}
95
96 .SUFFIXES: .elc .el
97
98 .el.elc:
99 @echo Compiling $<
100 @${RUN_EMACS} -l ${buildlisppath}/international/quail -f batch-byte-compile $<
101
102 all: ${SUBDIRS} leim-list.el compile-main
103
104 ${SUBDIRS}:
105 mkdir $@
106 touch stamp-subdir
107
108 TIT_SOURCES= \
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
122
123 ${CHINESE_TIT}: changed.tit
124 @true
125
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; \
131 echo "changed" > $@
132
133 MISC_SOURCES= \
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
140
141 ${MISC}: changed.misc
142 @true
143
144 changed.misc: ${SUBDIRS} ${MISC_SOURCES}
145 ${RUN_EMACS} -l ${buildlisppath}/international/titdic-cnv \
146 -f batch-miscdic-convert -dir quail ${srcdir}/MISC-DIC; \
147 echo "changed" > $@
148
149 leim-list.el: ${SUBDIRS} ${TIT_MISC} ${srcdir}/leim-ext.el
150 rm -f leim-list.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 \".\")" ; \
154 else \
155 ${RUN_EMACS} -l ${buildlisppath}/international/quail \
156 --eval "(update-leim-list-file \".\" \"${srcdir}\")" ; \
157 fi
158 sed -n '/^[^;]/ p' < ${srcdir}/leim-ext.el >> $@
159
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"
164
165 .PHONY: compile-targets
166 # TARGETS is set dynamically in the recursive call from `compile-main'.
167 compile-targets: $(TARGETS)
168
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}
172 @($(setwins); \
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; \
177 echo "$${el}c"; \
178 done | xargs echo) | \
179 while read chunk; do \
180 $(MAKE) $(MFLAGS) compile-targets EMACS="$(EMACS)" TARGETS="$$chunk"; \
181 done
182
183 install: all
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) ;\
192 else \
193 tar -chf - leim-list.el quail \
194 | (cd ${LEIM_INSTALLDIR}; umask 0; tar -xvf - && cat > /dev/null) ;\
195 cd ${srcdir}; \
196 tar -chf - quail/* ja-dic \
197 | (cd ${LEIM_INSTALLDIR}; umask 0; tar -xvf - && cat > /dev/null) ;\
198 fi; \
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 ; \
205 else true; fi
206 -unset CDPATH; \
207 if [ -n "${GZIP_PROG}" ]; \
208 then \
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/'` ; \
212 done) \
213 else true; fi
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 ; \
218 done ; \
219 find ${LEIM_INSTALLDIR} -exec chown $${installuser} '{}' ';'
220
221 clean mostlyclean:
222 rm -f ${TIT_MISC} ${TIT_MISC:.el=.elc} \
223 leim-list.el changed.tit changed.misc
224
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
230
231 distclean: clean
232 if test -f stamp-subdir; then rm -rf ${SUBDIRS} stamp-subdir; fi
233 rm -f Makefile
234
235 maintainer-clean: distclean bootstrap-clean
236
237 extraclean: maintainer-clean
238 -rm -f *~ \#* */*~ */\#*
239
240 .PHONY: check-declare
241
242 check-declare:
243 $(RUN_EMACS) -l $(buildlisppath)/emacs-lisp/check-declare \
244 --eval '(check-declare-directory "$(srcdir)")'