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