]> code.delx.au - gnu-emacs/blob - lisp/makefile.w32-in
(autoloads, $(lisp)/mh-e/mh-loaddefs.el): Use w32-batch-update-autoloads,
[gnu-emacs] / lisp / makefile.w32-in
1 # -*- Makefile -*- for GNU Emacs on the Microsoft W32 API.
2 # Copyright (C) 2000, 2001, 2002, 2003, 2004,
3 # 2005 Free Software Foundation, Inc.
4 #
5 # This file is part of GNU Emacs.
6 #
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.
11 #
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.
16 #
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
19 # Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20 # Boston, MA 02110-1301, USA.
21 #
22
23 ALL =
24
25 all: $(ALL)
26
27 SQUOTE='
28 # '
29
30 lisp = $(CURDIR)
31 srcdir = $(CURDIR)/..
32
33 # You can specify a different executable on the make command line,
34 # e.g. "make EMACS=../src/emacs ...".
35
36 EMACS = "$(THISDIR)/../bin/emacs.exe"
37
38 # Command line flags for Emacs. This must include --multibyte,
39 # otherwise some files will not compile.
40
41 EMACSOPT = -batch --no-init-file --no-site-file --multibyte
42
43 # Set EMACSLOADPATH correctly (already defined in environment).
44 EMACSLOADPATH=$(lisp)
45
46 lisptagsfiles1 = $(lisp)/*.el
47 lisptagsfiles2 = $(lisp)/*/*.el
48 ETAGS = "../lib-src/$(BLD)/etags"
49
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.
55
56 COMPILE_FIRST = \
57 $(lisp)/emacs-lisp/byte-opt.el \
58 $(lisp)/emacs-lisp/bytecomp.el \
59 $(lisp)/subr.el \
60 $(lisp)/progmodes/cc-mode.el \
61 $(lisp)/progmodes/cc-vars.el
62
63 # The actual Emacs command run in the targets below.
64
65 emacs = $(EMACS) $(EMACSOPT)
66
67 # Common command to find subdirectories
68
69 setwins=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.
77 WINS=\
78 calc \
79 calendar \
80 emacs-lisp \
81 emulation \
82 eshell \
83 gnus \
84 international \
85 language \
86 mail \
87 mh-e \
88 net \
89 obsolete \
90 play \
91 progmodes \
92 term \
93 textmodes \
94 url
95
96 doit:
97
98 $(lisp)/cus-load.el:
99 touch $@
100 # WARNING: Do NOT split the part inside $(ARGQUOTE)s into multiple lines as
101 # this can break with GNU Make 3.81 and later if sh.exe is used.
102 custom-deps: $(lisp)/cus-load.el doit
103 @echo Directories: $(WINS)
104 -$(emacs) -l cus-dep --eval $(ARGQUOTE)(setq find-file-hook nil)$(ARGQUOTE) -f custom-make-dependencies $(lisp) $(WINS)
105
106 finder-data: doit
107 @echo Directories: $(WINS)
108 $(emacs) -l finder -f finder-compile-keywords-make-dist $(lisp) $(WINS)
109
110 $(lisp)/loaddefs.el:
111 $(MAKE) $(MFLAGS) loaddefs.el-$(SHELLTYPE)
112 cp loaddefs.el-$(SHELLTYPE) $@
113 rm loaddefs.el-$(SHELLTYPE)
114
115 loaddefs.el-SH:
116 echo ";;; loaddefs.el --- automatically extracted autoloads" > $@
117 echo ";;" >> $@; echo ";;; Code:" >> $@
118 echo "(autoload 'define-minor-mode \"easy-mmode\")" >>$@
119 echo "(autoload 'define-ccl-program \"ccl\")" >>$@
120 echo "(autoload 'regexp-opt \"regexp-opt\")" >>$@
121 echo "(autoload 'string-to-list \"mule-util\")" >>$@
122 echo "(autoload 'define-derived-mode \"derived\")" >>$@
123 echo "(autoload 'encoded-kbd-mode \"encoded-kb\")" >>$@
124 echo "(defvar cvs-global-menu nil)" >>$@
125 echo "\f" >> $@
126 echo ";;; Local Variables:" >> $@
127 echo ";;; version-control: never" >> $@
128 echo ";;; no-byte-compile: t" >> $@
129 echo ";;; no-update-autoloads: t" >> $@
130 echo ";;; End:" >> $@
131 echo ";;; loaddefs.el ends here" >> $@
132
133 loaddefs.el-CMD:
134 echo ;;; loaddefs.el --- automatically extracted autoloads> $@
135 echo ;;; Code:>> $@
136 echo (autoload 'define-minor-mode "easy-mmode")>> $@
137 echo (autoload 'define-ccl-program "ccl")>> $@
138 echo (autoload 'regexp-opt "regexp-opt")>> $@
139 echo (autoload 'string-to-list "mule-util")>> $@
140 echo (autoload 'define-derived-mode "derived")>> $@
141 echo (autoload 'encoded-kbd-mode "encoded-kb")>> $@
142 echo (defvar cvs-global-menu nil)>> $@
143 echo.\f>> $@
144 echo ;;; Local Variables:>> $@
145 echo ;;; version-control: never>> $@
146 echo ;;; no-byte-compile: t>> $@
147 echo ;;; no-update-autoloads: t>> $@
148 echo ;;; End:>> $@
149 echo ;;; loaddefs.el ends here>> $@
150
151 # Use . instead of $(lisp) because $(lisp) is an absolute file name,
152 # including a drive letter and any leading directories, so the generated
153 # loaddefs.el will mention file names that on other machine reference
154 # possibly non-existent directories.
155 #
156 # WARNING: Do NOT split the part inside $(ARGQUOTE)s into multiple lines as
157 # this can break with GNU Make 3.81 and later if sh.exe is used.
158 autoloads: $(lisp)/loaddefs.el doit
159 @echo Directories: . $(WINS)
160 $(emacs) -l autoload \
161 --eval $(ARGQUOTE)(setq find-file-hook nil find-file-suppress-same-file-warnings t)$(ARGQUOTE) \
162 -f w32-batch-update-autoloads "$(lisp)/loaddefs.el" . $(WINS)
163
164 $(lisp)/subdirs.el:
165 $(MAKE) $(MFLAGS) update-subdirs
166
167 # Need separate version for sh and native cmd.exe
168 update-subdirs: update-subdirs-$(SHELLTYPE)
169
170 update-subdirs-CMD: doit
171 echo ;; -*- no-byte-compile: t -*-> $(lisp)/subdirs.el
172 echo ;; In load-path, after this directory should come>> $(lisp)/subdirs.el
173 echo ;; certain of its subdirectories. Here we specify them.>> $(lisp)/subdirs.el
174 echo (normal-top-level-add-to-load-path $(SQUOTE)(>> $(lisp)/subdirs.el
175 @for %%d in ($(WINS)) do if not (%%d)==(term) echo "%%d">> $(lisp)/subdirs.el
176 echo ))>> $(lisp)/subdirs.el
177
178 update-subdirs-SH: doit
179 $(srcdir)/update-subdirs $(lisp); \
180 for file in $(WINS); do \
181 $(srcdir)/update-subdirs $$file; \
182 done;
183
184 updates: update-subdirs autoloads mh-autoloads finder-data custom-deps
185
186 # Update the AUTHORS file.
187
188 update-authors:
189 $(emacs) -l authors -f batch-update-authors $(srcdir)/AUTHORS $(srcdir)
190
191 TAGS: $(lisptagsfiles1) $(lisptagsfiles2)
192 $(ETAGS) $(lisptagsfiles1) $(lisptagsfiles2)
193
194 TAGS-LISP: $(lisptagsfiles1) $(lisptagsfiles2)
195 $(ETAGS) -o TAGS-LISP $(lisptagsfiles1) $(lisptagsfiles2)
196
197 .SUFFIXES: .elc .el
198
199 .el.elc:
200 -$(emacs) -f batch-byte-compile $<
201
202 # Compile all Lisp files, but don't recompile those that are up to
203 # date. Some files don't actually get compiled because they set the
204 # local variable no-byte-compile.
205
206 # All .elc files are made writable before compilation in case we
207 # checked out read-only (CVS option -r). Files MUST be compiled one by
208 # one. If we compile several files in a row we can't make sure that
209 # the compilation environment is clean. We also set the load-path of
210 # the Emacs used for compilation to the current directory and its
211 # subdirectories, to make sure require's and load's in the files being
212 # compiled find the right files.
213
214 # Need separate version for sh and native cmd.exe
215 compile: $(lisp)/subdirs.el mh-autoloads compile-$(SHELLTYPE) doit
216
217 compile-CMD:
218 # -for %%f in ($(lisp) $(WINS)) do for %%g in (%%f\*.elc) do @attrib -r %%g
219 for %%f in ($(COMPILE_FIRST)) do \
220 $(emacs) -l loaddefs -f batch-byte-compile-if-not-done %%f
221 for %%f in (. $(WINS)) do for %%g in (%%f/*.el) do \
222 $(emacs) -l loaddefs -f batch-byte-compile-if-not-done %%f/%%g
223
224 compile-SH:
225 # for elc in $(lisp)/*.elc $(lisp)/*/*.elc; do attrib -r $$elc; done
226 for el in $(COMPILE_FIRST); do \
227 echo Compiling $$el; \
228 $(emacs) -l loaddefs -f batch-byte-compile-if-not-done $$el; \
229 done
230 for dir in $(lisp) $(WINS); do \
231 for el in $$dir/*.el; do \
232 if test -f $$el; \
233 then \
234 echo Compiling $$el; \
235 $(emacs) -l loaddefs -f batch-byte-compile-if-not-done $$el; \
236 fi \
237 done; \
238 done
239
240 # Compile all Lisp files. This is like `compile' but compiles files
241 # unconditionally. Some files don't actually get compiled because they
242 # set the local variable no-byte-compile.
243
244 compile-always: $(lisp)/subdirs.el compile-always-$(SHELLTYPE) doit
245
246 compile-always-CMD:
247 # -for %%f in ($(lisp) $(WINS)) do for %%g in (%%f\*.elc) do @attrib -r %%g
248 for %%f in ($(COMPILE_FIRST)) do $(emacs) -f batch-byte-compile %%f
249 for %%f in (. $(WINS)) do for %%g in (%%f/*.el) do $(emacs) -f batch-byte-compile %%f/%%g
250
251 compile-always-SH:
252 # for elc in $(lisp)/*.elc $(lisp)/*/*.elc; do attrib -r $$elc; done
253 for el in $(COMPILE_FIRST); do \
254 echo Compiling $$el; \
255 $(emacs) -f batch-byte-compile $$el || exit 1; \
256 done
257 for dir in $(lisp) $(WINS); do \
258 for el in $$dir/*.el; do \
259 echo Compiling $$el; \
260 $(emacs) -f batch-byte-compile $$el || exit 1; \
261 done; \
262 done
263
264 compile-calc: compile-calc-$(SHELLTYPE)
265
266 compile-calc-CMD:
267 for %%f in ($(lisp)/calc/*.el) do $(emacs) -f batch-byte-compile %%f
268
269 compile-calc-SH:
270 for el in $(lisp)/calc/*.el; do \
271 echo Compiling $$el; \
272 $(emacs) -f batch-byte-compile $$el || exit 1; \
273 done
274
275 # Backup compiled Lisp files in elc.tar.gz. If that file already
276 # exists, make a backup of it.
277
278 backup-compiled-files:
279 -mv $(lisp)/elc.tar.gz $(lisp)/elc.tar.gz~
280 -tar czf $(lisp)/elc.tar.gz $(lisp)/*.elc $(lisp)/*/*.elc
281
282 # Compile Lisp files, but save old compiled files first.
283
284 compile-after-backup: backup-compiled-files compile-always
285
286 # Recompile all Lisp files which are newer than their .elc files.
287 # Note that this doesn't create .elc files. It only recompiles if an
288 # .elc is present.
289
290 recompile: mh-autoloads doit
291 $(emacs) -f batch-byte-recompile-directory $(lisp)
292
293 # Update MH-E internal autoloads. These are not to be confused with
294 # the autoloads for the MH-E entry points, which are already in
295 # loaddefs.el.
296 MH_E_SRC = $(lisp)/mh-e/mh-acros.el $(lisp)/mh-e/mh-alias.el \
297 $(lisp)/mh-e/mh-comp.el $(lisp)/mh-e/mh-customize.el \
298 $(lisp)/mh-e/mh-e.el $(lisp)/mh-e/mh-funcs.el \
299 $(lisp)/mh-e/mh-mime.el $(lisp)/mh-e/mh-pick.el \
300 $(lisp)/mh-e/mh-print.el $(lisp)/mh-e/mh-inc.el \
301 $(lisp)/mh-e/mh-init.el $(lisp)/mh-e/mh-index.el \
302 $(lisp)/mh-e/mh-identity.el $(lisp)/mh-e/mh-junk.el \
303 $(lisp)/mh-e/mh-seq.el $(lisp)/mh-e/mh-speed.el \
304 $(lisp)/mh-e/mh-utils.el
305
306 mh-autoloads: $(lisp)/mh-e/mh-loaddefs.el
307 $(lisp)/mh-e/mh-loaddefs.el: $(MH_E_SRC)
308 $(MAKE) $(MFLAGS) pre-mh-loaddefs.el-$(SHELLTYPE)
309 cp pre-mh-loaddefs.el-$(SHELLTYPE) $@
310 rm pre-mh-loaddefs.el-$(SHELLTYPE)
311 $(EMACS) $(EMACSOPT) \
312 -l autoload \
313 --eval "(setq generate-autoload-cookie \";;;###mh-autoload\")" \
314 --eval "(setq find-file-suppress-same-file-warnings t)" \
315 --eval "(setq make-backup-files nil)" \
316 -f w32-batch-update-autoloads \
317 "$(lisp)/mh-e/mh-loaddefs.el" $(lisp)/mh-e
318
319 pre-mh-loaddefs.el-SH:
320 echo ";;; mh-loaddefs.el --- automatically extracted autoloads" > $@
321 echo ";;" >> $@
322 echo ";;; Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc." >> $@
323 echo ";;; Author: Bill Wohler <wohler@newt.com>" >> $@
324 echo ";;; Keywords: mail" >> $@
325 echo ";;; Commentary:" >> $@
326 echo ";;; Change Log:" >> $@
327 echo ";;; Code:" >> $@
328 echo "\f" >> $@
329 echo "(provide 'mh-loaddefs)" >> $@
330 echo ";;; Local Variables:" >> $@
331 echo ";;; version-control: never" >> $@
332 echo ";;; no-byte-compile: t" >> $@
333 echo ";;; no-update-autoloads: t" >> $@
334 echo ";;; End:" >> $@
335 echo ";;; mh-loaddefs.el ends here" >> $@
336
337 pre-mh-loaddefs.el-CMD:
338 echo ;;; mh-loaddefs.el --- automatically extracted autoloads> $@
339 echo ;;>> $@
340 echo ;;; Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.>> $@
341 echo ;;; Author: Bill Wohler (wohler@newt.com)>> $@
342 echo ;;; Keywords: mail>> $@
343 echo ;;; Commentary:>> $@
344 echo ;;; Change Log:>> $@
345 echo ;;; Code:>> $@
346 echo.\f>> $@
347 echo (provide 'mh-loaddefs)>> $@
348 echo ;;; Local Variables:>> $@
349 echo ;;; version-control: never>> $@
350 echo ;;; no-byte-compile: t>> $@
351 echo ;;; no-update-autoloads: t>> $@
352 echo ;;; End:>> $@
353 echo ;;; mh-loaddefs.el ends here>> $@
354
355 # Prepare a bootstrap in the lisp subdirectory.
356 #
357 # Build loaddefs.el to make sure it's up-to-date. If it's not, that
358 # might lead to errors during the bootstrap because something fails to
359 # autoload as expected. If there is no emacs binary, then we can't
360 # build autoloads yet. In that case we have to use ldefs-boot.el;
361 # bootstrap should always work with ldefs-boot.el. (Because
362 # loaddefs.el is an automatically generated file, we don't want to
363 # store it in the source repository).
364 #
365 # Remove compiled Lisp files so that bootstrap-emacs will be built from
366 # sources only.
367
368 # Need separate version for sh and native cmd.exe
369 bootstrap-clean: bootstrap-clean-$(SHELLTYPE) $(lisp)/loaddefs.el
370
371 bootstrap-clean-CMD:
372 # if exist $(EMACS) $(MAKE) $(MFLAGS) autoloads
373 cp $(lisp)/ldefs-boot.el $(lisp)/loaddefs.el
374 -for %%f in (. $(WINS)) do for %%g in (%%f\*.elc) do @$(DEL) %%g
375
376 bootstrap-clean-SH:
377 # if test -f $(EMACS); then $(MAKE) $(MFLAGS) autoloads; fi
378 # -rm -f $(lisp)/*.elc $(lisp)/*/*.elc
379 cp $(lisp)/ldefs-boot.el $(lisp)/loaddefs.el
380 -for dir in . $(WINS); do rm -f $$dir/*.elc; done
381
382 # Generate/update files for the bootstrap process.
383 # When done, remove bootstrap-emacs from ../bin, so that
384 # it will not be mistaken for an installed binary.
385
386 bootstrap: update-subdirs autoloads mh-autoloads compile finder-data custom-deps
387 - $(DEL) $(EMACS)
388
389 #
390 # Assuming INSTALL_DIR is defined, copy the elisp files to it
391 # Windows 95 makes this harder than it should be.
392 #
393 install:
394 - mkdir "$(INSTALL_DIR)/lisp"
395 - $(DEL) ../same-dir.tst
396 - $(DEL) "$(INSTALL_DIR)/same-dir.tst"
397 echo SameDirTest > "$(INSTALL_DIR)/same-dir.tst"
398 #ifdef COPY_LISP_SOURCE
399 $(IFNOTSAMEDIR) $(CP_DIR) . "$(INSTALL_DIR)/lisp" $(ENDIF)
400 #else
401 # $(IFNOTSAMEDIR) $(CP_DIR) *.elc "$(INSTALL_DIR)/lisp" $(ENDIF)
402 # $(IFNOTSAMEDIR) $(CP) cus-load.el "$(INSTALL_DIR)/lisp" $(ENDIF)
403 # $(IFNOTSAMEDIR) $(CP) forms*.el "$(INSTALL_DIR)/lisp" $(ENDIF)
404 # $(IFNOTSAMEDIR) $(CP) patcomp.el "$(INSTALL_DIR)/lisp" $(ENDIF)
405 # $(IFNOTSAMEDIR) $(CP) subdirs.el "$(INSTALL_DIR)/lisp" $(ENDIF)
406 # $(IFNOTSAMEDIR) $(CP) version.el "$(INSTALL_DIR)/lisp" $(ENDIF)
407 # $(IFNOTSAMEDIR) $(CP) mail/blessmail.el "$(INSTALL_DIR)/lisp/mail" $(ENDIF)
408 # $(IFNOTSAMEDIR) $(CP) mail/sc.el "$(INSTALL_DIR)/lisp/mail" $(ENDIF)
409 # $(IFNOTSAMEDIR) $(CP) play/bruce.el "$(INSTALL_DIR)/lisp/play" $(ENDIF)
410 # $(IFNOTSAMEDIR) $(CP) international/latin-*.el "$(INSTALL_DIR)/lisp/international" $(ENDIF)
411 # $(IFNOTSAMEDIR) $(CP) international/mule-conf.el "$(INSTALL_DIR)/lisp/international" $(ENDIF)
412 #endif
413 - $(DEL) ../same-dir.tst
414 - $(DEL) "$(INSTALL_DIR)/same-dir.tst"
415
416 #
417 # Maintenance
418 #
419 clean:
420 - $(DEL) *~