Avoid EMACSDATA in user environment interfering with building
[bpt/emacs.git] / leim / Makefile.in
... / ...
CommitLineData
1### @configure_input@
2
3# Copyright (C) 1997-2014 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
24SHELL = @SHELL@
25
26# Here are the things that we expect ../configure to edit.
27srcdir=@srcdir@
28
29# Where the generated files go.
30leimdir = ${srcdir}/../lisp/leim
31
32# Prevent any settings in the user environment causing problems.
33unexport EMACSDATA EMACSDOC EMACSPATH
34
35# Which Emacs to use to convert TIT files to Emacs Lisp files,
36# and generate the file leim-list.el.
37EMACS = ../src/emacs
38
39# How to run Emacs.
40# Prevent any setting of EMACSLOADPATH in user environment causing problems.
41RUN_EMACS = EMACSLOADPATH= '$(EMACS)' -batch --no-site-file --no-site-lisp
42
43MKDIR_P = @MKDIR_P@
44
45# Files generated from TIT dictionaries for Chinese GB character set.
46TIT_GB=\
47 ${leimdir}/quail/CCDOSPY.el \
48 ${leimdir}/quail/Punct.el \
49 ${leimdir}/quail/QJ.el \
50 ${leimdir}/quail/SW.el \
51 ${leimdir}/quail/TONEPY.el
52
53# Files generated from TIT dictionaries for Chinese BIG5 character set.
54TIT_BIG5=\
55 ${leimdir}/quail/4Corner.el \
56 ${leimdir}/quail/ARRAY30.el \
57 ${leimdir}/quail/ECDICT.el \
58 ${leimdir}/quail/ETZY.el \
59 ${leimdir}/quail/Punct-b5.el \
60 ${leimdir}/quail/PY-b5.el \
61 ${leimdir}/quail/QJ-b5.el \
62 ${leimdir}/quail/ZOZY.el
63
64CHINESE_TIT=${TIT_GB} ${TIT_BIG5}
65
66MISC= \
67 ${leimdir}/quail/tsang-b5.el \
68 ${leimdir}/quail/quick-b5.el \
69 ${leimdir}/quail/tsang-cns.el \
70 ${leimdir}/quail/quick-cns.el \
71 ${leimdir}/quail/PY.el \
72 ${leimdir}/quail/ZIRANMA.el \
73 ${leimdir}/quail/CTLau.el \
74 ${leimdir}/quail/CTLau-b5.el
75
76## The generated .el files.
77TIT_MISC=${CHINESE_TIT} ${MISC}
78
79all: ${leimdir}/leim-list.el ${leimdir}/ja-dic/ja-dic.el
80.PHONY: all
81
82TIT_SOURCES= \
83 ${srcdir}/CXTERM-DIC/4Corner.tit \
84 ${srcdir}/CXTERM-DIC/ARRAY30.tit \
85 ${srcdir}/CXTERM-DIC/CCDOSPY.tit \
86 ${srcdir}/CXTERM-DIC/ECDICT.tit \
87 ${srcdir}/CXTERM-DIC/ETZY.tit \
88 ${srcdir}/CXTERM-DIC/PY-b5.tit \
89 ${srcdir}/CXTERM-DIC/Punct-b5.tit \
90 ${srcdir}/CXTERM-DIC/Punct.tit \
91 ${srcdir}/CXTERM-DIC/QJ-b5.tit \
92 ${srcdir}/CXTERM-DIC/QJ.tit \
93 ${srcdir}/CXTERM-DIC/SW.tit \
94 ${srcdir}/CXTERM-DIC/TONEPY.tit \
95 ${srcdir}/CXTERM-DIC/ZOZY.tit
96
97${CHINESE_TIT}: changed.tit
98 @true
99
100## The changed.* files act to serialize this part of the build.
101## A single Emacs invocation creates all the CHINESE_TIT files.
102## Otherwise in a parallel build multiple Emacs instances could
103## interfere with each other. If we used GNU make we could probably
104## parallelize this without the need for an explicit rule for each
105## file. Something like the pattern rule:
106## quail/%.el: CXTERM-DIC/%.tit
107## It doesn't seem possible to do this with VPATH and suffix rules.
108changed.tit: ${TIT_SOURCES}
109 @${MKDIR_P} ${leimdir}/quail
110 ${RUN_EMACS} -l titdic-cnv \
111 -f batch-titdic-convert -dir ${leimdir}/quail ${srcdir}/CXTERM-DIC
112 echo "changed" > $@
113
114MISC_SOURCES= \
115 ${srcdir}/MISC-DIC/CTLau-b5.html \
116 ${srcdir}/MISC-DIC/CTLau.html \
117 ${srcdir}/MISC-DIC/cangjie-table.b5 \
118 ${srcdir}/MISC-DIC/cangjie-table.cns \
119 ${srcdir}/MISC-DIC/pinyin.map \
120 ${srcdir}/MISC-DIC/ziranma.cin
121
122${MISC}: changed.misc
123 @true
124
125changed.misc: ${MISC_SOURCES}
126 @${MKDIR_P} ${leimdir}/quail
127 ${RUN_EMACS} -l titdic-cnv \
128 -f batch-miscdic-convert -dir ${leimdir}/quail ${srcdir}/MISC-DIC
129 echo "changed" > $@
130
131.PHONY: leim-list.el
132leim-list.el: ${leimdir}/leim-list.el
133
134${leimdir}/leim-list.el: ${TIT_MISC} ${srcdir}/leim-ext.el
135 rm -f $@
136 ${RUN_EMACS} -l international/quail \
137 --eval "(update-leim-list-file (unmsys--file-name \"${leimdir}\"))"
138 sed -n -e '/^[^;]/p' -e 's/^;\(;*\)inc /;\1 /p' < ${srcdir}/leim-ext.el >> $@
139
140${leimdir}/ja-dic/ja-dic.el: $(srcdir)/SKK-DIC/SKK-JISYO.L
141 @$(MKDIR_P) $(leimdir)/ja-dic
142 $(RUN_EMACS) -batch -l ja-dic-cnv \
143 -f batch-skkdic-convert -dir "$(leimdir)/ja-dic" \
144 "$(srcdir)/SKK-DIC/SKK-JISYO.L"
145
146.PHONY: bootstrap-clean distclean maintainer-clean extraclean
147
148bootstrap-clean:
149 rm -f ${TIT_MISC} ${leimdir}/leim-list.el changed.tit changed.misc
150
151distclean:
152 rm -f Makefile
153
154maintainer-clean: distclean bootstrap-clean
155
156## We do not delete ja-dic, even in a bootstrap, because it rarely
157## changes and is slow to regenerate.
158## TODO? Could consider doing the same with TIT_MISC, though those
159## are much faster to generate.
160extraclean:
161 rm -rf ${leimdir}/ja-dic
162
163### Makefile.in ends here