changeset 95274:3edde37f5298

(update-elclist): New target, to update ELCFILES. (bootstrap-after): Run update-elclist.
author Glenn Morris <rgm@gnu.org>
date Sat, 24 May 2008 02:26:37 +0000
parents 4d3975347028
children 55d965d8f557
files lisp/Makefile.in
diffstat 1 files changed, 23 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/Makefile.in	Sat May 24 02:26:06 2008 +0000
+++ b/lisp/Makefile.in	Sat May 24 02:26:37 2008 +0000
@@ -149,15 +149,31 @@
 	els=`echo $(lisptagsfiles1) $(lisptagsfiles2) | sed -e "s,$(lisp)/[^ ]*loaddefs[^ ]*,," -e "s,$(lisp)/ldefs-boot[^ ]*,,"`; \
 	${ETAGS} -o $@ $$els
 
+.PHONY: update-elclist
+
+## Construct a sed command file that operates on lines between
+## ^ELCFILES and the next blank line.  Convert spaces between members
+## of COMPILE_FIRST to "\|", and escape directory "/".  List the .elc
+## files, exclude the members of COMPILE_FIRST, convert ^$(lisp) to a
+## literal " $(lisp)", add trailing " \\\" to the end of every line
+## (the last \ continues the line in sed, the other \\ result in a
+## single \ at the end of the replacement text).  For the last line,
+## just use a single "\", for sed.  Finally, run sed using the command
+## so constructed and update Makefile.in.  chmod +w is for CVSREAD=1.
+update-elclist:
+	echo "/^ELCFILES/,/^$$/c\\" > temp.sed
+	echo "ELCFILES = \\\\\\" >> temp.sed
+	exclude=`echo $(COMPILE_FIRST) | sed -e 's, ,\\\\|,g' -e 's,\/,\\\\/,g'`; \
+	ls $(lisp)/*.elc $(lisp)/*/*.elc | sed -e "/$$exclude/d" -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 temp.sed; exit 1 ; }
+	rm temp.sed
+	chmod +w $(lisp)/Makefile.in
+	mv -f temp-elcfiles $(lisp)/Makefile.in
 
 ## Explicitly list the .elc files, for the sake of parallel builds.
 ## http://lists.gnu.org/archive/html/bug-gnu-emacs/2008-05/msg00016.html
-## This can be done more elegantly, but needs to be portable.
-## This list generated by (after bootstrapping):
-## ls $lisp/*.elc $lisp/*/*.elc | sed -e "s|^$lisp|   \$(lisp)|" -e 's/$/ \\/'
-## and then excluding the members of COMPILE_FIRST.
-## FIXME find a way to automatically update this list in Makefile.in
-## after bootstrap.
+## This can probably be done more elegantly, but needs to be portable.
 ELCFILES = \
 	$(lisp)/abbrev.elc \
 	$(lisp)/abbrevlist.elc \
@@ -1397,7 +1413,7 @@
 # Generate/update files after the bootstrap process.
 # custom-deps needs `preloaded-file-list'.
 
-bootstrap-after: finder-data custom-deps
+bootstrap-after: finder-data custom-deps update-elclist
 
 distclean:
 	-rm -f ./Makefile