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