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