changeset 96154:0bca382a18f3

* src/Makefile.in (PRECOMP): Remove. (${lisp} ${SOME_MACHINE_LISP}): Remove pseudo dependency on PRECOMP. (witness-emacs): Run `compile-first'. (.el.elc): Use the new compile-onefile target. * lisp/Makefile.in (update-elclist): Don't exclude COMPILE_FIRST. (all): Run compile-last. (compile-onefile): New target. (compile-first): Simplify. (compile-last): Don't treat COMPILE_FIRST specially. (COMPILE_FIRST): List the elc files rather than the el files. (ELCFILES): Update.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Sat, 21 Jun 2008 19:20:40 +0000
parents 04289a261fac
children 1ccd4c713ecf
files lisp/ChangeLog lisp/Makefile.in src/ChangeLog src/Makefile.in
diffstat 4 files changed, 66 insertions(+), 33 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Sat Jun 21 15:43:34 2008 +0000
+++ b/lisp/ChangeLog	Sat Jun 21 19:20:40 2008 +0000
@@ -1,16 +1,25 @@
+2008-06-21  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* Makefile.in (update-elclist): Don't exclude COMPILE_FIRST.
+	(all): Run compile-last.
+	(compile-onefile): New target.
+	(compile-first): Simplify.
+	(compile-last): Don't treat COMPILE_FIRST specially.
+	(COMPILE_FIRST): List the elc files rather than the el files.
+	(ELCFILES): Update.
+
 2008-06-21  Ulf Jasper  <ulf@web.de>
 
-	* net/newst-treeview.el: Removed dead code.
-	(newsticker--window-config): Removed
+	* net/newst-treeview.el: Remove dead code.
+	(newsticker--window-config): Remove.
 	(newsticker-treeview-quit): Do not save window config.
 	(newsticker-treeview): Do not try to restore window config.
-	(newsticker-groups),
-	(newsticker--treeview-list-sort-by-column),
+	(newsticker-groups, newsticker--treeview-list-sort-by-column)
 	(newsticker--treeview-list-new-items)
-	(newsticker--treeview-list-immortal-items),
-	(newsticker--treeview-list-obsolete-items),
-	(newsticker--treeview-list-all-items),
-	(newsticker--treeview-list-feed-items): Documentation fixed.
+	(newsticker--treeview-list-immortal-items)
+	(newsticker--treeview-list-obsolete-items)
+	(newsticker--treeview-list-all-items)
+	(newsticker--treeview-list-feed-items): Fix documentation.
 
 2008-06-21  Miles Bader  <miles@gnu.org>
 
--- a/lisp/Makefile.in	Sat Jun 21 15:43:34 2008 +0000
+++ b/lisp/Makefile.in	Sat Jun 21 19:20:40 2008 +0000
@@ -62,17 +62,19 @@
 	eshell/esh-groups.el
 
 # Files to compile before others during a bootstrap.  This is done to
-# speed up the bootstrap process.  The CC files are compiled first
-# because CC mode tweaks the compilation process, and requiring
-# cc-mode when it is not compiled doesn't work during the
-# bootstrapping.
+# speed up the bootstrap process.
+# Why `subr.elc'?  It's dumped so byte-compiling it early shouldn't make
+# any difference!?  --Stef
+# Some CC files are compiled first because CC mode tweaks the compilation
+# process, and requiring cc-mode when it is not compiled doesn't work during
+# the bootstrapping.
 
 COMPILE_FIRST = \
-	$(lisp)/emacs-lisp/byte-opt.el \
-	$(lisp)/emacs-lisp/bytecomp.el \
-	$(lisp)/subr.el \
-	$(lisp)/progmodes/cc-mode.el \
-	$(lisp)/progmodes/cc-vars.el
+	$(lisp)/emacs-lisp/bytecomp.elc \
+	$(lisp)/emacs-lisp/byte-opt.elc \
+	$(lisp)/subr.elc \
+	$(lisp)/progmodes/cc-mode.elc \
+	$(lisp)/progmodes/cc-vars.elc
 
 # The actual Emacs command run in the targets below.
 
@@ -101,6 +103,8 @@
 # cus-load ans finder-inf are not explicitly requested by anything, so
 # we add them here to make sure they get built.
 all: compile-main $(lisp)/cus-load.el $(lisp)/finder-inf.el
+	@: Let us check that we byte-compiled all the files.
+	$(MAKE) $(MFLAGS) compile-last
 
 doit:
 
@@ -166,8 +170,8 @@
 
 .PHONY: update-elclist
 
-## Post-bootstrap, find the list of .elc files, exclude the members
-## of COMPILE_FIRST, and use sed to update ELCFILES in Makefile.in.
+## Post-bootstrap, find the list of .elc files and use sed to update
+## ELCFILES in Makefile.in.
 ## Errors in the final sed are non-fatal, since they have no effect on
 ## building Emacs.  chmod +w is for CVSREAD=1.
 ## "echo" is non-portable with regards to backslashes, eg between zsh
@@ -176,8 +180,7 @@
 update-elclist:
 	echo "/^ELCFILES/,/^$$/c\\" > temp.sed
 	echo "ELCFILES =" | sed -e 's/$$/ \\\\\\/' >> temp.sed
-	exclude=`echo $(COMPILE_FIRST) | sed -e 's, ,\\\\|,g' -e 's,\/,\\\\/,g'`; \
-	LC_COLLATE=C ls $(lisp)/*.elc $(lisp)/*/*.elc | sed -e "/$$exclude/d" -e "s|^$(lisp)|	\$$(lisp)|" -e 's/$$/ \\\\\\/' -e '$$ s/ \\\\//' >> temp.sed
+	LC_COLLATE=C ls $(lisp)/*.elc $(lisp)/*/*.elc | sed -e "s|^$(lisp)|	\$$(lisp)|" -e 's/$$/ \\\\\\/' -e '$$ s/ \\\\//' >> temp.sed
 	echo "" >> temp.sed
 	-sed -f temp.sed $(lisp)/Makefile.in > temp-elcfiles || rm temp-elcfiles
 	rm temp.sed
@@ -341,7 +344,9 @@
 	$(lisp)/emacs-lisp/backquote.elc \
 	$(lisp)/emacs-lisp/benchmark.elc \
 	$(lisp)/emacs-lisp/bindat.elc \
+	$(lisp)/emacs-lisp/byte-opt.elc \
 	$(lisp)/emacs-lisp/byte-run.elc \
+	$(lisp)/emacs-lisp/bytecomp.elc \
 	$(lisp)/emacs-lisp/check-declare.elc \
 	$(lisp)/emacs-lisp/checkdoc.elc \
 	$(lisp)/emacs-lisp/cl-compat.elc \
@@ -1002,8 +1007,10 @@
 	$(lisp)/progmodes/cc-fonts.elc \
 	$(lisp)/progmodes/cc-langs.elc \
 	$(lisp)/progmodes/cc-menus.elc \
+	$(lisp)/progmodes/cc-mode.elc \
 	$(lisp)/progmodes/cc-styles.elc \
 	$(lisp)/progmodes/cc-subword.elc \
+	$(lisp)/progmodes/cc-vars.elc \
 	$(lisp)/progmodes/cfengine.elc \
 	$(lisp)/progmodes/cmacexp.elc \
 	$(lisp)/progmodes/compile.elc \
@@ -1101,6 +1108,7 @@
 	$(lisp)/speedbar.elc \
 	$(lisp)/startup.elc \
 	$(lisp)/strokes.elc \
+	$(lisp)/subr.elc \
 	$(lisp)/t-mouse.elc \
 	$(lisp)/tabify.elc \
 	$(lisp)/talk.elc \
@@ -1153,6 +1161,7 @@
 	$(lisp)/textmodes/reftex-vars.elc \
 	$(lisp)/textmodes/reftex.elc \
 	$(lisp)/textmodes/remember.elc \
+	$(lisp)/textmodes/rst.elc \
 	$(lisp)/textmodes/sgml-mode.elc \
 	$(lisp)/textmodes/spell.elc \
 	$(lisp)/textmodes/table.elc \
@@ -1239,6 +1248,19 @@
 	$(lisp)/xml.elc \
 	$(lisp)/xt-mouse.elc
 
+# The src/Makefile.in has its own set of dependencies and when they decide
+# that one Lisp file needs to be re-compiled, we had better recompile it as
+# well, otherwise every subsequent make will again call us, until we finally
+# end up deciding that yes, the file deserves recompilation.
+# One option is to try and reproduce exactly the same dependencies here as
+# we have in src/Makefile.in, but it turns out to be painful
+# (e.g. src/Makefile.in may have a dependency for ../lisp/foo.elc where we
+# only know of $(lisp)/foo.elc).  So instead we provide a direct way for
+# src/Makefile.in to rebuild a particular Lisp file, no questions asked.
+compile-onefile:
+	@echo Compiling $(THEFILE)
+	@$(emacs) $(BYTE_COMPILE_EXTRA_FLAGS) -f batch-byte-compile $(THEFILE)
+
 # Files MUST be compiled one by one. If we compile several files in a
 # row (i.e., in the same instance of Emacs) we can't make sure that
 # the compilation environment is clean.  We also set the load-path of
@@ -1258,11 +1280,7 @@
 
 .PHONY: compile-first compile-main compile-last compile compile-always
 
-compile-first: $(LOADDEFS) autoloads $(COMPILE_FIRST)
-	for el in $(COMPILE_FIRST); do \
-	  echo Compiling $$el; \
-	  $(emacs) $(BYTE_COMPILE_EXTRA_FLAGS) -f batch-byte-compile-if-not-done $$el || exit 1; \
-	done
+compile-first: $(COMPILE_FIRST)
 
 compile-main: $(ELCFILES)
 
@@ -1290,7 +1308,7 @@
 compile-last:
 	@wd=$(lisp); $(setwins); \
 	els=`echo "$$wins " | sed -e 's|/\./|/|g' -e 's|/\. | |g' -e 's| |/*.el |g'`; \
-	for el in $(COMPILE_FIRST) $$els; do \
+	for el in $$els; do \
 	  test -f $$el || continue; \
 	  test -f $${el}c && continue; \
 	  grep 'no-byte-compile: t' $$el > /dev/null && continue; \
--- a/src/ChangeLog	Sat Jun 21 15:43:34 2008 +0000
+++ b/src/ChangeLog	Sat Jun 21 19:20:40 2008 +0000
@@ -1,3 +1,10 @@
+2008-06-21  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* Makefile.in (PRECOMP): Remove.
+	(${lisp} ${SOME_MACHINE_LISP}): Remove pseudo dependency on PRECOMP.
+	(witness-emacs): Run `compile-first'.
+	(.el.elc): Use the new compile-onefile target.
+
 2008-06-21  Kenichi Handa  <handa@m17n.org>
 
 	* xftfont.c (xftfont_open): Handle QCembolden only when
--- a/src/Makefile.in	Sat Jun 21 15:43:34 2008 +0000
+++ b/src/Makefile.in	Sat Jun 21 19:20:40 2008 +0000
@@ -1335,18 +1335,15 @@
 /* These suffix rules do not allow additional dependencies, sadly, so
    adding a bootstrap-emacs%{EXEEXT} dependency does not work --Stef */
 .el.elc:
-	cd ../lisp; $(MAKE) $(MFLAGS) $@ EMACS=../src/bootstrap-emacs${EXEEXT}
-
-/* Files that need to be compiled early to speed up further compilation.  */
-PRECOMP=../lisp/emacs-lisp/bytecomp.elc ../lisp/emacs-lisp/byte-opt.elc
-${PRECOMP}: witness-emacs
+	@cd ../lisp; $(MAKE) $(MFLAGS) compile-onefile \
+	                    THEFILE=$< EMACS=../src/bootstrap-emacs${EXEEXT}
 
 /* Since the .el.elc rule cannot specify an extra dependency, we do it here.
    The byte-compiler dependency is not necessary, but it substantially
    speeds up byte-compilation of the other files.
    Of course, it also has the downside of forcing a recompilation of all
    those files whenever a file in $PRECOMP changes.  */
-${lisp} ${SOME_MACHINE_LISP}: witness-emacs ${PRECOMP}
+${lisp} ${SOME_MACHINE_LISP}: witness-emacs
 
 ../lisp/loaddefs.el: witness-emacs
 	cd ../lisp; $(MAKE) $(MFLAGS) autoloads EMACS=../src/bootstrap-emacs${EXEEXT}
@@ -1366,3 +1363,5 @@
 	cd ../lisp; $(MAKE) $(MFLAGS) update-subdirs
 	$(MAKE) $(MFLAGS) bootstrap-emacs${EXEEXT}
 	touch witness-emacs
+	@: Compile some files earlier to speed up further compilation.
+	cd $(lispsource); $(MAKE) $(MFLAGS) compile-first