]> code.delx.au - gnu-emacs/commitdiff
Simplify admin/unidata Makefile rules
authorGlenn Morris <rgm@gnu.org>
Wed, 30 Oct 2013 07:15:23 +0000 (00:15 -0700)
committerGlenn Morris <rgm@gnu.org>
Wed, 30 Oct 2013 07:15:23 +0000 (00:15 -0700)
* 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.

admin/ChangeLog
admin/unidata/Makefile.in
admin/unidata/unidata-gen.el

index baa8706fd3260e09d399095fe92d0ac7648474ad..680792c12b74d3b807d9a8d1190e29e328f3079f 100644 (file)
@@ -1,5 +1,15 @@
 2013-10-30  Glenn Morris  <rgm@gnu.org>
 
+       * unidata/unidata-gen.el (unidata-gen-files): Use pop.
+       Also take the output directory as an argument.
+       * 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.
+
        * unidata/unidata-gen.el (unidata--ensure-compiled): New function.
        (unidata-gen-table-name, unidata-gen-table-decomposition)
        (unidata-gen-files): Use unidata--ensure-compiled.
index e4a8a87443b1681848be535d45aaac5573d58592..dc939cacd1e1896df7fc84d5c13ed2ef0aeed5b4 100644 (file)
 SHELL = @SHELL@
 
 srcdir = @srcdir@
-abs_srcdir = @abs_srcdir@
-abs_builddir = @abs_builddir@
 top_srcdir = @top_srcdir@
-abs_top_builddir = @abs_top_builddir@
+top_builddir = @top_builddir@
 
-EMACS = ${abs_top_builddir}/src/emacs
+EMACS = ${top_builddir}/src/emacs
 DSTDIR = ${top_srcdir}/lisp/international
 emacs = "${EMACS}" -batch --no-site-file --no-site-lisp
 
@@ -42,13 +40,13 @@ unidata.txt: ${srcdir}/UnicodeData.txt
        sed -e 's/\([^;]*\);\(.*\)/(#x\1 "\2")/' -e 's/;/" "/g' < ${srcdir}/UnicodeData.txt > $@
 
 ${DSTDIR}/charprop.el: ${srcdir}/unidata-gen.elc unidata.txt
-       cd ${DSTDIR} && ${emacs} -l ${abs_srcdir}/unidata-gen \
-         -f unidata-gen-files ${abs_srcdir} "${abs_builddir}/unidata.txt"
+       ${emacs} -L ${srcdir} -l unidata-gen -f unidata-gen-files \
+         ${srcdir} "${DSTDIR}"
 
 ## Like the above, but generate in PWD rather than lisp/international.
 charprop.el: ${srcdir}/unidata-gen.elc unidata.txt
-       ${emacs} -L ${srcdir} -l unidata-gen \
-         -f unidata-gen-files ${srcdir} "${abs_builddir}/unidata.txt"
+       ${emacs} -L ${srcdir} -l unidata-gen -f unidata-gen-files \
+         ${srcdir}
 
 install: charprop.el
        cp charprop.el ${DSTDIR}
index 05dde225d91a3a03108922733d283737855feb14..a45358dac6f1bb76d857403eac443f09478674fa 100644 (file)
@@ -31,7 +31,7 @@
 ;; FILES TO BE GENERATED
 ;;
 ;;   The entry function `unidata-gen-files' generates these files in
-;;   the current directory.
+;;   in directory specified by its dest-dir argument.
 ;;
 ;;   charprop.el
 ;;     It contains a series of forms of this format:
@@ -90,9 +90,9 @@
 
 (defvar unidata-list nil)
 
-;; Name of the directory containing files of Unicode Character
-;; Database.
+;; Name of the directory containing files of Unicode Character Database.
 
+;; Dynamically bound in unidata-gen-files.
 (defvar unidata-dir nil)
 
 (defun unidata-setup-list (unidata-text-file)
@@ -1182,12 +1182,17 @@ is the character itself.")))
 ;; The entry function.  It generates files described in the header
 ;; comment of this file.
 
-(defun unidata-gen-files (&optional data-dir unidata-text-file)
+;; Write files (charprop.el, uni-*.el) to dest-dir (default PWD),
+;; using as input files from data-dir, and
+;; unidata-text-file (default "unidata.txt" in PWD).
+(defun unidata-gen-files (&optional data-dir dest-dir unidata-text-file)
   (or data-dir
       (setq data-dir (pop command-line-args-left)
-           unidata-text-file (pop command-line-args-left)))
+           dest-dir (or (pop command-line-args-left) default-directory)
+           unidata-text-file (or (pop command-line-args-left)
+                                 (expand-file-name "unidata.txt"))))
   (let ((coding-system-for-write 'utf-8-unix)
-       (charprop-file "charprop.el")
+       (charprop-file (expand-file-name "charprop.el" dest-dir))
        (unidata-dir data-dir))
     (dolist (elt unidata-prop-alist)
       (let* ((prop (car elt))
@@ -1200,7 +1205,8 @@ is the character itself.")))
       (dolist (elt unidata-prop-alist)
        (let* ((prop (car elt))
               (generator (unidata-prop-generator prop))
-              (file (unidata-prop-file prop))
+              (file (expand-file-name (unidata-prop-file prop) dest-dir))
+              (basename (file-name-nondirectory file))
               (docstring (unidata-prop-docstring prop))
               (describer (unidata-prop-describer prop))
               (default-value (unidata-prop-default prop))
@@ -1208,9 +1214,9 @@ is the character itself.")))
               table)
          ;; Filename in this comment line is extracted by sed in
          ;; Makefile.
-         (insert (format ";; FILE: %s\n" file))
+         (insert (format ";; FILE: %s\n" basename))
          (insert (format "(define-char-code-property '%S %S\n  %S)\n"
-                         prop file docstring))
+                         prop basename docstring))
          (with-temp-buffer
            (message "Generating %s..." file)
            (when (file-exists-p file)
@@ -1235,7 +1241,7 @@ is the character itself.")))
                        ";; coding: utf-8\n"
                        ";; no-byte-compile: t\n"
                        ";; End:\n\n"
-                       (format ";; %s ends here\n" file)))
+                       (format ";; %s ends here\n" basename)))
            (write-file file)
            (message "Generating %s...done" file))))
       (message "Writing %s..." charprop-file)
@@ -1243,7 +1249,8 @@ is the character itself.")))
              ";; coding: utf-8\n"
              ";; no-byte-compile: t\n"
              ";; End:\n\n"
-             (format ";; %s ends here\n" charprop-file)))))
+             (format ";; %s ends here\n"
+                     (file-name-nondirectory charprop-file))))))
 
 \f