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