erc: use auth-source
[bpt/emacs.git] / lisp / makefile.w32-in
CommitLineData
5288ec68 1# -*- Makefile -*- for GNU Emacs on the Microsoft W32 API.
ff0c3cfb 2# Copyright (C) 2000-2012 Free Software Foundation, Inc.
eb3fa2cf 3
5288ec68 4# This file is part of GNU Emacs.
eb3fa2cf
GM
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/>.
7bbaaedd
AI
18
19ALL =
20
21all: $(ALL)
22
23SQUOTE='
24# '
25
6610f4b2 26lisp = $(CURDIR)
9b006cb2 27srcdir = $(CURDIR)/..
7bbaaedd
AI
28
29# You can specify a different executable on the make command line,
35eae264 30# e.g. "make EMACS=../bin/emacs ...".
7bbaaedd 31
35eae264 32EMACS = ../src/$(BLD)/emacs.exe
7bbaaedd 33
198a7a97 34# Command line flags for Emacs.
7bbaaedd 35
e7a42417 36EMACSOPT = -batch --no-site-file --no-site-lisp
7bbaaedd 37
8b9a5623
EZ
38# Extra flags to pass to the byte compiler
39BYTE_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
cc7aa053
AI
44# Set EMACSLOADPATH correctly (already defined in environment).
45EMACSLOADPATH=$(lisp)
46
dd6ab82f
MB
47# Use C locale
48LC_ALL = C
49
7bbaaedd
AI
50lisptagsfiles1 = $(lisp)/*.el
51lisptagsfiles2 = $(lisp)/*/*.el
73077a9a
EZ
52lisptagsfiles3 = $(lisp)/*/*/*.el
53lisptagsfiles4 = $(lisp)/*/*/*/*.el
54ETAGS = "../lib-src/$(BLD)/etags.exe"
55## $(DEST) is overridden by ../src/makefile.w32-in.
56DEST=$(lisp)
7bbaaedd 57
c79a07d7
EZ
58# Automatically generated autoload files, apart from lisp/loaddefs.el.
59LOADDEFS = $(lisp)/calendar/cal-loaddefs.el \
3dc94c30 60 $(lisp)/calendar/diary-loaddefs.el $(lisp)/calendar/hol-loaddefs.el \
5d921df2 61 $(lisp)/mh-e/mh-loaddefs.el $(lisp)/net/tramp-loaddefs.el
3dc94c30
JR
62
63AUTOGENEL = $(lisp)/loaddefs.el $(LOADDEFS) $(lisp)/cus-load.el \
f01d54ca 64 $(lisp)/finder-inf.el $(lisp)/subdirs.el $(lisp)/eshell/esh-groups.el \
8f885d01
EZ
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
c79a07d7 68
2ec42da9
SM
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#
1e48e282 73BIG_STACK_DEPTH = 2200
2ec42da9
SM
74BIG_STACK_OPTS = --eval "(setq max-lisp-eval-depth $(BIG_STACK_DEPTH))"
75
76BYTE_COMPILE_FLAGS = $(BIG_STACK_OPTS) $(BYTE_COMPILE_EXTRA_FLAGS)
77
170a9e70
GM
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.
7bbaaedd
AI
83
84COMPILE_FIRST = \
85 $(lisp)/emacs-lisp/byte-opt.el \
86 $(lisp)/emacs-lisp/bytecomp.el \
2663659f
SM
87 $(lisp)/emacs-lisp/macroexp.el \
88 $(lisp)/emacs-lisp/cconv.el \
170a9e70
GM
89 $(lisp)/progmodes/cc-mode.el \
90 $(lisp)/progmodes/cc-vars.el
7bbaaedd
AI
91
92# The actual Emacs command run in the targets below.
3196bfd2
EZ
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.
7bbaaedd 96
3196bfd2 97emacs = "$(EMACS)" $(EMACSOPT)
7bbaaedd 98
7bbaaedd 99# Have to define the list of subdirs manually when not using sh.
79711e36 100WINS_CEDET=\
d2bda74f 101 cedet \
79711e36
JB
102 cedet/ede \
103 cedet/semantic \
82d3343c 104 cedet/srecode \
b4a74f30
EZ
105 cedet/semantic/analyze \
106 cedet/semantic/bovine \
107 cedet/semantic/decorate \
108 cedet/semantic/symref \
109 cedet/semantic/wisent
110
79711e36 111WINS_BASIC=\
1142be39 112 calc \
7bbaaedd
AI
113 calendar \
114 emacs-lisp \
115 emulation \
3e66f07c 116 erc \
7bbaaedd
AI
117 eshell \
118 gnus \
119 international \
120 language \
121 mail \
942da20c 122 mh-e \
7bbaaedd 123 net \
14521da1 124 nxml \
41d7a854 125 org \
7bbaaedd
AI
126 play \
127 progmodes \
b036f5d8 128 textmodes \
5fee75d4
JB
129 url \
130 vc
7bbaaedd 131
82d3343c
CY
132# Directories with lisp files to compile, and to extract data from
133# (customs, autoloads, etc.)
134WINS_UPDATES=$(WINS_BASIC) \
79711e36
JB
135 $(WINS_CEDET)
136
8c4afe20 137# Directories to add to subdirs.el
79711e36
JB
138WINS_SUBDIR=$(WINS_BASIC) \
139 obsolete
140
82d3343c
CY
141# All directories
142WINS= $(WINS_UPDATES) \
cba3dac5 143 term \
3aeca4ac
JB
144 obsolete
145
7bbaaedd
AI
146doit:
147
d2373df5
EZ
148cus-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
158cus-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
bad197f0 169$(lisp)/cus-load.el:
d2373df5
EZ
170 $(MAKE) $(MFLAGS) cus-load.el-$(SHELLTYPE)
171 mv cus-load.el-$(SHELLTYPE) $@
172
c3d49b7a
EZ
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.
f2133d9e 175custom-deps: $(lisp)/cus-load.el $(lisp)/loaddefs.el doit
8c4afe20
JB
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)
7bbaaedd 179
f2133d9e 180finder-data: $(lisp)/loaddefs.el doit
8c4afe20
JB
181 @echo Directories: $(WINS_UPDATES)
182 $(emacs) -l finder -f finder-compile-keywords-make-dist $(lisp) $(WINS_UPDATES)
7bbaaedd 183
bad197f0 184$(lisp)/loaddefs.el:
e22b24eb
AI
185 $(MAKE) $(MFLAGS) loaddefs.el-$(SHELLTYPE)
186 cp loaddefs.el-$(SHELLTYPE) $@
187 rm loaddefs.el-$(SHELLTYPE)
188
189loaddefs.el-SH:
190 echo ";;; loaddefs.el --- automatically extracted autoloads" > $@
191 echo ";;" >> $@; echo ";;; Code:" >> $@
e22b24eb 192 echo "\f" >> $@
329b2661
JB
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:" >> $@
e22b24eb
AI
199 echo ";;; loaddefs.el ends here" >> $@
200
201loaddefs.el-CMD:
7bbaaedd 202 echo ;;; loaddefs.el --- automatically extracted autoloads> $@
329b2661 203 echo ;;>> $@
7bbaaedd 204 echo ;;; Code:>> $@
bad197f0 205 echo.\f>> $@
329b2661
JB
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:>> $@
7bbaaedd
AI
212 echo ;;; loaddefs.el ends here>> $@
213
81293113
EZ
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.
c3d49b7a
EZ
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.
c79a07d7 221autoloads: $(lisp)/loaddefs.el $(LOADDEFS) doit
8c4afe20 222 @echo Directories: . $(WINS_UPDATES)
c5bdb93d 223 $(emacs) -l autoload \
7c417300 224 --eval $(ARGQUOTE)(setq find-file-hook nil find-file-suppress-same-file-warnings t)$(ARGQUOTE) \
5288ec68 225 -f w32-batch-update-autoloads "$(lisp)/loaddefs.el" $(MAKE) . $(WINS_UPDATES)
7bbaaedd 226
bad197f0 227$(lisp)/subdirs.el:
7bbaaedd
AI
228 $(MAKE) $(MFLAGS) update-subdirs
229
230# Need separate version for sh and native cmd.exe
231update-subdirs: update-subdirs-$(SHELLTYPE)
232
233update-subdirs-CMD: doit
e152e577 234 echo ;; In load-path, after this directory should come> $(lisp)/subdirs.el
bad197f0
JR
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
a5b7b0eb 237 @for %%d in ($(WINS_SUBDIR) cedet) do echo "%%d">> $(lisp)/subdirs.el
bad197f0 238 echo ))>> $(lisp)/subdirs.el
e152e577
JB
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
7bbaaedd
AI
243
244update-subdirs-SH: doit
ff0c3cfb 245 $(srcdir)/build-aux/update-subdirs $(lisp); \
d2bda74f 246 for file in $(WINS_SUBDIR); do \
ff0c3cfb 247 $(srcdir)/build-aux/update-subdirs $$file; \
7bbaaedd
AI
248 done;
249
ba2b2673 250updates: update-subdirs autoloads mh-autoloads finder-data custom-deps
7bbaaedd 251
38c1ba62
EZ
252# This is useful after "bzr up".
253bzr-update: recompile autoloads finder-data custom-deps
254
255# For backwards compatibility:
256cvs-update: bzr-update
a9d25c79 257
9b006cb2
AI
258# Update the AUTHORS file.
259
260update-authors:
ed5e0894 261 $(emacs) -l authors -f batch-update-authors $(srcdir)/etc/AUTHORS $(srcdir)
9b006cb2 262
73077a9a 263TAGS: TAGS-$(MAKETYPE)
7bbaaedd 264
73077a9a
EZ
265TAGS-LISP: TAGS-LISP-$(MAKETYPE)
266
267TAGS-nmake:
268 echo This target is not supported with NMake
269 exit -1
270
271TAGS-LISP-nmake:
272 echo This target is not supported with NMake
273 exit -1
274
275TAGS-gmake: TAGS-$(SHELLTYPE)
276
277TAGS-LISP-gmake: TAGS-LISP-$(SHELLTYPE)
278
279TAGS-SH: $(lisptagsfiles1) $(lisptagsfiles2) $(lisptagsfiles3) $(lisptagsfiles4)
280 - $(DEL) TAGS
281 for dir in . $(WINS_UPDATES); do \
282 $(ETAGS) -a $(lisp)/$$dir/*.el; \
283 done
284
285TAGS-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
291TAGS-CMD: $(lisptagsfiles1) $(lisptagsfiles2) $(lisptagsfiles3) $(lisptagsfiles4)
292 - $(DEL) TAGS
293 for %%d in (. $(WINS_UPDATES)) do $(ETAGS) -a $(lisp)/%%d/*.el
294
295TAGS-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
7bbaaedd 299
49060c51
AI
300.SUFFIXES: .elc .el
301
7bbaaedd 302.el.elc:
2ec42da9 303 -$(emacs) $(BYTE_COMPILE_FLAGS) -f batch-byte-compile $<
7bbaaedd 304
8f801552
LK
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.
7bbaaedd 308
8f801552
LK
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.
7bbaaedd
AI
316
317# Need separate version for sh and native cmd.exe
8a26b487 318compile: $(lisp)/subdirs.el compile-$(SHELLTYPE) doit
7bbaaedd 319
8a26b487 320compile-CMD: autoloads
80bb1e21
JR
321# -for %%f in ($(lisp) $(WINS)) do for %%g in (%%f\*.elc) do @attrib -r %%g
322 for %%f in ($(COMPILE_FIRST)) do \
2ec42da9 323 $(emacs) -l loaddefs $(BYTE_COMPILE_FLAGS) -f batch-byte-compile-if-not-done %%f
80bb1e21 324 for %%f in (. $(WINS)) do for %%g in (%%f/*.el) do \
2ec42da9 325 $(emacs) -l loaddefs $(BYTE_COMPILE_FLAGS) -f batch-byte-compile-if-not-done %%f/%%g
0702b995 326
8a26b487 327compile-SH: autoloads
9b006cb2
AI
328# for elc in $(lisp)/*.elc $(lisp)/*/*.elc; do attrib -r $$elc; done
329 for el in $(COMPILE_FIRST); do \
330 echo Compiling $$el; \
2ec42da9 331 $(emacs) -l loaddefs $(BYTE_COMPILE_FLAGS) -f batch-byte-compile-if-not-done $$el; \
9b006cb2
AI
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; \
2ec42da9 338 $(emacs) -l loaddefs $(BYTE_COMPILE_FLAGS) -f batch-byte-compile-if-not-done $$el; \
9b006cb2
AI
339 fi \
340 done; \
341 done
342
8f801552
LK
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
bad197f0 347compile-always: $(lisp)/subdirs.el compile-always-$(SHELLTYPE) doit
9b006cb2
AI
348
349compile-always-CMD:
80bb1e21 350# -for %%f in ($(lisp) $(WINS)) do for %%g in (%%f\*.elc) do @attrib -r %%g
2ec42da9
SM
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
7bbaaedd 353
9b006cb2 354compile-always-SH:
7bbaaedd
AI
355# for elc in $(lisp)/*.elc $(lisp)/*/*.elc; do attrib -r $$elc; done
356 for el in $(COMPILE_FIRST); do \
357 echo Compiling $$el; \
2ec42da9 358 $(emacs) $(BYTE_COMPILE_FLAGS) -f batch-byte-compile $$el || exit 1; \
7bbaaedd
AI
359 done
360 for dir in $(lisp) $(WINS); do \
361 for el in $$dir/*.el; do \
362 echo Compiling $$el; \
2ec42da9 363 $(emacs) $(BYTE_COMPILE_FLAGS) -f batch-byte-compile $$el || exit 1; \
7bbaaedd
AI
364 done; \
365 done
366
9b006cb2
AI
367compile-calc: compile-calc-$(SHELLTYPE)
368
369compile-calc-CMD:
2ec42da9 370 for %%f in ($(lisp)/calc/*.el) do $(emacs) $(BYTE_COMPILE_FLAGS) -f batch-byte-compile %%f
9b006cb2 371
c45dbde8 372compile-calc-SH:
9b006cb2
AI
373 for el in $(lisp)/calc/*.el; do \
374 echo Compiling $$el; \
2ec42da9 375 $(emacs) $(BYTE_COMPILE_FLAGS) -f batch-byte-compile $$el || exit 1; \
9b006cb2
AI
376 done
377
7bbaaedd
AI
378# Backup compiled Lisp files in elc.tar.gz. If that file already
379# exists, make a backup of it.
380
381backup-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
d198b6f5 387compile-after-backup: backup-compiled-files compile-always
7bbaaedd 388
0b8e2d21
EZ
389compile-first: $(lisp)/emacs-lisp/bytecomp.elc $(lisp)/emacs-lisp/byte-opt.elc \
390 $(lisp)/emacs-lisp/autoload.elc
391
7bbaaedd
AI
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.
53fad1e4
EZ
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.
0b8e2d21 397recompile: compile-first autoloads doit $(lisp)/progmodes/cc-mode.elc
53fad1e4 398 $(emacs) --eval $(ARGQUOTE)(batch-byte-recompile-directory 0)$(ARGQUOTE) $(lisp)
7bbaaedd 399
c79a07d7
EZ
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" \
5288ec68 406 $(MAKE) ./calendar
c79a07d7
EZ
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 \
5288ec68 414 $(MAKE) ./calendar
c79a07d7
EZ
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 \
5288ec68 422 $(MAKE) ./calendar
c79a07d7 423
ba2b2673
BW
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.
e9b28650 427MH_E_SRC = $(lisp)/mh-e/mh-acros.el $(lisp)/mh-e/mh-alias.el \
3e66f07c
JB
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
ba2b2673 440
43618a57
EZ
441# See the commentary for autoloads above for why we use ./mh-e below
442# instead of $(lisp)/mh-e.
ba2b2673 443mh-autoloads: $(lisp)/mh-e/mh-loaddefs.el
e9b28650 444$(lisp)/mh-e/mh-loaddefs.el: $(MH_E_SRC)
3152b1eb 445 "$(EMACS)" $(EMACSOPT) \
e3188d80 446 -l autoload \
3dc94c30
JR
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) \
7c417300 450 -f w32-batch-update-autoloads \
5288ec68 451 $(ARGQUOTE)$(lisp)/mh-e/mh-loaddefs.el$(ARGQUOTE) $(MAKE) ./mh-e
e3188d80 452
5d921df2
JB
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.
456TRAMP_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 \
35f52ed6
JB
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
5d921df2
JB
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
54ab09c4
MB
472# Prepare a bootstrap in the lisp subdirectory.
473#
e8dbbf6f
EZ
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).
54ab09c4
MB
481#
482# Remove compiled Lisp files so that bootstrap-emacs will be built from
483# sources only.
7bbaaedd
AI
484
485# Need separate version for sh and native cmd.exe
329b2661
JB
486bootstrap-clean:
487 - $(DEL) $(lisp)/loaddefs.el
512dd711 488 $(MAKE) $(MFLAGS) bootstrap-clean-$(SHELLTYPE)
7bbaaedd
AI
489
490bootstrap-clean-CMD:
3152b1eb 491# if exist "$(EMACS)" $(MAKE) $(MFLAGS) autoloads
80bb1e21 492 -for %%f in (. $(WINS)) do for %%g in (%%f\*.elc) do @$(DEL) %%g
7bbaaedd
AI
493
494bootstrap-clean-SH:
3152b1eb 495# if test -f "$(EMACS)"; then $(MAKE) $(MFLAGS) autoloads; fi
a3599c30 496# -rm -f $(lisp)/*.elc $(lisp)/*/*.elc
82d3343c 497 -for dir in . $(WINS); do rm -f $$dir/*.elc $$dir/*/*.elc $$dir/*/*/*.elc; done
7bbaaedd
AI
498
499# Generate/update files for the bootstrap process.
014b37b6
EZ
500# When done, remove bootstrap-emacs from ../bin, so that
501# it will not be mistaken for an installed binary.
7bbaaedd 502
8a26b487 503bootstrap: update-subdirs compile finder-data custom-deps
3152b1eb 504 - $(DEL) "$(EMACS)"
7bbaaedd
AI
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#
510install:
511 - mkdir "$(INSTALL_DIR)/lisp"
e5a69fd0
EZ
512 - $(DEL) ../$(DIRNAME)_same-dir.tst
513 - $(DEL) "$(INSTALL_DIR)/$(DIRNAME)_same-dir.tst"
514 echo SameDirTest > "$(INSTALL_DIR)/$(DIRNAME)_same-dir.tst"
7bbaaedd 515#ifdef COPY_LISP_SOURCE
564a3032 516 $(IFNOTSAMEDIR) $(MAKE) $(MFLAGS) install-lisp-$(SHELLTYPE) $(ENDIF)
7bbaaedd
AI
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
e5a69fd0
EZ
530 - $(DEL) ../$(DIRNAME)_same-dir.tst
531 - $(DEL) "$(INSTALL_DIR)/$(DIRNAME)_same-dir.tst"
7bbaaedd 532
564a3032
EZ
533# Need to copy *.el files first, to avoid "source file is newer" annoyance
534# since cp does not preserve time stamps
535install-lisp-SH:
536 cp -f *.el "$(INSTALL_DIR)/lisp"
ec9bbc6c
EZ
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
564a3032
EZ
539 for dir in . $(WINS); do cp $$dir/*.elc "$(INSTALL_DIR)/lisp/$$dir"; done
540
541install-lisp-CMD:
542 cp -f *.el "$(INSTALL_DIR)/lisp"
ec9bbc6c 543 for %%f in ($(WINS)) do if not exist "$(INSTALL_DIR)/lisp/%%f" mkdir "$(INSTALL_DIR)/lisp/%%f"
564a3032
EZ
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
8b9a5623
EZ
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.
549check-declare:
550 $(emacs) -l $(lisp)/emacs-lisp/check-declare --eval $(ARGQUOTE)(check-declare-directory $(DQUOTE)$(lisp)$(DQUOTE))$(ARGQUOTE)
551
7bbaaedd
AI
552#
553# Maintenance
c45dbde8 554#
a055c272
EZ
555# We used to delete *~ here, but that might inadvertently remove
556# precious files if it happens to match their short 8+3 aliases.
7bbaaedd 557clean:
3dc94c30 558 - $(DEL) *.el~
6eb5ddb8
EZ
559 - $(DEL) calc/calc-loaddefs.el~
560 - $(DEL) eshell/esh-groups.el~
3dc94c30 561
6eb5ddb8 562distclean: clean
3dc94c30
JR
563 - $(DEL) $(lisp)/Makefile
564
565maintainer-clean: bootstrap-clean distclean
566 - $(DEL) $(AUTOGENEL)
1ed6e04d
EZ
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\
1f35fda9 578 $(lisp)/progmodes/cc-vars.elc: \
1ed6e04d
EZ
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
1ed6e04d 612$(lisp)/progmodes/cc-vars.elc: $(lisp)/custom.elc $(lisp)/widget.elc
6c4d5dd3
EZ
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.
618MH_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