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