Attempt at a fix for mingw CPPFLAGS
[bpt/emacs.git] / lisp / Makefile.in
index 1e701df..5861038 100644 (file)
@@ -1,4 +1,5 @@
-# Maintenance productions for the Lisp directory
+### @configure_input@
+
 # Copyright (C) 2000-2013 Free Software Foundation, Inc.
 
 # This file is part of GNU Emacs.
 # You should have received a copy of the GNU General Public License
 # along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
 
-SHELL = /bin/sh
+SHELL = @SHELL@
 
 srcdir = @srcdir@
+abs_srcdir = @abs_srcdir@
 top_srcdir = @top_srcdir@
+abs_top_srcdir = @abs_top_srcdir@
 abs_top_builddir = @abs_top_builddir@
+abs_lisp = $(abs_srcdir)
 lisp = $(srcdir)
 VPATH = $(srcdir)
 
+# Empty for all systems except MinGW, where xargs needs an explicit
+# limitation.
+XARGS_LIMIT = @XARGS_LIMIT@
+
 # You can specify a different executable on the make command line,
 # e.g. "make EMACS=../src/emacs ...".
 
@@ -64,6 +72,7 @@ AUTOGENEL = loaddefs.el \
        cus-load.el \
        finder-inf.el \
        subdirs.el \
+       emacs-lisp/cl-loaddefs.el \
        calc/calc-loaddefs.el \
        eshell/esh-groups.el \
        cedet/semantic/loaddefs.el \
@@ -75,7 +84,6 @@ AUTOGENEL = loaddefs.el \
 AUTOGEN_VCS = \
        ps-print.el \
        emulation/tpu-edt.el \
-       emacs-lisp/cl-loaddefs.el \
        mail/rmail.el \
        dired.el \
        ibuffer.el \
@@ -107,13 +115,13 @@ COMPILE_FIRST = \
 
 # The actual Emacs command run in the targets below.
 
-emacs = EMACSLOADPATH=$(lisp) LC_ALL=C $(EMACS) $(EMACSOPT)
+emacs = EMACSLOADPATH="$(abs_lisp)" LC_ALL=C "$(EMACS)" $(EMACSOPT)
 
 # Common command to find subdirectories
 setwins=subdirs=`find . -type d -print`; \
        for file in $$subdirs; do \
           case $$file in */.* | */.*/* | */=* ) ;; \
-               *) wins="$$wins $$file" ;; \
+               *) wins="$$wins$${wins:+ }$$file" ;; \
           esac; \
         done
 
@@ -121,7 +129,7 @@ setwins=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" ;; \
+               *) wins="$$wins$${wins:+ }$$file" ;; \
           esac; \
         done
 
@@ -129,7 +137,7 @@ setwins_almost=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" ;; \
+               *) wins="$$wins$${wins:+ }$$file" ;; \
           esac; \
         done
 
@@ -160,21 +168,24 @@ $(lisp)/cus-load.el:
 custom-deps: doit
        cd $(lisp); $(setwins_almost); \
        echo Directories: $$wins; \
-       $(emacs) -l cus-dep --eval '(setq generated-custom-dependencies-file "$(lisp)/cus-load.el")' -f custom-make-dependencies $$wins
+       $(emacs) -l cus-dep --eval '(setq generated-custom-dependencies-file (unmsys--file-name "$(abs_lisp)/cus-load.el"))' -f custom-make-dependencies $$wins
 
 $(lisp)/finder-inf.el:
        $(MAKE) $(MFLAGS) finder-data
 finder-data: doit
        cd $(lisp); $(setwins_almost); \
        echo Directories: $$wins; \
-       $(emacs) -l finder --eval '(setq generated-finder-keywords-file "$(lisp)/finder-inf.el")' -f finder-compile-keywords-make-dist $$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
 
 # The chmod +w is to handle env var CVSREAD=1.
 autoloads: $(LOADDEFS) doit
        cd $(lisp) && chmod +w $(AUTOGEN_VCS)
        cd $(lisp); $(setwins_almost); \
        echo Directories: $$wins; \
-       $(emacs) -l autoload --eval '(setq generated-autoload-file "$(lisp)/loaddefs.el")' -f batch-update-autoloads $$wins
+       $(emacs) -l autoload \
+           --eval '(setq autoload-builtin-package-versions t)' \
+           --eval '(setq generated-autoload-file (unmsys--file-name "$(abs_lisp)/loaddefs.el"))' \
+           -f batch-update-autoloads $$wins
 
 # 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.
@@ -183,7 +194,7 @@ $(lisp)/subdirs.el:
 update-subdirs: doit
        cd $(lisp); $(setwins_for_subdirs); \
        for file in $$wins; do \
-          $(top_srcdir)/build-aux/update-subdirs $$file; \
+          $(abs_top_srcdir)/build-aux/update-subdirs $$file; \
        done;
 
 .PHONY: updates bzr-update update-authors
@@ -205,8 +216,9 @@ update-authors:
        $(emacs) -l authors -f batch-update-authors $(top_srcdir)/etc/AUTHORS $(top_srcdir)
 
 TAGS TAGS-LISP: $(lisptagsfiles1) $(lisptagsfiles2) $(lisptagsfiles3) $(lisptagsfiles4)
-       els=`echo $(lisptagsfiles1) $(lisptagsfiles2) $(lisptagsfiles3) $(lisptagsfiles4) | sed -e "s,$(lisp)/[^ ]*loaddefs[^ ]*,," -e "s,$(lisp)/ldefs-boot[^ ]*,,"`; \
-       ${ETAGS} -o $@ $$els
+       rm -f $@; touch $@; \
+        echo $(lisptagsfiles1) $(lisptagsfiles2) $(lisptagsfiles3) $(lisptagsfiles4) | sed -e "s,$(lisp)/[^ ]*loaddefs[^ ]*,," -e "s,$(lisp)/ldefs-boot[^ ]*,," | \
+       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
@@ -274,7 +286,7 @@ compile-main: compile-clean
          test -f $$el || continue; \
          test ! -f $${el}c && GREP_OPTIONS= grep '^;.*no-byte-compile: t' $$el > /dev/null && continue; \
          echo "$${el}c"; \
-       done | xargs echo) | \
+       done | xargs $(XARGS_LIMIT) echo) | \
        while read chunk; do \
          $(MAKE) $(MFLAGS) compile-targets EMACS="$(EMACS)" TARGETS="$$chunk"; \
        done
@@ -298,14 +310,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) $(MFLAGS) 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) $(MFLAGS) compile EMACS="$(EMACS)"
 
 .PHONY: compile-calc backup-compiled-files compile-after-backup
 
@@ -369,7 +381,7 @@ mh-autoloads: $(MH_E_DIR)/mh-loaddefs.el
 $(MH_E_DIR)/mh-loaddefs.el: $(MH_E_SRC)
        $(emacs) -l autoload \
           --eval "(setq generate-autoload-cookie \";;;###mh-autoload\")" \
-          --eval "(setq generated-autoload-file \"$@\")" \
+          --eval "(setq generated-autoload-file (unmsys--file-name (expand-file-name \"$@\")))" \
           --eval "(setq make-backup-files nil)" \
           -f batch-update-autoloads $(MH_E_DIR)
 
@@ -387,7 +399,7 @@ TRAMP_SRC = $(TRAMP_DIR)/tramp.el    $(TRAMP_DIR)/tramp-adb.el      \
 $(TRAMP_DIR)/tramp-loaddefs.el: $(TRAMP_SRC)
        $(emacs) -l autoload \
           --eval "(setq generate-autoload-cookie \";;;###tramp-autoload\")" \
-          --eval "(setq generated-autoload-file \"$@\")" \
+          --eval "(setq generated-autoload-file (unmsys--file-name (expand-file-name \"$@\")))" \
           --eval "(setq make-backup-files nil)" \
           -f batch-update-autoloads $(TRAMP_DIR)
 
@@ -409,21 +421,21 @@ CAL_SRC = $(CAL_DIR)/cal-bahai.el $(CAL_DIR)/cal-china.el  \
 $(CAL_DIR)/cal-loaddefs.el: $(CAL_SRC)
        $(emacs) -l autoload \
           --eval "(setq generate-autoload-cookie \";;;###cal-autoload\")" \
-          --eval "(setq generated-autoload-file \"$@\")" \
+          --eval "(setq generated-autoload-file (unmsys--file-name (expand-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 \"$@\")" \
+          --eval "(setq generated-autoload-file (unmsys--file-name (expand-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 \"$@\")" \
+          --eval "(setq generated-autoload-file (unmsys--file-name (expand-file-name \"$@\")))" \
           --eval "(setq make-backup-files nil)" \
           -f batch-update-autoloads $(CAL_DIR)
 
@@ -433,7 +445,7 @@ bootstrap-clean:
        cd $(lisp); rm -f *.elc */*.elc */*/*.elc */*/*/*.elc $(AUTOGENEL)
 
 distclean:
-       -rm -f ./Makefile
+       -rm -f ./Makefile $(lisp)/loaddefs.el~
 
 maintainer-clean: distclean bootstrap-clean