(gud-find-class): Make jdb work again since
[bpt/emacs.git] / lisp / makefile.w32-in
CommitLineData
53b67fa0
AI
1# Makefile for GNU Emacs on the Microsoft W32 API.
2# Copyright (c) 2000-2001 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 \
ddcb4d2f
JB
75 $(lisp)/language/malayalam.el \
76 $(lisp)/language/tamil.el \
9b006cb2
AI
77 $(lisp)/language/english.el \
78 $(lisp)/language/greek.el \
79 $(lisp)/language/hebrew.el \
80 $(lisp)/language/japanese.el \
81 $(lisp)/language/korean.el \
82 $(lisp)/language/lao.el \
83 $(lisp)/language/misc-lang.el \
84 $(lisp)/language/romanian.el \
85 $(lisp)/language/slovak.el \
86 $(lisp)/language/thai.el \
87 $(lisp)/language/utf-8-lang.el \
88 $(lisp)/language/georgian.el \
7bbaaedd
AI
89 $(lisp)/loaddefs.el \
90 $(lisp)/loadup.el \
91 $(lisp)/mail/blessmail.el \
7bbaaedd
AI
92 $(lisp)/patcomp.el \
93 $(lisp)/paths.el \
94 $(lisp)/play/bruce.el \
95 $(lisp)/subdirs.el \
96 $(lisp)/term/internal.el \
6c317bd2
GM
97 $(lisp)/term/AT386.el \
98 $(lisp)/term/apollo.el \
99 $(lisp)/term/bobcat.el \
100 $(lisp)/term/iris-ansi.el \
101 $(lisp)/term/keyswap.el \
102 $(lisp)/term/linux.el \
103 $(lisp)/term/lk201.el \
104 $(lisp)/term/news.el \
105 $(lisp)/term/vt102.el \
106 $(lisp)/term/vt125.el \
107 $(lisp)/term/vt200.el \
108 $(lisp)/term/vt201.el \
109 $(lisp)/term/vt220.el \
110 $(lisp)/term/vt240.el \
111 $(lisp)/term/vt300.el \
112 $(lisp)/term/vt320.el \
113 $(lisp)/term/vt400.el \
114 $(lisp)/term/vt420.el \
115 $(lisp)/term/wyse50.el \
7bbaaedd
AI
116 $(lisp)/version.el
117
170a9e70
GM
118# Files to compile before others during a bootstrap. This is done to
119# speed up the bootstrap process. The CC files are compiled first
120# because CC mode tweaks the compilation process, and requiring
121# cc-mode when it is not compiled doesn't work during the
122# bootstrapping.
7bbaaedd
AI
123
124COMPILE_FIRST = \
125 $(lisp)/emacs-lisp/byte-opt.el \
126 $(lisp)/emacs-lisp/bytecomp.el \
170a9e70
GM
127 $(lisp)/subr.el \
128 $(lisp)/progmodes/cc-mode.el \
129 $(lisp)/progmodes/cc-vars.el
7bbaaedd
AI
130
131# The actual Emacs command run in the targets below.
132
133emacs = $(EMACS) $(EMACSOPT)
134
135# Common command to find subdirectories
136
137setwins=subdirs=`find $$wd -type d -print`; \
138 for file in $$subdirs; do \
139 case $$file in */Old | */RCS | */CVS | */CVS/* | */=* ) ;; \
140 *) wins="$$wins $$file" ;; \
141 esac; \
142 done
143
144# Have to define the list of subdirs manually when not using sh.
145WINS=\
1142be39 146 calc \
7bbaaedd
AI
147 calendar \
148 emacs-lisp \
149 emulation \
150 eshell \
151 gnus \
152 international \
153 language \
154 mail \
942da20c 155 mh-e \
7bbaaedd 156 net \
1142be39 157 obsolete \
7bbaaedd
AI
158 play \
159 progmodes \
160 term \
b036f5d8 161 textmodes \
5e73ebb4 162 toolbar
7bbaaedd
AI
163
164doit:
165
166cus-load.el:
167 touch $@
168custom-deps: cus-load.el doit
169 @echo Directories: $(WINS)
cc7aa053 170 -$(emacs) -l cus-dep --eval $(ARGQUOTE)(setq find-file-hooks nil)$(ARGQUOTE) -f custom-make-dependencies $(lisp) $(WINS)
7bbaaedd 171
9b006cb2 172finder-data: doit
7bbaaedd
AI
173 @echo Directories: $(WINS)
174 $(emacs) -l finder -f finder-compile-keywords-make-dist $(lisp) $(WINS)
175
176loaddefs.el:
e22b24eb
AI
177 $(MAKE) $(MFLAGS) loaddefs.el-$(SHELLTYPE)
178 cp loaddefs.el-$(SHELLTYPE) $@
179 rm loaddefs.el-$(SHELLTYPE)
180
181loaddefs.el-SH:
182 echo ";;; loaddefs.el --- automatically extracted autoloads" > $@
183 echo ";;" >> $@; echo ";;; Code:" >> $@
184 echo "(autoload 'define-minor-mode \"easy-mmode\")" >>$@
185 echo "(autoload 'define-ccl-program \"ccl\")" >>$@
186 echo "(autoload 'regexp-opt \"regexp-opt\")" >>$@
187 echo "(autoload 'string-to-list \"mule-util\")" >>$@
188 echo "(autoload 'define-derived-mode \"derived\")" >>$@
189 echo "(autoload 'encoded-kbd-mode \"encoded-kb\")" >>$@
190 echo "(defvar cvs-global-menu nil)" >>$@
191 echo "\f" >> $@
192 echo ";;; Local Variables:" >> $@
193 echo ";;; version-control: never" >> $@
194 echo ";;; no-byte-compile: t" >> $@
195 echo ";;; no-update-autoloads: t" >> $@
196 echo ";;; End:" >> $@
197 echo ";;; loaddefs.el ends here" >> $@
198
199loaddefs.el-CMD:
7bbaaedd
AI
200 echo ;;; loaddefs.el --- automatically extracted autoloads> $@
201 echo ;;; Code:>> $@
e22b24eb
AI
202 echo (autoload 'define-minor-mode "easy-mmode")>> $@
203 echo (autoload 'define-ccl-program "ccl")>> $@
204 echo (autoload 'regexp-opt "regexp-opt")>> $@
205 echo (autoload 'string-to-list "mule-util")>> $@
206 echo (autoload 'define-derived-mode "derived")>> $@
207 echo (autoload 'encoded-kbd-mode "encoded-kb")>> $@
208 echo (defvar cvs-global-menu nil)>> $@
209 echo.\f>> $@
7bbaaedd
AI
210 echo ;;; Local Variables:>> $@
211 echo ;;; version-control: never>> $@
212 echo ;;; no-byte-compile: t>> $@
213 echo ;;; no-update-autoloads: t>> $@
214 echo ;;; End:>> $@
215 echo ;;; loaddefs.el ends here>> $@
216
217autoloads: loaddefs.el doit
218 @echo Directories: $(WINS)
c5bdb93d
AI
219 $(emacs) -l autoload \
220 --eval $(ARGQUOTE)(setq find-file-hooks nil \
221 find-file-suppress-same-file-warnings t \
222 generated-autoload-file \
223 $(DQUOTE)$(lisp)/loaddefs.el$(DQUOTE))$(ARGQUOTE) \
224 -f batch-update-autoloads $(lisp) $(WINS)
7bbaaedd
AI
225
226subdirs.el:
227 $(MAKE) $(MFLAGS) update-subdirs
228
229# Need separate version for sh and native cmd.exe
230update-subdirs: update-subdirs-$(SHELLTYPE)
231
232update-subdirs-CMD: doit
c45dbde8
JB
233 echo ;; -*- no-byte-compile: t -*->subdirs.el
234 echo ;; In load-path, after this directory should come>> subdirs.el
7bbaaedd 235 echo ;; certain of its subdirectories. Here we specify them.>> subdirs.el
d053bf7e
JB
236 echo (normal-top-level-add-to-load-path $(SQUOTE)(>> subdirs.el
237 @for %d in ($(WINS)) do if not (%d)==(term) echo "%d">> subdirs.el
238 echo ))>> subdirs.el
7bbaaedd
AI
239
240update-subdirs-SH: doit
0cfc4b54 241 $(srcdir)/update-subdirs $(lisp); \
e22b24eb 242 for file in $(WINS); do \
7bbaaedd
AI
243 $(srcdir)/update-subdirs $$file; \
244 done;
245
246updates: update-subdirs autoloads finder-data custom-deps
247
9b006cb2
AI
248# Update the AUTHORS file.
249
250update-authors:
251 $(emacs) -f batch-update-authors $(srcdir)/AUTHORS $(srcdir)
252
7bbaaedd
AI
253TAGS: $(lisptagsfiles1) $(lisptagsfiles2)
254 $(ETAGS) $(lisptagsfiles1) $(lisptagsfiles2)
255
9b006cb2
AI
256TAGS-LISP: $(lisptagsfiles1) $(lisptagsfiles2)
257 $(ETAGS) -o TAGS-LISP $(lisptagsfiles1) $(lisptagsfiles2)
7bbaaedd 258
49060c51
AI
259.SUFFIXES: .elc .el
260
7bbaaedd 261.el.elc:
cc7aa053 262 -$(emacs) -f batch-byte-compile $<
7bbaaedd
AI
263
264$(DONTCOMPILE:.el=.elc):
265 -$(DEL) $@
266
9b006cb2
AI
267# Compile all Lisp files, except those from DONTCOMPILE,
268# but don't recompile those that are up to date.
269
270# All .elc files are made writable
7bbaaedd
AI
271# before compilation in case we checked out read-only (CVS option -r).
272# Files MUST be compiled one by one. If we compile several files in a
273# row we can't make sure that the compilation environment is clean.
274# We also set the load-path of the Emacs used for compilation to the
275# current directory and its subdirectories, to make sure require's and
276# load's in the files being compiled find the right files.
277
278# Need separate version for sh and native cmd.exe
d198b6f5 279compile: subdirs.el compile-$(SHELLTYPE) doit
7bbaaedd 280
d198b6f5 281compile-CMD:
9b006cb2 282# -for %f in ($(lisp) $(WINS)) do for %g in (%f\*.elc) do @attrib -r %g
e22b24eb
AI
283 for %f in ($(COMPILE_FIRST)) do \
284 $(emacs) -l loaddefs -f batch-byte-compile-if-not-done %f
285 for %f in (. $(WINS)) do for %g in (%f/*.el) do \
286 $(emacs) -l loaddefs -f batch-byte-compile-if-not-done %f/%g
0702b995 287
d198b6f5 288compile-SH:
9b006cb2
AI
289# for elc in $(lisp)/*.elc $(lisp)/*/*.elc; do attrib -r $$elc; done
290 for el in $(COMPILE_FIRST); do \
291 echo Compiling $$el; \
e22b24eb 292 $(emacs) -l loaddefs -f batch-byte-compile-if-not-done $$el; \
9b006cb2
AI
293 done
294 for dir in $(lisp) $(WINS); do \
295 for el in $$dir/*.el; do \
296 if test -f $$el; \
297 then \
298 echo Compiling $$el; \
e22b24eb 299 $(emacs) -l loaddefs -f batch-byte-compile-if-not-done $$el; \
9b006cb2
AI
300 fi \
301 done; \
302 done
303
304# Compile all Lisp files, except those from DONTCOMPILE. This
305# is like `compile' but compiles files unconditionally.
306compile-always: subdirs.el compile-always-$(SHELLTYPE) doit
307
308compile-always-CMD:
202c7edc 309# -for %f in ($(lisp) $(WINS)) do for %g in (%f\*.elc) do @attrib -r %g
7bbaaedd 310 for %f in ($(COMPILE_FIRST)) do $(emacs) -f batch-byte-compile %f
c5bdb93d 311 for %f in (. $(WINS)) do for %g in (%f/*.el) do $(emacs) -f batch-byte-compile %f/%g
7bbaaedd 312
9b006cb2 313compile-always-SH:
7bbaaedd
AI
314# for elc in $(lisp)/*.elc $(lisp)/*/*.elc; do attrib -r $$elc; done
315 for el in $(COMPILE_FIRST); do \
316 echo Compiling $$el; \
9b006cb2 317 $(emacs) -f batch-byte-compile $$el || exit 1; \
7bbaaedd
AI
318 done
319 for dir in $(lisp) $(WINS); do \
320 for el in $$dir/*.el; do \
321 echo Compiling $$el; \
9b006cb2 322 $(emacs) -f batch-byte-compile $$el || exit 1; \
7bbaaedd
AI
323 done; \
324 done
325
9b006cb2
AI
326compile-calc: compile-calc-$(SHELLTYPE)
327
328compile-calc-CMD:
329 for %f in ($(lisp)/calc/*.el) do $(emacs) -f batch-byte-compile %f
330
c45dbde8 331compile-calc-SH:
9b006cb2
AI
332 for el in $(lisp)/calc/*.el; do \
333 echo Compiling $$el; \
334 $(emacs) -f batch-byte-compile $$el || exit 1; \
335 done
336
7bbaaedd
AI
337# Backup compiled Lisp files in elc.tar.gz. If that file already
338# exists, make a backup of it.
339
340backup-compiled-files:
341 -mv $(lisp)/elc.tar.gz $(lisp)/elc.tar.gz~
342 -tar czf $(lisp)/elc.tar.gz $(lisp)/*.elc $(lisp)/*/*.elc
343
344# Compile Lisp files, but save old compiled files first.
345
d198b6f5 346compile-after-backup: backup-compiled-files compile-always
7bbaaedd
AI
347
348# Recompile all Lisp files which are newer than their .elc files.
349# Note that this doesn't create .elc files. It only recompiles if an
350# .elc is present.
351
352recompile: doit
9b006cb2 353 $(emacs) -f batch-byte-recompile-directory $(lisp)
7bbaaedd
AI
354
355# Prepare a bootstrap in the lisp subdirectory. Build loaddefs.el,
356# because it's not sure it's up-to-date, and if it's not, that might
357# lead to errors during the bootstrap because something fails to
358# autoload as expected. Remove compiled Lisp files so that
359# bootstrap-emacs will be built from sources only.
360
361# Need separate version for sh and native cmd.exe
e22b24eb 362bootstrap-clean: bootstrap-clean-$(SHELLTYPE) loaddefs.el
7bbaaedd
AI
363
364bootstrap-clean-CMD:
5de7f0f7 365# if exist $(EMACS) $(MAKE) $(MFLAGS) autoloads
c5bdb93d 366 -for %f in (. $(WINS)) do for %g in (%f\*.elc) do @$(DEL) %g
7bbaaedd
AI
367
368bootstrap-clean-SH:
5de7f0f7 369# if test -f $(EMACS); then $(MAKE) $(MFLAGS) autoloads; fi
a3599c30
AI
370# -rm -f $(lisp)/*.elc $(lisp)/*/*.elc
371 -for dir in . $(WINS); do rm -f $$dir/*.elc; done
7bbaaedd
AI
372
373# Generate/update files for the bootstrap process.
374
d198b6f5 375bootstrap: update-subdirs autoloads compile finder-data custom-deps
7bbaaedd
AI
376
377#
378# Assuming INSTALL_DIR is defined, copy the elisp files to it
379# Windows 95 makes this harder than it should be.
380#
381install:
382 - mkdir "$(INSTALL_DIR)/lisp"
383 - $(DEL) ../same-dir.tst
384 - $(DEL) "$(INSTALL_DIR)/same-dir.tst"
385 echo SameDirTest > "$(INSTALL_DIR)/same-dir.tst"
386#ifdef COPY_LISP_SOURCE
387 $(IFNOTSAMEDIR) $(CP_DIR) . "$(INSTALL_DIR)/lisp" $(ENDIF)
388#else
389# $(IFNOTSAMEDIR) $(CP_DIR) *.elc "$(INSTALL_DIR)/lisp" $(ENDIF)
390# $(IFNOTSAMEDIR) $(CP) cus-load.el "$(INSTALL_DIR)/lisp" $(ENDIF)
391# $(IFNOTSAMEDIR) $(CP) forms*.el "$(INSTALL_DIR)/lisp" $(ENDIF)
392# $(IFNOTSAMEDIR) $(CP) patcomp.el "$(INSTALL_DIR)/lisp" $(ENDIF)
393# $(IFNOTSAMEDIR) $(CP) subdirs.el "$(INSTALL_DIR)/lisp" $(ENDIF)
394# $(IFNOTSAMEDIR) $(CP) version.el "$(INSTALL_DIR)/lisp" $(ENDIF)
395# $(IFNOTSAMEDIR) $(CP) mail/blessmail.el "$(INSTALL_DIR)/lisp/mail" $(ENDIF)
396# $(IFNOTSAMEDIR) $(CP) mail/sc.el "$(INSTALL_DIR)/lisp/mail" $(ENDIF)
397# $(IFNOTSAMEDIR) $(CP) play/bruce.el "$(INSTALL_DIR)/lisp/play" $(ENDIF)
398# $(IFNOTSAMEDIR) $(CP) international/latin-*.el "$(INSTALL_DIR)/lisp/international" $(ENDIF)
399# $(IFNOTSAMEDIR) $(CP) international/mule-conf.el "$(INSTALL_DIR)/lisp/international" $(ENDIF)
400#endif
401 - $(DEL) ../same-dir.tst
402 - $(DEL) "$(INSTALL_DIR)/same-dir.tst"
403
404#
405# Maintenance
c45dbde8 406#
7bbaaedd
AI
407clean:
408 - $(DEL) *~
ab5796a9
MB
409
410# arch-tag: bd03b562-c58d-4403-99db-c7bccd8c49a0