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