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