From fc46d2193603d395a8aaf254fa07e450744e2eb2 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Sat, 21 Jun 2008 01:38:39 +0000 Subject: Make "make" do a bootstrap if needed. * src/Makefile.in (emacs${EXEEXT}): Link the new emacs to bootstrap-emacs. (bootstrapclean): Remove. (.el.elc): New rule. (PRECOMP): New var. (../lisp/subdirs.el): Remove. (bootstrap-emacs${EXEEXT}): Remove subdirs.el and charpro.el dependency. (witness-emacs): New target. (mostlyclean): Remove witness-emacs as well. (../lisp/loaddefs.el, ${lisp} ${SOME_MACHINE_LISP}): Add witness-emacs dependency. * lisp/loadup.el: Don't add emacs- name when bootstrapping. * lisp/Makefile.in (emacs-deps): Remove. ($(lisp)/cus-load.el, $(lisp)/finder-inf.el): Re-add. (all): Use them. (autogen-clean): Remove. * Makefile.in (maybe_bootstrap, src/bootstrap-emacs${EXEEXT}) (bootstrap-build): Remove. (top_bootclean): New var. (top_distclean, bootstrap-clean): Use it. (bootstrap): Don't recheck config. Make normally. --- src/ChangeLog | 13 +++++++++++++ src/Makefile.in | 52 ++++++++++++++++++++++++++++++++++++++++------------ 2 files changed, 53 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 83405f2e414..c3476f667d8 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,16 @@ +2008-06-21 Stefan Monnier + + * Makefile.in (emacs${EXEEXT}): Link the new emacs to bootstrap-emacs. + (bootstrapclean): Remove. + (.el.elc): New rule. + (PRECOMP): New var. + (../lisp/subdirs.el): Remove. + (bootstrap-emacs${EXEEXT}): Remove subdirs.el and charpro.el dependency. + (witness-emacs): New target. + (mostlyclean): Remove witness-emacs as well. + (../lisp/loaddefs.el, ${lisp} ${SOME_MACHINE_LISP}): + Add witness-emacs dependency. + 2008-06-20 Chong Yidong * font.c (Ffont_face_attributes): Omit key-attribute pairs not diff --git a/src/Makefile.in b/src/Makefile.in index 85b1c6c0f34..7f93441039a 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -912,6 +912,9 @@ emacs${EXEEXT}: temacs${EXEEXT} ${etc}DOC ${lisp} ${SOME_MACHINE_LISP} ln temacs${EXEEXT} emacs${EXEEXT} #else LC_ALL=C $(RUN_TEMACS) -batch -l loadup dump + @: This new Emacs is as functional and more efficient then + @: bootstrap-emacs, so let us replace it. + -ln -f emacs${EXEEXT} bootstrap-emacs${EXEEXT} #endif /* ! defined (CANNOT_DUMP) */ -./emacs -q -batch -f list-load-path-shadows @@ -1268,12 +1271,10 @@ ${emacsapp}Contents/MacOS/Emacs: emacs${EXEEXT} cd ${emacsapp}Contents/MacOS/; cp ../../../../src/emacs${EXEEXT} Emacs${EXEEXT} #endif -bootstrapclean: - rm -f bootstrap-emacs${EXEEXT} emacs-${version}${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} + rm -f bootstrap-emacs${EXEEXT} emacs-${version}${EXEEXT} witness-emacs rm -f buildobj.lst clean: mostlyclean rm -f emacs-*.*.*${EXEEXT} emacs${EXEEXT} @@ -1319,22 +1320,49 @@ tags: TAGS TAGS-LISP $(lwlibdir)TAGS /* Bootstrapping. */ - -bootstrap: bootstrap-emacs${EXEEXT} - -../lisp/subdirs.el: - cd $(lispsource); $(MAKE) update-subdirs - -../lisp/loaddefs.el: bootstrap-emacs${EXEEXT} - cd $(lispsource); $(MAKE) autoloads EMACS=../src/bootstrap-emacs${EXEEXT} +/* Bootstrapping right is difficult because of the circular dependencies. + Furthermore, we have to deal with the fact that many compilation targets + such as loaddefs.el or *.elc can typically be produced by any old + Emacs executable, so we would like to avoid rebuilding them whenever + we build a new Emacs executable. + 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. */ + +/* These suffix rules do not allow additional dependencies, sadly, so + adding a bootstrap-emacs%{EXEEXT} dependency does not work --Stef */ +.el.elc: + cd ${lispsource}; $(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 + +/* 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/loaddefs.el: witness-emacs + cd $(lispsource); $(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} ${lispsource}international/charprop.el ../lisp/subdirs.el +bootstrap-emacs${EXEEXT}: temacs${EXEEXT} #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: + cd $(lispsource); $(MAKE) $(MFLAGS) update-subdirs + $(MAKE) $(MFLAGS) bootstrap-emacs${EXEEXT} + touch witness-emacs -- cgit v1.2.1