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