HideIfDef mode bug fixes and enhancements. This is #2 of 3 patches based
[bpt/emacs.git] / lisp / Makefile.in
index 0c23264..d6e10c6 100644 (file)
@@ -1,6 +1,6 @@
 ### @configure_input@
 
-# Copyright (C) 2000-2013 Free Software Foundation, Inc.
+# Copyright (C) 2000-2014 Free Software Foundation, Inc.
 
 # This file is part of GNU Emacs.
 
@@ -74,12 +74,13 @@ AUTOGENEL = loaddefs.el \
 # Note that update_loaddefs parses this.
 AUTOGEN_VCS = \
        ps-print.el \
-       emulation/tpu-edt.el \
+       obsolete/tpu-edt.el \
        mail/rmail.el \
        dired.el \
        ibuffer.el \
        htmlfontify.el \
-       emacs-lisp/eieio.el
+       emacs-lisp/eieio.el \
+       textmodes/reftex.el
 
 # Value of max-lisp-eval-depth when compiling initially.
 # During bootstrapping the byte-compiler is run interpreted when compiling
@@ -88,7 +89,9 @@ AUTOGEN_VCS = \
 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)
+# Set load-prefer-newer for the benefit of the non-bootstrappers.
+BYTE_COMPILE_FLAGS = $(BIG_STACK_OPTS) \
+  --eval '(setq load-prefer-newer t)' $(BYTE_COMPILE_EXTRA_FLAGS)
 
 # Files to compile before others during a bootstrap.  This is done to
 # speed up the bootstrap process.  They're ordered by size, so we use
@@ -104,28 +107,41 @@ COMPILE_FIRST = \
        $(lisp)/emacs-lisp/bytecomp.elc \
        $(lisp)/emacs-lisp/autoload.elc
 
+# Prevent any settings in the user environment causing problems.
+unexport EMACSDATA EMACSDOC EMACSPATH
+
 # The actual Emacs command run in the targets below.
 # Prevent any setting of EMACSLOADPATH in user environment causing problems.
-emacs = unset EMACSLOADPATH; "$(EMACS)" $(EMACSOPT)
+emacs = EMACSLOADPATH= '$(EMACS)' $(EMACSOPT)
 
 # Common command to find subdirectories
 setwins=for file in `find . -type d -print`; do \
           case $$file in */.* ) ;; \
                *) wins="$$wins$${wins:+ }$$file" ;; \
           esac; \
-        done
+       done
 
 # Find all subdirectories except `obsolete' and `term'.
-setwins_almost=for file in `find . -type d -print`; do \
-          case $$file in */.* | */obsolete | */term ) ;; \
-               *) wins="$$wins$${wins:+ }$$file" ;; \
+setwins_almost=for file in `find ${srcdir} -type d -print`; do \
+          case $$file in ${srcdir}*/obsolete | ${srcdir}*/term ) ;; \
+            *) wins="$$wins$${wins:+ }$$file" ;; \
           esac; \
         done
 
-# Find all subdirectories in which we might want to create subdirs.el
-setwins_for_subdirs=for file in `find . -type d -print`; do \
-          case $$file in */.* | */cedet* ) ;; \
-               *) wins="$$wins$${wins:+ }$$file" ;; \
+# Find all subdirectories except `obsolete', `term', and `leim' (and subdirs).
+# We don't want the leim files listed as packages, especially
+# since many share basenames with files in language/.
+setwins_finder=for file in `find ${srcdir} -type d -print`; do \
+          case $$file in ${srcdir}*/obsolete | ${srcdir}*/term | ${srcdir}*/leim* ) ;; \
+            *) wins="$$wins$${wins:+ }$$file" ;; \
+          esac; \
+        done
+
+# Find all subdirectories in which we might want to create subdirs.el.
+setwins_for_subdirs=for file in `find ${srcdir} -type d -print`; do \
+          case $$file in \
+            ${srcdir}*/cedet* | ${srcdir}*/leim* ) ;; \
+            *) wins="$$wins$${wins:+ }$$file" ;; \
           esac; \
         done
 
@@ -152,40 +168,58 @@ doit:
 # since they will never contain any useful information
 # (see finder-no-scan-regexp and custom-dependencies-no-scan-regexp).
 $(lisp)/cus-load.el:
-       $(MAKE) $(MFLAGS) custom-deps
+       $(MAKE) custom-deps
 custom-deps: doit
-       thisdir=`pwd`; cd $(lisp) && $(setwins_almost); cd "$$thisdir"; \
+       $(setwins_almost); \
        echo Directories: $$wins; \
-       $(emacs) --chdir $(lisp) -l cus-dep -f custom-make-dependencies $$wins
+       $(emacs) -l cus-dep \
+         --eval '(setq generated-custom-dependencies-file (unmsys--file-name "$(srcdir)/cus-load.el"))' \
+         -f custom-make-dependencies $$wins
 
 $(lisp)/finder-inf.el:
-       $(MAKE) $(MFLAGS) finder-data
+       $(MAKE) finder-data
 finder-data: doit
-       thisdir=`pwd`; cd $(lisp) && $(setwins_almost); cd "$$thisdir"; \
+       $(setwins_finder); \
        echo Directories: $$wins; \
-       $(emacs) --chdir $(lisp) -l finder \
+       $(emacs) -l finder \
+         --eval '(setq generated-finder-keywords-file (unmsys--file-name "$(srcdir)/finder-inf.el"))' \
          -f finder-compile-keywords-make-dist $$wins
 
 # The chmod +w is to handle env var CVSREAD=1.
 # Use expand-file-name rather than $abs_scrdir so that Emacs does not
 # get confused when it compares file-names for equality.
+#
+# Note that we set no-update-autoloads in _generated_ leim files.
+# If you want to allow autoloads in such files, remove that,
+# and make this depend on leim.
 autoloads: $(LOADDEFS) doit
        cd $(lisp) && chmod +w $(AUTOGEN_VCS)
-       thisdir=`pwd`; cd $(lisp) && $(setwins_almost); cd "$$thisdir"; \
+       $(setwins_almost); \
        echo Directories: $$wins; \
-       $(emacs) --chdir $(lisp) -l autoload \
+       $(emacs) -l autoload \
            --eval '(setq autoload-builtin-package-versions t)' \
-           --eval '(setq generated-autoload-file (expand-file-name "loaddefs.el"))' \
+           --eval '(setq generated-autoload-file (expand-file-name (unmsys--file-name "$(srcdir)/loaddefs.el")))' \
            -f batch-update-autoloads $$wins
+       $(MAKE) obsolete-autoloads
+
+# The obsolete/ subdirectory is normally not scanned for autoloads.
+# Sometimes we still want to autoload something from that directory,
+# eg iswitchb.
+.PHONY: obsolete-autoloads
+obsolete-autoloads: ${lisp}/obsolete/*.el
+       $(emacs) -l autoload \
+           --eval '(setq generate-autoload-cookie ";;;###obsolete-autoload")' \
+           --eval '(setq generated-autoload-file (expand-file-name (unmsys--file-name "$(srcdir)/loaddefs.el")))' \
+           -f batch-update-autoloads ${lisp}/obsolete
 
 # This is required by the bootstrap-emacs target in ../src/Makefile, so
 # we know that if we have an emacs executable, we also have a subdirs.el.
 $(lisp)/subdirs.el:
-       $(MAKE) $(MFLAGS) update-subdirs
+       $(MAKE) update-subdirs
 update-subdirs: doit
-       cd $(lisp) && $(setwins_for_subdirs); \
+       $(setwins_for_subdirs); \
        for file in $$wins; do \
-          ../build-aux/update-subdirs $$file; \
+          $(srcdir)/../build-aux/update-subdirs $$file; \
        done;
 
 .PHONY: updates bzr-update update-authors
@@ -273,7 +307,7 @@ compile-onefile:
 compile-first: $(COMPILE_FIRST)
 
 # In `compile-main' we could directly do
-#    ... | xargs $(MAKE) $(MFLAGS) EMACS="$(EMACS)"
+#    ... | xargs $(MAKE) EMACS="$(EMACS)"
 # and it works, but it generates a lot of messages like
 #    make[2]: gnus/gnus-mlspl.elc is up to date.
 # so instead, we use "xargs echo" to split the list of file into manageable
@@ -288,7 +322,7 @@ compile-targets: $(TARGETS)
 
 # Compile all the Elisp files that need it.  Beware: it approximates
 # `no-byte-compile', so watch out for false-positives!
-compile-main: compile-clean
+compile-main: leim semantic compile-clean
        @(cd $(lisp) && $(setwins); \
        els=`echo "$$wins " | sed -e 's|/\./|/|g' -e 's|/\. | |g' -e 's| |/*.el |g'`; \
        for el in $$els; do \
@@ -297,7 +331,7 @@ compile-main: compile-clean
          echo "$${el}c"; \
        done | xargs $(XARGS_LIMIT) echo) | \
        while read chunk; do \
-         $(MAKE) $(MFLAGS) compile-targets EMACS="$(EMACS)" TARGETS="$$chunk"; \
+         $(MAKE) compile-targets EMACS="$(EMACS)" TARGETS="$$chunk"; \
        done
 
 .PHONY: compile-clean
@@ -312,6 +346,18 @@ compile-clean:
          fi \
        done
 
+.PHONY: leim semantic
+leim:
+       $(MAKE) -C ../leim all EMACS="$(EMACS)"
+
+# FIXME.  Yuck.
+semantic:
+       case ${EMACS} in \
+         .*) EMACS="../${EMACS}" ;; \
+          *) EMACS="${EMACS}" ;; \
+       esac; \
+       $(MAKE) -C ../admin/grammars all EMACS="$${EMACS}"
+
 # Compile all Lisp files, but don't recompile those that are up to
 # date.  Some .el files don't get compiled because they set the
 # local variable no-byte-compile.
@@ -319,14 +365,14 @@ compile-clean:
 # Explicitly pass EMACS (sometimes ../src/bootstrap-emacs) to those
 # sub-makes that run rules that use it, for the sake of some non-GNU makes.
 compile: $(LOADDEFS) autoloads compile-first
-       $(MAKE) $(MFLAGS) compile-main EMACS="$(EMACS)"
+       $(MAKE) compile-main EMACS="$(EMACS)"
 
 # Compile all Lisp files.  This is like `compile' but compiles files
 # unconditionally.  Some files don't actually get compiled because they
 # set the local variable no-byte-compile.
 compile-always: doit
        cd $(lisp) && rm -f *.elc */*.elc */*/*.elc */*/*/*.elc
-       $(MAKE) $(MFLAGS) compile EMACS="$(EMACS)"
+       $(MAKE) compile EMACS="$(EMACS)"
 
 .PHONY: backup-compiled-files compile-after-backup
 
@@ -385,7 +431,6 @@ $(MH_E_DIR)/mh-loaddefs.el: $(MH_E_SRC)
        $(emacs) -l autoload \
           --eval "(setq generate-autoload-cookie \";;;###mh-autoload\")" \
           --eval "(setq generated-autoload-file (expand-file-name (unmsys--file-name \"$@\")))" \
-          --eval "(setq make-backup-files nil)" \
           -f batch-update-autoloads $(MH_E_DIR)
 
 # Update TRAMP internal autoloads. Maybe we could move tramp*.el into
@@ -403,7 +448,6 @@ $(TRAMP_DIR)/tramp-loaddefs.el: $(TRAMP_SRC)
        $(emacs) -l autoload \
           --eval "(setq generate-autoload-cookie \";;;###tramp-autoload\")" \
           --eval "(setq generated-autoload-file (expand-file-name (unmsys--file-name \"$@\")))" \
-          --eval "(setq make-backup-files nil)" \
           -f batch-update-autoloads $(TRAMP_DIR)
 
 CAL_DIR = $(lisp)/calendar
@@ -425,21 +469,18 @@ $(CAL_DIR)/cal-loaddefs.el: $(CAL_SRC)
        $(emacs) -l autoload \
           --eval "(setq generate-autoload-cookie \";;;###cal-autoload\")" \
           --eval "(setq generated-autoload-file (expand-file-name (unmsys--file-name \"$@\")))" \
-          --eval "(setq make-backup-files nil)" \
           -f batch-update-autoloads $(CAL_DIR)
 
 $(CAL_DIR)/diary-loaddefs.el: $(CAL_SRC)
        $(emacs) -l autoload \
           --eval "(setq generate-autoload-cookie \";;;###diary-autoload\")" \
           --eval "(setq generated-autoload-file (expand-file-name (unmsys--file-name \"$@\")))" \
-          --eval "(setq make-backup-files nil)" \
           -f batch-update-autoloads $(CAL_DIR)
 
 $(CAL_DIR)/hol-loaddefs.el: $(CAL_SRC)
        $(emacs) -l autoload \
           --eval "(setq generate-autoload-cookie \";;;###holiday-autoload\")" \
           --eval "(setq generated-autoload-file (expand-file-name (unmsys--file-name \"$@\")))" \
-          --eval "(setq make-backup-files nil)" \
           -f batch-update-autoloads $(CAL_DIR)
 
 .PHONY: bootstrap-clean distclean maintainer-clean
@@ -478,28 +519,22 @@ $(lisp)/progmodes/cc-align.elc $(lisp)/progmodes/cc-awk.elc\
  $(lisp)/progmodes/cc-vars.elc: \
    $(lisp)/progmodes/cc-bytecomp.elc $(lisp)/progmodes/cc-defs.elc
 
-$(lisp)/progmodes/cc-align.elc: \
-   $(lisp)/progmodes/cc-vars.elc $(lisp)/progmodes/cc-engine.elc
-
-$(lisp)/progmodes/cc-cmds.elc: \
+$(lisp)/progmodes/cc-align.elc $(lisp)/progmodes/cc-cmds.elc: \
    $(lisp)/progmodes/cc-vars.elc $(lisp)/progmodes/cc-engine.elc
 
 $(lisp)/progmodes/cc-compat.elc: \
    $(lisp)/progmodes/cc-vars.elc $(lisp)/progmodes/cc-styles.elc \
    $(lisp)/progmodes/cc-engine.elc
 
-$(lisp)/progmodes/cc-defs.elc: $(lisp)/progmodes/cc-bytecomp.elc \
-   $(lisp)/emacs-lisp/cl.elc $(lisp)/emacs-lisp/regexp-opt.elc
+$(lisp)/progmodes/cc-defs.elc: $(lisp)/progmodes/cc-bytecomp.elc
 
 $(lisp)/progmodes/cc-engine.elc: $(lisp)/progmodes/cc-langs.elc \
    $(lisp)/progmodes/cc-vars.elc
 
 $(lisp)/progmodes/cc-fonts.elc: $(lisp)/progmodes/cc-langs.elc \
-   $(lisp)/progmodes/cc-vars.elc $(lisp)/progmodes/cc-engine.elc \
-   $(lisp)/font-lock.elc
+   $(lisp)/progmodes/cc-vars.elc $(lisp)/progmodes/cc-engine.elc
 
-$(lisp)/progmodes/cc-langs.elc: $(lisp)/progmodes/cc-vars.elc \
-   $(lisp)/emacs-lisp/cl.elc
+$(lisp)/progmodes/cc-langs.elc: $(lisp)/progmodes/cc-vars.elc
 
 $(lisp)/progmodes/cc-mode.elc: $(lisp)/progmodes/cc-langs.elc \
    $(lisp)/progmodes/cc-vars.elc $(lisp)/progmodes/cc-engine.elc \
@@ -509,6 +544,4 @@ $(lisp)/progmodes/cc-mode.elc: $(lisp)/progmodes/cc-langs.elc \
 $(lisp)/progmodes/cc-styles.elc: $(lisp)/progmodes/cc-vars.elc \
    $(lisp)/progmodes/cc-align.elc
 
-$(lisp)/progmodes/cc-vars.elc: $(lisp)/custom.elc $(lisp)/widget.elc
-
 # Makefile ends here.