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