emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] trunk r114866: Simplify admin/unidata Makefile rules


From: Glenn Morris
Subject: [Emacs-diffs] trunk r114866: Simplify admin/unidata Makefile rules
Date: Wed, 30 Oct 2013 07:16:12 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 114866
revision-id: address@hidden
parent: address@hidden
committer: Glenn Morris <address@hidden>
branch nick: trunk
timestamp: Wed 2013-10-30 00:15:23 -0700
message:
  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.
modified:
  admin/ChangeLog                changelog-20091113204419-o5vbwnq5f7feedwu-2226
  admin/unidata/Makefile.in      
makefile.in-20091113204419-o5vbwnq5f7feedwu-8551
  admin/unidata/unidata-gen.el   
unidatagen.el-20091113204419-o5vbwnq5f7feedwu-8382
=== modified file 'admin/ChangeLog'
--- a/admin/ChangeLog   2013-10-30 06:40:15 +0000
+++ b/admin/ChangeLog   2013-10-30 07:15:23 +0000
@@ -1,5 +1,15 @@
 2013-10-30  Glenn Morris  <address@hidden>
 
+       * 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.

=== modified file 'admin/unidata/Makefile.in'
--- a/admin/unidata/Makefile.in 2013-10-30 06:40:15 +0000
+++ b/admin/unidata/Makefile.in 2013-10-30 07:15:23 +0000
@@ -24,12 +24,10 @@
 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 @@
        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}

=== modified file 'admin/unidata/unidata-gen.el'
--- a/admin/unidata/unidata-gen.el      2013-10-30 06:25:44 +0000
+++ b/admin/unidata/unidata-gen.el      2013-10-30 07:15:23 +0000
@@ -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 @@
 ;; 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 @@
       (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 @@
               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 @@
                        ";; 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 @@
              ";; 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))))))
 
 
 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]