comparison src/Makefile.in @ 96137:eae2eee28ad3

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-<VERS> 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.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Sat, 21 Jun 2008 01:38:39 +0000
parents d143e6de14ec
children 41be5bc2426e
comparison
equal deleted inserted replaced
96136:73e422173a87 96137:eae2eee28ad3
910 #ifdef CANNOT_DUMP 910 #ifdef CANNOT_DUMP
911 rm -f emacs${EXEEXT} 911 rm -f emacs${EXEEXT}
912 ln temacs${EXEEXT} emacs${EXEEXT} 912 ln temacs${EXEEXT} emacs${EXEEXT}
913 #else 913 #else
914 LC_ALL=C $(RUN_TEMACS) -batch -l loadup dump 914 LC_ALL=C $(RUN_TEMACS) -batch -l loadup dump
915 @: This new Emacs is as functional and more efficient then
916 @: bootstrap-emacs, so let us replace it.
917 -ln -f emacs${EXEEXT} bootstrap-emacs${EXEEXT}
915 #endif /* ! defined (CANNOT_DUMP) */ 918 #endif /* ! defined (CANNOT_DUMP) */
916 -./emacs -q -batch -f list-load-path-shadows 919 -./emacs -q -batch -f list-load-path-shadows
917 920
918 /* We run make-docfile twice because the command line may get too long 921 /* We run make-docfile twice because the command line may get too long
919 on some systems. */ 922 on some systems. */
1266 ${emacsapp}Contents/MacOS/Emacs: emacs${EXEEXT} 1269 ${emacsapp}Contents/MacOS/Emacs: emacs${EXEEXT}
1267 mkdir -p ${emacsapp}Contents/MacOS/; 1270 mkdir -p ${emacsapp}Contents/MacOS/;
1268 cd ${emacsapp}Contents/MacOS/; cp ../../../../src/emacs${EXEEXT} Emacs${EXEEXT} 1271 cd ${emacsapp}Contents/MacOS/; cp ../../../../src/emacs${EXEEXT} Emacs${EXEEXT}
1269 #endif 1272 #endif
1270 1273
1271 bootstrapclean:
1272 rm -f bootstrap-emacs${EXEEXT} emacs-${version}${EXEEXT}
1273 mostlyclean: 1274 mostlyclean:
1274 rm -f temacs${EXEEXT} prefix-args${EXEEXT} core *.core \#* *.o libXMenu11.a liblw.a 1275 rm -f temacs${EXEEXT} prefix-args${EXEEXT} core *.core \#* *.o libXMenu11.a liblw.a
1275 rm -f ../etc/DOC 1276 rm -f ../etc/DOC
1276 rm -f bootstrap-emacs${EXEEXT} emacs-${version}${EXEEXT} 1277 rm -f bootstrap-emacs${EXEEXT} emacs-${version}${EXEEXT} witness-emacs
1277 rm -f buildobj.lst 1278 rm -f buildobj.lst
1278 clean: mostlyclean 1279 clean: mostlyclean
1279 rm -f emacs-*.*.*${EXEEXT} emacs${EXEEXT} 1280 rm -f emacs-*.*.*${EXEEXT} emacs${EXEEXT}
1280 /**/# This is used in making a distribution. 1281 /**/# This is used in making a distribution.
1281 /**/# Do not use it on development directories! 1282 /**/# Do not use it on development directories!
1317 tags: TAGS TAGS-LISP $(lwlibdir)TAGS 1318 tags: TAGS TAGS-LISP $(lwlibdir)TAGS
1318 .PHONY: tags 1319 .PHONY: tags
1319 1320
1320 1321
1321 /* Bootstrapping. */ 1322 /* Bootstrapping. */
1322 1323 /* Bootstrapping right is difficult because of the circular dependencies.
1323 bootstrap: bootstrap-emacs${EXEEXT} 1324 Furthermore, we have to deal with the fact that many compilation targets
1324 1325 such as loaddefs.el or *.elc can typically be produced by any old
1325 ../lisp/subdirs.el: 1326 Emacs executable, so we would like to avoid rebuilding them whenever
1326 cd $(lispsource); $(MAKE) update-subdirs 1327 we build a new Emacs executable.
1327 1328 To solve the circularity, we use 2 different Emacs executables,
1328 ../lisp/loaddefs.el: bootstrap-emacs${EXEEXT} 1329 "emacs" is the main target and "bootstrap-emacs" is the one used
1329 cd $(lispsource); $(MAKE) autoloads EMACS=../src/bootstrap-emacs${EXEEXT} 1330 to build the *.elc and loaddefs.el files.
1331 To solve the freshness issue, we use a third file "witness-emacs"
1332 which is used to witness the fact that there is a bootstrap-emacs
1333 executable. */
1334
1335 /* These suffix rules do not allow additional dependencies, sadly, so
1336 adding a bootstrap-emacs%{EXEEXT} dependency does not work --Stef */
1337 .el.elc:
1338 cd ${lispsource}; $(MAKE) $(MFLAGS) $@ EMACS=../src/bootstrap-emacs${EXEEXT}
1339
1340 /* Files that need to be compiled early to speed up further compilation. */
1341 PRECOMP=../lisp/emacs-lisp/bytecomp.elc ../lisp/emacs-lisp/byte-opt.elc
1342 ${PRECOMP}: witness-emacs
1343
1344 /* Since the .el.elc rule cannot specify an extra dependency, we do it here.
1345 The byte-compiler dependency is not necessary, but it substantially
1346 speeds up byte-compilation of the other files.
1347 Of course, it also has the downside of forcing a recompilation of all
1348 those files whenever a file in $PRECOMP changes. */
1349 ${lisp} ${SOME_MACHINE_LISP}: witness-emacs ${PRECOMP}
1350
1351 ../lisp/loaddefs.el: witness-emacs
1352 cd $(lispsource); $(MAKE) $(MFLAGS) autoloads EMACS=../src/bootstrap-emacs${EXEEXT}
1330 1353
1331 /* Dump an Emacs executable named bootstrap-emacs containing the 1354 /* Dump an Emacs executable named bootstrap-emacs containing the
1332 files from loadup.el in source form. */ 1355 files from loadup.el in source form. */
1333 1356
1334 bootstrap-emacs${EXEEXT}: temacs${EXEEXT} ${lispsource}international/charprop.el ../lisp/subdirs.el 1357 bootstrap-emacs${EXEEXT}: temacs${EXEEXT}
1335 #ifdef CANNOT_DUMP 1358 #ifdef CANNOT_DUMP
1336 ln temacs${EXEEXT} bootstrap-emacs${EXEEXT} 1359 ln temacs${EXEEXT} bootstrap-emacs${EXEEXT}
1337 #else 1360 #else
1338 $(RUN_TEMACS) --batch --load loadup bootstrap 1361 $(RUN_TEMACS) --batch --load loadup bootstrap
1339 mv -f emacs${EXEEXT} bootstrap-emacs${EXEEXT} 1362 mv -f emacs${EXEEXT} bootstrap-emacs${EXEEXT}
1340 #endif /* ! defined (CANNOT_DUMP) */ 1363 #endif /* ! defined (CANNOT_DUMP) */
1364
1365 witness-emacs:
1366 cd $(lispsource); $(MAKE) $(MFLAGS) update-subdirs
1367 $(MAKE) $(MFLAGS) bootstrap-emacs${EXEEXT}
1368 touch witness-emacs