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