-# -*- Makefile -*- for GNU Emacs on the Microsoft W32 API.
-# Copyright (C) 2000, 2001, 2002, 2003, 2004,
-# 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+# -*- Makefile -*- for GNU Emacs on the Microsoft W32 API.
+# Copyright (C) 2000-2011 Free Software Foundation, Inc.
-# This file is part of GNU Emacs.
+# This file is part of GNU Emacs.
# GNU Emacs is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
srcdir = $(CURDIR)/..
# You can specify a different executable on the make command line,
-# e.g. "make EMACS=../src/emacs ...".
+# e.g. "make EMACS=../bin/emacs ...".
-EMACS = $(THISDIR)/../bin/emacs.exe
+EMACS = ../src/$(BLD)/emacs.exe
-# Command line flags for Emacs. This must include --multibyte,
-# otherwise some files will not compile.
+# Command line flags for Emacs.
-EMACSOPT = -batch --no-init-file --no-site-file --multibyte
+EMACSOPT = -batch --no-site-file --no-site-lisp
# Extra flags to pass to the byte compiler
BYTE_COMPILE_EXTRA_FLAGS =
lisptagsfiles1 = $(lisp)/*.el
lisptagsfiles2 = $(lisp)/*/*.el
-ETAGS = "../lib-src/$(BLD)/etags"
+lisptagsfiles3 = $(lisp)/*/*/*.el
+lisptagsfiles4 = $(lisp)/*/*/*/*.el
+ETAGS = "../lib-src/$(BLD)/etags.exe"
+## $(DEST) is overridden by ../src/makefile.w32-in.
+DEST=$(lisp)
# Automatically generated autoload files, apart from lisp/loaddefs.el.
LOADDEFS = $(lisp)/calendar/cal-loaddefs.el \
$(lisp)/calendar/diary-loaddefs.el $(lisp)/calendar/hol-loaddefs.el \
- $(lisp)/mh-e/mh-loaddefs.el
+ $(lisp)/mh-e/mh-loaddefs.el $(lisp)/net/tramp-loaddefs.el
AUTOGENEL = $(lisp)/loaddefs.el $(LOADDEFS) $(lisp)/cus-load.el \
$(lisp)/finder-inf.el $(lisp)/subdirs.el $(lisp)/eshell/esh-groups.el \
- $(lisp)/calc/calc-loaddefs.el $(lisp)/nxml/subdirs.el
+ $(lisp)/calc/calc-loaddefs.el $(lisp)/nxml/subdirs.el \
+ $(lisp)/cedet/semantic/loaddefs.el $(lisp)/cedet/ede/loaddefs.el \
+ $(lisp)/cedet/srecode/loaddefs.el
+
+# Value of max-lisp-eval-depth when compiling initially.
+# During bootstrapping the byte-compiler is run interpreted when compiling
+# itself, and uses more stack than usual.
+#
+BIG_STACK_DEPTH = 1200
+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. The CC files are compiled first
COMPILE_FIRST = \
$(lisp)/emacs-lisp/byte-opt.el \
$(lisp)/emacs-lisp/bytecomp.el \
+ $(lisp)/emacs-lisp/macroexp.el \
+ $(lisp)/emacs-lisp/cconv.el \
$(lisp)/subr.el \
$(lisp)/progmodes/cc-mode.el \
$(lisp)/progmodes/cc-vars.el
emacs = "$(EMACS)" $(EMACSOPT)
# Have to define the list of subdirs manually when not using sh.
-WINS_ALMOST=\
+WINS_CEDET=\
+ cedet \
+ cedet/ede \
+ cedet/semantic \
+ cedet/srecode \
+ cedet/semantic/analyze \
+ cedet/semantic/bovine \
+ cedet/semantic/decorate \
+ cedet/semantic/symref \
+ cedet/semantic/wisent
+
+WINS_BASIC=\
calc \
calendar \
emacs-lisp \
play \
progmodes \
textmodes \
- url
+ url \
+ vc
+
+# Directories with lisp files to compile, and to extract data from
+# (customs, autoloads, etc.)
+WINS_UPDATES=$(WINS_BASIC) \
+ $(WINS_CEDET)
+
+# Directories to add to subdirs.el
+WINS_SUBDIR=$(WINS_BASIC) \
+ obsolete
-WINS= $(WINS_ALMOST) \
+# All directories
+WINS= $(WINS_UPDATES) \
term \
obsolete
# WARNING: Do NOT split the part inside $(ARGQUOTE)s into multiple lines as
# this can break with GNU Make 3.81 and later if sh.exe is used.
custom-deps: $(lisp)/cus-load.el $(lisp)/loaddefs.el doit
- @echo Directories: $(WINS_ALMOST)
- -$(emacs) -l cus-dep --eval $(ARGQUOTE)(setq find-file-hook nil)$(ARGQUOTE) -f custom-make-dependencies $(lisp) $(WINS_ALMOST)
+ @echo Directories: $(WINS_UPDATES)
+ -$(emacs) -l cus-dep --eval $(ARGQUOTE)(setq find-file-hook nil)$(ARGQUOTE) \
+ -f custom-make-dependencies $(lisp) $(WINS_UPDATES)
finder-data: $(lisp)/loaddefs.el doit
- @echo Directories: $(WINS_ALMOST)
- $(emacs) -l finder -f finder-compile-keywords-make-dist $(lisp) $(WINS_ALMOST)
+ @echo Directories: $(WINS_UPDATES)
+ $(emacs) -l finder -f finder-compile-keywords-make-dist $(lisp) $(WINS_UPDATES)
$(lisp)/loaddefs.el:
$(MAKE) $(MFLAGS) loaddefs.el-$(SHELLTYPE)
# WARNING: Do NOT split the part inside $(ARGQUOTE)s into multiple lines as
# this can break with GNU Make 3.81 and later if sh.exe is used.
autoloads: $(lisp)/loaddefs.el $(LOADDEFS) doit
- @echo Directories: . $(WINS_ALMOST)
+ @echo Directories: . $(WINS_UPDATES)
$(emacs) -l autoload \
--eval $(ARGQUOTE)(setq find-file-hook nil find-file-suppress-same-file-warnings t)$(ARGQUOTE) \
- -f w32-batch-update-autoloads "$(lisp)/loaddefs.el" . $(WINS_ALMOST)
+ -f w32-batch-update-autoloads "$(lisp)/loaddefs.el" $(MAKE) . $(WINS_UPDATES)
$(lisp)/subdirs.el:
$(MAKE) $(MFLAGS) update-subdirs
echo ;; In load-path, after this directory should come>> $(lisp)/subdirs.el
echo ;; certain of its subdirectories. Here we specify them.>> $(lisp)/subdirs.el
echo (normal-top-level-add-to-load-path $(SQUOTE)(>> $(lisp)/subdirs.el
- @for %%d in ($(WINS)) do if not (%%d)==(term) echo "%%d">> $(lisp)/subdirs.el
+ @for %%d in ($(WINS_SUBDIR) cedet) do echo "%%d">> $(lisp)/subdirs.el
echo ))>> $(lisp)/subdirs.el
update-subdirs-SH: doit
$(srcdir)/update-subdirs $(lisp); \
- for file in $(WINS); do \
+ for file in $(WINS_SUBDIR); do \
$(srcdir)/update-subdirs $$file; \
done;
updates: update-subdirs autoloads mh-autoloads finder-data custom-deps
-# This is useful after "cvs up".
-cvs-update: recompile autoloads finder-data custom-deps
+# This is useful after "bzr up".
+bzr-update: recompile autoloads finder-data custom-deps
+
+# For backwards compatibility:
+cvs-update: bzr-update
# Update the AUTHORS file.
update-authors:
$(emacs) -l authors -f batch-update-authors $(srcdir)/etc/AUTHORS $(srcdir)
-TAGS: $(lisptagsfiles1) $(lisptagsfiles2)
- $(ETAGS) $(lisptagsfiles1) $(lisptagsfiles2)
+TAGS: TAGS-$(MAKETYPE)
+
+TAGS-LISP: TAGS-LISP-$(MAKETYPE)
+
+TAGS-nmake:
+ echo This target is not supported with NMake
+ exit -1
+
+TAGS-LISP-nmake:
+ echo This target is not supported with NMake
+ exit -1
-TAGS-LISP: $(lisptagsfiles1) $(lisptagsfiles2)
- $(ETAGS) -o TAGS-LISP $(lisptagsfiles1) $(lisptagsfiles2)
+TAGS-gmake: TAGS-$(SHELLTYPE)
+
+TAGS-LISP-gmake: TAGS-LISP-$(SHELLTYPE)
+
+TAGS-SH: $(lisptagsfiles1) $(lisptagsfiles2) $(lisptagsfiles3) $(lisptagsfiles4)
+ - $(DEL) TAGS
+ for dir in . $(WINS_UPDATES); do \
+ $(ETAGS) -a $(lisp)/$$dir/*.el; \
+ done
+
+TAGS-LISP-SH: $(lisptagsfiles1) $(lisptagsfiles2) $(lisptagsfiles3) $(lisptagsfiles4)
+ - $(DEL) $(DEST)/TAGS-LISP
+ for dir in . $(WINS_UPDATES); do \
+ $(ETAGS) -a -o $(DEST)/TAGS-LISP $(lisp)/$$dir/*.el; \
+ done
+
+TAGS-CMD: $(lisptagsfiles1) $(lisptagsfiles2) $(lisptagsfiles3) $(lisptagsfiles4)
+ - $(DEL) TAGS
+ for %%d in (. $(WINS_UPDATES)) do $(ETAGS) -a $(lisp)/%%d/*.el
+
+TAGS-LISP-CMD: $(lisptagsfiles1) $(lisptagsfiles2) $(lisptagsfiles3) $(lisptagsfiles4)
+ - $(DEL) $(DEST)/TAGS-LISP
+ for %%d in (. $(WINS_UPDATES)) do \
+ $(ETAGS) -a -o $(DEST)/TAGS-LISP $(lisp)/%%d/*.el
.SUFFIXES: .elc .el
.el.elc:
- -$(emacs) $(BYTE_COMPILE_EXTRA_FLAGS) -f batch-byte-compile $<
+ -$(emacs) $(BYTE_COMPILE_FLAGS) -f batch-byte-compile $<
# Compile all Lisp files, but don't recompile those that are up to
# date. Some files don't actually get compiled because they set the
compile-CMD:
# -for %%f in ($(lisp) $(WINS)) do for %%g in (%%f\*.elc) do @attrib -r %%g
for %%f in ($(COMPILE_FIRST)) do \
- $(emacs) -l loaddefs $(BYTE_COMPILE_EXTRA_FLAGS) -f batch-byte-compile-if-not-done %%f
+ $(emacs) -l loaddefs $(BYTE_COMPILE_FLAGS) -f batch-byte-compile-if-not-done %%f
for %%f in (. $(WINS)) do for %%g in (%%f/*.el) do \
- $(emacs) -l loaddefs $(BYTE_COMPILE_EXTRA_FLAGS) -f batch-byte-compile-if-not-done %%f/%%g
+ $(emacs) -l loaddefs $(BYTE_COMPILE_FLAGS) -f batch-byte-compile-if-not-done %%f/%%g
compile-SH:
# for elc in $(lisp)/*.elc $(lisp)/*/*.elc; do attrib -r $$elc; done
for el in $(COMPILE_FIRST); do \
echo Compiling $$el; \
- $(emacs) -l loaddefs $(BYTE_COMPILE_EXTRA_FLAGS) -f batch-byte-compile-if-not-done $$el; \
+ $(emacs) -l loaddefs $(BYTE_COMPILE_FLAGS) -f batch-byte-compile-if-not-done $$el; \
done
for dir in $(lisp) $(WINS); do \
for el in $$dir/*.el; do \
if test -f $$el; \
then \
echo Compiling $$el; \
- $(emacs) -l loaddefs $(BYTE_COMPILE_EXTRA_FLAGS) -f batch-byte-compile-if-not-done $$el; \
+ $(emacs) -l loaddefs $(BYTE_COMPILE_FLAGS) -f batch-byte-compile-if-not-done $$el; \
fi \
done; \
done
compile-always-CMD:
# -for %%f in ($(lisp) $(WINS)) do for %%g in (%%f\*.elc) do @attrib -r %%g
- for %%f in ($(COMPILE_FIRST)) do $(emacs) $(BYTE_COMPILE_EXTRA_FLAGS) -f batch-byte-compile %%f
- for %%f in (. $(WINS)) do for %%g in (%%f/*.el) do $(emacs) $(BYTE_COMPILE_EXTRA_FLAGS) -f batch-byte-compile %%f/%%g
+ for %%f in ($(COMPILE_FIRST)) do $(emacs) $(BYTE_COMPILE_FLAGS) -f batch-byte-compile %%f
+ for %%f in (. $(WINS)) do for %%g in (%%f/*.el) do $(emacs) $(BYTE_COMPILE_FLAGS) -f batch-byte-compile %%f/%%g
compile-always-SH:
# for elc in $(lisp)/*.elc $(lisp)/*/*.elc; do attrib -r $$elc; done
for el in $(COMPILE_FIRST); do \
echo Compiling $$el; \
- $(emacs) $(BYTE_COMPILE_EXTRA_FLAGS) -f batch-byte-compile $$el || exit 1; \
+ $(emacs) $(BYTE_COMPILE_FLAGS) -f batch-byte-compile $$el || exit 1; \
done
for dir in $(lisp) $(WINS); do \
for el in $$dir/*.el; do \
echo Compiling $$el; \
- $(emacs) $(BYTE_COMPILE_EXTRA_FLAGS) -f batch-byte-compile $$el || exit 1; \
+ $(emacs) $(BYTE_COMPILE_FLAGS) -f batch-byte-compile $$el || exit 1; \
done; \
done
compile-calc: compile-calc-$(SHELLTYPE)
compile-calc-CMD:
- for %%f in ($(lisp)/calc/*.el) do $(emacs) $(BYTE_COMPILE_EXTRA_FLAGS) -f batch-byte-compile %%f
+ for %%f in ($(lisp)/calc/*.el) do $(emacs) $(BYTE_COMPILE_FLAGS) -f batch-byte-compile %%f
compile-calc-SH:
for el in $(lisp)/calc/*.el; do \
echo Compiling $$el; \
- $(emacs) $(BYTE_COMPILE_EXTRA_FLAGS) -f batch-byte-compile $$el || exit 1; \
+ $(emacs) $(BYTE_COMPILE_FLAGS) -f batch-byte-compile $$el || exit 1; \
done
# Backup compiled Lisp files in elc.tar.gz. If that file already
--eval "(setq find-file-suppress-same-file-warnings t)" \
--eval "(setq make-backup-files nil)" \
-f w32-batch-update-autoloads "$(lisp)/calendar/cal-loaddefs.el" \
- ./calendar
+ $(MAKE) ./calendar
$(lisp)/calendar/diary-loaddefs.el:
"$(EMACS)" $(EMACSOPT) -l autoload \
--eval "(setq find-file-suppress-same-file-warnings t)" \
--eval "(setq make-backup-files nil)" \
-f w32-batch-update-autoloads $(lisp)/calendar/diary-loaddefs.el \
- ./calendar
+ $(MAKE) ./calendar
$(lisp)/calendar/hol-loaddefs.el:
"$(EMACS)" $(EMACSOPT) -l autoload \
--eval "(setq find-file-suppress-same-file-warnings t)" \
--eval "(setq make-backup-files nil)" \
-f w32-batch-update-autoloads $(lisp)/calendar/hol-loaddefs.el \
- ./calendar
+ $(MAKE) ./calendar
# Update MH-E internal autoloads. These are not to be confused with
# the autoloads for the MH-E entry points, which are already in
--eval $(ARGQUOTE)(setq find-file-suppress-same-file-warnings t)$(ARGQUOTE) \
--eval $(ARGQUOTE)(setq make-backup-files nil)$(ARGQUOTE) \
-f w32-batch-update-autoloads \
- $(ARGQUOTE)$(lisp)/mh-e/mh-loaddefs.el$(ARGQUOTE) ./mh-e
+ $(ARGQUOTE)$(lisp)/mh-e/mh-loaddefs.el$(ARGQUOTE) $(MAKE) ./mh-e
+
+# Update TRAMP internal autoloads. Maybe we could move tramp*.el into
+# its own subdirectory. OTOH, it does not hurt to keep them in
+# lisp/net.
+TRAMP_SRC = $(lisp)/net/tramp.el $(lisp)/net/tramp-cache.el \
+ $(lisp)/net/tramp-cmds.el $(lisp)/net/tramp-compat.el \
+ $(lisp)/net/tramp-ftp.el $(lisp)/net/tramp-gvfs.el \
+ $(lisp)/net/tramp-gw.el $(lisp)/net/tramp-sh.el \
+ $(lisp)/net/tramp-smb.el $(lisp)/net/tramp-uu.el \
+ $(lisp)/net/trampver.el
+
+$(lisp)/net/tramp-loaddefs.el: $(TRAMP_SRC)
+ "$(EMACS)" $(EMACSOPT) \
+ -l autoload \
+ --eval $(ARGQUOTE)(setq generate-autoload-cookie $(DQUOTE);;;###tramp-autoload$(DQUOTE))$(ARGQUOTE) \
+ --eval $(ARGQUOTE)(setq find-file-suppress-same-file-warnings t)$(ARGQUOTE) \
+ --eval $(ARGQUOTE)(setq make-backup-files nil)$(ARGQUOTE) \
+ -f w32-batch-update-autoloads \
+ $(ARGQUOTE)$(lisp)/net/tramp-loaddefs.el$(ARGQUOTE) $(MAKE) ./net
# Prepare a bootstrap in the lisp subdirectory.
#
bootstrap-clean-SH:
# if test -f "$(EMACS)"; then $(MAKE) $(MFLAGS) autoloads; fi
# -rm -f $(lisp)/*.elc $(lisp)/*/*.elc
- -for dir in . $(WINS); do rm -f $$dir/*.elc; done
+ -for dir in . $(WINS); do rm -f $$dir/*.elc $$dir/*/*.elc $$dir/*/*/*.elc; done
# Generate/update files for the bootstrap process.
# When done, remove bootstrap-emacs from ../bin, so that
$(lisp)/progmodes/cc-engine.elc $(lisp)/progmodes/cc-fonts.elc\
$(lisp)/progmodes/cc-langs.elc $(lisp)/progmodes/cc-menus.elc\
$(lisp)/progmodes/cc-mode.elc $(lisp)/progmodes/cc-styles.elc\
- $(lisp)/progmodes/cc-subword.elc $(lisp)/progmodes/cc-vars.elc: \
+ $(lisp)/progmodes/cc-vars.elc: \
$(lisp)/progmodes/cc-bytecomp.elc $(lisp)/progmodes/cc-defs.elc
$(lisp)/progmodes/cc-align.elc: \
$(lisp)/progmodes/cc-styles.elc: $(lisp)/progmodes/cc-vars.elc \
$(lisp)/progmodes/cc-align.elc
-$(lisp)/progmodes/cc-subword.elc: $(lisp)/progmodes/cc-cmds.elc
-
$(lisp)/progmodes/cc-vars.elc: $(lisp)/custom.elc $(lisp)/widget.elc
+
+# MH-E dependencies, mainly to prevent failures with parallel
+# compilation, due to race conditions between writing a given FOO.elc
+# file and another file being compiled that says "(require FOO)",
+# which causes Emacs to try to read FOO.elc.
+MH_E_DIR = ./mh-e
+$(MH_E_DIR)/mh-alias.elc $(MH_E_DIR)/mh-comp.elc $(MH_E_DIR)/mh-folder.elc\
+ $(MH_E_DIR)/mh-funcs.elc $(MH_E_DIR)/mh-identity.elc $(MH_E_DIR)/mh-inc.elc\
+ $(MH_E_DIR)/mh-junk.elc $(MH_E_DIR)/mh-letter.elc $(MH_E_DIR)/mh-limit.elc\
+ $(MH_E_DIR)/mh-mime.elc $(MH_E_DIR)/mh-print.elc $(MH_E_DIR)/mh-scan.elc\
+ $(MH_E_DIR)/mh-search.elc $(MH_E_DIR)/mh-seq.elc $(MH_E_DIR)/mh-show.elc\
+ $(MH_E_DIR)/mh-speed.elc $(MH_E_DIR)/mh-thread.elc $(MH_E_DIR)/mh-tool-bar.elc\
+ $(MH_E_DIR)/mh-utils.elc $(MH_E_DIR)/mh-xface.elc:\
+ $(MH_E_DIR)/mh-e.elc
+
+$(MH_E_DIR)/mh-alias.elc $(MH_E_DIR)/mh-e.elc $(MH_E_DIR)/mh-folder.elc\
+ $(MH_E_DIR)/mh-inc.elc $(MH_E_DIR)/mh-junk.elc $(MH_E_DIR)/mh-limit.elc\
+ $(MH_E_DIR)/mh-search.elc $(MH_E_DIR)/mh-seq.elc $(MH_E_DIR)/mh-speed.elc\
+ $(MH_E_DIR)/mh-utils.elc $(MH_E_DIR)/mh-xface.elc:\
+ $(lisp)/emacs-lisp/cl.elc
+
+$(MH_E_DIR)/mh-comp.elc $(MH_E_DIR)/mh-folder.elc $(MH_E_DIR)/mh-funcs.elc\
+ $(MH_E_DIR)/mh-junk.elc $(MH_E_DIR)/mh-limit.elc $(MH_E_DIR)/mh-print.elc\
+ $(MH_E_DIR)/mh-seq.elc $(MH_E_DIR)/mh-show.elc $(MH_E_DIR)/mh-thread.elc:\
+ $(MH_E_DIR)/mh-scan.elc
+
+$(MH_E_DIR)/mh-folder.elc $(MH_E_DIR)/mh-letter.elc $(MH_E_DIR)/mh-mime.elc\
+ $(MH_E_DIR)/mh-search.elc $(MH_E_DIR)/mh-show.elc $(MH_E_DIR)/mh-speed.elc:\
+ $(lisp)/gnus/gnus-util.elc
+
+$(MH_E_DIR)/mh-folder.elc $(MH_E_DIR)/mh-search.elc:\
+ $(lisp)/progmodes/which-func.elc
+
+$(MH_E_DIR)/mh-letter.elc $(MH_E_DIR)/mh-seq.elc $(MH_E_DIR)/mh-show.elc\
+ $(MH_E_DIR)/mh-utils.elc:\
+ $(lisp)/font-lock.elc
+
+$(MH_E_DIR)/mh-alias.elc $(MH_E_DIR)/mh-show.elc: $(lisp)/net/goto-addr.elc
+
+$(MH_E_DIR)/mh-comp.elc: $(lisp)/mail/sendmail.elc
+
+$(MH_E_DIR)/mh-e.elc: $(MH_E_DIR)/mh-buffers.elc $(lisp)/gnus/gnus.elc \
+ $(lisp)/cus-face.elc
+
+$(MH_E_DIR)/mh-letter.elc: $(lisp)/gnus/mailcap.elc $(lisp)/gnus/mm-decode.elc \
+ $(lisp)/gnus/mm-view.elc $(lisp)/gnus/mml.elc $(lisp)/gnus/message.elc
+
+$(MH_E_DIR)/mh-print.elc: $(lisp)/ps-print.elc
+
+$(MH_E_DIR)/mh-search.elc: $(lisp)/imenu.elc
+
+$(MH_E_DIR)/mh-show.elc: $(lisp)/gnus/gnus-cite.elc
+
+$(MH_E_DIR)/mh-speed.elc: $(lisp)/speedbar.elc $(lisp)/emacs-lisp/timer.elc
+
+$(MH_E_DIR)/mh-tool-bar.elc: $(lisp)/tool-bar.elc