aboutsummaryrefslogtreecommitdiffstats
path: root/admin
diff options
context:
space:
mode:
authorGlenn Morris2013-10-30 00:15:23 -0700
committerGlenn Morris2013-10-30 00:15:23 -0700
commit9835cedbfa3901f9d5ed1c14a2e0846643462bd2 (patch)
treeaa0039e0247e7c22f3ee633e64acc6fa0f0e33a8 /admin
parent55498a0fe4713d9d6e6737bd4bd293ac4d8c4236 (diff)
downloademacs-9835cedbfa3901f9d5ed1c14a2e0846643462bd2.tar.gz
emacs-9835cedbfa3901f9d5ed1c14a2e0846643462bd2.zip
Simplify admin/unidata Makefile rules
* admin/unidata/unidata-gen.el (unidata-gen-files): Use pop. Also take the output directory as an argument. * admin/unidata/Makefile.in: Simplify now that unidata-gen-files takes the output directory as an argument (no need to cd, etc). (abs_srcdir, abs_builddir): Remove. (abs_top_builddir): Replace by top_builddir. (${DSTDIR}/charprop.el): No need to cd. Pass dest as argument. (${DSTDIR}/charprop.el, charprop.el): No need to pass unidata.txt as argument.
Diffstat (limited to 'admin')
-rw-r--r--admin/ChangeLog10
-rw-r--r--admin/unidata/Makefile.in14
-rw-r--r--admin/unidata/unidata-gen.el29
3 files changed, 34 insertions, 19 deletions
diff --git a/admin/ChangeLog b/admin/ChangeLog
index baa8706fd32..680792c12b7 100644
--- a/admin/ChangeLog
+++ b/admin/ChangeLog
@@ -1,5 +1,15 @@
12013-10-30 Glenn Morris <rgm@gnu.org> 12013-10-30 Glenn Morris <rgm@gnu.org>
2 2
3 * unidata/unidata-gen.el (unidata-gen-files): Use pop.
4 Also take the output directory as an argument.
5 * unidata/Makefile.in: Simplify now that unidata-gen-files takes
6 the output directory as an argument (no need to cd, etc).
7 (abs_srcdir, abs_builddir): Remove.
8 (abs_top_builddir): Replace by top_builddir.
9 (${DSTDIR}/charprop.el): No need to cd. Pass dest as argument.
10 (${DSTDIR}/charprop.el, charprop.el):
11 No need to pass unidata.txt as argument.
12
3 * unidata/unidata-gen.el (unidata--ensure-compiled): New function. 13 * unidata/unidata-gen.el (unidata--ensure-compiled): New function.
4 (unidata-gen-table-name, unidata-gen-table-decomposition) 14 (unidata-gen-table-name, unidata-gen-table-decomposition)
5 (unidata-gen-files): Use unidata--ensure-compiled. 15 (unidata-gen-files): Use unidata--ensure-compiled.
diff --git a/admin/unidata/Makefile.in b/admin/unidata/Makefile.in
index e4a8a87443b..dc939cacd1e 100644
--- a/admin/unidata/Makefile.in
+++ b/admin/unidata/Makefile.in
@@ -24,12 +24,10 @@
24SHELL = @SHELL@ 24SHELL = @SHELL@
25 25
26srcdir = @srcdir@ 26srcdir = @srcdir@
27abs_srcdir = @abs_srcdir@
28abs_builddir = @abs_builddir@
29top_srcdir = @top_srcdir@ 27top_srcdir = @top_srcdir@
30abs_top_builddir = @abs_top_builddir@ 28top_builddir = @top_builddir@
31 29
32EMACS = ${abs_top_builddir}/src/emacs 30EMACS = ${top_builddir}/src/emacs
33DSTDIR = ${top_srcdir}/lisp/international 31DSTDIR = ${top_srcdir}/lisp/international
34emacs = "${EMACS}" -batch --no-site-file --no-site-lisp 32emacs = "${EMACS}" -batch --no-site-file --no-site-lisp
35 33
@@ -42,13 +40,13 @@ unidata.txt: ${srcdir}/UnicodeData.txt
42 sed -e 's/\([^;]*\);\(.*\)/(#x\1 "\2")/' -e 's/;/" "/g' < ${srcdir}/UnicodeData.txt > $@ 40 sed -e 's/\([^;]*\);\(.*\)/(#x\1 "\2")/' -e 's/;/" "/g' < ${srcdir}/UnicodeData.txt > $@
43 41
44${DSTDIR}/charprop.el: ${srcdir}/unidata-gen.elc unidata.txt 42${DSTDIR}/charprop.el: ${srcdir}/unidata-gen.elc unidata.txt
45 cd ${DSTDIR} && ${emacs} -l ${abs_srcdir}/unidata-gen \ 43 ${emacs} -L ${srcdir} -l unidata-gen -f unidata-gen-files \
46 -f unidata-gen-files ${abs_srcdir} "${abs_builddir}/unidata.txt" 44 ${srcdir} "${DSTDIR}"
47 45
48## Like the above, but generate in PWD rather than lisp/international. 46## Like the above, but generate in PWD rather than lisp/international.
49charprop.el: ${srcdir}/unidata-gen.elc unidata.txt 47charprop.el: ${srcdir}/unidata-gen.elc unidata.txt
50 ${emacs} -L ${srcdir} -l unidata-gen \ 48 ${emacs} -L ${srcdir} -l unidata-gen -f unidata-gen-files \
51 -f unidata-gen-files ${srcdir} "${abs_builddir}/unidata.txt" 49 ${srcdir}
52 50
53install: charprop.el 51install: charprop.el
54 cp charprop.el ${DSTDIR} 52 cp charprop.el ${DSTDIR}
diff --git a/admin/unidata/unidata-gen.el b/admin/unidata/unidata-gen.el
index 05dde225d91..a45358dac6f 100644
--- a/admin/unidata/unidata-gen.el
+++ b/admin/unidata/unidata-gen.el
@@ -31,7 +31,7 @@
31;; FILES TO BE GENERATED 31;; FILES TO BE GENERATED
32;; 32;;
33;; The entry function `unidata-gen-files' generates these files in 33;; The entry function `unidata-gen-files' generates these files in
34;; the current directory. 34;; in directory specified by its dest-dir argument.
35;; 35;;
36;; charprop.el 36;; charprop.el
37;; It contains a series of forms of this format: 37;; It contains a series of forms of this format:
@@ -90,9 +90,9 @@
90 90
91(defvar unidata-list nil) 91(defvar unidata-list nil)
92 92
93;; Name of the directory containing files of Unicode Character 93;; Name of the directory containing files of Unicode Character Database.
94;; Database.
95 94
95;; Dynamically bound in unidata-gen-files.
96(defvar unidata-dir nil) 96(defvar unidata-dir nil)
97 97
98(defun unidata-setup-list (unidata-text-file) 98(defun unidata-setup-list (unidata-text-file)
@@ -1182,12 +1182,17 @@ is the character itself.")))
1182;; The entry function. It generates files described in the header 1182;; The entry function. It generates files described in the header
1183;; comment of this file. 1183;; comment of this file.
1184 1184
1185(defun unidata-gen-files (&optional data-dir unidata-text-file) 1185;; Write files (charprop.el, uni-*.el) to dest-dir (default PWD),
1186;; using as input files from data-dir, and
1187;; unidata-text-file (default "unidata.txt" in PWD).
1188(defun unidata-gen-files (&optional data-dir dest-dir unidata-text-file)
1186 (or data-dir 1189 (or data-dir
1187 (setq data-dir (pop command-line-args-left) 1190 (setq data-dir (pop command-line-args-left)
1188 unidata-text-file (pop command-line-args-left))) 1191 dest-dir (or (pop command-line-args-left) default-directory)
1192 unidata-text-file (or (pop command-line-args-left)
1193 (expand-file-name "unidata.txt"))))
1189 (let ((coding-system-for-write 'utf-8-unix) 1194 (let ((coding-system-for-write 'utf-8-unix)
1190 (charprop-file "charprop.el") 1195 (charprop-file (expand-file-name "charprop.el" dest-dir))
1191 (unidata-dir data-dir)) 1196 (unidata-dir data-dir))
1192 (dolist (elt unidata-prop-alist) 1197 (dolist (elt unidata-prop-alist)
1193 (let* ((prop (car elt)) 1198 (let* ((prop (car elt))
@@ -1200,7 +1205,8 @@ is the character itself.")))
1200 (dolist (elt unidata-prop-alist) 1205 (dolist (elt unidata-prop-alist)
1201 (let* ((prop (car elt)) 1206 (let* ((prop (car elt))
1202 (generator (unidata-prop-generator prop)) 1207 (generator (unidata-prop-generator prop))
1203 (file (unidata-prop-file prop)) 1208 (file (expand-file-name (unidata-prop-file prop) dest-dir))
1209 (basename (file-name-nondirectory file))
1204 (docstring (unidata-prop-docstring prop)) 1210 (docstring (unidata-prop-docstring prop))
1205 (describer (unidata-prop-describer prop)) 1211 (describer (unidata-prop-describer prop))
1206 (default-value (unidata-prop-default prop)) 1212 (default-value (unidata-prop-default prop))
@@ -1208,9 +1214,9 @@ is the character itself.")))
1208 table) 1214 table)
1209 ;; Filename in this comment line is extracted by sed in 1215 ;; Filename in this comment line is extracted by sed in
1210 ;; Makefile. 1216 ;; Makefile.
1211 (insert (format ";; FILE: %s\n" file)) 1217 (insert (format ";; FILE: %s\n" basename))
1212 (insert (format "(define-char-code-property '%S %S\n %S)\n" 1218 (insert (format "(define-char-code-property '%S %S\n %S)\n"
1213 prop file docstring)) 1219 prop basename docstring))
1214 (with-temp-buffer 1220 (with-temp-buffer
1215 (message "Generating %s..." file) 1221 (message "Generating %s..." file)
1216 (when (file-exists-p file) 1222 (when (file-exists-p file)
@@ -1235,7 +1241,7 @@ is the character itself.")))
1235 ";; coding: utf-8\n" 1241 ";; coding: utf-8\n"
1236 ";; no-byte-compile: t\n" 1242 ";; no-byte-compile: t\n"
1237 ";; End:\n\n" 1243 ";; End:\n\n"
1238 (format ";; %s ends here\n" file))) 1244 (format ";; %s ends here\n" basename)))
1239 (write-file file) 1245 (write-file file)
1240 (message "Generating %s...done" file)))) 1246 (message "Generating %s...done" file))))
1241 (message "Writing %s..." charprop-file) 1247 (message "Writing %s..." charprop-file)
@@ -1243,7 +1249,8 @@ is the character itself.")))
1243 ";; coding: utf-8\n" 1249 ";; coding: utf-8\n"
1244 ";; no-byte-compile: t\n" 1250 ";; no-byte-compile: t\n"
1245 ";; End:\n\n" 1251 ";; End:\n\n"
1246 (format ";; %s ends here\n" charprop-file))))) 1252 (format ";; %s ends here\n"
1253 (file-name-nondirectory charprop-file))))))
1247 1254
1248 1255
1249 1256