don't require grep in vc-git
[bpt/emacs.git] / lisp / makefile.w32-in
index 2137607..cb2a1b4 100644 (file)
@@ -1,5 +1,5 @@
-# -*- Makefile -*- for GNU Emacs on the Microsoft W32 API.
-# Copyright (C) 2000-2012 Free Software Foundation, Inc.
+# -*- Makefile -*- for GNU Emacs on the Microsoft Windows API.
+# Copyright (C) 2000-2014 Free Software Foundation, Inc.
 
 # This file is part of GNU Emacs.
 
@@ -79,10 +79,10 @@ BYTE_COMPILE_FLAGS = $(BIG_STACK_OPTS) $(BYTE_COMPILE_EXTRA_FLAGS)
 # speed up the bootstrap process.
 
 COMPILE_FIRST = \
-       $(lisp)/emacs-lisp/bytecomp.el \
-       $(lisp)/emacs-lisp/byte-opt.el \
        $(lisp)/emacs-lisp/macroexp.el \
        $(lisp)/emacs-lisp/cconv.el \
+       $(lisp)/emacs-lisp/byte-opt.el \
+       $(lisp)/emacs-lisp/bytecomp.el \
        $(lisp)/emacs-lisp/autoload.el
 
 # The actual Emacs command run in the targets below.
@@ -104,27 +104,39 @@ WINS_CEDET=\
        cedet/semantic/symref \
        cedet/semantic/wisent
 
-WINS_BASIC=\
+# The list of subdirectories is subdivided into 4 more or less equal
+# parts so that we could have 4-way parallelism while compiling Lisp
+# files, which helps to slash bootstrap times.  See the 'compile'
+# target below.
+WINS_BASIC1=\
        calc \
        calendar \
        emacs-lisp \
-       emulation \
        erc \
-       eshell \
+       net \
+       url
+
+WINS_BASIC2=\
        gnus \
        international \
        language \
-       mail \
+       mail
+
+WINS_BASIC3=\
+       emulation \
        mh-e \
-       net \
        nxml \
        org \
        play \
-       progmodes \
        textmodes \
-       url \
        vc
 
+WINS_BASIC4=\
+       eshell \
+       progmodes
+
+WINS_BASIC= $(WINS_BASIC1) $(WINS_BASIC2) $(WINS_BASIC3) $(WINS_BASIC4)
+
 # Directories with lisp files to compile, and to extract data from
 # (customs, autoloads, etc.)
 WINS_UPDATES=$(WINS_BASIC) \
@@ -168,12 +180,12 @@ $(lisp)/cus-load.el:
 
 # 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
+custom-deps: $(lisp)/cus-load.el $(lisp)/loaddefs.el $(lisp)/subdirs.el doit
        @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
+finder-data: $(lisp)/loaddefs.el $(lisp)/subdirs.el doit
        @echo Directories: $(WINS_UPDATES)
        $(emacs) -l finder -f finder-compile-keywords-make-dist $(lisp) $(WINS_UPDATES)
 
@@ -243,7 +255,7 @@ update-subdirs-SH: doit
           $(srcdir)/build-aux/update-subdirs $$file; \
        done;
 
-updates: update-subdirs autoloads mh-autoloads finder-data custom-deps
+updates: $(lisp)/subdirs.el autoloads mh-autoloads finder-data custom-deps
 
 # This is useful after "bzr up".
 bzr-update: recompile autoloads finder-data custom-deps
@@ -311,22 +323,71 @@ TAGS-LISP-CMD: $(lisptagsfiles1) $(lisptagsfiles2) $(lisptagsfiles3) $(lisptagsf
 # compiled find the right files.
 
 # Need separate version for sh and native cmd.exe
-compile: $(lisp)/subdirs.el compile-$(SHELLTYPE) doit
+compile: $(lisp)/subdirs.el compile0-$(SHELLTYPE) compile1-$(SHELLTYPE) compile2-$(SHELLTYPE) compile3-$(SHELLTYPE) compile4-$(SHELLTYPE) doit
 
-compile-CMD: autoloads
+compile0-CMD: autoloads
 #      -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_FLAGS) -f batch-byte-compile-if-not-done %%f
-       for %%f in (. $(WINS)) do for %%g in (%%f/*.el) do \
+
+compile1-CMD: autoloads compile0-CMD
+       for %%f in (. $(WINS_BASIC1)) do for %%g in (%%f/*.el) do \
+         $(emacs) -l loaddefs $(BYTE_COMPILE_FLAGS) -f batch-byte-compile-if-not-done %%f/%%g
+
+compile2-CMD: autoloads compile0-CMD
+       for %%f in ($(WINS_BASIC2)) do for %%g in (%%f/*.el) do \
+         $(emacs) -l loaddefs $(BYTE_COMPILE_FLAGS) -f batch-byte-compile-if-not-done %%f/%%g
+
+compile3-CMD: autoloads compile0-CMD
+       for %%f in ($(WINS_BASIC3)) do for %%g in (%%f/*.el) do \
          $(emacs) -l loaddefs $(BYTE_COMPILE_FLAGS) -f batch-byte-compile-if-not-done %%f/%%g
 
-compile-SH: autoloads
+compile4-CMD: autoloads compile0-CMD
+       for %%f in ($(WINS_BASIC4) $(WINS_CEDET) term obsolete) do for %%g in (%%f/*.el) do \
+         $(emacs) -l loaddefs $(BYTE_COMPILE_FLAGS) -f batch-byte-compile-if-not-done %%f/%%g
+
+compile0-SH: autoloads
 #      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_FLAGS) -f batch-byte-compile-if-not-done $$el; \
        done
-       for dir in $(lisp) $(WINS); do \
+
+compile1-SH: autoloads compile0-SH
+       for dir in $(lisp) $(WINS_BASIC1); do \
+         for el in $$dir/*.el; do \
+           if test -f $$el; \
+           then \
+             echo Compiling $$el; \
+             $(emacs) -l loaddefs $(BYTE_COMPILE_FLAGS) -f batch-byte-compile-if-not-done $$el; \
+           fi \
+         done; \
+       done
+
+compile2-SH: autoloads compile0-SH
+       for dir in $(WINS_BASIC2); do \
+         for el in $$dir/*.el; do \
+           if test -f $$el; \
+           then \
+             echo Compiling $$el; \
+             $(emacs) -l loaddefs $(BYTE_COMPILE_FLAGS) -f batch-byte-compile-if-not-done $$el; \
+           fi \
+         done; \
+       done
+
+compile3-SH: autoloads compile0-SH
+       for dir in $(WINS_BASIC3); do \
+         for el in $$dir/*.el; do \
+           if test -f $$el; \
+           then \
+             echo Compiling $$el; \
+             $(emacs) -l loaddefs $(BYTE_COMPILE_FLAGS) -f batch-byte-compile-if-not-done $$el; \
+           fi \
+         done; \
+       done
+
+compile4-SH: autoloads compile0-SH
+       for dir in $(WINS_BASIC4) $(WINS_CEDET) term obsolete; do \
          for el in $$dir/*.el; do \
            if test -f $$el; \
            then \
@@ -383,7 +444,7 @@ backup-compiled-files:
 compile-after-backup: backup-compiled-files compile-always
 
 compile-first:         $(lisp)/emacs-lisp/bytecomp.elc $(lisp)/emacs-lisp/byte-opt.elc \
-       $(lisp)/emacs-lisp/autoload.elc
+       $(lisp)/emacs-lisp/autoload.elc $(lisp)/subdirs.el
 
 # Recompile all Lisp files which are newer than their .elc files.
 # Note that this doesn't create .elc files.  It only recompiles if an
@@ -393,7 +454,7 @@ compile-first:      $(lisp)/emacs-lisp/bytecomp.elc $(lisp)/emacs-lisp/byte-opt.elc
 recompile: compile-first autoloads doit $(lisp)/progmodes/cc-mode.elc
        $(emacs) --eval $(ARGQUOTE)(batch-byte-recompile-directory 0)$(ARGQUOTE) $(lisp)
 
-$(lisp)/calendar/cal-loaddefs.el:
+$(lisp)/calendar/cal-loaddefs.el: $(lisp)/subdirs.el
        "$(EMACS)" $(EMACSOPT) -l autoload \
           --eval "(setq generate-autoload-cookie \";;;###cal-autoload\")" \
           --eval "(setq find-file-suppress-same-file-warnings t)" \
@@ -401,7 +462,7 @@ $(lisp)/calendar/cal-loaddefs.el:
           -f w32-batch-update-autoloads "$(lisp)/calendar/cal-loaddefs.el" \
              $(MAKE) ./calendar
 
-$(lisp)/calendar/diary-loaddefs.el:
+$(lisp)/calendar/diary-loaddefs.el: $(lisp)/subdirs.el
        "$(EMACS)" $(EMACSOPT) -l autoload \
           --eval "(setq generate-autoload-cookie \";;;###diary-autoload\")" \
           --eval "(setq find-file-suppress-same-file-warnings t)" \
@@ -409,7 +470,7 @@ $(lisp)/calendar/diary-loaddefs.el:
           -f w32-batch-update-autoloads $(lisp)/calendar/diary-loaddefs.el \
              $(MAKE) ./calendar
 
-$(lisp)/calendar/hol-loaddefs.el:
+$(lisp)/calendar/hol-loaddefs.el: $(lisp)/subdirs.el
        "$(EMACS)" $(EMACSOPT) -l autoload \
           --eval "(setq generate-autoload-cookie \";;;###holiday-autoload\")" \
           --eval "(setq find-file-suppress-same-file-warnings t)" \
@@ -437,7 +498,7 @@ MH_E_SRC = $(lisp)/mh-e/mh-acros.el $(lisp)/mh-e/mh-alias.el        \
 # See the commentary for autoloads above for why we use ./mh-e below
 # instead of $(lisp)/mh-e.
 mh-autoloads: $(lisp)/mh-e/mh-loaddefs.el
-$(lisp)/mh-e/mh-loaddefs.el: $(MH_E_SRC)
+$(lisp)/mh-e/mh-loaddefs.el: $(MH_E_SRC) $(lisp)/subdirs.el
        "$(EMACS)" $(EMACSOPT) \
           -l autoload \
           --eval $(ARGQUOTE)(setq generate-autoload-cookie $(DQUOTE);;;###mh-autoload$(DQUOTE))$(ARGQUOTE) \
@@ -447,23 +508,24 @@ $(lisp)/mh-e/mh-loaddefs.el: $(MH_E_SRC)
           $(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
+# an 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)
+TRAMP_DIR = $(lisp)/net
+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) $(lisp)/subdirs.el
        "$(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
+          $(ARGQUOTE)$(TRAMP_DIR)/tramp-loaddefs.el$(ARGQUOTE) $(MAKE) ./net
 
 # Prepare a bootstrap in the lisp subdirectory.
 #
@@ -481,6 +543,7 @@ $(lisp)/net/tramp-loaddefs.el: $(TRAMP_SRC)
 # Need separate version for sh and native cmd.exe
 bootstrap-clean:
        - $(DEL) $(lisp)/loaddefs.el
+       - $(DEL) $(lisp)/subdirs.el
        $(MAKE) $(MFLAGS) bootstrap-clean-$(SHELLTYPE)
 
 bootstrap-clean-CMD:
@@ -496,7 +559,7 @@ bootstrap-clean-SH:
 # When done, remove bootstrap-emacs from ../bin, so that
 # it will not be mistaken for an installed binary.
 
-bootstrap: update-subdirs compile finder-data custom-deps
+bootstrap: $(lisp)/subdirs.el compile finder-data custom-deps
        - $(DEL) "$(EMACS)"
 
 #
@@ -600,7 +663,8 @@ $(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 \
    $(lisp)/progmodes/cc-styles.elc $(lisp)/progmodes/cc-cmds.elc \
-   $(lisp)/progmodes/cc-align.elc $(lisp)/progmodes/cc-menus.elc
+   $(lisp)/progmodes/cc-align.elc $(lisp)/progmodes/cc-menus.elc \
+   $(lisp)/subdirs.el
 
 $(lisp)/progmodes/cc-styles.elc: $(lisp)/progmodes/cc-vars.elc \
    $(lisp)/progmodes/cc-align.elc