summaryrefslogtreecommitdiff
path: root/lisp/Makefile.in
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2017-04-13 10:03:09 +0300
committerEli Zaretskii <eliz@gnu.org>2017-04-13 10:03:09 +0300
commit88e012511ac6bfd7eb31b14d792ab0005e3693a8 (patch)
treecb557e7a5d502c2c5fe068bd3991e848604a7a79 /lisp/Makefile.in
parent6354e3c3368d99fad755d4dbd7c872ce1280f005 (diff)
downloademacs-88e012511ac6bfd7eb31b14d792ab0005e3693a8.tar.gz
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.
Diffstat (limited to 'lisp/Makefile.in')
-rw-r--r--lisp/Makefile.in12
1 files changed, 11 insertions, 1 deletions
diff --git a/lisp/Makefile.in b/lisp/Makefile.in
index 334f2a44bb2..ec9ea16021e 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