emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] master 88e0125: Avoid unnecessary regeneration of the enti


From: Eli Zaretskii
Subject: [Emacs-diffs] master 88e0125: Avoid unnecessary regeneration of the entire loaddefs.el
Date: Thu, 13 Apr 2017 03:04:20 -0400 (EDT)

branch: master
commit 88e012511ac6bfd7eb31b14d792ab0005e3693a8
Author: Eli Zaretskii <address@hidden>
Commit: Eli Zaretskii <address@hidden>

    Avoid unnecessary regeneration of the entire loaddefs.el
    
    * lisp/Makefile.in (autoloads .PHONY): Add commentary explaining
    why $(lisp)/loaddefs.el is a dependency of '.PHONY'.
    ($(lisp)/loaddefs.el): Copy an existing loaddefs.el to
    loaddefs.tmp before running 'batch-update-autoloads' on it, to
    avoid slow regeneration of the full contents.  (Bug#26459)
    Use 'move-if-change' instead of 'mv', to avoid producing a new
    Emacs binary when not necessary.
---
 lisp/Makefile.in | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/lisp/Makefile.in b/lisp/Makefile.in
index 334f2a4..ec9ea16 100644
--- a/lisp/Makefile.in
+++ b/lisp/Makefile.in
@@ -182,15 +182,25 @@ $(lisp)/finder-inf.el:
 #
 # Write to a temporary file in case we're doing a parallel build and a
 # CANNOT_DUMP-mode Emacs needs to read loaddefs at startup.
+#
+# We make $(lisp)/loaddefs.el a dependency of .PHONY to cause Make to
+# ignore its time stamp.  That's because the real dependencies of
+# loaddefs.el aren't known to Make, they are implemented in
+# batch-update-autoloads, which only updates the autoloads whose
+# sources have changed.  We start by copying an existing loaddefs.el
+# to loaddefs.tmp to avoid regenerating the entire file anew, which is
+# slow; starting from an almost-correct content will enable the "only
+# update where necessary" feature of batch-update-autoloads.
 autoloads .PHONY: $(lisp)/loaddefs.el
 $(lisp)/loaddefs.el: $(LOADDEFS)
        @echo Directories for loaddefs: ${SUBDIRS_ALMOST}
+       @if test -f $@ ; then cp $@ $(lisp)/loaddefs.tmp ; fi
        $(AM_V_GEN)$(emacs) -l autoload \
            --eval '(setq autoload-ensure-writable t)' \
            --eval '(setq autoload-builtin-package-versions t)' \
            --eval '(setq generated-autoload-file (expand-file-name 
(unmsys--file-name "$(lisp)/loaddefs.tmp")))' \
            -f batch-update-autoloads ${SUBDIRS_ALMOST}
-       mv -f $(lisp)/loaddefs.tmp $@
+       $(top_srcdir)/build-aux/move-if-change $(lisp)/loaddefs.tmp $@
 
 # autoloads only runs when loaddefs.el is nonexistent, although it
 # generates a number of different files. Provide a force option to enable



reply via email to

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