# Maintenance productions for the Lisp directory
-# Copyright (C) 2000-2012 Free Software Foundation, Inc.
+# Copyright (C) 2000-2013 Free Software Foundation, Inc.
# This file is part of GNU Emacs.
# During bootstrapping the byte-compiler is run interpreted when compiling
# itself, and uses more stack than usual.
#
-BIG_STACK_DEPTH = 1200
+BIG_STACK_DEPTH = 2200
BIG_STACK_OPTS = --eval "(setq max-lisp-eval-depth $(BIG_STACK_DEPTH))"
BYTE_COMPILE_FLAGS = $(BIG_STACK_OPTS) $(BYTE_COMPILE_EXTRA_FLAGS)
# Files to compile before others during a bootstrap. This is done to
-# speed up the bootstrap process.
+# speed up the bootstrap process. They're ordered by size, so we use
+# the slowest-compiler on the smallest file and move to larger files as the
+# compiler gets faster. `autoload.elc' comes last because it is not used by
+# the compiler (so its compilation does not speed up subsequent compilations),
+# it's only placed here so as to speed up generation of the loaddefs.el file.
COMPILE_FIRST = \
- $(lisp)/emacs-lisp/bytecomp.elc \
- $(lisp)/emacs-lisp/byte-opt.elc \
$(lisp)/emacs-lisp/macroexp.elc \
- $(lisp)/emacs-lisp/cconv.elc \
+ $(lisp)/emacs-lisp/cconv.elc \
+ $(lisp)/emacs-lisp/byte-opt.elc \
+ $(lisp)/emacs-lisp/bytecomp.elc \
$(lisp)/emacs-lisp/autoload.elc
# The actual Emacs command run in the targets below.
emacs = EMACSLOADPATH=$(lisp) LC_ALL=C $(EMACS) $(EMACSOPT)
# Common command to find subdirectories
-setwins=subdirs=`(find . -type d -print)`; \
+setwins=subdirs=`find . -type d -print`; \
for file in $$subdirs; do \
case $$file in */.* | */.*/* | */=* ) ;; \
*) wins="$$wins $$file" ;; \
done
# Find all subdirectories except `obsolete' and `term'.
-setwins_almost=subdirs=`(find . -type d -print)`; \
+setwins_almost=subdirs=`find . -type d -print`; \
for file in $$subdirs; do \
case $$file in */.* | */.*/* | */=* | */obsolete | */term ) ;; \
*) wins="$$wins $$file" ;; \
done
# Find all subdirectories in which we might want to create subdirs.el
-setwins_for_subdirs=subdirs=`(find . -type d -print)`; \
+setwins_for_subdirs=subdirs=`find . -type d -print`; \
for file in $$subdirs; do \
case $$file in */.* | */.*/* | */=* | */cedet* ) ;; \
*) wins="$$wins $$file" ;; \
esac; \
done
-# `compile-main' tends to be slower than `recompile' but can be parallelized
-# with "make -j" and results in more deterministic compilation warnings.
# cus-load and finder-inf are not explicitly requested by anything, so
# we add them here to make sure they get built.
all: compile-main $(lisp)/cus-load.el $(lisp)/finder-inf.el
doit:
+.PHONY: all doit custom-deps finder-data autoloads update-subdirs
+
# custom-deps and finder-data both used to scan _all_ the *.el files.
# This could lead to problems in parallel builds if automatically
# generated *.el files (eg loaddefs etc) were being changed at the same time.
update-subdirs: doit
cd $(lisp); $(setwins_for_subdirs); \
for file in $$wins; do \
- $(top_srcdir)/update-subdirs $$file; \
+ $(top_srcdir)/build-aux/update-subdirs $$file; \
done;
-updates: update-subdirs autoloads finder-data custom-deps
+.PHONY: updates bzr-update update-authors
-# This is useful after "bzr up".
-bzr-update: recompile autoloads finder-data custom-deps
+# Some modes of make-dist use this.
+updates: update-subdirs autoloads finder-data custom-deps
-# For backwards compatibility:
-cvs-update: bzr-update
+# This is useful after "bzr up"; but it doesn't do anything that a
+# plain "make" at top-level doesn't.
+# The only difference between this and this directory's "all" rule
+# is that this runs "autoloads" as well (because it uses "compile"
+# rather than "compile-main"). In a bootstrap, $(lisp) in src/Makefile
+# triggers this directory's autoloads rule.
+bzr-update: compile finder-data custom-deps
# Update the AUTHORS file.
# src/Makefile.in to rebuild a particular Lisp file, no questions asked.
# Use byte-compile-refresh-preloaded to try and work around some of
# the most common problems of not bootstrapping from a clean state.
+.PHONY: compile-onefile
compile-onefile:
@echo Compiling $(THEFILE)
@# Use byte-compile-refresh-preloaded to try and work around some of
cd $(lisp); rm -f *.elc */*.elc */*/*.elc */*/*/*.elc
$(MAKE) $(MFLAGS) compile EMACS=$(EMACS)
+.PHONY: compile-calc backup-compiled-files compile-after-backup
+
compile-calc:
for el in $(lisp)/calc/*.el; do \
echo Compiling $$el; \
compile-after-backup: backup-compiled-files compile-always
-# Recompile all Lisp files which are newer than their .elc files and compile
-# new ones.
-# This has the same effect as compile-main. recompile has some advantages:
-# i) It is faster (on a single processor), since it only has to start
-# Emacs once. It was 33% faster on a test with a random 10% of the .el
-# files needing recompilation.
-# ii) The explicit cc-mode dependency.
-# recompile's disadvantages are:
-# i) Not parallelizable.
-# ii) Compiling multiple files in the same instance of Emacs is wrong,
-# since the environment of later files is affected by definitions in
-# earlier ones.
-recompile: doit $(LOADDEFS) compile-first $(lisp)/progmodes/cc-mode.elc
+# This does the same job as the "compile" rule, but in a different way.
+# Rather than spawning a separate Emacs instance to compile each file,
+# it uses the same Emacs instance to compile everything.
+# This is faster on a single core, since it avoids the overhead of
+# starting Emacs many times (it was 33% faster on a test with a
+# random 10% of the .el files needing recompilation).
+# Unlike compile, this is not parallelizable; so if you have more than
+# one core and use make -j#, compile will be (much) faster.
+# This rule also produces less accurate compilation warnings.
+# The environment of later files is affected by definitions in
+# earlier ones, so it does not produce some warnings that it should.
+# It can also produces spurious warnings about "invalid byte code" if
+# files that use byte-compile-dynamic are updated.
+# There is no reason to use this rule unless you only have a single
+# core and CPU time is an issue.
+.PHONY: compile-one-process
+compile-one-process: doit $(LOADDEFS) compile-first $(lisp)/progmodes/cc-mode.elc
$(emacs) $(BYTE_COMPILE_FLAGS) \
--eval "(batch-byte-recompile-directory 0)" $(lisp)
$(MH_E_DIR)/mh-tool-bar.el $(MH_E_DIR)/mh-utils.el \
$(MH_E_DIR)/mh-xface.el
+.PHONY: mh-autoloads
mh-autoloads: $(MH_E_DIR)/mh-loaddefs.el
$(MH_E_DIR)/mh-loaddefs.el: $(MH_E_SRC)
$(emacs) -l autoload \
# an own subdirectory. OTOH, it does not hurt to keep them in
# lisp/net.
TRAMP_DIR = $(lisp)/net
-TRAMP_SRC = $(TRAMP_DIR)/tramp.el $(TRAMP_DIR)/tramp-cache.el \
- $(TRAMP_DIR)/tramp-cmds.el $(TRAMP_DIR)/tramp-compat.el \
- $(TRAMP_DIR)/tramp-ftp.el $(TRAMP_DIR)/tramp-gvfs.el \
- $(TRAMP_DIR)/tramp-gw.el $(TRAMP_DIR)/tramp-sh.el \
- $(TRAMP_DIR)/tramp-smb.el $(TRAMP_DIR)/tramp-uu.el \
- $(TRAMP_DIR)/trampver.el
+TRAMP_SRC = $(TRAMP_DIR)/tramp.el $(TRAMP_DIR)/tramp-adb.el \
+ $(TRAMP_DIR)/tramp-cache.el $(TRAMP_DIR)/tramp-cmds.el \
+ $(TRAMP_DIR)/tramp-compat.el $(TRAMP_DIR)/tramp-ftp.el \
+ $(TRAMP_DIR)/tramp-gvfs.el $(TRAMP_DIR)/tramp-gw.el \
+ $(TRAMP_DIR)/tramp-sh.el $(TRAMP_DIR)/tramp-smb.el \
+ $(TRAMP_DIR)/tramp-uu.el $(TRAMP_DIR)/trampver.el
$(TRAMP_DIR)/tramp-loaddefs.el: $(TRAMP_SRC)
$(emacs) -l autoload \
--eval "(setq make-backup-files nil)" \
-f batch-update-autoloads $(CAL_DIR)
-# Prepare a bootstrap in the lisp subdirectory.
-#
-# Build loaddefs.el to make sure it's up-to-date. If it's not, that
-# might lead to errors during the bootstrap because something fails to
-# autoload as expected. If there is no emacs binary, then we can't
-# build autoloads yet. In that case we have to use ldefs-boot.el.
-# Bootstrap should always work with ldefs-boot.el. Therefore,
-# whenever a new autoload cookie gets added that is necessary during
-# bootstrapping, ldefs-boot.el should be updated by overwriting it with
-# an up-to-date copy of loaddefs.el that is uncorrupted by
-# local changes. (Because loaddefs.el is an automatically generated
-# file, we don't want to store it in the source repository).
+.PHONY: bootstrap-clean distclean maintainer-clean
bootstrap-clean:
cd $(lisp); rm -f *.elc */*.elc */*/*.elc */*/*/*.elc $(AUTOGENEL)