gnulib: import mktime and move-if-change fixes from gnulib
[emacs.git] / lisp / makefile.w32-in
blobeb65bb7a60fe37f807800aa8c59b1c5964c95047
1 # -*- Makefile -*- for GNU Emacs on the Microsoft W32 API.
2 # Copyright (C) 2000-2011  Free Software Foundation, Inc.
4 # This file is part of GNU Emacs.
6 # GNU Emacs is free software: you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation, either version 3 of the License, or
9 # (at your option) any later version.
11 # GNU Emacs is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
19 ALL =
21 all: $(ALL)
23 SQUOTE='
24 # '
26 lisp = $(CURDIR)
27 srcdir = $(CURDIR)/..
29 # You can specify a different executable on the make command line,
30 # e.g. "make EMACS=../src/emacs ...".
32 EMACS = $(THISDIR)/../bin/emacs.exe
34 # Command line flags for Emacs.
36 EMACSOPT = -batch --no-site-file --no-site-lisp
38 # Extra flags to pass to the byte compiler
39 BYTE_COMPILE_EXTRA_FLAGS =
40 # For example to not display the undefined function warnings you can use this:
41 # BYTE_COMPILE_EXTRA_FLAGS = --eval '(setq byte-compile-warnings (quote (not unresolved)))'
42 # The example above is just for developers, it should not be used by default.
44 # Set EMACSLOADPATH correctly (already defined in environment).
45 EMACSLOADPATH=$(lisp)
47 # Use C locale
48 LC_ALL = C
50 lisptagsfiles1 = $(lisp)/*.el
51 lisptagsfiles2 = $(lisp)/*/*.el
52 lisptagsfiles3 = $(lisp)/*/*/*.el
53 lisptagsfiles4 = $(lisp)/*/*/*/*.el
54 ETAGS = "../lib-src/$(BLD)/etags.exe"
55 ## $(DEST) is overridden by ../src/makefile.w32-in.
56 DEST=$(lisp)
58 # Automatically generated autoload files, apart from lisp/loaddefs.el.
59 LOADDEFS = $(lisp)/calendar/cal-loaddefs.el \
60         $(lisp)/calendar/diary-loaddefs.el $(lisp)/calendar/hol-loaddefs.el \
61         $(lisp)/mh-e/mh-loaddefs.el $(lisp)/net/tramp-loaddefs.el
63 AUTOGENEL = $(lisp)/loaddefs.el $(LOADDEFS) $(lisp)/cus-load.el \
64         $(lisp)/finder-inf.el $(lisp)/subdirs.el $(lisp)/eshell/esh-groups.el \
65         $(lisp)/calc/calc-loaddefs.el $(lisp)/nxml/subdirs.el \
66         $(lisp)/cedet/semantic/loaddefs.el $(lisp)/cedet/ede/loaddefs.el \
67         $(lisp)/cedet/srecode/loaddefs.el
69 # Files to compile before others during a bootstrap.  This is done to
70 # speed up the bootstrap process.  The CC files are compiled first
71 # because CC mode tweaks the compilation process, and requiring
72 # cc-mode when it is not compiled doesn't work during the
73 # bootstrapping.
75 COMPILE_FIRST = \
76         $(lisp)/emacs-lisp/byte-opt.el \
77         $(lisp)/emacs-lisp/bytecomp.el \
78         $(lisp)/subr.el \
79         $(lisp)/progmodes/cc-mode.el \
80         $(lisp)/progmodes/cc-vars.el
82 # The actual Emacs command run in the targets below.
83 # The quotes around $(EMACS) are here because the user could type
84 # it with forward slashes and without quotes, which will fail if
85 # the shell is cmd.exe.
87 emacs = "$(EMACS)" $(EMACSOPT)
89 # Have to define the list of subdirs manually when not using sh.
90 WINS_CEDET=\
91         cedet \
92         cedet/ede \
93         cedet/semantic \
94         cedet/srecode \
95         cedet/semantic/analyze \
96         cedet/semantic/bovine \
97         cedet/semantic/decorate \
98         cedet/semantic/symref \
99         cedet/semantic/wisent
101 WINS_BASIC=\
102         calc \
103         calendar \
104         emacs-lisp \
105         emulation \
106         erc \
107         eshell \
108         gnus \
109         international \
110         language \
111         mail \
112         mh-e \
113         net \
114         nxml \
115         org \
116         play \
117         progmodes \
118         textmodes \
119         url \
120         vc
122 # Directories with lisp files to compile, and to extract data from
123 # (customs, autoloads, etc.)
124 WINS_UPDATES=$(WINS_BASIC) \
125         $(WINS_CEDET)
127 # Directories to add to subdirs.el
128 WINS_SUBDIR=$(WINS_BASIC) \
129         obsolete
131 # All directories
132 WINS= $(WINS_UPDATES) \
133         term \
134         obsolete
136 doit:
138 cus-load.el-SH:
139         echo ";;; cus-load.el --- automatically extracted custom dependencies" > $@
140         echo ";;" >> $@; echo ";;; Code:" >> $@
141         echo "\f" >> $@
142         echo ";; Local Variables:" >> $@
143         echo ";; version-control: never" >> $@
144         echo ";; no-byte-compile: t" >> $@
145         echo ";; no-update-autoloads: t" >> $@
146         echo ";; End:" >> $@
148 cus-load.el-CMD:
149         echo ;;; cus-load.el --- automatically extracted custom dependencies> $@
150         echo ;;>> $@
151         echo ;;; Code:>> $@
152         echo.\f>> $@
153         echo ;; Local Variables:>> $@
154         echo ;; version-control: never>> $@
155         echo ;; no-byte-compile: t>> $@
156         echo ;; no-update-autoloads: t>> $@
157         echo ;; End:>> $@
159 $(lisp)/cus-load.el:
160         $(MAKE) $(MFLAGS) cus-load.el-$(SHELLTYPE)
161         mv cus-load.el-$(SHELLTYPE) $@
163 # WARNING: Do NOT split the part inside $(ARGQUOTE)s into multiple lines as
164 #          this can break with GNU Make 3.81 and later if sh.exe is used.
165 custom-deps: $(lisp)/cus-load.el $(lisp)/loaddefs.el doit
166         @echo Directories: $(WINS_UPDATES)
167         -$(emacs) -l cus-dep --eval $(ARGQUOTE)(setq find-file-hook nil)$(ARGQUOTE) \
168                   -f custom-make-dependencies $(lisp) $(WINS_UPDATES)
170 finder-data: $(lisp)/loaddefs.el doit
171         @echo Directories: $(WINS_UPDATES)
172         $(emacs) -l finder -f finder-compile-keywords-make-dist $(lisp) $(WINS_UPDATES)
174 $(lisp)/loaddefs.el:
175         $(MAKE) $(MFLAGS) loaddefs.el-$(SHELLTYPE)
176         cp loaddefs.el-$(SHELLTYPE) $@
177         rm loaddefs.el-$(SHELLTYPE)
179 loaddefs.el-SH:
180         echo ";;; loaddefs.el --- automatically extracted autoloads" > $@
181         echo ";;" >> $@; echo ";;; Code:" >> $@
182         echo "\f" >> $@
183         echo ";; Local Variables:" >> $@
184         echo ";; version-control: never" >> $@
185         echo ";; no-byte-compile: t" >> $@
186         echo ";; no-update-autoloads: t" >> $@
187         echo ";; coding: utf-8" >> $@
188         echo ";; End:" >> $@
189         echo ";;; loaddefs.el ends here" >> $@
191 loaddefs.el-CMD:
192         echo ;;; loaddefs.el --- automatically extracted autoloads> $@
193         echo ;;>> $@
194         echo ;;; Code:>> $@
195         echo.\f>> $@
196         echo ;; Local Variables:>> $@
197         echo ;; version-control: never>> $@
198         echo ;; no-byte-compile: t>> $@
199         echo ;; no-update-autoloads: t>> $@
200         echo ;; coding: utf-8>> $@
201         echo ;; End:>> $@
202         echo ;;; loaddefs.el ends here>> $@
204 # Use . instead of $(lisp) because $(lisp) is an absolute file name,
205 # including a drive letter and any leading directories, so the generated
206 # loaddefs.el will mention file names that on other machine reference
207 # possibly non-existent directories.
209 # WARNING: Do NOT split the part inside $(ARGQUOTE)s into multiple lines as
210 #          this can break with GNU Make 3.81 and later if sh.exe is used.
211 autoloads: $(lisp)/loaddefs.el $(LOADDEFS) doit
212         @echo Directories: . $(WINS_UPDATES)
213         $(emacs) -l autoload \
214                 --eval $(ARGQUOTE)(setq find-file-hook nil find-file-suppress-same-file-warnings t)$(ARGQUOTE) \
215                 -f w32-batch-update-autoloads "$(lisp)/loaddefs.el" $(MAKE) . $(WINS_UPDATES)
217 $(lisp)/subdirs.el:
218         $(MAKE) $(MFLAGS) update-subdirs
220 # Need separate version for sh and native cmd.exe
221 update-subdirs: update-subdirs-$(SHELLTYPE)
223 update-subdirs-CMD: doit
224         echo ;; -*- no-byte-compile: t -*-> $(lisp)/subdirs.el
225         echo ;; In load-path, after this directory should come>> $(lisp)/subdirs.el
226         echo ;; certain of its subdirectories.  Here we specify them.>> $(lisp)/subdirs.el
227         echo (normal-top-level-add-to-load-path $(SQUOTE)(>> $(lisp)/subdirs.el
228         @for %%d in ($(WINS_SUBDIR) cedet) do echo "%%d">> $(lisp)/subdirs.el
229         echo ))>> $(lisp)/subdirs.el
231 update-subdirs-SH: doit
232         $(srcdir)/update-subdirs $(lisp); \
233         for file in $(WINS_SUBDIR); do \
234            $(srcdir)/update-subdirs $$file; \
235         done;
237 updates: update-subdirs autoloads mh-autoloads finder-data custom-deps
239 # This is useful after "bzr up".
240 bzr-update: recompile autoloads finder-data custom-deps
242 # For backwards compatibility:
243 cvs-update: bzr-update
245 # Update the AUTHORS file.
247 update-authors:
248         $(emacs) -l authors -f batch-update-authors $(srcdir)/etc/AUTHORS $(srcdir)
250 TAGS: TAGS-$(MAKETYPE)
252 TAGS-LISP: TAGS-LISP-$(MAKETYPE)
254 TAGS-nmake:
255         echo This target is not supported with NMake
256         exit -1
258 TAGS-LISP-nmake:
259         echo This target is not supported with NMake
260         exit -1
262 TAGS-gmake: TAGS-$(SHELLTYPE)
264 TAGS-LISP-gmake: TAGS-LISP-$(SHELLTYPE)
266 TAGS-SH: $(lisptagsfiles1) $(lisptagsfiles2) $(lisptagsfiles3) $(lisptagsfiles4)
267         - $(DEL) TAGS
268         for dir in . $(WINS_UPDATES); do \
269           $(ETAGS) -a $(lisp)/$$dir/*.el; \
270         done
272 TAGS-LISP-SH: $(lisptagsfiles1) $(lisptagsfiles2) $(lisptagsfiles3) $(lisptagsfiles4)
273         - $(DEL) $(DEST)/TAGS-LISP
274         for dir in . $(WINS_UPDATES); do \
275           $(ETAGS) -a -o $(DEST)/TAGS-LISP $(lisp)/$$dir/*.el; \
276         done
278 TAGS-CMD: $(lisptagsfiles1) $(lisptagsfiles2) $(lisptagsfiles3) $(lisptagsfiles4)
279         - $(DEL) TAGS
280         for %%d in (. $(WINS_UPDATES)) do $(ETAGS) -a $(lisp)/%%d/*.el
282 TAGS-LISP-CMD: $(lisptagsfiles1) $(lisptagsfiles2) $(lisptagsfiles3) $(lisptagsfiles4)
283         - $(DEL) $(DEST)/TAGS-LISP
284         for %%d in (. $(WINS_UPDATES)) do \
285           $(ETAGS) -a -o $(DEST)/TAGS-LISP $(lisp)/%%d/*.el
287 .SUFFIXES: .elc .el
289 .el.elc:
290         -$(emacs) $(BYTE_COMPILE_EXTRA_FLAGS) -f batch-byte-compile $<
292 # Compile all Lisp files, but don't recompile those that are up to
293 # date.  Some files don't actually get compiled because they set the
294 # local variable no-byte-compile.
296 # All .elc files are made writable before compilation in case we
297 # checked out read-only (CVS option -r).  Files MUST be compiled one by
298 # one.  If we compile several files in a row we can't make sure that
299 # the compilation environment is clean.  We also set the load-path of
300 # the Emacs used for compilation to the current directory and its
301 # subdirectories, to make sure require's and load's in the files being
302 # compiled find the right files.
304 # Need separate version for sh and native cmd.exe
305 compile: $(lisp)/subdirs.el mh-autoloads compile-$(SHELLTYPE) doit
307 compile-CMD:
308 #       -for %%f in ($(lisp) $(WINS)) do for %%g in (%%f\*.elc) do @attrib -r %%g
309         for %%f in ($(COMPILE_FIRST)) do \
310           $(emacs) -l loaddefs $(BYTE_COMPILE_EXTRA_FLAGS) -f batch-byte-compile-if-not-done %%f
311         for %%f in (. $(WINS)) do for %%g in (%%f/*.el) do \
312           $(emacs) -l loaddefs $(BYTE_COMPILE_EXTRA_FLAGS) -f batch-byte-compile-if-not-done %%f/%%g
314 compile-SH:
315 #       for elc in $(lisp)/*.elc $(lisp)/*/*.elc; do attrib -r $$elc; done
316         for el in $(COMPILE_FIRST); do \
317           echo Compiling $$el; \
318           $(emacs) -l loaddefs $(BYTE_COMPILE_EXTRA_FLAGS) -f batch-byte-compile-if-not-done $$el; \
319         done
320         for dir in $(lisp) $(WINS); do \
321           for el in $$dir/*.el; do \
322             if test -f $$el; \
323             then \
324               echo Compiling $$el; \
325               $(emacs) -l loaddefs $(BYTE_COMPILE_EXTRA_FLAGS) -f batch-byte-compile-if-not-done $$el; \
326             fi \
327           done; \
328         done
330 # Compile all Lisp files.  This is like `compile' but compiles files
331 # unconditionally.  Some files don't actually get compiled because they
332 # set the local variable no-byte-compile.
334 compile-always: $(lisp)/subdirs.el compile-always-$(SHELLTYPE) doit
336 compile-always-CMD:
337 #       -for %%f in ($(lisp) $(WINS)) do for %%g in (%%f\*.elc) do @attrib -r %%g
338         for %%f in ($(COMPILE_FIRST)) do $(emacs) $(BYTE_COMPILE_EXTRA_FLAGS) -f batch-byte-compile %%f
339         for %%f in (. $(WINS)) do for %%g in (%%f/*.el) do $(emacs) $(BYTE_COMPILE_EXTRA_FLAGS) -f batch-byte-compile %%f/%%g
341 compile-always-SH:
342 #       for elc in $(lisp)/*.elc $(lisp)/*/*.elc; do attrib -r $$elc; done
343         for el in $(COMPILE_FIRST); do \
344           echo Compiling $$el; \
345           $(emacs) $(BYTE_COMPILE_EXTRA_FLAGS) -f batch-byte-compile $$el || exit 1; \
346         done
347         for dir in $(lisp) $(WINS); do \
348           for el in $$dir/*.el; do \
349             echo Compiling $$el; \
350             $(emacs) $(BYTE_COMPILE_EXTRA_FLAGS) -f batch-byte-compile $$el || exit 1; \
351           done; \
352         done
354 compile-calc: compile-calc-$(SHELLTYPE)
356 compile-calc-CMD:
357         for %%f in ($(lisp)/calc/*.el) do $(emacs) $(BYTE_COMPILE_EXTRA_FLAGS) -f batch-byte-compile %%f
359 compile-calc-SH:
360         for el in $(lisp)/calc/*.el; do \
361           echo Compiling $$el; \
362           $(emacs) $(BYTE_COMPILE_EXTRA_FLAGS) -f batch-byte-compile $$el || exit 1; \
363         done
365 # Backup compiled Lisp files in elc.tar.gz.  If that file already
366 # exists, make a backup of it.
368 backup-compiled-files:
369         -mv $(lisp)/elc.tar.gz $(lisp)/elc.tar.gz~
370         -tar czf $(lisp)/elc.tar.gz $(lisp)/*.elc $(lisp)/*/*.elc
372 # Compile Lisp files, but save old compiled files first.
374 compile-after-backup: backup-compiled-files compile-always
376 compile-first:  $(lisp)/emacs-lisp/bytecomp.elc $(lisp)/emacs-lisp/byte-opt.elc \
377         $(lisp)/emacs-lisp/autoload.elc
379 # Recompile all Lisp files which are newer than their .elc files.
380 # Note that this doesn't create .elc files.  It only recompiles if an
381 # .elc is present.
382 # WARNING: Do NOT split the part inside $(ARGQUOTE)s into multiple lines as
383 #          this can break with GNU Make 3.81 and later if sh.exe is used.
384 recompile: compile-first autoloads doit $(lisp)/progmodes/cc-mode.elc
385         $(emacs) --eval $(ARGQUOTE)(batch-byte-recompile-directory 0)$(ARGQUOTE) $(lisp)
387 $(lisp)/calendar/cal-loaddefs.el:
388         "$(EMACS)" $(EMACSOPT) -l autoload \
389            --eval "(setq generate-autoload-cookie \";;;###cal-autoload\")" \
390            --eval "(setq find-file-suppress-same-file-warnings t)" \
391            --eval "(setq make-backup-files nil)" \
392            -f w32-batch-update-autoloads "$(lisp)/calendar/cal-loaddefs.el" \
393               $(MAKE) ./calendar
395 $(lisp)/calendar/diary-loaddefs.el:
396         "$(EMACS)" $(EMACSOPT) -l autoload \
397            --eval "(setq generate-autoload-cookie \";;;###diary-autoload\")" \
398            --eval "(setq find-file-suppress-same-file-warnings t)" \
399            --eval "(setq make-backup-files nil)" \
400            -f w32-batch-update-autoloads $(lisp)/calendar/diary-loaddefs.el \
401               $(MAKE) ./calendar
403 $(lisp)/calendar/hol-loaddefs.el:
404         "$(EMACS)" $(EMACSOPT) -l autoload \
405            --eval "(setq generate-autoload-cookie \";;;###holiday-autoload\")" \
406            --eval "(setq find-file-suppress-same-file-warnings t)" \
407            --eval "(setq make-backup-files nil)" \
408            -f w32-batch-update-autoloads $(lisp)/calendar/hol-loaddefs.el \
409               $(MAKE) ./calendar
411 # Update MH-E internal autoloads. These are not to be confused with
412 # the autoloads for the MH-E entry points, which are already in
413 # loaddefs.el.
414 MH_E_SRC = $(lisp)/mh-e/mh-acros.el $(lisp)/mh-e/mh-alias.el    \
415         $(lisp)/mh-e/mh-buffers.el $(lisp)/mh-e/mh-compat.el    \
416         $(lisp)/mh-e/mh-comp.el $(lisp)/mh-e/mh-e.el            \
417         $(lisp)/mh-e/mh-folder.el $(lisp)/mh-e/mh-funcs.el      \
418         $(lisp)/mh-e/mh-gnus.el $(lisp)/mh-e/mh-identity.el     \
419         $(lisp)/mh-e/mh-inc.el $(lisp)/mh-e/mh-junk.el          \
420         $(lisp)/mh-e/mh-letter.el $(lisp)/mh-e/mh-limit.el      \
421         $(lisp)/mh-e/mh-mime.el $(lisp)/mh-e/mh-print.el        \
422         $(lisp)/mh-e/mh-scan.el $(lisp)/mh-e/mh-search.el       \
423         $(lisp)/mh-e/mh-seq.el $(lisp)/mh-e/mh-show.el          \
424         $(lisp)/mh-e/mh-speed.el $(lisp)/mh-e/mh-thread.el      \
425         $(lisp)/mh-e/mh-tool-bar.el $(lisp)/mh-e/mh-utils.el    \
426         $(lisp)/mh-e/mh-xface.el
428 # See the commentary for autoloads above for why we use ./mh-e below
429 # instead of $(lisp)/mh-e.
430 mh-autoloads: $(lisp)/mh-e/mh-loaddefs.el
431 $(lisp)/mh-e/mh-loaddefs.el: $(MH_E_SRC)
432         "$(EMACS)" $(EMACSOPT) \
433            -l autoload \
434            --eval $(ARGQUOTE)(setq generate-autoload-cookie $(DQUOTE);;;###mh-autoload$(DQUOTE))$(ARGQUOTE) \
435            --eval $(ARGQUOTE)(setq find-file-suppress-same-file-warnings t)$(ARGQUOTE) \
436            --eval $(ARGQUOTE)(setq make-backup-files nil)$(ARGQUOTE) \
437            -f w32-batch-update-autoloads \
438            $(ARGQUOTE)$(lisp)/mh-e/mh-loaddefs.el$(ARGQUOTE) $(MAKE) ./mh-e
440 # Update TRAMP internal autoloads. Maybe we could move tramp*.el into
441 # its own subdirectory. OTOH, it does not hurt to keep them in
442 # lisp/net.
443 TRAMP_SRC = $(lisp)/net/tramp.el  $(lisp)/net/tramp-cache.el  \
444         $(lisp)/net/tramp-cmds.el $(lisp)/net/tramp-compat.el \
445         $(lisp)/net/tramp-ftp.el  $(lisp)/net/tramp-gvfs.el   \
446         $(lisp)/net/tramp-gw.el   $(lisp)/net/tramp-imap.el   \
447         $(lisp)/net/tramp-sh.el   $(lisp)/net/tramp-smb.el    \
448         $(lisp)/net/tramp-uu.el   $(lisp)/net/trampver.el
450 $(lisp)/net/tramp-loaddefs.el: $(TRAMP_SRC)
451         "$(EMACS)" $(EMACSOPT) \
452            -l autoload \
453            --eval $(ARGQUOTE)(setq generate-autoload-cookie $(DQUOTE);;;###tramp-autoload$(DQUOTE))$(ARGQUOTE) \
454            --eval $(ARGQUOTE)(setq find-file-suppress-same-file-warnings t)$(ARGQUOTE) \
455            --eval $(ARGQUOTE)(setq make-backup-files nil)$(ARGQUOTE) \
456            -f w32-batch-update-autoloads \
457            $(ARGQUOTE)$(lisp)/net/tramp-loaddefs.el$(ARGQUOTE) $(MAKE) ./net
459 # Prepare a bootstrap in the lisp subdirectory.
461 # Build loaddefs.el to make sure it's up-to-date.  If it's not, that
462 # might lead to errors during the bootstrap because something fails to
463 # autoload as expected.  If there is no emacs binary, then we can't
464 # build autoloads yet.  In that case we have to use ldefs-boot.el;
465 # bootstrap should always work with ldefs-boot.el.  (Because
466 # loaddefs.el is an automatically generated file, we don't want to
467 # store it in the source repository).
469 # Remove compiled Lisp files so that bootstrap-emacs will be built from
470 # sources only.
472 # Need separate version for sh and native cmd.exe
473 bootstrap-clean:
474         - $(DEL) $(lisp)/loaddefs.el
475         $(MAKE) $(MFLAGS) bootstrap-clean-$(SHELLTYPE)
477 bootstrap-clean-CMD:
478 #       if exist "$(EMACS)" $(MAKE) $(MFLAGS) autoloads
479         -for %%f in (. $(WINS)) do for %%g in (%%f\*.elc) do @$(DEL) %%g
481 bootstrap-clean-SH:
482 #       if test -f "$(EMACS)"; then $(MAKE) $(MFLAGS) autoloads; fi
483 #       -rm -f $(lisp)/*.elc $(lisp)/*/*.elc
484         -for dir in . $(WINS); do rm -f $$dir/*.elc $$dir/*/*.elc $$dir/*/*/*.elc; done
486 # Generate/update files for the bootstrap process.
487 # When done, remove bootstrap-emacs from ../bin, so that
488 # it will not be mistaken for an installed binary.
490 bootstrap: update-subdirs autoloads mh-autoloads compile finder-data custom-deps
491         - $(DEL) "$(EMACS)"
494 # Assuming INSTALL_DIR is defined, copy the elisp files to it
495 # Windows 95 makes this harder than it should be.
497 install:
498                 - mkdir "$(INSTALL_DIR)/lisp"
499                 - $(DEL) ../same-dir.tst
500                 - $(DEL) "$(INSTALL_DIR)/same-dir.tst"
501                 echo SameDirTest > "$(INSTALL_DIR)/same-dir.tst"
502 #ifdef COPY_LISP_SOURCE
503                 $(IFNOTSAMEDIR) $(MAKE) $(MFLAGS) install-lisp-$(SHELLTYPE) $(ENDIF)
504 #else
505 #               $(IFNOTSAMEDIR) $(CP_DIR) *.elc "$(INSTALL_DIR)/lisp" $(ENDIF)
506 #               $(IFNOTSAMEDIR) $(CP) cus-load.el "$(INSTALL_DIR)/lisp" $(ENDIF)
507 #               $(IFNOTSAMEDIR) $(CP) forms*.el "$(INSTALL_DIR)/lisp" $(ENDIF)
508 #               $(IFNOTSAMEDIR) $(CP) patcomp.el "$(INSTALL_DIR)/lisp" $(ENDIF)
509 #               $(IFNOTSAMEDIR) $(CP) subdirs.el "$(INSTALL_DIR)/lisp" $(ENDIF)
510 #               $(IFNOTSAMEDIR) $(CP) version.el "$(INSTALL_DIR)/lisp" $(ENDIF)
511 #               $(IFNOTSAMEDIR) $(CP) mail/blessmail.el "$(INSTALL_DIR)/lisp/mail" $(ENDIF)
512 #               $(IFNOTSAMEDIR) $(CP) mail/sc.el "$(INSTALL_DIR)/lisp/mail" $(ENDIF)
513 #               $(IFNOTSAMEDIR) $(CP) play/bruce.el "$(INSTALL_DIR)/lisp/play" $(ENDIF)
514 #               $(IFNOTSAMEDIR) $(CP) international/latin-*.el "$(INSTALL_DIR)/lisp/international" $(ENDIF)
515 #               $(IFNOTSAMEDIR) $(CP) international/mule-conf.el "$(INSTALL_DIR)/lisp/international" $(ENDIF)
516 #endif
517                 - $(DEL) ../same-dir.tst
518                 - $(DEL) "$(INSTALL_DIR)/same-dir.tst"
520 # Need to copy *.el files first, to avoid "source file is newer" annoyance
521 # since cp does not preserve time stamps
522 install-lisp-SH:
523         cp -f *.el "$(INSTALL_DIR)/lisp"
524         for dir in $(WINS); do [ -d "$(INSTALL_DIR)/lisp/$$dir" ] || mkdir "$(INSTALL_DIR)/lisp/$$dir"; done
525         for dir in $(WINS); do cp -f $$dir/*.el "$(INSTALL_DIR)/lisp/$$dir"; done
526         for dir in . $(WINS); do cp $$dir/*.elc "$(INSTALL_DIR)/lisp/$$dir"; done
528 install-lisp-CMD:
529         cp -f *.el "$(INSTALL_DIR)/lisp"
530         for %%f in ($(WINS)) do if not exist "$(INSTALL_DIR)/lisp/%%f" mkdir "$(INSTALL_DIR)/lisp/%%f"
531         for %%f in ($(WINS)) do cp -f %%f/*.el "$(INSTALL_DIR)/lisp/%%f"
532         for %%f in (. $(WINS)) do cp -f %%f/*.elc "$(INSTALL_DIR)/lisp/%%f"
534 # WARNING: Do NOT split the part inside $(ARGQUOTE)s into multiple lines as
535 #          this can break with GNU Make 3.81 and later if sh.exe is used.
536 check-declare:
537         $(emacs) -l $(lisp)/emacs-lisp/check-declare --eval $(ARGQUOTE)(check-declare-directory $(DQUOTE)$(lisp)$(DQUOTE))$(ARGQUOTE)
540 # Maintenance
542 # We used to delete *~ here, but that might inadvertently remove
543 # precious files if it happens to match their short 8+3 aliases.
544 clean:
545         - $(DEL) *.el~
546         - $(DEL) calc/calc-loaddefs.el~
547         - $(DEL) eshell/esh-groups.el~
549 distclean: clean
550         - $(DEL) $(lisp)/Makefile
552 maintainer-clean: bootstrap-clean distclean
553         - $(DEL) $(AUTOGENEL)
555 # Dependencies
557 # CC Mode uses a compile time macro system which causes a compile time
558 # dependency in cc-*.elc files on the macros in other cc-*.el and the
559 # version string in cc-defs.el.
560 $(lisp)/progmodes/cc-align.elc $(lisp)/progmodes/cc-awk.elc\
561  $(lisp)/progmodes/cc-cmds.elc $(lisp)/progmodes/cc-compat.elc\
562  $(lisp)/progmodes/cc-engine.elc $(lisp)/progmodes/cc-fonts.elc\
563  $(lisp)/progmodes/cc-langs.elc $(lisp)/progmodes/cc-menus.elc\
564  $(lisp)/progmodes/cc-mode.elc $(lisp)/progmodes/cc-styles.elc\
565  $(lisp)/progmodes/cc-vars.elc: \
566    $(lisp)/progmodes/cc-bytecomp.elc $(lisp)/progmodes/cc-defs.elc
568 $(lisp)/progmodes/cc-align.elc: \
569    $(lisp)/progmodes/cc-vars.elc $(lisp)/progmodes/cc-engine.elc
571 $(lisp)/progmodes/cc-cmds.elc: \
572    $(lisp)/progmodes/cc-vars.elc $(lisp)/progmodes/cc-engine.elc
574 $(lisp)/progmodes/cc-compat.elc: \
575    $(lisp)/progmodes/cc-vars.elc $(lisp)/progmodes/cc-styles.elc \
576    $(lisp)/progmodes/cc-engine.elc
578 $(lisp)/progmodes/cc-defs.elc: $(lisp)/progmodes/cc-bytecomp.elc \
579    $(lisp)/emacs-lisp/cl.elc $(lisp)/emacs-lisp/regexp-opt.elc
581 $(lisp)/progmodes/cc-engine.elc: $(lisp)/progmodes/cc-langs.elc \
582    $(lisp)/progmodes/cc-vars.elc
584 $(lisp)/progmodes/cc-fonts.elc: $(lisp)/progmodes/cc-langs.elc \
585    $(lisp)/progmodes/cc-vars.elc $(lisp)/progmodes/cc-engine.elc \
586    $(lisp)/font-lock.elc
588 $(lisp)/progmodes/cc-langs.elc: $(lisp)/progmodes/cc-vars.elc \
589    $(lisp)/emacs-lisp/cl.elc
591 $(lisp)/progmodes/cc-mode.elc: $(lisp)/progmodes/cc-langs.elc \
592    $(lisp)/progmodes/cc-vars.elc $(lisp)/progmodes/cc-engine.elc \
593    $(lisp)/progmodes/cc-styles.elc $(lisp)/progmodes/cc-cmds.elc \
594    $(lisp)/progmodes/cc-align.elc $(lisp)/progmodes/cc-menus.elc
596 $(lisp)/progmodes/cc-styles.elc: $(lisp)/progmodes/cc-vars.elc \
597    $(lisp)/progmodes/cc-align.elc
599 $(lisp)/progmodes/cc-vars.elc: $(lisp)/custom.elc $(lisp)/widget.elc
601 # MH-E dependencies, mainly to prevent failures with parallel
602 # compilation, due to race conditions between writing a given FOO.elc
603 # file and another file being compiled that says "(require FOO)",
604 # which causes Emacs to try to read FOO.elc.
605 MH_E_DIR = ./mh-e
606 $(MH_E_DIR)/mh-alias.elc $(MH_E_DIR)/mh-comp.elc $(MH_E_DIR)/mh-folder.elc\
607  $(MH_E_DIR)/mh-funcs.elc $(MH_E_DIR)/mh-identity.elc $(MH_E_DIR)/mh-inc.elc\
608  $(MH_E_DIR)/mh-junk.elc $(MH_E_DIR)/mh-letter.elc $(MH_E_DIR)/mh-limit.elc\
609  $(MH_E_DIR)/mh-mime.elc $(MH_E_DIR)/mh-print.elc $(MH_E_DIR)/mh-scan.elc\
610  $(MH_E_DIR)/mh-search.elc $(MH_E_DIR)/mh-seq.elc $(MH_E_DIR)/mh-show.elc\
611  $(MH_E_DIR)/mh-speed.elc $(MH_E_DIR)/mh-thread.elc $(MH_E_DIR)/mh-tool-bar.elc\
612  $(MH_E_DIR)/mh-utils.elc $(MH_E_DIR)/mh-xface.elc:\
613    $(MH_E_DIR)/mh-e.elc
615 $(MH_E_DIR)/mh-alias.elc $(MH_E_DIR)/mh-e.elc $(MH_E_DIR)/mh-folder.elc\
616  $(MH_E_DIR)/mh-inc.elc $(MH_E_DIR)/mh-junk.elc $(MH_E_DIR)/mh-limit.elc\
617  $(MH_E_DIR)/mh-search.elc $(MH_E_DIR)/mh-seq.elc $(MH_E_DIR)/mh-speed.elc\
618  $(MH_E_DIR)/mh-utils.elc $(MH_E_DIR)/mh-xface.elc:\
619    $(lisp)/emacs-lisp/cl.elc
621 $(MH_E_DIR)/mh-comp.elc $(MH_E_DIR)/mh-folder.elc $(MH_E_DIR)/mh-funcs.elc\
622  $(MH_E_DIR)/mh-junk.elc $(MH_E_DIR)/mh-limit.elc $(MH_E_DIR)/mh-print.elc\
623  $(MH_E_DIR)/mh-seq.elc $(MH_E_DIR)/mh-show.elc $(MH_E_DIR)/mh-thread.elc:\
624    $(MH_E_DIR)/mh-scan.elc
626 $(MH_E_DIR)/mh-folder.elc $(MH_E_DIR)/mh-letter.elc $(MH_E_DIR)/mh-mime.elc\
627  $(MH_E_DIR)/mh-search.elc $(MH_E_DIR)/mh-show.elc $(MH_E_DIR)/mh-speed.elc:\
628    $(lisp)/gnus/gnus-util.elc
630 $(MH_E_DIR)/mh-folder.elc $(MH_E_DIR)/mh-search.elc:\
631    $(lisp)/progmodes/which-func.elc
633 $(MH_E_DIR)/mh-letter.elc $(MH_E_DIR)/mh-seq.elc $(MH_E_DIR)/mh-show.elc\
634  $(MH_E_DIR)/mh-utils.elc:\
635    $(lisp)/font-lock.elc
637 $(MH_E_DIR)/mh-alias.elc $(MH_E_DIR)/mh-show.elc: $(lisp)/net/goto-addr.elc
639 $(MH_E_DIR)/mh-comp.elc: $(lisp)/mail/sendmail.elc
641 $(MH_E_DIR)/mh-e.elc: $(MH_E_DIR)/mh-buffers.elc $(lisp)/gnus/gnus.elc \
642    $(lisp)/cus-face.elc
644 $(MH_E_DIR)/mh-letter.elc: $(lisp)/gnus/mailcap.elc $(lisp)/gnus/mm-decode.elc \
645    $(lisp)/gnus/mm-view.elc  $(lisp)/gnus/mml.elc $(lisp)/gnus/message.elc
647 $(MH_E_DIR)/mh-print.elc:  $(lisp)/ps-print.elc
649 $(MH_E_DIR)/mh-search.elc: $(lisp)/imenu.elc
651 $(MH_E_DIR)/mh-show.elc: $(lisp)/gnus/gnus-cite.elc
653 $(MH_E_DIR)/mh-speed.elc: $(lisp)/speedbar.elc $(lisp)/emacs-lisp/timer.elc
655 $(MH_E_DIR)/mh-tool-bar.elc: $(lisp)/tool-bar.elc