From b4945b9599f0651fef5fa2ca2ef6034fa0b5bfaa Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Sun, 22 Jun 2008 13:57:28 +0000 Subject: * Makefile.in ${SUBDIR}: Pass additional BOOTSTRAPEMACS argument. * Makefile.in (${lisp} ${SOME_MACHINE_LISP}, ../lisp/loaddefs.el): Use $(BOOTSTRAPEMACS) rather than witness-emacs. (bootstrap-emacs${EXEEXT}): Merge witness-emacs into it. (witness-emacs): Remove. (lisp, shortlisp): Move loaddefs.el earlier. (mostlyclean): Forget about witness-emacs. * Makefile.in (COMPILE_FIRST): Trim down and add autoload.el. --- src/ChangeLog | 9 +++++++++ src/Makefile.in | 48 +++++++++++++++++++++++++++--------------------- 2 files changed, 36 insertions(+), 21 deletions(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 52b7bf078f4..fc0a84128b3 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,12 @@ +2008-06-22 Stefan Monnier + + * Makefile.in (${lisp} ${SOME_MACHINE_LISP}, ../lisp/loaddefs.el): + Use $(BOOTSTRAPEMACS) rather than witness-emacs. + (bootstrap-emacs${EXEEXT}): Merge witness-emacs into it. + (witness-emacs): Remove. + (lisp, shortlisp): Move loaddefs.el earlier. + (mostlyclean): Forget about witness-emacs. + 2008-06-22 Glenn Morris * Makefile.in (witness-emacs): Depend on temacs${EXEEXT}. diff --git a/src/Makefile.in b/src/Makefile.in index 8c85c2c4414..140f944e0d6 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -680,7 +680,11 @@ otherobj= $(termcapobj) lastfile.o $(mallocobj) $(widgetobj) $(LIBOBJS) Files included conditionally here should be included (unconditionally) in SOME_MACHINE_LISP. */ +/* Please loaddefs.el first, so it gets generated first, since it is on + the critical path (relevant in parallel compilations). */ + lisp= \ + ${lispsource}loaddefs.el \ ${lispsource}abbrev.elc \ ${lispsource}buff-menu.elc \ ${lispsource}button.elc \ @@ -705,7 +709,6 @@ lisp= \ ${lispsource}isearch.elc \ ${lispsource}rfn-eshadow.elc \ ${lispsource}loadup.el \ - ${lispsource}loaddefs.el \ ${lispsource}bindings.elc \ ${lispsource}emacs-lisp/map-ynp.elc \ ${lispsource}menu-bar.elc \ @@ -775,6 +778,7 @@ lisp= \ It need not contain the files that are loaded conditionally because SOME_MACHINE_LISP has those. */ shortlisp= \ + ../lisp/loaddefs.el \ ../lisp/abbrev.elc \ ../lisp/buff-menu.elc \ ../lisp/button.elc \ @@ -797,7 +801,6 @@ shortlisp= \ ../lisp/isearch.elc \ ../lisp/rfn-eshadow.elc \ ../lisp/loadup.el \ - ../lisp/loaddefs.el \ ../lisp/bindings.elc \ ../lisp/emacs-lisp/map-ynp.elc \ ../lisp/env.elc \ @@ -1274,7 +1277,7 @@ ${emacsapp}Contents/MacOS/Emacs: emacs${EXEEXT} mostlyclean: rm -f temacs${EXEEXT} prefix-args${EXEEXT} core *.core \#* *.o libXMenu11.a liblw.a rm -f ../etc/DOC - rm -f bootstrap-emacs${EXEEXT} emacs-${version}${EXEEXT} witness-emacs + rm -f bootstrap-emacs${EXEEXT} emacs-${version}${EXEEXT} rm -f buildobj.lst clean: mostlyclean rm -f emacs-*.*.*${EXEEXT} emacs${EXEEXT} @@ -1328,42 +1331,45 @@ tags: TAGS TAGS-LISP $(lwlibdir)TAGS To solve the circularity, we use 2 different Emacs executables, "emacs" is the main target and "bootstrap-emacs" is the one used to build the *.elc and loaddefs.el files. - To solve the freshness issue, we use a third file "witness-emacs" - which is used to witness the fact that there is a bootstrap-emacs - executable. */ + To solve the freshness issue, we used to use a third file "witness-emacs" + which was used to witness the fact that there is a bootstrap-emacs + executable, and then have dependencies on witness-emacs rather than + bootstrap-emacs, but that lead to problems in parallel builds (because + witness-emacs needed to be free from dependencies (to avoid rebuilding + it), so it was compiled in parallel, leading typically to having 2 + processes dumping bootstrap-emacs at the same time). + So instead, we replace the witness-emacs dependencies by conditional + bootstrap-dependencies (via ${BOOTSTRAPEMACS}). Of course, since we do + not want to rely on GNU Make features, we have to rely on an external + script to do the conditional part of the dependency + (i.e. see the ${SUBDIR} rule ../Makefile.in). */ -/* These suffix rules do not allow additional dependencies, sadly, so - adding a bootstrap-emacs%{EXEEXT} dependency does not work --Stef */ .SUFFIXES: .elc .el +/* These suffix rules do not allow additional dependencies, sadly, so + instead of adding a $(BOOTSTRAPEMACS) dependency here, we add it + separately below. + With GNU Make, we would just say "%.el : %.elc $(BOOTSTRAPEMACS)" */ .el.elc: @cd ../lisp; $(MAKE) $(MFLAGS) compile-onefile \ - THEFILE=$< EMACS=../src/bootstrap-emacs${EXEEXT} + 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 +/* Since the .el.elc rule cannot specify an extra dependency, we do it here. */ +${lisp} ${SOME_MACHINE_LISP}: $(BOOTSTRAPEMACS) -../lisp/loaddefs.el: witness-emacs +../lisp/loaddefs.el: $(BOOTSTRAPEMACS) cd ../lisp; $(MAKE) $(MFLAGS) autoloads EMACS=../src/bootstrap-emacs${EXEEXT} /* Dump an Emacs executable named bootstrap-emacs containing the files from loadup.el in source form. */ bootstrap-emacs${EXEEXT}: temacs${EXEEXT} + cd ../lisp; $(MAKE) $(MFLAGS) update-subdirs #ifdef CANNOT_DUMP ln temacs${EXEEXT} bootstrap-emacs${EXEEXT} #else $(RUN_TEMACS) --batch --load loadup bootstrap mv -f emacs${EXEEXT} bootstrap-emacs${EXEEXT} #endif /* ! defined (CANNOT_DUMP) */ - -witness-emacs: temacs${EXEEXT} - cd ../lisp; $(MAKE) $(MFLAGS) update-subdirs - $(MAKE) $(MFLAGS) bootstrap-emacs${EXEEXT} - touch witness-emacs @: Compile some files earlier to speed up further compilation. cd ../lisp; $(MAKE) $(MFLAGS) compile-first EMACS=../src/bootstrap-emacs${EXEEXT} -- cgit v1.2.1