Revision: miles@gnu.org--gnu-2004/emacs--unicode--0--patch-34
[bpt/emacs.git] / lisp / makefile.w32-in
CommitLineData
bd6766d3 1# -*- Makefile -*- for GNU Emacs on the Microsoft W32 API.
05cecc58 2# Copyright (c) 2000,2001,2004 Free Software Foundation, Inc.
7bbaaedd
AI
3#
4# This file is part of GNU Emacs.
c45dbde8 5#
7bbaaedd
AI
6# GNU Emacs is free software; you can redistribute it and/or modify
7# it under the terms of the GNU General Public License as published by
8# the Free Software Foundation; either version 2, or (at your option)
9# any later version.
c45dbde8 10#
7bbaaedd
AI
11# GNU Emacs is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14# GNU General Public License for more details.
c45dbde8 15#
7bbaaedd
AI
16# You should have received a copy of the GNU General Public License
17# along with GNU Emacs; see the file COPYING. If not, write to the
18# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19# Boston, MA 02111-1307, USA.
20#
21
22ALL =
23
24all: $(ALL)
25
26SQUOTE='
27# '
28
6610f4b2 29lisp = $(CURDIR)
9b006cb2 30srcdir = $(CURDIR)/..
7bbaaedd
AI
31
32# You can specify a different executable on the make command line,
33# e.g. "make EMACS=../src/emacs ...".
34
587b5737 35EMACS = "$(THISDIR)/../bin/emacs.exe"
7bbaaedd
AI
36
37# Command line flags for Emacs. This must include --multibyte,
38# otherwise some files will not compile.
39
40EMACSOPT = -batch --no-init-file --no-site-file --multibyte
41
cc7aa053
AI
42# Set EMACSLOADPATH correctly (already defined in environment).
43EMACSLOADPATH=$(lisp)
44
7bbaaedd
AI
45lisptagsfiles1 = $(lisp)/*.el
46lisptagsfiles2 = $(lisp)/*/*.el
47ETAGS = "../lib-src/$(BLD)/etags"
48
9b006cb2
AI
49# Files which should not be compiled. If you change the name `DONTCOMPILE'
50# to something different, you'll have to change make-dist as well, and
51# modify the lists in $lisp and $shortlisp on src/Makefile.in.
52#
7bbaaedd
AI
53# - emacs-lisp/cl-specs.el: only contains `def-edebug-spec's so there's
54# no point compiling it, although it doesn't hurt.
55
56DONTCOMPILE = \
7bbaaedd 57 $(lisp)/cus-load.el \
7bbaaedd
AI
58 $(lisp)/emacs-lisp/cl-specs.el \
59 $(lisp)/eshell/esh-maint.el \
60 $(lisp)/eshell/esh-groups.el \
61 $(lisp)/finder-inf.el \
62 $(lisp)/forms-d2.el \
63 $(lisp)/forms-pass.el \
64 $(lisp)/generic-x.el \
65 $(lisp)/international/latin-1.el \
66 $(lisp)/international/latin-2.el \
67 $(lisp)/international/latin-3.el \
68 $(lisp)/international/latin-4.el \
69 $(lisp)/international/latin-5.el \
70 $(lisp)/international/latin-8.el \
71 $(lisp)/international/latin-9.el \
72 $(lisp)/international/mule-conf.el \
9b006cb2
AI
73 $(lisp)/language/czech.el \
74 $(lisp)/language/devanagari.el \
a7d9e5a7 75 $(lisp)/language/kannada.el \
ddcb4d2f
JB
76 $(lisp)/language/malayalam.el \
77 $(lisp)/language/tamil.el \
9b006cb2
AI
78 $(lisp)/language/english.el \
79 $(lisp)/language/greek.el \
80 $(lisp)/language/hebrew.el \
81 $(lisp)/language/japanese.el \
82 $(lisp)/language/korean.el \
83 $(lisp)/language/lao.el \
84 $(lisp)/language/misc-lang.el \
85 $(lisp)/language/romanian.el \
86 $(lisp)/language/slovak.el \
87 $(lisp)/language/thai.el \
88 $(lisp)/language/utf-8-lang.el \
89 $(lisp)/language/georgian.el \
7bbaaedd 90 $(lisp)/loaddefs.el \
ec2e9398 91 $(lisp)/ldefs-boot.el \
7bbaaedd
AI
92 $(lisp)/loadup.el \
93 $(lisp)/mail/blessmail.el \
7bbaaedd
AI
94 $(lisp)/patcomp.el \
95 $(lisp)/paths.el \
96 $(lisp)/play/bruce.el \
97 $(lisp)/subdirs.el \
98 $(lisp)/term/internal.el \
6c317bd2
GM
99 $(lisp)/term/AT386.el \
100 $(lisp)/term/apollo.el \
101 $(lisp)/term/bobcat.el \
102 $(lisp)/term/iris-ansi.el \
103 $(lisp)/term/keyswap.el \
104 $(lisp)/term/linux.el \
105 $(lisp)/term/lk201.el \
106 $(lisp)/term/news.el \
107 $(lisp)/term/vt102.el \
108 $(lisp)/term/vt125.el \
109 $(lisp)/term/vt200.el \
110 $(lisp)/term/vt201.el \
111 $(lisp)/term/vt220.el \
112 $(lisp)/term/vt240.el \
113 $(lisp)/term/vt300.el \
114 $(lisp)/term/vt320.el \
115 $(lisp)/term/vt400.el \
116 $(lisp)/term/vt420.el \
117 $(lisp)/term/wyse50.el \
7bbaaedd
AI
118 $(lisp)/version.el
119
170a9e70
GM
120# Files to compile before others during a bootstrap. This is done to
121# speed up the bootstrap process. The CC files are compiled first
122# because CC mode tweaks the compilation process, and requiring
123# cc-mode when it is not compiled doesn't work during the
124# bootstrapping.
7bbaaedd
AI
125
126COMPILE_FIRST = \
127 $(lisp)/emacs-lisp/byte-opt.el \
128 $(lisp)/emacs-lisp/bytecomp.el \
170a9e70
GM
129 $(lisp)/subr.el \
130 $(lisp)/progmodes/cc-mode.el \
131 $(lisp)/progmodes/cc-vars.el
7bbaaedd
AI
132
133# The actual Emacs command run in the targets below.
134
135emacs = $(EMACS) $(EMACSOPT)
136
137# Common command to find subdirectories
138
139setwins=subdirs=`find $$wd -type d -print`; \
140 for file in $$subdirs; do \
141 case $$file in */Old | */RCS | */CVS | */CVS/* | */=* ) ;; \
142 *) wins="$$wins $$file" ;; \
143 esac; \
144 done
145
146# Have to define the list of subdirs manually when not using sh.
147WINS=\
1142be39 148 calc \
7bbaaedd
AI
149 calendar \
150 emacs-lisp \
151 emulation \
152 eshell \
153 gnus \
154 international \
155 language \
156 mail \
942da20c 157 mh-e \
7bbaaedd 158 net \
1142be39 159 obsolete \
7bbaaedd
AI
160 play \
161 progmodes \
162 term \
b036f5d8 163 textmodes \
05cecc58
JB
164 toolbar \
165 url
7bbaaedd
AI
166
167doit:
168
169cus-load.el:
170 touch $@
171custom-deps: cus-load.el doit
172 @echo Directories: $(WINS)
cc7aa053 173 -$(emacs) -l cus-dep --eval $(ARGQUOTE)(setq find-file-hooks nil)$(ARGQUOTE) -f custom-make-dependencies $(lisp) $(WINS)
7bbaaedd 174
9b006cb2 175finder-data: doit
7bbaaedd
AI
176 @echo Directories: $(WINS)
177 $(emacs) -l finder -f finder-compile-keywords-make-dist $(lisp) $(WINS)
178
179loaddefs.el:
e22b24eb
AI
180 $(MAKE) $(MFLAGS) loaddefs.el-$(SHELLTYPE)
181 cp loaddefs.el-$(SHELLTYPE) $@
182 rm loaddefs.el-$(SHELLTYPE)
183
184loaddefs.el-SH:
185 echo ";;; loaddefs.el --- automatically extracted autoloads" > $@
186 echo ";;" >> $@; echo ";;; Code:" >> $@
187 echo "(autoload 'define-minor-mode \"easy-mmode\")" >>$@
188 echo "(autoload 'define-ccl-program \"ccl\")" >>$@
189 echo "(autoload 'regexp-opt \"regexp-opt\")" >>$@
190 echo "(autoload 'string-to-list \"mule-util\")" >>$@
191 echo "(autoload 'define-derived-mode \"derived\")" >>$@
192 echo "(autoload 'encoded-kbd-mode \"encoded-kb\")" >>$@
193 echo "(defvar cvs-global-menu nil)" >>$@
194 echo "\f" >> $@
195 echo ";;; Local Variables:" >> $@
196 echo ";;; version-control: never" >> $@
197 echo ";;; no-byte-compile: t" >> $@
198 echo ";;; no-update-autoloads: t" >> $@
199 echo ";;; End:" >> $@
200 echo ";;; loaddefs.el ends here" >> $@
201
202loaddefs.el-CMD:
7bbaaedd
AI
203 echo ;;; loaddefs.el --- automatically extracted autoloads> $@
204 echo ;;; Code:>> $@
e22b24eb
AI
205 echo (autoload 'define-minor-mode "easy-mmode")>> $@
206 echo (autoload 'define-ccl-program "ccl")>> $@
207 echo (autoload 'regexp-opt "regexp-opt")>> $@
208 echo (autoload 'string-to-list "mule-util")>> $@
209 echo (autoload 'define-derived-mode "derived")>> $@
210 echo (autoload 'encoded-kbd-mode "encoded-kb")>> $@
211 echo (defvar cvs-global-menu nil)>> $@
d5ef6196 212 echo ;;; >> $@
7bbaaedd
AI
213 echo ;;; Local Variables:>> $@
214 echo ;;; version-control: never>> $@
215 echo ;;; no-byte-compile: t>> $@
216 echo ;;; no-update-autoloads: t>> $@
217 echo ;;; End:>> $@
218 echo ;;; loaddefs.el ends here>> $@
219
220autoloads: loaddefs.el doit
221 @echo Directories: $(WINS)
c5bdb93d
AI
222 $(emacs) -l autoload \
223 --eval $(ARGQUOTE)(setq find-file-hooks nil \
224 find-file-suppress-same-file-warnings t \
225 generated-autoload-file \
226 $(DQUOTE)$(lisp)/loaddefs.el$(DQUOTE))$(ARGQUOTE) \
227 -f batch-update-autoloads $(lisp) $(WINS)
7bbaaedd
AI
228
229subdirs.el:
230 $(MAKE) $(MFLAGS) update-subdirs
231
232# Need separate version for sh and native cmd.exe
233update-subdirs: update-subdirs-$(SHELLTYPE)
234
235update-subdirs-CMD: doit
c45dbde8
JB
236 echo ;; -*- no-byte-compile: t -*->subdirs.el
237 echo ;; In load-path, after this directory should come>> subdirs.el
7bbaaedd 238 echo ;; certain of its subdirectories. Here we specify them.>> subdirs.el
d053bf7e 239 echo (normal-top-level-add-to-load-path $(SQUOTE)(>> subdirs.el
80bb1e21 240 @for %%d in ($(WINS)) do if not (%%d)==(term) echo "%%d">> subdirs.el
d053bf7e 241 echo ))>> subdirs.el
7bbaaedd
AI
242
243update-subdirs-SH: doit
0cfc4b54 244 $(srcdir)/update-subdirs $(lisp); \
e22b24eb 245 for file in $(WINS); do \
7bbaaedd
AI
246 $(srcdir)/update-subdirs $$file; \
247 done;
248
249updates: update-subdirs autoloads finder-data custom-deps
250
9b006cb2
AI
251# Update the AUTHORS file.
252
253update-authors:
254 $(emacs) -f batch-update-authors $(srcdir)/AUTHORS $(srcdir)
255
7bbaaedd
AI
256TAGS: $(lisptagsfiles1) $(lisptagsfiles2)
257 $(ETAGS) $(lisptagsfiles1) $(lisptagsfiles2)
258
9b006cb2
AI
259TAGS-LISP: $(lisptagsfiles1) $(lisptagsfiles2)
260 $(ETAGS) -o TAGS-LISP $(lisptagsfiles1) $(lisptagsfiles2)
7bbaaedd 261
49060c51
AI
262.SUFFIXES: .elc .el
263
7bbaaedd 264.el.elc:
cc7aa053 265 -$(emacs) -f batch-byte-compile $<
7bbaaedd
AI
266
267$(DONTCOMPILE:.el=.elc):
268 -$(DEL) $@
269
9b006cb2
AI
270# Compile all Lisp files, except those from DONTCOMPILE,
271# but don't recompile those that are up to date.
272
273# All .elc files are made writable
7bbaaedd
AI
274# before compilation in case we checked out read-only (CVS option -r).
275# Files MUST be compiled one by one. If we compile several files in a
276# row we can't make sure that the compilation environment is clean.
277# We also set the load-path of the Emacs used for compilation to the
278# current directory and its subdirectories, to make sure require's and
279# load's in the files being compiled find the right files.
280
281# Need separate version for sh and native cmd.exe
d198b6f5 282compile: subdirs.el compile-$(SHELLTYPE) doit
7bbaaedd 283
d198b6f5 284compile-CMD:
80bb1e21
JR
285# -for %%f in ($(lisp) $(WINS)) do for %%g in (%%f\*.elc) do @attrib -r %%g
286 for %%f in ($(COMPILE_FIRST)) do \
287 $(emacs) -l loaddefs -f batch-byte-compile-if-not-done %%f
288 for %%f in (. $(WINS)) do for %%g in (%%f/*.el) do \
289 $(emacs) -l loaddefs -f batch-byte-compile-if-not-done %%f/%%g
0702b995 290
d198b6f5 291compile-SH:
9b006cb2
AI
292# for elc in $(lisp)/*.elc $(lisp)/*/*.elc; do attrib -r $$elc; done
293 for el in $(COMPILE_FIRST); do \
294 echo Compiling $$el; \
e22b24eb 295 $(emacs) -l loaddefs -f batch-byte-compile-if-not-done $$el; \
9b006cb2
AI
296 done
297 for dir in $(lisp) $(WINS); do \
298 for el in $$dir/*.el; do \
299 if test -f $$el; \
300 then \
301 echo Compiling $$el; \
e22b24eb 302 $(emacs) -l loaddefs -f batch-byte-compile-if-not-done $$el; \
9b006cb2
AI
303 fi \
304 done; \
305 done
306
307# Compile all Lisp files, except those from DONTCOMPILE. This
308# is like `compile' but compiles files unconditionally.
309compile-always: subdirs.el compile-always-$(SHELLTYPE) doit
310
311compile-always-CMD:
80bb1e21
JR
312# -for %%f in ($(lisp) $(WINS)) do for %%g in (%%f\*.elc) do @attrib -r %%g
313 for %%f in ($(COMPILE_FIRST)) do $(emacs) -f batch-byte-compile %%f
314 for %%f in (. $(WINS)) do for %%g in (%%f/*.el) do $(emacs) -f batch-byte-compile %%f/%%g
7bbaaedd 315
9b006cb2 316compile-always-SH:
7bbaaedd
AI
317# for elc in $(lisp)/*.elc $(lisp)/*/*.elc; do attrib -r $$elc; done
318 for el in $(COMPILE_FIRST); do \
319 echo Compiling $$el; \
9b006cb2 320 $(emacs) -f batch-byte-compile $$el || exit 1; \
7bbaaedd
AI
321 done
322 for dir in $(lisp) $(WINS); do \
323 for el in $$dir/*.el; do \
324 echo Compiling $$el; \
9b006cb2 325 $(emacs) -f batch-byte-compile $$el || exit 1; \
7bbaaedd
AI
326 done; \
327 done
328
9b006cb2
AI
329compile-calc: compile-calc-$(SHELLTYPE)
330
331compile-calc-CMD:
80bb1e21 332 for %%f in ($(lisp)/calc/*.el) do $(emacs) -f batch-byte-compile %%f
9b006cb2 333
c45dbde8 334compile-calc-SH:
9b006cb2
AI
335 for el in $(lisp)/calc/*.el; do \
336 echo Compiling $$el; \
337 $(emacs) -f batch-byte-compile $$el || exit 1; \
338 done
339
7bbaaedd
AI
340# Backup compiled Lisp files in elc.tar.gz. If that file already
341# exists, make a backup of it.
342
343backup-compiled-files:
344 -mv $(lisp)/elc.tar.gz $(lisp)/elc.tar.gz~
345 -tar czf $(lisp)/elc.tar.gz $(lisp)/*.elc $(lisp)/*/*.elc
346
347# Compile Lisp files, but save old compiled files first.
348
d198b6f5 349compile-after-backup: backup-compiled-files compile-always
7bbaaedd
AI
350
351# Recompile all Lisp files which are newer than their .elc files.
352# Note that this doesn't create .elc files. It only recompiles if an
353# .elc is present.
354
355recompile: doit
9b006cb2 356 $(emacs) -f batch-byte-recompile-directory $(lisp)
7bbaaedd 357
54ab09c4
MB
358# Prepare a bootstrap in the lisp subdirectory.
359#
360# Build loaddefs.el, because it's not sure it's up-to-date, and if it's not,
361# that might lead to errors during the bootstrap because something fails to
362# autoload as expected. However, if there is no emacs binary, then we can't
363# build autoloads yet, so just make sure there's some loaddefs.el file, as
364# it's necessary for generating the binary (because loaddefs.el is an
365# automatically generated file, we don't want to store it in the source
366# repository).
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
e22b24eb 372bootstrap-clean: bootstrap-clean-$(SHELLTYPE) loaddefs.el
7bbaaedd
AI
373
374bootstrap-clean-CMD:
5de7f0f7 375# if exist $(EMACS) $(MAKE) $(MFLAGS) autoloads
ec2e9398 376 if not exist $(lisp)\loaddefs.el 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
54ab09c4 382 if ! test -r $(lisp)/loaddefs.el; then \
ec2e9398 383 cp $(lisp)/ldefs-boot.el $(lisp)/loaddefs.el; \
54ab09c4 384 fi
a3599c30 385 -for dir in . $(WINS); do rm -f $$dir/*.elc; done
7bbaaedd
AI
386
387# Generate/update files for the bootstrap process.
388
d198b6f5 389bootstrap: update-subdirs autoloads compile finder-data custom-deps
7bbaaedd
AI
390
391#
392# Assuming INSTALL_DIR is defined, copy the elisp files to it
393# Windows 95 makes this harder than it should be.
394#
395install:
396 - mkdir "$(INSTALL_DIR)/lisp"
397 - $(DEL) ../same-dir.tst
398 - $(DEL) "$(INSTALL_DIR)/same-dir.tst"
399 echo SameDirTest > "$(INSTALL_DIR)/same-dir.tst"
400#ifdef COPY_LISP_SOURCE
401 $(IFNOTSAMEDIR) $(CP_DIR) . "$(INSTALL_DIR)/lisp" $(ENDIF)
402#else
403# $(IFNOTSAMEDIR) $(CP_DIR) *.elc "$(INSTALL_DIR)/lisp" $(ENDIF)
404# $(IFNOTSAMEDIR) $(CP) cus-load.el "$(INSTALL_DIR)/lisp" $(ENDIF)
405# $(IFNOTSAMEDIR) $(CP) forms*.el "$(INSTALL_DIR)/lisp" $(ENDIF)
406# $(IFNOTSAMEDIR) $(CP) patcomp.el "$(INSTALL_DIR)/lisp" $(ENDIF)
407# $(IFNOTSAMEDIR) $(CP) subdirs.el "$(INSTALL_DIR)/lisp" $(ENDIF)
408# $(IFNOTSAMEDIR) $(CP) version.el "$(INSTALL_DIR)/lisp" $(ENDIF)
409# $(IFNOTSAMEDIR) $(CP) mail/blessmail.el "$(INSTALL_DIR)/lisp/mail" $(ENDIF)
410# $(IFNOTSAMEDIR) $(CP) mail/sc.el "$(INSTALL_DIR)/lisp/mail" $(ENDIF)
411# $(IFNOTSAMEDIR) $(CP) play/bruce.el "$(INSTALL_DIR)/lisp/play" $(ENDIF)
412# $(IFNOTSAMEDIR) $(CP) international/latin-*.el "$(INSTALL_DIR)/lisp/international" $(ENDIF)
413# $(IFNOTSAMEDIR) $(CP) international/mule-conf.el "$(INSTALL_DIR)/lisp/international" $(ENDIF)
414#endif
415 - $(DEL) ../same-dir.tst
416 - $(DEL) "$(INSTALL_DIR)/same-dir.tst"
417
418#
419# Maintenance
c45dbde8 420#
7bbaaedd
AI
421clean:
422 - $(DEL) *~