diff options
author | Glenn Morris <rgm@gnu.org> | 2014-06-09 21:44:11 -0400 |
---|---|---|
committer | Glenn Morris <rgm@gnu.org> | 2014-06-09 21:44:11 -0400 |
commit | bb175792b137dde8c4fd47a0e4660395e6e2f77f (patch) | |
tree | b32f5505b3b0bffe352834892b49becb56dae600 | |
parent | feb6546cdf5b43f8e50aaaabb29c6856a9251893 (diff) | |
download | emacs-bb175792b137dde8c4fd47a0e4660395e6e2f77f.tar.gz |
leim/Makefile.in: use GNU Make features to simplify and parallelize.
* leim/Makefile.in (CHINESE_TIT, TIT_SOURCES, MISC_SOURCES, changed.tit)
(changed.misc): Remove.
(${leimdir}/quail, ${leimdir}/ja-dic): Create using order-only prereq.
(misc_convert): New.
(${leimdir}/quail/%.el, ${leimdir}/quail/CT%.el)
(${leimdir}/quail/PY.el, ${leimdir}/quail/ZIRANMA.el)
(${leimdir}/quail/tsang-%.el, ${leimdir}/quail/quick-%.el): Use pattern rules.
(${leimdir}/leim-list.el, ${leimdir}/ja-dic/ja-dic.el):
Use automatic variables.
(bootstrap-clean): No changed.* files to delete any more.
* .bzrignore: No leim/changed.* files to ignore any more.
-rw-r--r-- | leim/ChangeLog | 15 | ||||
-rw-r--r-- | leim/Makefile.in | 100 |
2 files changed, 56 insertions, 59 deletions
diff --git a/leim/ChangeLog b/leim/ChangeLog index 6c3ec294269..ac698f63e71 100644 --- a/leim/ChangeLog +++ b/leim/ChangeLog @@ -1,3 +1,18 @@ +2014-06-10 Glenn Morris <rgm@gnu.org> + + Use GNU Make features to simplify and parallelize. + * Makefile.in (CHINESE_TIT, TIT_SOURCES, MISC_SOURCES, changed.tit) + (changed.misc): Remove. + (${leimdir}/quail, ${leimdir}/ja-dic): Create using order-only prereq. + (misc_convert): New. + (${leimdir}/quail/%.el, ${leimdir}/quail/CT%.el) + (${leimdir}/quail/PY.el, ${leimdir}/quail/ZIRANMA.el) + (${leimdir}/quail/tsang-%.el, ${leimdir}/quail/quick-%.el): + Use pattern rules. + (${leimdir}/leim-list.el, ${leimdir}/ja-dic/ja-dic.el): + Use automatic variables. + (bootstrap-clean): No changed.* files to delete any more. + 2014-04-11 Glenn Morris <rgm@gnu.org> * Makefile.in (EMACSDATA, EMACSDOC, EMACSPATH): Unexport. diff --git a/leim/Makefile.in b/leim/Makefile.in index 293b052aeb3..16f3917c61c 100644 --- a/leim/Makefile.in +++ b/leim/Makefile.in @@ -61,8 +61,6 @@ TIT_BIG5=\ ${leimdir}/quail/QJ-b5.el \ ${leimdir}/quail/ZOZY.el -CHINESE_TIT=${TIT_GB} ${TIT_BIG5} - MISC= \ ${leimdir}/quail/tsang-b5.el \ ${leimdir}/quail/quick-b5.el \ @@ -73,80 +71,66 @@ MISC= \ ${leimdir}/quail/CTLau.el \ ${leimdir}/quail/CTLau-b5.el -## The generated .el files. -TIT_MISC=${CHINESE_TIT} ${MISC} +## All the generated .el files. +TIT_MISC = ${TIT_GB} ${TIT_BIG5} ${MISC} + all: ${leimdir}/leim-list.el ${leimdir}/ja-dic/ja-dic.el .PHONY: all -TIT_SOURCES= \ - ${srcdir}/CXTERM-DIC/4Corner.tit \ - ${srcdir}/CXTERM-DIC/ARRAY30.tit \ - ${srcdir}/CXTERM-DIC/CCDOSPY.tit \ - ${srcdir}/CXTERM-DIC/ECDICT.tit \ - ${srcdir}/CXTERM-DIC/ETZY.tit \ - ${srcdir}/CXTERM-DIC/PY-b5.tit \ - ${srcdir}/CXTERM-DIC/Punct-b5.tit \ - ${srcdir}/CXTERM-DIC/Punct.tit \ - ${srcdir}/CXTERM-DIC/QJ-b5.tit \ - ${srcdir}/CXTERM-DIC/QJ.tit \ - ${srcdir}/CXTERM-DIC/SW.tit \ - ${srcdir}/CXTERM-DIC/TONEPY.tit \ - ${srcdir}/CXTERM-DIC/ZOZY.tit - -${CHINESE_TIT}: changed.tit - @true - -## The changed.* files act to serialize this part of the build. -## A single Emacs invocation creates all the CHINESE_TIT files. -## Otherwise in a parallel build multiple Emacs instances could -## interfere with each other. If we used GNU make we could probably -## parallelize this without the need for an explicit rule for each -## file. Something like the pattern rule: -## quail/%.el: CXTERM-DIC/%.tit -## It doesn't seem possible to do this with VPATH and suffix rules. -changed.tit: ${TIT_SOURCES} - @${MKDIR_P} ${leimdir}/quail - ${RUN_EMACS} -l titdic-cnv \ - -f batch-titdic-convert -dir ${leimdir}/quail ${srcdir}/CXTERM-DIC - echo "changed" > $@ - -MISC_SOURCES= \ - ${srcdir}/MISC-DIC/CTLau-b5.html \ - ${srcdir}/MISC-DIC/CTLau.html \ - ${srcdir}/MISC-DIC/cangjie-table.b5 \ - ${srcdir}/MISC-DIC/cangjie-table.cns \ - ${srcdir}/MISC-DIC/pinyin.map \ - ${srcdir}/MISC-DIC/ziranma.cin - -${MISC}: changed.misc - @true - -changed.misc: ${MISC_SOURCES} - @${MKDIR_P} ${leimdir}/quail + +## Ensure the output directory exists. +${TIT_MISC}: | ${leimdir}/quail + +${leimdir}/quail ${leimdir}/ja-dic: + ${MKDIR_P} $@ + + +## All of TIT_GB and TIT_BIG5. +${leimdir}/quail/%.el: ${srcdir}/CXTERM-DIC/%.tit ${RUN_EMACS} -l titdic-cnv \ - -f batch-miscdic-convert -dir ${leimdir}/quail ${srcdir}/MISC-DIC - echo "changed" > $@ + -f batch-titdic-convert -dir ${leimdir}/quail $< + + +misc_convert = ${RUN_EMACS} -l titdic-cnv -f batch-miscdic-convert -dir ${leimdir}/quail + +## CTLau.el, CTLau-b5.el. +${leimdir}/quail/CT%.el: ${srcdir}/MISC-DIC/CT%.html + ${misc_convert} $< + +${leimdir}/quail/PY.el: ${srcdir}/MISC-DIC/pinyin.map + ${misc_convert} $< + +${leimdir}/quail/ZIRANMA.el: ${srcdir}/MISC-DIC/ziranma.cin + ${misc_convert} $< + +## Processing cangjie-table.b5 and cangjie-table.cns generates two files +## in each case. +${leimdir}/quail/tsang-%.el ${leimdir}/quail/quick-%.el: ${srcdir}/MISC-DIC/cangjie-table.% + ${misc_convert} $< + .PHONY: leim-list.el leim-list.el: ${leimdir}/leim-list.el -${leimdir}/leim-list.el: ${TIT_MISC} ${srcdir}/leim-ext.el +${leimdir}/leim-list.el: ${srcdir}/leim-ext.el ${TIT_MISC} rm -f $@ ${RUN_EMACS} -l international/quail \ --eval "(update-leim-list-file (unmsys--file-name \"${leimdir}\"))" - sed -n -e '/^[^;]/p' -e 's/^;\(;*\)inc /;\1 /p' < ${srcdir}/leim-ext.el >> $@ + sed -n -e '/^[^;]/p' -e 's/^;\(;*\)inc /;\1 /p' < $< >> $@ + + +${leimdir}/ja-dic/ja-dic.el: | $(leimdir)/ja-dic ${leimdir}/ja-dic/ja-dic.el: $(srcdir)/SKK-DIC/SKK-JISYO.L - @$(MKDIR_P) $(leimdir)/ja-dic $(RUN_EMACS) -batch -l ja-dic-cnv \ - -f batch-skkdic-convert -dir "$(leimdir)/ja-dic" \ - "$(srcdir)/SKK-DIC/SKK-JISYO.L" + -f batch-skkdic-convert -dir "$(leimdir)/ja-dic" "$<" + .PHONY: bootstrap-clean distclean maintainer-clean extraclean bootstrap-clean: - rm -f ${TIT_MISC} ${leimdir}/leim-list.el changed.tit changed.misc + rm -f ${TIT_MISC} ${leimdir}/leim-list.el distclean: rm -f Makefile @@ -155,8 +139,6 @@ maintainer-clean: distclean bootstrap-clean ## We do not delete ja-dic, even in a bootstrap, because it rarely ## changes and is slow to regenerate. -## TODO? Could consider doing the same with TIT_MISC, though those -## are much faster to generate. extraclean: rm -rf ${leimdir}/ja-dic |