aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Morris2017-04-26 14:12:56 -0400
committerGlenn Morris2017-04-26 14:12:56 -0400
commitbce5ff9140fc9af7541e8365da953a08bd4dd09a (patch)
tree493c475c43a4aa005521e744ff1ccd1ad6f28c59
parent8f2062d96b0319fc2a837ba9e2c6b67abf31c920 (diff)
downloademacs-bce5ff9140fc9af7541e8365da953a08bd4dd09a.tar.gz
emacs-bce5ff9140fc9af7541e8365da953a08bd4dd09a.zip
; * lisp/Makefile.in: Comments about loaddefs.
-rw-r--r--lisp/Makefile.in55
1 files changed, 36 insertions, 19 deletions
diff --git a/lisp/Makefile.in b/lisp/Makefile.in
index 0cb07b2d35a..06d8135c0b9 100644
--- a/lisp/Makefile.in
+++ b/lisp/Makefile.in
@@ -173,31 +173,46 @@ $(lisp)/finder-inf.el:
173 --eval '(setq generated-finder-keywords-file (unmsys--file-name "$(srcdir)/finder-inf.el"))' \ 173 --eval '(setq generated-finder-keywords-file (unmsys--file-name "$(srcdir)/finder-inf.el"))' \
174 -f finder-compile-keywords-make-dist ${SUBDIRS_FINDER} 174 -f finder-compile-keywords-make-dist ${SUBDIRS_FINDER}
175 175
176# Use expand-file-name rather than $abs_scrdir so that Emacs does not 176## Comments on loaddefs generation:
177# get confused when it compares file-names for equality. 177
178# 178# loaddefs depends on gen-lisp for two reasons:
179# Note that we set no-update-autoloads in _generated_ leim files. 179# 1) In ../src, the emacs target depends on loaddefs but not on eg leim-list.
180# If you want to allow autoloads in such files, remove that, 180# So having leim as a dependency of loaddefs (via gen-lisp) ensures leim-list
181# and make this depend on leim. 181# gets created before the final emacs is dumped. Having leim
182# Actually this should depend on leim anyway, since no-update-autoloads 182# dependencies in ../src as well would create a parallel race condition.
183# files are still recorded in loaddefs. So we should ensure
184# that all input files are generated before we create loaddefs.
185# Otherwise making loaddefs again will change the output.
186#
187# In fact, now we rely on this target to create leim-list.
188# In src, emacs depends directly on loaddefs.el (not leim-list).
189# 183#
190# Write to a temporary file in case we're doing a parallel build and a 184# 2) Files that are marked no-update-autoloads still get recorded in loaddefs.
191# CANNOT_DUMP-mode Emacs needs to read loaddefs at startup. 185# So those files should be generated before we make autoloads, if we
186# don't want a successive make autoloads to change the output file.
187# Said changes are trivial (only comments in the "files without autoloads"
188# section), but still can be annoying. Of course, if generated lisp files
189# do contain autoloads, it is essential they be built before make autoloads.
190# (Also, if a generated file is not written atomically, it is possible that
191# in a parallel build, make autoloads could read a partial version of it.)
192# 192#
193# We'd really like to add "make -C ../admin/unidata all" to gen-lisp
194# because of 2) above, but it causes a race condition in parallel
195# builds because ../src also runs that rule. Given the limitations of
196# recursive make, the only way to fix that would be to remove unidata
197# from ../src rules, but that doesn't seem possible due to the various
198# non-trivial dependencies.
199
193# We make $(lisp)/loaddefs.el a dependency of .PHONY to cause Make to 200# We make $(lisp)/loaddefs.el a dependency of .PHONY to cause Make to
194# ignore its time stamp. That's because the real dependencies of 201# ignore its time stamp. That's because the real dependencies of
195# loaddefs.el aren't known to Make, they are implemented in 202# loaddefs.el aren't known to Make, they are implemented in
196# batch-update-autoloads, which only updates the autoloads whose 203# batch-update-autoloads, which only updates the autoloads whose
197# sources have changed. We start by copying an existing loaddefs.el 204# sources have changed.
198# to loaddefs.tmp to avoid regenerating the entire file anew, which is 205
199# slow; starting from an almost-correct content will enable the "only 206# Write to a temporary file in case we're doing a parallel build and a
200# update where necessary" feature of batch-update-autoloads. 207# CANNOT_DUMP-mode Emacs needs to read loaddefs at startup. We start
208# by copying an existing loaddefs.el to loaddefs.tmp to avoid regenerating
209# the entire file anew, which is slow; starting from an almost-correct
210# content will enable the "only update where necessary" feature of
211# batch-update-autoloads.
212
213# Use expand-file-name rather than $abs_scrdir so that Emacs does not
214# get confused when it compares file-names for equality.
215
201autoloads .PHONY: $(lisp)/loaddefs.el 216autoloads .PHONY: $(lisp)/loaddefs.el
202$(lisp)/loaddefs.el: gen-lisp $(LOADDEFS) 217$(lisp)/loaddefs.el: gen-lisp $(LOADDEFS)
203 @echo Directories for loaddefs: ${SUBDIRS_ALMOST} 218 @echo Directories for loaddefs: ${SUBDIRS_ALMOST}
@@ -352,6 +367,8 @@ compile-clean:
352 367
353.PHONY: gen-lisp leim semantic 368.PHONY: gen-lisp leim semantic
354 369
370## make -C ../admin/unidata all should be here, but that would race
371## with ../src. See comments above for loaddefs.
355gen-lisp: leim semantic 372gen-lisp: leim semantic
356 373
357leim: 374leim: