aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2008-06-21 01:38:39 +0000
committerStefan Monnier2008-06-21 01:38:39 +0000
commitfc46d2193603d395a8aaf254fa07e450744e2eb2 (patch)
tree7cbffce7d24ea4adeabe982dea16e52561300668
parent5989ba2f87b231d9421ec13fb9e0811767921aa5 (diff)
downloademacs-fc46d2193603d395a8aaf254fa07e450744e2eb2.tar.gz
emacs-fc46d2193603d395a8aaf254fa07e450744e2eb2.zip
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.
-rw-r--r--ChangeLog8
-rw-r--r--Makefile.in53
-rw-r--r--lisp/ChangeLog9
-rw-r--r--lisp/Makefile.in53
-rw-r--r--lisp/loadup.el18
-rw-r--r--src/ChangeLog13
-rw-r--r--src/Makefile.in52
7 files changed, 118 insertions, 88 deletions
diff --git a/ChangeLog b/ChangeLog
index 7ce8e321a18..f697fd6baa7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
12008-06-21 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * Makefile.in (maybe_bootstrap, src/bootstrap-emacs${EXEEXT})
4 (bootstrap-build): Remove.
5 (top_bootclean): New var.
6 (top_distclean, bootstrap-clean): Use it.
7 (bootstrap): Don't recheck config. Make normally.
8
12008-06-20 Stefan Monnier <monnier@iro.umontreal.ca> 92008-06-20 Stefan Monnier <monnier@iro.umontreal.ca>
2 10
3 * Makefile.in (SUBDIR): Include `lisp'. 11 * Makefile.in (SUBDIR): Include `lisp'.
diff --git a/Makefile.in b/Makefile.in
index 2b313dffa56..ceb1d3abe3b 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -54,8 +54,8 @@
54# Still more severe - delete backup and autosave files, too. 54# Still more severe - delete backup and autosave files, too.
55# 55#
56# make bootstrap 56# make bootstrap
57# Recompiles all the Emacs Lisp files using the latest source, 57# Removes all the compiled files to force a new bootstrap from a
58# then rebuilds Emacs. 58# clean slate, and then build in the normal way.
59 59
60SHELL = /bin/sh 60SHELL = /bin/sh
61 61
@@ -315,7 +315,7 @@ lib-src: FRC src/config.stamp
315# We need to build `emacs' in `src' to compile the *.elc files in `lisp'. 315# We need to build `emacs' in `src' to compile the *.elc files in `lisp'.
316lisp: src 316lisp: src
317 317
318${SUBDIR}: maybe_bootstrap ${SUBDIR_MAKEFILES} FRC 318${SUBDIR}: ${SUBDIR_MAKEFILES} FRC
319 cd $@; $(MAKE) all $(MFLAGS) \ 319 cd $@; $(MAKE) all $(MFLAGS) \
320 CC='${CC}' CFLAGS='${CFLAGS}' CPPFLAGS='${CPPFLAGS}' \ 320 CC='${CC}' CFLAGS='${CFLAGS}' CPPFLAGS='${CPPFLAGS}' \
321 LDFLAGS='${LDFLAGS}' MAKE='${MAKE}' 321 LDFLAGS='${LDFLAGS}' MAKE='${MAKE}'
@@ -706,6 +706,11 @@ clean: FRC
706 -(cd doc/lispintro && $(MAKE) $(MFLAGS) clean) 706 -(cd doc/lispintro && $(MAKE) $(MFLAGS) clean)
707 (cd leim; $(MAKE) $(MFLAGS) clean) 707 (cd leim; $(MAKE) $(MFLAGS) clean)
708 708
709### `bootclean'
710### Delete all files that need to be remade for a clean bootstrap.
711top_bootclean=\
712 rm -f config.cache config.log ; \
713 if [ -d lock ] ; then (cd lock && (rm -f * || true)); else true; fi
709### `distclean' 714### `distclean'
710### Delete all files from the current directory that are created by 715### Delete all files from the current directory that are created by
711### configuring or building the program. If you have unpacked the 716### configuring or building the program. If you have unpacked the
@@ -713,9 +718,8 @@ clean: FRC
713### `make distclean' should leave only the files that were in the 718### `make distclean' should leave only the files that were in the
714### distribution. 719### distribution.
715top_distclean=\ 720top_distclean=\
716 rm -f config.cache config.log ; \ 721 ${top_bootclean}; \
717 rm -f Makefile ${SUBDIR_MAKEFILES} ; \ 722 rm -f config.status Makefile ${SUBDIR_MAKEFILES}
718 if [ -d lock ] ; then (cd lock && (rm -f * || true)); else true; fi
719distclean: FRC 723distclean: FRC
720 (cd src; $(MAKE) $(MFLAGS) distclean) 724 (cd src; $(MAKE) $(MFLAGS) distclean)
721 (cd oldXMenu; $(MAKE) $(MFLAGS) distclean) 725 (cd oldXMenu; $(MAKE) $(MFLAGS) distclean)
@@ -742,8 +746,8 @@ bootstrap-clean: FRC
742 -(cd doc/lispref && $(MAKE) $(MFLAGS) maintainer-clean) 746 -(cd doc/lispref && $(MAKE) $(MFLAGS) maintainer-clean)
743 -(cd doc/lispintro && $(MAKE) $(MFLAGS) maintainer-clean) 747 -(cd doc/lispintro && $(MAKE) $(MFLAGS) maintainer-clean)
744 (cd leim; $(MAKE) $(MFLAGS) maintainer-clean) 748 (cd leim; $(MAKE) $(MFLAGS) maintainer-clean)
745 (cd lisp; $(MAKE) $(MFLAGS) maintainer-clean) 749 (cd lisp; $(MAKE) $(MFLAGS) bootstrap-clean)
746 ${top_distclean} 750 ${top_bootclean}
747 751
748### `maintainer-clean' 752### `maintainer-clean'
749### Delete everything from the current directory that can be 753### Delete everything from the current directory that can be
@@ -756,9 +760,10 @@ bootstrap-clean: FRC
756### Makefile. More generally, `make maintainer-clean' should not delete 760### Makefile. More generally, `make maintainer-clean' should not delete
757### anything that needs to exist in order to run `configure' and then 761### anything that needs to exist in order to run `configure' and then
758### begin to build the program. 762### begin to build the program.
759maintainer-clean: bootstrap-clean 763maintainer-clean: bootstrap-clean FRC
760 (cd src; $(MAKE) $(MFLAGS) maintainer-clean) 764 (cd src; $(MAKE) $(MFLAGS) maintainer-clean)
761 -rm -f config.status 765 (cd lisp; $(MAKE) $(MFLAGS) maintainer-clean)
766 ${top_distclean}
762 767
763### This doesn't actually appear in the coding standards, but Karl 768### This doesn't actually appear in the coding standards, but Karl
764### says GCC supports it, and that's where the configuration part of 769### says GCC supports it, and that's where the configuration part of
@@ -829,41 +834,17 @@ dvi:
829#### Bootstrapping. 834#### Bootstrapping.
830 835
831### This first cleans the lisp subdirectory, removing all compiled 836### This first cleans the lisp subdirectory, removing all compiled
832### Lisp files. Then a special emacs executable is built from Lisp 837### Lisp files. Then re-run make to build all the files anew.
833### sources, which is then used to compile Lisp files. The last step
834### is a "normal" make.
835 838
836.PHONY: bootstrap 839.PHONY: bootstrap
837.PHONY: bootstrap-build
838.PHONY: maybe_bootstrap
839
840maybe_bootstrap:
841 @bar="`echo $(srcdir)/lisp/*.elc`"; \
842 if [ \( "$$bar" = '$(srcdir)/lisp/*.elc' \) -o \( "$$bar" = '' \) ]; then \
843 echo "Your tree does not include the compiled Lisp files."; \
844 echo "You need to do \`make bootstrap' to build Emacs."; \
845 exit 1;\
846 fi
847 840
848bootstrap: bootstrap-clean FRC 841bootstrap: bootstrap-clean FRC
849 if [ -x ./config.status ]; then \ 842 if [ -x ./config.status ]; then \
850 ./config.status --recheck; \
851 ./config.status; \ 843 ./config.status; \
852 else \ 844 else \
853 ./configure --enable-maintainer-mode; \ 845 ./configure --enable-maintainer-mode; \
854 fi 846 fi
855 $(MAKE) $(MFLAGS) info bootstrap-build 847 $(MAKE) $(MFLAGS) info all
856
857src/bootstrap-emacs${EXEEXT}:
858 (cd src; $(MAKE) $(MFLAGS) bootstrap-emacs${EXEEXT})
859
860## There used to be a src; mostlyclean before all, but it does not
861## seem to serve any purpose, and compiles things twice.
862## http://lists.gnu.org/archive/html/emacs-devel/2008-06/msg00104.html
863bootstrap-build: src/bootstrap-emacs$(EXEEXT) FRC
864 (cd lisp; $(MAKE) $(MFLAGS) bootstrap EMACS=../src/bootstrap-emacs${EXEEXT})
865 $(MAKE) $(MFLAGS) all
866 (cd lisp; $(MAKE) $(MFLAGS) bootstrap-after)
867 848
868.PHONY: check-declare 849.PHONY: check-declare
869 850
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index bed038f31ef..817dc58ecdd 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,12 @@
12008-06-21 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * loadup.el: Don't add emacs-<VERS> name when bootstrapping.
4
5 * Makefile.in (emacs-deps): Remove.
6 ($(lisp)/cus-load.el, $(lisp)/finder-inf.el): Re-add.
7 (all): Use them.
8 (autogen-clean): Remove.
9
12008-06-20 Stefan Monnier <monnier@iro.umontreal.ca> 102008-06-20 Stefan Monnier <monnier@iro.umontreal.ca>
2 11
3 * Makefile.in (all): New target. 12 * Makefile.in (all): New target.
diff --git a/lisp/Makefile.in b/lisp/Makefile.in
index 9b354b9bdf6..0633324b714 100644
--- a/lisp/Makefile.in
+++ b/lisp/Makefile.in
@@ -77,8 +77,6 @@ COMPILE_FIRST = \
77# The actual Emacs command run in the targets below. 77# The actual Emacs command run in the targets below.
78 78
79emacs = EMACSLOADPATH=$(lisp) LC_ALL=C $(EMACS) $(EMACSOPT) 79emacs = EMACSLOADPATH=$(lisp) LC_ALL=C $(EMACS) $(EMACSOPT)
80# Prerequisites for running $(emacs)
81emacs-deps = $(lisp)/subdirs.el
82 80
83# Common command to find subdirectories 81# Common command to find subdirectories
84 82
@@ -100,7 +98,9 @@ setwins_almost=subdirs=`(cd $$wd; find . -type d -print)`; \
100 98
101# `compile-main' tends to be slower than `recompile' but can be parallelized 99# `compile-main' tends to be slower than `recompile' but can be parallelized
102# with "make -j" and results in more deterministic compilation warnings. 100# with "make -j" and results in more deterministic compilation warnings.
103all: compile-main 101# cus-load ans finder-inf are not explicitly requested by anything, so
102# we add them here to make sure they get built.
103all: compile-main $(lisp)/cus-load.el $(lisp)/finder-inf.el
104 104
105doit: 105doit:
106 106
@@ -117,27 +117,31 @@ doit:
117# bootstrap-after would modify loaddefs after src/emacs, resulting 117# bootstrap-after would modify loaddefs after src/emacs, resulting
118# in make install remaking src/emacs for no real reason: 118# in make install remaking src/emacs for no real reason:
119# http://lists.gnu.org/archive/html/emacs-devel/2008-02/msg00311.html 119# http://lists.gnu.org/archive/html/emacs-devel/2008-02/msg00311.html
120custom-deps: $(emacs-deps) doit 120$(lisp)/cus-load.el:
121 $(MAKE) $(MFLAGS) custom-deps
122custom-deps: doit
121 wd=$(lisp); $(setwins_almost); \ 123 wd=$(lisp); $(setwins_almost); \
122 echo Directories: $$wins; \ 124 echo Directories: $$wins; \
123 $(emacs) -l cus-dep --eval '(setq generated-custom-dependencies-file "$(lisp)/cus-load.el")' -f custom-make-dependencies $$wins 125 $(emacs) -l cus-dep --eval '(setq generated-custom-dependencies-file "$(lisp)/cus-load.el")' -f custom-make-dependencies $$wins
124 126
125finder-data: $(emacs-deps) doit 127$(lisp)/finder-inf.el:
128 $(MAKE) $(MFLAGS) finder-data
129finder-data: doit
126 wd=$(lisp); $(setwins_almost); \ 130 wd=$(lisp); $(setwins_almost); \
127 echo Directories: $$wins; \ 131 echo Directories: $$wins; \
128 $(emacs) -l finder --eval '(setq generated-finder-keywords-file "$(lisp)/finder-inf.el")' -f finder-compile-keywords-make-dist $$wins 132 $(emacs) -l finder --eval '(setq generated-finder-keywords-file "$(lisp)/finder-inf.el")' -f finder-compile-keywords-make-dist $$wins
129 133
130# The chmod +w is to handle env var CVSREAD=1. Files named 134# The chmod +w is to handle env var CVSREAD=1. Files named
131# are identified by being the value of `generated-autoload-file'. 135# are identified by being the value of `generated-autoload-file'.
132autoloads: $(emacs-deps) $(LOADDEFS) doit 136autoloads: $(LOADDEFS) doit
133 chmod +w $(lisp)/ps-print.el $(lisp)/emulation/tpu-edt.el \ 137 chmod +w $(lisp)/ps-print.el $(lisp)/emulation/tpu-edt.el \
134 $(lisp)/emacs-lisp/cl-loaddefs.el 138 $(lisp)/emacs-lisp/cl-loaddefs.el
135 wd=$(lisp); $(setwins_almost); \ 139 wd=$(lisp); $(setwins_almost); \
136 echo Directories: $$wins; \ 140 echo Directories: $$wins; \
137 $(emacs) -l autoload --eval '(setq generated-autoload-file "$(lisp)/loaddefs.el")' -f batch-update-autoloads $$wins 141 $(emacs) -l autoload --eval '(setq generated-autoload-file "$(lisp)/loaddefs.el")' -f batch-update-autoloads $$wins
138 142
139# Note: every rule that runs $(emacs) and is called during bootstrap must 143# This is required by the witness-emacs target in ../src/Makefile, so
140# depend on this. 144# we know that if we have an emacs executable, we also have a subdirs.el.
141$(lisp)/subdirs.el: 145$(lisp)/subdirs.el:
142 $(MAKE) $(MFLAGS) update-subdirs 146 $(MAKE) $(MFLAGS) update-subdirs
143update-subdirs: doit 147update-subdirs: doit
@@ -1254,7 +1258,7 @@ ELCFILES = \
1254 1258
1255.PHONY: compile-first compile-main compile-last compile compile-always 1259.PHONY: compile-first compile-main compile-last compile compile-always
1256 1260
1257compile-first: $(emacs-deps) $(LOADDEFS) autoloads $(COMPILE_FIRST) 1261compile-first: $(LOADDEFS) autoloads $(COMPILE_FIRST)
1258 for el in $(COMPILE_FIRST); do \ 1262 for el in $(COMPILE_FIRST); do \
1259 echo Compiling $$el; \ 1263 echo Compiling $$el; \
1260 $(emacs) $(BYTE_COMPILE_EXTRA_FLAGS) -f batch-byte-compile-if-not-done $$el || exit 1; \ 1264 $(emacs) $(BYTE_COMPILE_EXTRA_FLAGS) -f batch-byte-compile-if-not-done $$el || exit 1; \
@@ -1268,7 +1272,7 @@ compile-main: $(ELCFILES)
1268# Calling make recursively because suffix rule cannot have prerequisites. 1272# Calling make recursively because suffix rule cannot have prerequisites.
1269# Explicitly pass EMACS (sometimes ../src/bootstrap-emacs) to those 1273# Explicitly pass EMACS (sometimes ../src/bootstrap-emacs) to those
1270# sub-makes that run rules that use it, for the sake of some non-GNU makes. 1274# sub-makes that run rules that use it, for the sake of some non-GNU makes.
1271compile: $(emacs-deps) $(LOADDEFS) autoloads compile-first 1275compile: $(LOADDEFS) autoloads compile-first
1272 $(MAKE) $(MFLAGS) compile-main EMACS=$(EMACS) 1276 $(MAKE) $(MFLAGS) compile-main EMACS=$(EMACS)
1273 $(MAKE) $(MFLAGS) compile-last EMACS=$(EMACS) 1277 $(MAKE) $(MFLAGS) compile-last EMACS=$(EMACS)
1274 1278
@@ -1349,7 +1353,7 @@ MH_E_SRC = $(MH_E_DIR)/mh-acros.el $(MH_E_DIR)/mh-alias.el \
1349 $(MH_E_DIR)/mh-xface.el 1353 $(MH_E_DIR)/mh-xface.el
1350 1354
1351mh-autoloads: $(MH_E_DIR)/mh-loaddefs.el 1355mh-autoloads: $(MH_E_DIR)/mh-loaddefs.el
1352$(MH_E_DIR)/mh-loaddefs.el: $(emacs-deps) $(MH_E_SRC) 1356$(MH_E_DIR)/mh-loaddefs.el: $(MH_E_SRC)
1353 $(emacs) -l autoload \ 1357 $(emacs) -l autoload \
1354 --eval "(setq generate-autoload-cookie \";;;###mh-autoload\")" \ 1358 --eval "(setq generate-autoload-cookie \";;;###mh-autoload\")" \
1355 --eval "(setq generated-autoload-file \"$@\")" \ 1359 --eval "(setq generated-autoload-file \"$@\")" \
@@ -1371,21 +1375,21 @@ CAL_SRC = $(CAL_DIR)/cal-bahai.el $(CAL_DIR)/cal-china.el \
1371 $(CAL_DIR)/holidays.el $(CAL_DIR)/lunar.el \ 1375 $(CAL_DIR)/holidays.el $(CAL_DIR)/lunar.el \
1372 $(CAL_DIR)/solar.el 1376 $(CAL_DIR)/solar.el
1373 1377
1374$(CAL_DIR)/cal-loaddefs.el: $(emacs-deps) $(CAL_SRC) 1378$(CAL_DIR)/cal-loaddefs.el: $(CAL_SRC)
1375 $(emacs) -l autoload \ 1379 $(emacs) -l autoload \
1376 --eval "(setq generate-autoload-cookie \";;;###cal-autoload\")" \ 1380 --eval "(setq generate-autoload-cookie \";;;###cal-autoload\")" \
1377 --eval "(setq generated-autoload-file \"$@\")" \ 1381 --eval "(setq generated-autoload-file \"$@\")" \
1378 --eval "(setq make-backup-files nil)" \ 1382 --eval "(setq make-backup-files nil)" \
1379 -f batch-update-autoloads $(CAL_DIR) 1383 -f batch-update-autoloads $(CAL_DIR)
1380 1384
1381$(CAL_DIR)/diary-loaddefs.el: $(emacs-deps) $(CAL_SRC) 1385$(CAL_DIR)/diary-loaddefs.el: $(CAL_SRC)
1382 $(emacs) -l autoload \ 1386 $(emacs) -l autoload \
1383 --eval "(setq generate-autoload-cookie \";;;###diary-autoload\")" \ 1387 --eval "(setq generate-autoload-cookie \";;;###diary-autoload\")" \
1384 --eval "(setq generated-autoload-file \"$@\")" \ 1388 --eval "(setq generated-autoload-file \"$@\")" \
1385 --eval "(setq make-backup-files nil)" \ 1389 --eval "(setq make-backup-files nil)" \
1386 -f batch-update-autoloads $(CAL_DIR) 1390 -f batch-update-autoloads $(CAL_DIR)
1387 1391
1388$(CAL_DIR)/hol-loaddefs.el: $(emacs-deps) $(CAL_SRC) 1392$(CAL_DIR)/hol-loaddefs.el: $(CAL_SRC)
1389 $(emacs) -l autoload \ 1393 $(emacs) -l autoload \
1390 --eval "(setq generate-autoload-cookie \";;;###holiday-autoload\")" \ 1394 --eval "(setq generate-autoload-cookie \";;;###holiday-autoload\")" \
1391 --eval "(setq generated-autoload-file \"$@\")" \ 1395 --eval "(setq generated-autoload-file \"$@\")" \
@@ -1405,25 +1409,12 @@ $(CAL_DIR)/hol-loaddefs.el: $(emacs-deps) $(CAL_SRC)
1405# local changes. (Because loaddefs.el is an automatically generated 1409# local changes. (Because loaddefs.el is an automatically generated
1406# file, we don't want to store it in the source repository). 1410# file, we don't want to store it in the source repository).
1407 1411
1408autogen-clean: 1412bootstrap-clean:
1409 cd $(lisp); rm -f $(AUTOGENEL) 1413 cd $(lisp); rm -f *.elc */*.elc $(AUTOGENEL)
1410 1414
1411maintainer-clean: distclean bootstrap-clean 1415distclean: bootstrap-clean
1412
1413bootstrap-clean: autogen-clean
1414 cd $(lisp); rm -f *.elc */*.elc
1415
1416# Generate/update files for the bootstrap process.
1417
1418bootstrap: update-subdirs autoloads compile
1419
1420# Generate/update files after the bootstrap process.
1421# custom-deps needs `preloaded-file-list'.
1422
1423bootstrap-after: finder-data custom-deps
1424
1425distclean:
1426 -rm -f ./Makefile 1416 -rm -f ./Makefile
1417maintainer-clean: distclean
1427 1418
1428.PHONY: check-declare 1419.PHONY: check-declare
1429 1420
diff --git a/lisp/loadup.el b/lisp/loadup.el
index 805f82c09f4..eb51d10ee9e 100644
--- a/lisp/loadup.el
+++ b/lisp/loadup.el
@@ -343,14 +343,9 @@
343 (message "Dumping data as file temacs.dump") 343 (message "Dumping data as file temacs.dump")
344 (dump-emacs "temacs.dump" "temacs") 344 (dump-emacs "temacs.dump" "temacs")
345 (kill-emacs)) 345 (kill-emacs))
346 (let ((name (concat "emacs-" emacs-version))) 346 (if (memq system-type '(ms-dos windows-nt cygwin))
347 (while (string-match "[^-+_.a-zA-Z0-9]+" name) 347 (message "Dumping under the name emacs")
348 (setq name (concat (downcase (substring name 0 (match-beginning 0))) 348 (message "Dumping under the name emacs"))
349 "-"
350 (substring name (match-end 0)))))
351 (if (memq system-type '(ms-dos windows-nt cygwin))
352 (message "Dumping under the name emacs")
353 (message "Dumping under names emacs and %s" name)))
354 (condition-case () 349 (condition-case ()
355 (delete-file "emacs") 350 (delete-file "emacs")
356 (file-error nil)) 351 (file-error nil))
@@ -361,12 +356,17 @@
361 (dump-emacs "emacs" "temacs") 356 (dump-emacs "emacs" "temacs")
362 (message "%d pure bytes used" pure-bytes-used) 357 (message "%d pure bytes used" pure-bytes-used)
363 ;; Recompute NAME now, so that it isn't set when we dump. 358 ;; Recompute NAME now, so that it isn't set when we dump.
364 (if (not (memq system-type '(ms-dos windows-nt cygwin))) 359 (if (not (or (memq system-type '(ms-dos windows-nt cygwin))
360 ;; Don't bother adding another name if we're just
361 ;; building bootstrap-emacs.
362 (equal (nth 3 command-line-args) "bootstrap")
363 (equal (nth 4 command-line-args) "bootstrap")))
365 (let ((name (concat "emacs-" emacs-version))) 364 (let ((name (concat "emacs-" emacs-version)))
366 (while (string-match "[^-+_.a-zA-Z0-9]+" name) 365 (while (string-match "[^-+_.a-zA-Z0-9]+" name)
367 (setq name (concat (downcase (substring name 0 (match-beginning 0))) 366 (setq name (concat (downcase (substring name 0 (match-beginning 0)))
368 "-" 367 "-"
369 (substring name (match-end 0))))) 368 (substring name (match-end 0)))))
369 (message "Adding name %s" name)
370 (add-name-to-file "emacs" name t))) 370 (add-name-to-file "emacs" name t)))
371 (kill-emacs))) 371 (kill-emacs)))
372 372
diff --git a/src/ChangeLog b/src/ChangeLog
index 83405f2e414..c3476f667d8 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,16 @@
12008-06-21 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * Makefile.in (emacs${EXEEXT}): Link the new emacs to bootstrap-emacs.
4 (bootstrapclean): Remove.
5 (.el.elc): New rule.
6 (PRECOMP): New var.
7 (../lisp/subdirs.el): Remove.
8 (bootstrap-emacs${EXEEXT}): Remove subdirs.el and charpro.el dependency.
9 (witness-emacs): New target.
10 (mostlyclean): Remove witness-emacs as well.
11 (../lisp/loaddefs.el, ${lisp} ${SOME_MACHINE_LISP}):
12 Add witness-emacs dependency.
13
12008-06-20 Chong Yidong <cyd@stupidchicken.com> 142008-06-20 Chong Yidong <cyd@stupidchicken.com>
2 15
3 * font.c (Ffont_face_attributes): Omit key-attribute pairs not 16 * 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}
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
@@ -1268,12 +1271,10 @@ ${emacsapp}Contents/MacOS/Emacs: emacs${EXEEXT}
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
1271bootstrapclean:
1272 rm -f bootstrap-emacs${EXEEXT} emacs-${version}${EXEEXT}
1273mostlyclean: 1274mostlyclean:
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
1278clean: mostlyclean 1279clean: mostlyclean
1279 rm -f emacs-*.*.*${EXEEXT} emacs${EXEEXT} 1280 rm -f emacs-*.*.*${EXEEXT} emacs${EXEEXT}
@@ -1319,22 +1320,49 @@ tags: TAGS TAGS-LISP $(lwlibdir)TAGS
1319 1320
1320 1321
1321/* Bootstrapping. */ 1322/* Bootstrapping. */
1322 1323/* Bootstrapping right is difficult because of the circular dependencies.
1323bootstrap: 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. */
1341PRECOMP=../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
1334bootstrap-emacs${EXEEXT}: temacs${EXEEXT} ${lispsource}international/charprop.el ../lisp/subdirs.el 1357bootstrap-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
1365witness-emacs:
1366 cd $(lispsource); $(MAKE) $(MFLAGS) update-subdirs
1367 $(MAKE) $(MFLAGS) bootstrap-emacs${EXEEXT}
1368 touch witness-emacs