From 46ea93792da1db916305d50272c6465a6dde7c25 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Sat, 16 May 2015 17:52:27 -0700 Subject: * src/lisp.mk: Remove from repository and generate at build-time. * src/Makefile.in (lisp.mk): New rule to generate from loadup.el. (shortlisp_filter): New variable. (emacs$(EXEEXT), $(etc)/DOC): Depend on lisp.mk. (distclean): Remove lisp.mk. * Makefile.in ($(MAKEFILE_NAME)): No longer depend on src/lisp.mk. * lisp/loadup.el: Tweak layout to make it easier to parse. * make-dist: Do not distribute src/lisp.mk. --- .gitignore | 1 + Makefile.in | 2 +- lisp/loadup.el | 36 ++++++------ make-dist | 2 +- src/Makefile.in | 38 +++++++++++-- src/lisp.mk | 168 -------------------------------------------------------- 6 files changed, 55 insertions(+), 192 deletions(-) delete mode 100644 src/lisp.mk diff --git a/.gitignore b/.gitignore index 4e526beedc5..618249c8def 100644 --- a/.gitignore +++ b/.gitignore @@ -76,6 +76,7 @@ lib/unistd.h lib/warn-on-use.h src/buildobj.h src/globals.h +src/lisp.mk # Lisp-level sources built by 'make'. *cus-load.el diff --git a/Makefile.in b/Makefile.in index a02f0749d3d..eec6d313524 100644 --- a/Makefile.in +++ b/Makefile.in @@ -413,7 +413,7 @@ blessmail: Makefile src # etc. to be built without running into similar recursion problems. MAKEFILE_NAME = Makefile $(MAKEFILE_NAME): config.status $(srcdir)/src/config.in \ - $(srcdir)/Makefile.in $(SUBDIR_MAKEFILES_IN) $(srcdir)/src/lisp.mk + $(srcdir)/Makefile.in $(SUBDIR_MAKEFILES_IN) MAKE='$(MAKE)' ./config.status # Don't erase these files if make is interrupted while refreshing them. diff --git a/lisp/loadup.el b/lisp/loadup.el index b69005f0c01..84fa327050a 100644 --- a/lisp/loadup.el +++ b/lisp/loadup.el @@ -26,20 +26,24 @@ ;; This is loaded into a bare Emacs to make a dumpable one. -;; If you add/remove Lisp files to be loaded here, consider the -;; following issues: +;; If you add a file to be loaded here, keep the following points in mind: -;; i) Any file loaded on any platform should appear in src/lisp.mk. -;; Use the .el or .elc version as appropriate. +;; i) If the file is no-byte-compile, explicitly load the .el version. +;; Such files should (where possible) obey the doc-string conventions +;; expected by make-docfile. They should also be added to the +;; uncompiled[] list in make-docfile.c. +;; ii) If the file is dumped with Emacs (on any platform), put the +;; load statement at the start of a line (leading whitespace is ok). + +;; iii) If the file is _not_ dumped with Emacs, make sure the load +;; statement is _not_ at the start of a line. See pcase for an example. + +;; These rules are so that src/Makefile can construct lisp.mk automatically. ;; This ensures both that the Lisp files are compiled (if necessary) ;; before the emacs executable is dumped, and that they are passed to ;; make-docfile. (Any that are not processed for DOC will not have -;; doc strings in the dumped Emacs.) Because of this: - -;; ii) If the file is loaded uncompiled, it should (where possible) -;; obey the doc-string conventions expected by make-docfile. It -;; should also be added to the uncompiled[] list in make-docfile.c. +;; doc strings in the dumped Emacs.) ;;; Code: @@ -117,8 +121,7 @@ ;; Since loaddefs is not yet loaded, macroexp's uses of pcase will simply ;; fail until pcase is explicitly loaded. This also means that we have to ;; disable eager macro-expansion while loading pcase. - (let ((macroexp--pending-eager-loads '(skip))) - (load "emacs-lisp/pcase")) + (let ((macroexp--pending-eager-loads '(skip))) (load "emacs-lisp/pcase")) ;; Re-load macroexp so as to eagerly macro-expand its uses of pcase. (let ((max-lisp-eval-depth (* 2 max-lisp-eval-depth))) (load "emacs-lisp/macroexp"))) @@ -139,9 +142,7 @@ ;; should be updated by overwriting it with an up-to-date copy of ;; loaddefs.el that is uncorrupted by local changes. ;; autogen/update_autogen can be used to periodically update ldefs-boot. -(condition-case nil - ;; Don't get confused if someone compiled this by mistake. - (load "loaddefs.el") +(condition-case nil (load "loaddefs.el") ;; In case loaddefs hasn't been generated yet. (file-error (load "ldefs-boot.el"))) @@ -178,8 +179,8 @@ (load "language/romanian") (load "language/greek") (load "language/hebrew") -(load "international/cp51932") -(load "international/eucjp-ms") +(load "international/cp51932.el") +(load "international/eucjp-ms.el") (load "language/japanese") (load "language/korean") (load "language/lao") @@ -289,7 +290,8 @@ (load "electric") (load "emacs-lisp/eldoc") (load "cus-start") ;Late to reduce customize-rogue (needs loaddefs.el anyway) -(if (not (eq system-type 'ms-dos)) (load "tooltip")) +(if (not (eq system-type 'ms-dos)) + (load "tooltip")) ;; This file doesn't exist when building a development version of Emacs ;; from the repository. It is generated just after temacs is built. diff --git a/make-dist b/make-dist index bc5874e6b7d..6bf01ffa11b 100755 --- a/make-dist +++ b/make-dist @@ -375,7 +375,7 @@ echo "Making links to 'src'" echo " (It is ok if ln fails in some cases.)" ln [a-zA-Z]*.[chm] ../${tempdir}/src ln [a-zA-Z]*.in ../${tempdir}/src - ln [a-zA-Z]*.mk ../${tempdir}/src + ln deps.mk ../${tempdir}/src ln README ChangeLog.*[0-9] ../${tempdir}/src ln makefile.w32-in ../${tempdir}/src ln .gdbinit .dbxinit ../${tempdir}/src diff --git a/src/Makefile.in b/src/Makefile.in index f6fa03a8dfd..57417fcb3fa 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -418,8 +418,36 @@ otherobj= $(TERMCAP_OBJ) $(PRE_ALLOC_OBJ) $(GMALLOC_OBJ) $(RALLOC_OBJ) \ FIRSTFILE_OBJ=@FIRSTFILE_OBJ@ ALLOBJS = $(FIRSTFILE_OBJ) $(VMLIMIT_OBJ) $(obj) $(otherobj) -include $(srcdir)/lisp.mk - +## This is the list of all Lisp files that might be loaded into the +## dumped Emacs. Some of them are not loaded on all platforms, but +## the DOC file on every platform uses them (because the DOC file is +## supposed to be platform-independent). +## Note that this list should not include lisp files which might not +## be present, like site-load.el and site-init.el; this makefile +## expects them all to be either present or buildable. +## +## To generate this list from loadup.el, we can either: +## 1) Extract everything matching (load "..."), in which case +## we need to add charprop.el by hand; or +## 2) Extract everything matching (load "...", in which case +## we need to remove leim-list, site-init, and site-load by hand. +## There's not much to choose between these two approaches, +## but the second one seems like it could be more future-proof. +shortlisp = +lisp.mk: $(lispsource)/loadup.el + @rm -f $@ + ${AM_V_GEN}( echo "shortlisp = \\"; \ + sed -n 's/^[ \t]*(load "\([^"]*\)".*/\1/p' $< | \ + sed -e 's/$$/.elc \\/' -e 's/\.el\.elc/.el/'; \ + echo "" ) > $@ + +-include lisp.mk +shortlisp_filter = leim/leim-list.el site-load.elc site-init.elc +shortlisp := $(filter-out ${shortlisp_filter},${shortlisp}) +## Place loaddefs.el first, so it gets generated first, since it is on +## the critical path (relevant in parallel compilations). +## We don't really need to sort, but may as well use it to remove duplicates. +shortlisp := loaddefs.el loadup.el $(sort ${shortlisp}) lisp = $(addprefix ${lispsource}/,${shortlisp}) ## Construct full set of libraries to be linked. @@ -454,7 +482,7 @@ $(srcdir)/macuvs.h $(lispsource)/international/charprop.el: \ ## since not all pieces are used on all platforms. But DOC depends ## on all of $lisp, and emacs depends on DOC, so it is ok to use $lisp here. emacs$(EXEEXT): temacs$(EXEEXT) \ - $(etc)/DOC $(lisp) $(leimdir)/leim-list.el \ + lisp.mk $(etc)/DOC $(lisp) $(leimdir)/leim-list.el \ $(lispsource)/international/charprop.el ifeq ($(CANNOT_DUMP),yes) ln -f temacs$(EXEEXT) $@ @@ -475,7 +503,7 @@ endif ## for the first time, this prevents any variation between configurations ## in the contents of the DOC file. ## -$(etc)/DOC: $(libsrc)/make-docfile$(EXEEXT) $(obj) $(lisp) +$(etc)/DOC: lisp.mk $(libsrc)/make-docfile$(EXEEXT) $(obj) $(lisp) $(AM_V_GEN)$(MKDIR_P) $(etc) -$(AM_V_at)rm -f $(etc)/DOC $(AM_V_at)$(libsrc)/make-docfile -d $(srcdir) \ @@ -581,7 +609,7 @@ bootstrap-clean: clean fi distclean: bootstrap-clean - rm -f Makefile + rm -f Makefile lisp.mk maintainer-clean: distclean rm -f TAGS diff --git a/src/lisp.mk b/src/lisp.mk deleted file mode 100644 index 32882d1ed3d..00000000000 --- a/src/lisp.mk +++ /dev/null @@ -1,168 +0,0 @@ -### lisp.mk --- src/Makefile fragment for GNU Emacs - -## Copyright (C) 1985, 1987-1988, 1993-1995, 1999-2015 Free Software -## Foundation, Inc. - -## This file is part of GNU Emacs. - -## GNU Emacs is free software: you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation, either version 3 of the License, or -## (at your option) any later version. - -## GNU Emacs is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. - -## You should have received a copy of the GNU General Public License -## along with GNU Emacs. If not, see . - -### Commentary: - -## This is the list of all Lisp files that might be loaded into the -## dumped Emacs. Some of them are not loaded on all platforms, but -## the DOC file on every platform uses them (because the DOC file is -## supposed to be platform-independent). -## It is arranged like this because it is easier to generate it -## semi-mechanically from loadup.el this way. -## Eg something like: -## sed -e 's/"[ )].*//' -n -e '/(load "/ s/.*load "//p' loadup.el | \ -## grep -vE 'site-|ldefs-boot' -## minus any duplicates. -## Note that you can generally just add a ".elc" extension to every file -## that does not have an explicit .el extension, but beware of any -## no-byte-compile ones. - -## Note that this list should not include lisp files which might not -## be present, like site-load.el and site-init.el; this makefile -## expects them all to be either present or buildable. - -## Place loaddefs.el first, so it gets generated first, since it is on -## the critical path (relevant in parallel compilations). - -### Code: - -shortlisp = \ - loaddefs.el \ - loadup.el \ - emacs-lisp/byte-run.elc \ - emacs-lisp/backquote.elc \ - subr.elc \ - version.elc \ - widget.elc \ - custom.elc \ - emacs-lisp/map-ynp.elc \ - cus-start.elc \ - international/mule.elc \ - international/mule-conf.elc \ - env.elc \ - format.elc \ - bindings.elc \ - files.elc \ - emacs-lisp/macroexp.elc \ - cus-face.elc \ - faces.elc \ - button.elc \ - startup.elc \ - emacs-lisp/cl-preloaded.elc \ - emacs-lisp/nadvice.elc \ - minibuffer.elc \ - abbrev.elc \ - simple.elc \ - help.elc \ - jka-cmpr-hook.elc \ - epa-hook.elc \ - international/mule-cmds.elc \ - case-table.elc \ - international/characters.elc \ - composite.elc \ - international/charprop.el \ - language/chinese.elc \ - language/cyrillic.elc \ - language/indian.elc \ - language/sinhala.elc \ - language/english.elc \ - language/ethiopic.elc \ - language/european.elc \ - language/czech.elc \ - language/slovak.elc \ - language/romanian.elc \ - language/greek.elc \ - language/hebrew.elc \ - international/cp51932.el \ - international/eucjp-ms.el \ - language/japanese.elc \ - language/korean.elc \ - language/lao.elc \ - language/tai-viet.elc \ - language/thai.elc \ - language/tibetan.elc \ - language/vietnamese.elc \ - language/misc-lang.elc \ - language/utf-8-lang.elc \ - language/georgian.elc \ - language/khmer.elc \ - language/burmese.elc \ - language/cham.elc \ - indent.elc \ - window.elc \ - emacs-lisp/cl-generic.elc \ - frame.elc \ - term/tty-colors.elc \ - font-core.elc \ - facemenu.elc \ - emacs-lisp/syntax.elc \ - font-lock.elc \ - jit-lock.elc \ - mouse.elc \ - scroll-bar.elc \ - select.elc \ - emacs-lisp/timer.elc \ - isearch.elc \ - rfn-eshadow.elc \ - menu-bar.elc \ - emacs-lisp/lisp.elc \ - textmodes/page.elc \ - register.elc \ - textmodes/paragraphs.elc \ - progmodes/prog-mode.elc \ - emacs-lisp/lisp-mode.elc \ - progmodes/elisp-mode.elc \ - textmodes/text-mode.elc \ - textmodes/fill.elc \ - newcomment.elc \ - replace.elc \ - emacs-lisp/tabulated-list.elc \ - buff-menu.elc \ - fringe.elc \ - emacs-lisp/regexp-opt.elc \ - image.elc \ - international/fontset.elc \ - dnd.elc \ - tool-bar.elc \ - dynamic-setting.elc \ - x-dnd.elc \ - term/common-win.elc \ - term/x-win.elc \ - w32-vars.elc \ - term/w32-win.elc \ - ls-lisp.elc \ - disp-table.elc \ - dos-w32.elc \ - w32-fns.elc \ - dos-fns.elc \ - dos-vars.elc \ - term/pc-win.elc \ - term/internal.elc \ - term/ns-win.elc \ - mwheel.elc \ - emacs-lisp/float-sup.elc \ - vc/vc-hooks.elc \ - vc/ediff-hook.elc \ - electric.elc \ - emacs-lisp/eldoc.elc \ - uniquify.elc \ - tooltip.elc - -### lisp.mk ends here -- cgit v1.2.1