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