(MH_E_SRC): Replace mh-index.el and mh-pick.el with mh-search.el.
[bpt/emacs.git] / lisp / makefile.w32-in
CommitLineData
bd6766d3 1# -*- Makefile -*- for GNU Emacs on the Microsoft W32 API.
92b47a4a
TTN
2# Copyright (C) 2000, 2001, 2002, 2003, 2004,
3# 2005 Free Software Foundation, Inc.
7bbaaedd
AI
4#
5# This file is part of GNU Emacs.
c45dbde8 6#
7bbaaedd
AI
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 2, or (at your option)
10# any later version.
c45dbde8 11#
7bbaaedd
AI
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.
c45dbde8 16#
7bbaaedd
AI
17# You should have received a copy of the GNU General Public License
18# along with GNU Emacs; see the file COPYING. If not, write to the
086add15
LK
19# Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20# Boston, MA 02110-1301, USA.
7bbaaedd
AI
21#
22
23ALL =
24
25all: $(ALL)
26
27SQUOTE='
28# '
29
6610f4b2 30lisp = $(CURDIR)
9b006cb2 31srcdir = $(CURDIR)/..
7bbaaedd
AI
32
33# You can specify a different executable on the make command line,
34# e.g. "make EMACS=../src/emacs ...".
35
587b5737 36EMACS = "$(THISDIR)/../bin/emacs.exe"
7bbaaedd
AI
37
38# Command line flags for Emacs. This must include --multibyte,
39# otherwise some files will not compile.
40
41EMACSOPT = -batch --no-init-file --no-site-file --multibyte
42
cc7aa053
AI
43# Set EMACSLOADPATH correctly (already defined in environment).
44EMACSLOADPATH=$(lisp)
45
7bbaaedd
AI
46lisptagsfiles1 = $(lisp)/*.el
47lisptagsfiles2 = $(lisp)/*/*.el
48ETAGS = "../lib-src/$(BLD)/etags"
49
170a9e70
GM
50# Files to compile before others during a bootstrap. This is done to
51# speed up the bootstrap process. The CC files are compiled first
52# because CC mode tweaks the compilation process, and requiring
53# cc-mode when it is not compiled doesn't work during the
54# bootstrapping.
7bbaaedd
AI
55
56COMPILE_FIRST = \
57 $(lisp)/emacs-lisp/byte-opt.el \
58 $(lisp)/emacs-lisp/bytecomp.el \
170a9e70
GM
59 $(lisp)/subr.el \
60 $(lisp)/progmodes/cc-mode.el \
61 $(lisp)/progmodes/cc-vars.el
7bbaaedd
AI
62
63# The actual Emacs command run in the targets below.
64
65emacs = $(EMACS) $(EMACSOPT)
66
67# Common command to find subdirectories
68
69setwins=subdirs=`find $$wd -type d -print`; \
70 for file in $$subdirs; do \
71 case $$file in */Old | */RCS | */CVS | */CVS/* | */=* ) ;; \
72 *) wins="$$wins $$file" ;; \
73 esac; \
74 done
75
76# Have to define the list of subdirs manually when not using sh.
77WINS=\
1142be39 78 calc \
7bbaaedd
AI
79 calendar \
80 emacs-lisp \
81 emulation \
82 eshell \
83 gnus \
84 international \
85 language \
86 mail \
942da20c 87 mh-e \
7bbaaedd 88 net \
1142be39 89 obsolete \
7bbaaedd
AI
90 play \
91 progmodes \
92 term \
b036f5d8 93 textmodes \
05cecc58 94 url
7bbaaedd
AI
95
96doit:
97
bad197f0 98$(lisp)/cus-load.el:
7bbaaedd 99 touch $@
c3d49b7a
EZ
100# WARNING: Do NOT split the part inside $(ARGQUOTE)s into multiple lines as
101# this can break with GNU Make 3.81 and later if sh.exe is used.
bad197f0 102custom-deps: $(lisp)/cus-load.el doit
7bbaaedd 103 @echo Directories: $(WINS)
5459bcdf 104 -$(emacs) -l cus-dep --eval $(ARGQUOTE)(setq find-file-hook nil)$(ARGQUOTE) -f custom-make-dependencies $(lisp) $(WINS)
7bbaaedd 105
9b006cb2 106finder-data: doit
7bbaaedd
AI
107 @echo Directories: $(WINS)
108 $(emacs) -l finder -f finder-compile-keywords-make-dist $(lisp) $(WINS)
109
bad197f0 110$(lisp)/loaddefs.el:
e22b24eb
AI
111 $(MAKE) $(MFLAGS) loaddefs.el-$(SHELLTYPE)
112 cp loaddefs.el-$(SHELLTYPE) $@
113 rm loaddefs.el-$(SHELLTYPE)
114
115loaddefs.el-SH:
116 echo ";;; loaddefs.el --- automatically extracted autoloads" > $@
117 echo ";;" >> $@; echo ";;; Code:" >> $@
118 echo "(autoload 'define-minor-mode \"easy-mmode\")" >>$@
119 echo "(autoload 'define-ccl-program \"ccl\")" >>$@
120 echo "(autoload 'regexp-opt \"regexp-opt\")" >>$@
121 echo "(autoload 'string-to-list \"mule-util\")" >>$@
122 echo "(autoload 'define-derived-mode \"derived\")" >>$@
123 echo "(autoload 'encoded-kbd-mode \"encoded-kb\")" >>$@
124 echo "(defvar cvs-global-menu nil)" >>$@
125 echo "\f" >> $@
126 echo ";;; Local Variables:" >> $@
127 echo ";;; version-control: never" >> $@
128 echo ";;; no-byte-compile: t" >> $@
129 echo ";;; no-update-autoloads: t" >> $@
130 echo ";;; End:" >> $@
131 echo ";;; loaddefs.el ends here" >> $@
132
133loaddefs.el-CMD:
7bbaaedd
AI
134 echo ;;; loaddefs.el --- automatically extracted autoloads> $@
135 echo ;;; Code:>> $@
e22b24eb
AI
136 echo (autoload 'define-minor-mode "easy-mmode")>> $@
137 echo (autoload 'define-ccl-program "ccl")>> $@
138 echo (autoload 'regexp-opt "regexp-opt")>> $@
139 echo (autoload 'string-to-list "mule-util")>> $@
140 echo (autoload 'define-derived-mode "derived")>> $@
141 echo (autoload 'encoded-kbd-mode "encoded-kb")>> $@
142 echo (defvar cvs-global-menu nil)>> $@
bad197f0 143 echo.\f>> $@
7bbaaedd
AI
144 echo ;;; Local Variables:>> $@
145 echo ;;; version-control: never>> $@
146 echo ;;; no-byte-compile: t>> $@
147 echo ;;; no-update-autoloads: t>> $@
148 echo ;;; End:>> $@
149 echo ;;; loaddefs.el ends here>> $@
150
81293113
EZ
151# Use . instead of $(lisp) because $(lisp) is an absolute file name,
152# including a drive letter and any leading directories, so the generated
153# loaddefs.el will mention file names that on other machine reference
154# possibly non-existent directories.
c3d49b7a
EZ
155#
156# WARNING: Do NOT split the part inside $(ARGQUOTE)s into multiple lines as
157# this can break with GNU Make 3.81 and later if sh.exe is used.
bad197f0 158autoloads: $(lisp)/loaddefs.el doit
81293113 159 @echo Directories: . $(WINS)
c5bdb93d 160 $(emacs) -l autoload \
7c417300
EZ
161 --eval $(ARGQUOTE)(setq find-file-hook nil find-file-suppress-same-file-warnings t)$(ARGQUOTE) \
162 -f w32-batch-update-autoloads "$(lisp)/loaddefs.el" . $(WINS)
7bbaaedd 163
bad197f0 164$(lisp)/subdirs.el:
7bbaaedd
AI
165 $(MAKE) $(MFLAGS) update-subdirs
166
167# Need separate version for sh and native cmd.exe
168update-subdirs: update-subdirs-$(SHELLTYPE)
169
170update-subdirs-CMD: doit
bad197f0
JR
171 echo ;; -*- no-byte-compile: t -*-> $(lisp)/subdirs.el
172 echo ;; In load-path, after this directory should come>> $(lisp)/subdirs.el
173 echo ;; certain of its subdirectories. Here we specify them.>> $(lisp)/subdirs.el
174 echo (normal-top-level-add-to-load-path $(SQUOTE)(>> $(lisp)/subdirs.el
175 @for %%d in ($(WINS)) do if not (%%d)==(term) echo "%%d">> $(lisp)/subdirs.el
176 echo ))>> $(lisp)/subdirs.el
7bbaaedd
AI
177
178update-subdirs-SH: doit
0cfc4b54 179 $(srcdir)/update-subdirs $(lisp); \
e22b24eb 180 for file in $(WINS); do \
7bbaaedd
AI
181 $(srcdir)/update-subdirs $$file; \
182 done;
183
ba2b2673 184updates: update-subdirs autoloads mh-autoloads finder-data custom-deps
7bbaaedd 185
a9d25c79
EZ
186# This is useful after "cvs up".
187cvs-update: recompile autoloads finder-data custom-deps
188
9b006cb2
AI
189# Update the AUTHORS file.
190
191update-authors:
8f801552 192 $(emacs) -l authors -f batch-update-authors $(srcdir)/AUTHORS $(srcdir)
9b006cb2 193
7bbaaedd
AI
194TAGS: $(lisptagsfiles1) $(lisptagsfiles2)
195 $(ETAGS) $(lisptagsfiles1) $(lisptagsfiles2)
196
9b006cb2
AI
197TAGS-LISP: $(lisptagsfiles1) $(lisptagsfiles2)
198 $(ETAGS) -o TAGS-LISP $(lisptagsfiles1) $(lisptagsfiles2)
7bbaaedd 199
49060c51
AI
200.SUFFIXES: .elc .el
201
7bbaaedd 202.el.elc:
cc7aa053 203 -$(emacs) -f batch-byte-compile $<
7bbaaedd 204
8f801552
LK
205# Compile all Lisp files, but don't recompile those that are up to
206# date. Some files don't actually get compiled because they set the
207# local variable no-byte-compile.
7bbaaedd 208
8f801552
LK
209# All .elc files are made writable before compilation in case we
210# checked out read-only (CVS option -r). Files MUST be compiled one by
211# one. If we compile several files in a row we can't make sure that
212# the compilation environment is clean. We also set the load-path of
213# the Emacs used for compilation to the current directory and its
214# subdirectories, to make sure require's and load's in the files being
215# compiled find the right files.
7bbaaedd
AI
216
217# Need separate version for sh and native cmd.exe
bad197f0 218compile: $(lisp)/subdirs.el mh-autoloads compile-$(SHELLTYPE) doit
7bbaaedd 219
d198b6f5 220compile-CMD:
80bb1e21
JR
221# -for %%f in ($(lisp) $(WINS)) do for %%g in (%%f\*.elc) do @attrib -r %%g
222 for %%f in ($(COMPILE_FIRST)) do \
223 $(emacs) -l loaddefs -f batch-byte-compile-if-not-done %%f
224 for %%f in (. $(WINS)) do for %%g in (%%f/*.el) do \
225 $(emacs) -l loaddefs -f batch-byte-compile-if-not-done %%f/%%g
0702b995 226
d198b6f5 227compile-SH:
9b006cb2
AI
228# for elc in $(lisp)/*.elc $(lisp)/*/*.elc; do attrib -r $$elc; done
229 for el in $(COMPILE_FIRST); do \
230 echo Compiling $$el; \
e22b24eb 231 $(emacs) -l loaddefs -f batch-byte-compile-if-not-done $$el; \
9b006cb2
AI
232 done
233 for dir in $(lisp) $(WINS); do \
234 for el in $$dir/*.el; do \
235 if test -f $$el; \
236 then \
237 echo Compiling $$el; \
e22b24eb 238 $(emacs) -l loaddefs -f batch-byte-compile-if-not-done $$el; \
9b006cb2
AI
239 fi \
240 done; \
241 done
242
8f801552
LK
243# Compile all Lisp files. This is like `compile' but compiles files
244# unconditionally. Some files don't actually get compiled because they
245# set the local variable no-byte-compile.
246
bad197f0 247compile-always: $(lisp)/subdirs.el compile-always-$(SHELLTYPE) doit
9b006cb2
AI
248
249compile-always-CMD:
80bb1e21
JR
250# -for %%f in ($(lisp) $(WINS)) do for %%g in (%%f\*.elc) do @attrib -r %%g
251 for %%f in ($(COMPILE_FIRST)) do $(emacs) -f batch-byte-compile %%f
252 for %%f in (. $(WINS)) do for %%g in (%%f/*.el) do $(emacs) -f batch-byte-compile %%f/%%g
7bbaaedd 253
9b006cb2 254compile-always-SH:
7bbaaedd
AI
255# for elc in $(lisp)/*.elc $(lisp)/*/*.elc; do attrib -r $$elc; done
256 for el in $(COMPILE_FIRST); do \
257 echo Compiling $$el; \
9b006cb2 258 $(emacs) -f batch-byte-compile $$el || exit 1; \
7bbaaedd
AI
259 done
260 for dir in $(lisp) $(WINS); do \
261 for el in $$dir/*.el; do \
262 echo Compiling $$el; \
9b006cb2 263 $(emacs) -f batch-byte-compile $$el || exit 1; \
7bbaaedd
AI
264 done; \
265 done
266
9b006cb2
AI
267compile-calc: compile-calc-$(SHELLTYPE)
268
269compile-calc-CMD:
80bb1e21 270 for %%f in ($(lisp)/calc/*.el) do $(emacs) -f batch-byte-compile %%f
9b006cb2 271
c45dbde8 272compile-calc-SH:
9b006cb2
AI
273 for el in $(lisp)/calc/*.el; do \
274 echo Compiling $$el; \
275 $(emacs) -f batch-byte-compile $$el || exit 1; \
276 done
277
7bbaaedd
AI
278# Backup compiled Lisp files in elc.tar.gz. If that file already
279# exists, make a backup of it.
280
281backup-compiled-files:
282 -mv $(lisp)/elc.tar.gz $(lisp)/elc.tar.gz~
283 -tar czf $(lisp)/elc.tar.gz $(lisp)/*.elc $(lisp)/*/*.elc
284
285# Compile Lisp files, but save old compiled files first.
286
d198b6f5 287compile-after-backup: backup-compiled-files compile-always
7bbaaedd
AI
288
289# Recompile all Lisp files which are newer than their .elc files.
290# Note that this doesn't create .elc files. It only recompiles if an
291# .elc is present.
292
ba2b2673 293recompile: mh-autoloads doit
9b006cb2 294 $(emacs) -f batch-byte-recompile-directory $(lisp)
7bbaaedd 295
ba2b2673
BW
296# Update MH-E internal autoloads. These are not to be confused with
297# the autoloads for the MH-E entry points, which are already in
298# loaddefs.el.
e9b28650 299MH_E_SRC = $(lisp)/mh-e/mh-acros.el $(lisp)/mh-e/mh-alias.el \
ba2b2673
BW
300 $(lisp)/mh-e/mh-comp.el $(lisp)/mh-e/mh-customize.el \
301 $(lisp)/mh-e/mh-e.el $(lisp)/mh-e/mh-funcs.el \
302 $(lisp)/mh-e/mh-mime.el $(lisp)/mh-e/mh-pick.el \
303 $(lisp)/mh-e/mh-print.el $(lisp)/mh-e/mh-inc.el \
304 $(lisp)/mh-e/mh-init.el $(lisp)/mh-e/mh-index.el \
305 $(lisp)/mh-e/mh-identity.el $(lisp)/mh-e/mh-junk.el \
306 $(lisp)/mh-e/mh-seq.el $(lisp)/mh-e/mh-speed.el \
307 $(lisp)/mh-e/mh-utils.el
308
309mh-autoloads: $(lisp)/mh-e/mh-loaddefs.el
e9b28650 310$(lisp)/mh-e/mh-loaddefs.el: $(MH_E_SRC)
e3188d80
JR
311 $(MAKE) $(MFLAGS) pre-mh-loaddefs.el-$(SHELLTYPE)
312 cp pre-mh-loaddefs.el-$(SHELLTYPE) $@
bad197f0 313 rm pre-mh-loaddefs.el-$(SHELLTYPE)
e3188d80
JR
314 $(EMACS) $(EMACSOPT) \
315 -l autoload \
316 --eval "(setq generate-autoload-cookie \";;;###mh-autoload\")" \
a5f271ab 317 --eval "(setq find-file-suppress-same-file-warnings t)" \
e3188d80 318 --eval "(setq make-backup-files nil)" \
7c417300
EZ
319 -f w32-batch-update-autoloads \
320 "$(lisp)/mh-e/mh-loaddefs.el" $(lisp)/mh-e
e3188d80
JR
321
322pre-mh-loaddefs.el-SH:
ba2b2673
BW
323 echo ";;; mh-loaddefs.el --- automatically extracted autoloads" > $@
324 echo ";;" >> $@
325 echo ";;; Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc." >> $@
326 echo ";;; Author: Bill Wohler <wohler@newt.com>" >> $@
327 echo ";;; Keywords: mail" >> $@
328 echo ";;; Commentary:" >> $@
329 echo ";;; Change Log:" >> $@
330 echo ";;; Code:" >> $@
ba2b2673
BW
331 echo "\f" >> $@
332 echo "(provide 'mh-loaddefs)" >> $@
333 echo ";;; Local Variables:" >> $@
334 echo ";;; version-control: never" >> $@
335 echo ";;; no-byte-compile: t" >> $@
336 echo ";;; no-update-autoloads: t" >> $@
337 echo ";;; End:" >> $@
338 echo ";;; mh-loaddefs.el ends here" >> $@
339
e3188d80
JR
340pre-mh-loaddefs.el-CMD:
341 echo ;;; mh-loaddefs.el --- automatically extracted autoloads> $@
342 echo ;;>> $@
343 echo ;;; Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.>> $@
344 echo ;;; Author: Bill Wohler (wohler@newt.com)>> $@
345 echo ;;; Keywords: mail>> $@
346 echo ;;; Commentary:>> $@
347 echo ;;; Change Log:>> $@
348 echo ;;; Code:>> $@
349 echo.\f>> $@
350 echo (provide 'mh-loaddefs)>> $@
351 echo ;;; Local Variables:>> $@
352 echo ;;; version-control: never>> $@
353 echo ;;; no-byte-compile: t>> $@
354 echo ;;; no-update-autoloads: t>> $@
355 echo ;;; End:>> $@
356 echo ;;; mh-loaddefs.el ends here>> $@
357
54ab09c4
MB
358# Prepare a bootstrap in the lisp subdirectory.
359#
e8dbbf6f
EZ
360# Build loaddefs.el to make sure it's up-to-date. If it's not, that
361# might lead to errors during the bootstrap because something fails to
362# autoload as expected. If there is no emacs binary, then we can't
363# build autoloads yet. In that case we have to use ldefs-boot.el;
364# bootstrap should always work with ldefs-boot.el. (Because
365# loaddefs.el is an automatically generated file, we don't want to
366# store it in the source repository).
54ab09c4
MB
367#
368# Remove compiled Lisp files so that bootstrap-emacs will be built from
369# sources only.
7bbaaedd
AI
370
371# Need separate version for sh and native cmd.exe
bad197f0 372bootstrap-clean: bootstrap-clean-$(SHELLTYPE) $(lisp)/loaddefs.el
7bbaaedd
AI
373
374bootstrap-clean-CMD:
5de7f0f7 375# if exist $(EMACS) $(MAKE) $(MFLAGS) autoloads
e8dbbf6f 376 cp $(lisp)/ldefs-boot.el $(lisp)/loaddefs.el
80bb1e21 377 -for %%f in (. $(WINS)) do for %%g in (%%f\*.elc) do @$(DEL) %%g
7bbaaedd
AI
378
379bootstrap-clean-SH:
5de7f0f7 380# if test -f $(EMACS); then $(MAKE) $(MFLAGS) autoloads; fi
a3599c30 381# -rm -f $(lisp)/*.elc $(lisp)/*/*.elc
e8dbbf6f 382 cp $(lisp)/ldefs-boot.el $(lisp)/loaddefs.el
a3599c30 383 -for dir in . $(WINS); do rm -f $$dir/*.elc; done
7bbaaedd
AI
384
385# Generate/update files for the bootstrap process.
014b37b6
EZ
386# When done, remove bootstrap-emacs from ../bin, so that
387# it will not be mistaken for an installed binary.
7bbaaedd 388
ba2b2673 389bootstrap: update-subdirs autoloads mh-autoloads compile finder-data custom-deps
014b37b6 390 - $(DEL) $(EMACS)
7bbaaedd
AI
391
392#
393# Assuming INSTALL_DIR is defined, copy the elisp files to it
394# Windows 95 makes this harder than it should be.
395#
396install:
397 - mkdir "$(INSTALL_DIR)/lisp"
398 - $(DEL) ../same-dir.tst
399 - $(DEL) "$(INSTALL_DIR)/same-dir.tst"
400 echo SameDirTest > "$(INSTALL_DIR)/same-dir.tst"
401#ifdef COPY_LISP_SOURCE
402 $(IFNOTSAMEDIR) $(CP_DIR) . "$(INSTALL_DIR)/lisp" $(ENDIF)
403#else
404# $(IFNOTSAMEDIR) $(CP_DIR) *.elc "$(INSTALL_DIR)/lisp" $(ENDIF)
405# $(IFNOTSAMEDIR) $(CP) cus-load.el "$(INSTALL_DIR)/lisp" $(ENDIF)
406# $(IFNOTSAMEDIR) $(CP) forms*.el "$(INSTALL_DIR)/lisp" $(ENDIF)
407# $(IFNOTSAMEDIR) $(CP) patcomp.el "$(INSTALL_DIR)/lisp" $(ENDIF)
408# $(IFNOTSAMEDIR) $(CP) subdirs.el "$(INSTALL_DIR)/lisp" $(ENDIF)
409# $(IFNOTSAMEDIR) $(CP) version.el "$(INSTALL_DIR)/lisp" $(ENDIF)
410# $(IFNOTSAMEDIR) $(CP) mail/blessmail.el "$(INSTALL_DIR)/lisp/mail" $(ENDIF)
411# $(IFNOTSAMEDIR) $(CP) mail/sc.el "$(INSTALL_DIR)/lisp/mail" $(ENDIF)
412# $(IFNOTSAMEDIR) $(CP) play/bruce.el "$(INSTALL_DIR)/lisp/play" $(ENDIF)
413# $(IFNOTSAMEDIR) $(CP) international/latin-*.el "$(INSTALL_DIR)/lisp/international" $(ENDIF)
414# $(IFNOTSAMEDIR) $(CP) international/mule-conf.el "$(INSTALL_DIR)/lisp/international" $(ENDIF)
415#endif
416 - $(DEL) ../same-dir.tst
417 - $(DEL) "$(INSTALL_DIR)/same-dir.tst"
418
419#
420# Maintenance
c45dbde8 421#
7bbaaedd
AI
422clean:
423 - $(DEL) *~