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