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