Unset EMACSLOADPATH in some Makefiles rather than setting it to the default
[bpt/emacs.git] / lisp / Makefile.in
index ff9439d..7b0206a 100644 (file)
 SHELL = @SHELL@
 
 srcdir = @srcdir@
-abs_srcdir = @abs_srcdir@
 top_srcdir = @top_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_lisp = $(abs_srcdir)
 lisp = $(srcdir)
 VPATH = $(srcdir)
 
@@ -34,10 +31,10 @@ XARGS_LIMIT = @XARGS_LIMIT@
 # You can specify a different executable on the make command line,
 # e.g. "make EMACS=../src/emacs ...".
 
-# We sometimes change directory before running Emacs (typically when
-# building out-of-tree, we chdir to the source directory), so we need
-# to use an absolute file name.
-EMACS = ${abs_top_builddir}/src/emacs
+# We never change directory before running Emacs, so a relative file
+# name is fine, and makes life easier.  If we need to change
+# directory, we can use emacs --chdir.
+EMACS = ../src/emacs
 
 # Command line flags for Emacs.
 
@@ -49,12 +46,6 @@ BYTE_COMPILE_EXTRA_FLAGS =
 # BYTE_COMPILE_EXTRA_FLAGS = --eval '(setq byte-compile-warnings (quote (not unresolved)))'
 # The example above is just for developers, it should not be used by default.
 
-lisptagsfiles1 = $(lisp)/*.el
-lisptagsfiles2 = $(lisp)/*/*.el
-lisptagsfiles3 = $(lisp)/*/*/*.el
-lisptagsfiles4 = $(lisp)/*/*/*/*.el
-ETAGS = ../lib-src/etags
-
 # Automatically generated autoload files, apart from lisp/loaddefs.el.
 # Note this includes only those files that need special rules to
 # build; ie it does not need to include things created via
@@ -114,8 +105,8 @@ COMPILE_FIRST = \
        $(lisp)/emacs-lisp/autoload.elc
 
 # The actual Emacs command run in the targets below.
-
-emacs = EMACSLOADPATH="$(abs_lisp)" LC_ALL=C "$(EMACS)" $(EMACSOPT)
+# Prevent any setting of EMACSLOADPATH in user environment causing problems.
+emacs = unset EMACSLOADPATH; LC_ALL=C "$(EMACS)" $(EMACSOPT)
 
 # Common command to find subdirectories
 setwins=subdirs=`find . -type d -print`; \
@@ -166,27 +157,28 @@ doit:
 $(lisp)/cus-load.el:
        $(MAKE) $(MFLAGS) custom-deps
 custom-deps: doit
-       cd $(lisp) && $(setwins_almost); \
+       thisdir=`pwd`; cd $(lisp) && $(setwins_almost); cd "$$thisdir"; \
        echo Directories: $$wins; \
-       $(emacs) -l cus-dep --eval '(setq generated-custom-dependencies-file (unmsys--file-name "$(abs_lisp)/cus-load.el"))' -f custom-make-dependencies $$wins
+       $(emacs) --chdir $(lisp) -l cus-dep -f custom-make-dependencies $$wins
 
 $(lisp)/finder-inf.el:
        $(MAKE) $(MFLAGS) finder-data
 finder-data: doit
-       cd $(lisp) && $(setwins_almost); \
+       thisdir=`pwd`; cd $(lisp) && $(setwins_almost); cd "$$thisdir"; \
        echo Directories: $$wins; \
-       $(emacs) -l finder --eval '(setq generated-finder-keywords-file (unmsys--file-name "$(abs_lisp)/finder-inf.el"))' -f finder-compile-keywords-make-dist $$wins
+       $(emacs) --chdir $(lisp) -l finder \
+         -f finder-compile-keywords-make-dist $$wins
 
 # The chmod +w is to handle env var CVSREAD=1.
-# Use expand-file-name rather than $abs_lisp so that Emacs does not
+# Use expand-file-name rather than $abs_scrdir so that Emacs does not
 # get confused when it compares file-names for equality.
 autoloads: $(LOADDEFS) doit
        cd $(lisp) && chmod +w $(AUTOGEN_VCS)
-       cd $(lisp) && $(setwins_almost); \
+       thisdir=`pwd`; cd $(lisp) && $(setwins_almost); cd "$$thisdir"; \
        echo Directories: $$wins; \
-       $(emacs) -l autoload \
+       $(emacs) --chdir $(lisp) -l autoload \
            --eval '(setq autoload-builtin-package-versions t)' \
-           --eval '(setq generated-autoload-file (expand-file-name (unmsys--file-name "$(lisp)/loaddefs.el")))' \
+           --eval '(setq generated-autoload-file (expand-file-name "loaddefs.el"))' \
            -f batch-update-autoloads $$wins
 
 # This is required by the bootstrap-emacs target in ../src/Makefile, so
@@ -217,10 +209,28 @@ bzr-update: compile finder-data custom-deps
 update-authors:
        $(emacs) -l authors -f batch-update-authors $(top_srcdir)/etc/AUTHORS $(top_srcdir)
 
-TAGS TAGS-LISP: $(lisptagsfiles1) $(lisptagsfiles2) $(lisptagsfiles3) $(lisptagsfiles4)
-       rm -f $@; touch $@; \
-        echo $(lisptagsfiles1) $(lisptagsfiles2) $(lisptagsfiles3) $(lisptagsfiles4) | sed -e "s,$(lisp)/[^ ]*loaddefs[^ ]*,," -e "s,$(lisp)/ldefs-boot[^ ]*,," | \
-       xargs $(XARGS_LIMIT) ${ETAGS} -a -o $@
+
+ETAGS = ../lib-src/etags
+
+lisptagsfiles1 = $(srcdir)/*.el
+lisptagsfiles2 = $(srcdir)/*/*.el
+lisptagsfiles3 = $(srcdir)/*/*/*.el
+lisptagsfiles4 = $(srcdir)/*/*/*/*.el
+
+## The echo | sed | xargs is to stop the command line getting too long
+## on MS Windows, when the MSYS Bash passes it to a MinGW compiled
+## etags.  It might be better to use find in a similar way to
+## compile-main.  But maybe this is not even necessary any more now
+## that this uses relative filenames.
+TAGS: $(lisptagsfiles1) $(lisptagsfiles2) $(lisptagsfiles3) $(lisptagsfiles4)
+       rm -f $@
+       touch $@
+       echo $(lisptagsfiles1) $(lisptagsfiles2) $(lisptagsfiles3) $(lisptagsfiles4) | \
+         sed -e 's,$(srcdir)/[^ ]*loaddefs[^ ]*,,g' \
+           -e 's,$(srcdir)/ldefs-boot[^ ]*,,' \
+           -e 's,$(srcdir)/[^ ]*esh-groups.el[^ ]*,,' | \
+           xargs $(XARGS_LIMIT) "$(ETAGS)" -a -o $@
+
 
 # The src/Makefile.in has its own set of dependencies and when they decide
 # that one Lisp file needs to be re-compiled, we had better recompile it as
@@ -444,6 +454,7 @@ distclean:
        -rm -f ./Makefile $(lisp)/loaddefs.el~
 
 maintainer-clean: distclean bootstrap-clean
+       rm -f TAGS
 
 .PHONY: check-declare
 
@@ -452,6 +463,13 @@ check-declare:
 
 # Dependencies
 
+## None of the following matters for bootstrap, which is the only way
+## to ensure a correct compilation of all lisp files.
+## Manually specifying dependencies of a handful of lisp files, (and
+## ones that don't change very often at that) seems pretty pointless
+## to me.
+
+# http://debbugs.gnu.org/1004
 # CC Mode uses a compile time macro system which causes a compile time
 # dependency in cc-*.elc files on the macros in other cc-*.el and the
 # version string in cc-defs.el.
@@ -496,59 +514,4 @@ $(lisp)/progmodes/cc-styles.elc: $(lisp)/progmodes/cc-vars.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-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
-
 # Makefile ends here.