Commit | Line | Data |
---|---|---|
bd6766d3 | 1 | # -*- Makefile -*- for GNU Emacs on the Microsoft W32 API. |
92b47a4a | 2 | # Copyright (C) 2000, 2001, 2002, 2003, 2004, |
409cc4a3 | 3 | # 2005, 2006, 2007, 2008 Free Software Foundation, Inc. |
eb3fa2cf | 4 | |
7bbaaedd | 5 | # This file is part of GNU Emacs. |
eb3fa2cf GM |
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 3 of the License, or | |
10 | # (at your option) 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. If not, see <http://www.gnu.org/licenses/>. | |
7bbaaedd AI |
19 | |
20 | ALL = | |
21 | ||
22 | all: $(ALL) | |
23 | ||
24 | SQUOTE=' | |
25 | # ' | |
26 | ||
6610f4b2 | 27 | lisp = $(CURDIR) |
9b006cb2 | 28 | srcdir = $(CURDIR)/.. |
7bbaaedd AI |
29 | |
30 | # You can specify a different executable on the make command line, | |
31 | # e.g. "make EMACS=../src/emacs ...". | |
32 | ||
3196bfd2 | 33 | EMACS = $(THISDIR)/../bin/emacs.exe |
7bbaaedd AI |
34 | |
35 | # Command line flags for Emacs. This must include --multibyte, | |
36 | # otherwise some files will not compile. | |
37 | ||
38 | EMACSOPT = -batch --no-init-file --no-site-file --multibyte | |
39 | ||
8b9a5623 EZ |
40 | # Extra flags to pass to the byte compiler |
41 | BYTE_COMPILE_EXTRA_FLAGS = | |
42 | # For example to not display the undefined function warnings you can use this: | |
43 | # BYTE_COMPILE_EXTRA_FLAGS = --eval '(setq byte-compile-warnings (quote (not unresolved)))' | |
44 | # The example above is just for developers, it should not be used by default. | |
45 | ||
cc7aa053 AI |
46 | # Set EMACSLOADPATH correctly (already defined in environment). |
47 | EMACSLOADPATH=$(lisp) | |
48 | ||
dd6ab82f MB |
49 | # Use C locale |
50 | LC_ALL = C | |
51 | ||
7bbaaedd AI |
52 | lisptagsfiles1 = $(lisp)/*.el |
53 | lisptagsfiles2 = $(lisp)/*/*.el | |
54 | ETAGS = "../lib-src/$(BLD)/etags" | |
55 | ||
c79a07d7 EZ |
56 | # Automatically generated autoload files, apart from lisp/loaddefs.el. |
57 | LOADDEFS = $(lisp)/calendar/cal-loaddefs.el \ | |
3dc94c30 JR |
58 | $(lisp)/calendar/diary-loaddefs.el $(lisp)/calendar/hol-loaddefs.el \ |
59 | $(lisp)/mh-e/mh-loaddefs.el | |
60 | ||
61 | AUTOGENEL = $(lisp)/loaddefs.el $(LOADDEFS) $(lisp)/cus-load.el \ | |
f01d54ca | 62 | $(lisp)/finder-inf.el $(lisp)/subdirs.el $(lisp)/eshell/esh-groups.el \ |
6eb5ddb8 | 63 | $(lisp)/calc/calc-loaddefs.el $(lisp)/nxml/subdirs.el |
c79a07d7 | 64 | |
170a9e70 GM |
65 | # Files to compile before others during a bootstrap. This is done to |
66 | # speed up the bootstrap process. The CC files are compiled first | |
67 | # because CC mode tweaks the compilation process, and requiring | |
68 | # cc-mode when it is not compiled doesn't work during the | |
69 | # bootstrapping. | |
7bbaaedd AI |
70 | |
71 | COMPILE_FIRST = \ | |
72 | $(lisp)/emacs-lisp/byte-opt.el \ | |
73 | $(lisp)/emacs-lisp/bytecomp.el \ | |
170a9e70 GM |
74 | $(lisp)/subr.el \ |
75 | $(lisp)/progmodes/cc-mode.el \ | |
76 | $(lisp)/progmodes/cc-vars.el | |
7bbaaedd AI |
77 | |
78 | # The actual Emacs command run in the targets below. | |
3196bfd2 EZ |
79 | # The quotes around $(EMACS) are here because the user could type |
80 | # it with forward slashes and without quotes, which will fail if | |
81 | # the shell is cmd.exe. | |
7bbaaedd | 82 | |
3196bfd2 | 83 | emacs = "$(EMACS)" $(EMACSOPT) |
7bbaaedd | 84 | |
7bbaaedd | 85 | # Have to define the list of subdirs manually when not using sh. |
3aeca4ac | 86 | WINS_ALMOST=\ |
1142be39 | 87 | calc \ |
7bbaaedd AI |
88 | calendar \ |
89 | emacs-lisp \ | |
90 | emulation \ | |
3e66f07c | 91 | erc \ |
7bbaaedd AI |
92 | eshell \ |
93 | gnus \ | |
94 | international \ | |
95 | language \ | |
96 | mail \ | |
942da20c | 97 | mh-e \ |
7bbaaedd | 98 | net \ |
14521da1 | 99 | nxml \ |
41d7a854 | 100 | org \ |
7bbaaedd AI |
101 | play \ |
102 | progmodes \ | |
b036f5d8 | 103 | textmodes \ |
05cecc58 | 104 | url |
7bbaaedd | 105 | |
3aeca4ac | 106 | WINS= $(WINS_ALMOST) \ |
cba3dac5 | 107 | term \ |
3aeca4ac JB |
108 | obsolete |
109 | ||
7bbaaedd AI |
110 | doit: |
111 | ||
d2373df5 EZ |
112 | cus-load.el-SH: |
113 | echo ";;; cus-load.el --- automatically extracted custom dependencies" > $@ | |
114 | echo ";;" >> $@; echo ";;; Code:" >> $@ | |
115 | echo "\f" >> $@ | |
116 | echo ";; Local Variables:" >> $@ | |
117 | echo ";; version-control: never" >> $@ | |
118 | echo ";; no-byte-compile: t" >> $@ | |
119 | echo ";; no-update-autoloads: t" >> $@ | |
120 | echo ";; End:" >> $@ | |
121 | ||
122 | cus-load.el-CMD: | |
123 | echo ;;; cus-load.el --- automatically extracted custom dependencies> $@ | |
124 | echo ;;>> $@ | |
125 | echo ;;; Code:>> $@ | |
126 | echo.\f>> $@ | |
127 | echo ;; Local Variables:>> $@ | |
128 | echo ;; version-control: never>> $@ | |
129 | echo ;; no-byte-compile: t>> $@ | |
130 | echo ;; no-update-autoloads: t>> $@ | |
131 | echo ;; End:>> $@ | |
132 | ||
bad197f0 | 133 | $(lisp)/cus-load.el: |
d2373df5 EZ |
134 | $(MAKE) $(MFLAGS) cus-load.el-$(SHELLTYPE) |
135 | mv cus-load.el-$(SHELLTYPE) $@ | |
136 | ||
c3d49b7a EZ |
137 | # WARNING: Do NOT split the part inside $(ARGQUOTE)s into multiple lines as |
138 | # this can break with GNU Make 3.81 and later if sh.exe is used. | |
f2133d9e | 139 | custom-deps: $(lisp)/cus-load.el $(lisp)/loaddefs.el doit |
cba3dac5 JR |
140 | @echo Directories: $(WINS_ALMOST) |
141 | -$(emacs) -l cus-dep --eval $(ARGQUOTE)(setq find-file-hook nil)$(ARGQUOTE) -f custom-make-dependencies $(lisp) $(WINS_ALMOST) | |
7bbaaedd | 142 | |
f2133d9e | 143 | finder-data: $(lisp)/loaddefs.el doit |
cba3dac5 JR |
144 | @echo Directories: $(WINS_ALMOST) |
145 | $(emacs) -l finder -f finder-compile-keywords-make-dist $(lisp) $(WINS_ALMOST) | |
7bbaaedd | 146 | |
bad197f0 | 147 | $(lisp)/loaddefs.el: |
e22b24eb AI |
148 | $(MAKE) $(MFLAGS) loaddefs.el-$(SHELLTYPE) |
149 | cp loaddefs.el-$(SHELLTYPE) $@ | |
150 | rm loaddefs.el-$(SHELLTYPE) | |
151 | ||
152 | loaddefs.el-SH: | |
153 | echo ";;; loaddefs.el --- automatically extracted autoloads" > $@ | |
154 | echo ";;" >> $@; echo ";;; Code:" >> $@ | |
e22b24eb | 155 | echo "\f" >> $@ |
329b2661 JB |
156 | echo ";; Local Variables:" >> $@ |
157 | echo ";; version-control: never" >> $@ | |
158 | echo ";; no-byte-compile: t" >> $@ | |
159 | echo ";; no-update-autoloads: t" >> $@ | |
160 | echo ";; coding: utf-8" >> $@ | |
161 | echo ";; End:" >> $@ | |
e22b24eb AI |
162 | echo ";;; loaddefs.el ends here" >> $@ |
163 | ||
164 | loaddefs.el-CMD: | |
7bbaaedd | 165 | echo ;;; loaddefs.el --- automatically extracted autoloads> $@ |
329b2661 | 166 | echo ;;>> $@ |
7bbaaedd | 167 | echo ;;; Code:>> $@ |
bad197f0 | 168 | echo.\f>> $@ |
329b2661 JB |
169 | echo ;; Local Variables:>> $@ |
170 | echo ;; version-control: never>> $@ | |
171 | echo ;; no-byte-compile: t>> $@ | |
172 | echo ;; no-update-autoloads: t>> $@ | |
173 | echo ;; coding: utf-8>> $@ | |
174 | echo ;; End:>> $@ | |
7bbaaedd AI |
175 | echo ;;; loaddefs.el ends here>> $@ |
176 | ||
81293113 EZ |
177 | # Use . instead of $(lisp) because $(lisp) is an absolute file name, |
178 | # including a drive letter and any leading directories, so the generated | |
179 | # loaddefs.el will mention file names that on other machine reference | |
180 | # possibly non-existent directories. | |
c3d49b7a EZ |
181 | # |
182 | # WARNING: Do NOT split the part inside $(ARGQUOTE)s into multiple lines as | |
183 | # this can break with GNU Make 3.81 and later if sh.exe is used. | |
c79a07d7 | 184 | autoloads: $(lisp)/loaddefs.el $(LOADDEFS) doit |
3aeca4ac | 185 | @echo Directories: . $(WINS_ALMOST) |
c5bdb93d | 186 | $(emacs) -l autoload \ |
7c417300 | 187 | --eval $(ARGQUOTE)(setq find-file-hook nil find-file-suppress-same-file-warnings t)$(ARGQUOTE) \ |
3aeca4ac | 188 | -f w32-batch-update-autoloads "$(lisp)/loaddefs.el" . $(WINS_ALMOST) |
7bbaaedd | 189 | |
bad197f0 | 190 | $(lisp)/subdirs.el: |
7bbaaedd AI |
191 | $(MAKE) $(MFLAGS) update-subdirs |
192 | ||
193 | # Need separate version for sh and native cmd.exe | |
194 | update-subdirs: update-subdirs-$(SHELLTYPE) | |
195 | ||
196 | update-subdirs-CMD: doit | |
bad197f0 JR |
197 | echo ;; -*- no-byte-compile: t -*-> $(lisp)/subdirs.el |
198 | echo ;; In load-path, after this directory should come>> $(lisp)/subdirs.el | |
199 | echo ;; certain of its subdirectories. Here we specify them.>> $(lisp)/subdirs.el | |
200 | echo (normal-top-level-add-to-load-path $(SQUOTE)(>> $(lisp)/subdirs.el | |
201 | @for %%d in ($(WINS)) do if not (%%d)==(term) echo "%%d">> $(lisp)/subdirs.el | |
202 | echo ))>> $(lisp)/subdirs.el | |
7bbaaedd AI |
203 | |
204 | update-subdirs-SH: doit | |
0cfc4b54 | 205 | $(srcdir)/update-subdirs $(lisp); \ |
e22b24eb | 206 | for file in $(WINS); do \ |
7bbaaedd AI |
207 | $(srcdir)/update-subdirs $$file; \ |
208 | done; | |
209 | ||
ba2b2673 | 210 | updates: update-subdirs autoloads mh-autoloads finder-data custom-deps |
7bbaaedd | 211 | |
a9d25c79 EZ |
212 | # This is useful after "cvs up". |
213 | cvs-update: recompile autoloads finder-data custom-deps | |
214 | ||
9b006cb2 AI |
215 | # Update the AUTHORS file. |
216 | ||
217 | update-authors: | |
ed5e0894 | 218 | $(emacs) -l authors -f batch-update-authors $(srcdir)/etc/AUTHORS $(srcdir) |
9b006cb2 | 219 | |
7bbaaedd AI |
220 | TAGS: $(lisptagsfiles1) $(lisptagsfiles2) |
221 | $(ETAGS) $(lisptagsfiles1) $(lisptagsfiles2) | |
222 | ||
9b006cb2 AI |
223 | TAGS-LISP: $(lisptagsfiles1) $(lisptagsfiles2) |
224 | $(ETAGS) -o TAGS-LISP $(lisptagsfiles1) $(lisptagsfiles2) | |
7bbaaedd | 225 | |
49060c51 AI |
226 | .SUFFIXES: .elc .el |
227 | ||
7bbaaedd | 228 | .el.elc: |
8b9a5623 | 229 | -$(emacs) $(BYTE_COMPILE_EXTRA_FLAGS) -f batch-byte-compile $< |
7bbaaedd | 230 | |
8f801552 LK |
231 | # Compile all Lisp files, but don't recompile those that are up to |
232 | # date. Some files don't actually get compiled because they set the | |
233 | # local variable no-byte-compile. | |
7bbaaedd | 234 | |
8f801552 LK |
235 | # All .elc files are made writable before compilation in case we |
236 | # checked out read-only (CVS option -r). Files MUST be compiled one by | |
237 | # one. If we compile several files in a row we can't make sure that | |
238 | # the compilation environment is clean. We also set the load-path of | |
239 | # the Emacs used for compilation to the current directory and its | |
240 | # subdirectories, to make sure require's and load's in the files being | |
241 | # compiled find the right files. | |
7bbaaedd AI |
242 | |
243 | # Need separate version for sh and native cmd.exe | |
bad197f0 | 244 | compile: $(lisp)/subdirs.el mh-autoloads compile-$(SHELLTYPE) doit |
7bbaaedd | 245 | |
d198b6f5 | 246 | compile-CMD: |
80bb1e21 JR |
247 | # -for %%f in ($(lisp) $(WINS)) do for %%g in (%%f\*.elc) do @attrib -r %%g |
248 | for %%f in ($(COMPILE_FIRST)) do \ | |
8b9a5623 | 249 | $(emacs) -l loaddefs $(BYTE_COMPILE_EXTRA_FLAGS) -f batch-byte-compile-if-not-done %%f |
80bb1e21 | 250 | for %%f in (. $(WINS)) do for %%g in (%%f/*.el) do \ |
8b9a5623 | 251 | $(emacs) -l loaddefs $(BYTE_COMPILE_EXTRA_FLAGS) -f batch-byte-compile-if-not-done %%f/%%g |
0702b995 | 252 | |
d198b6f5 | 253 | compile-SH: |
9b006cb2 AI |
254 | # for elc in $(lisp)/*.elc $(lisp)/*/*.elc; do attrib -r $$elc; done |
255 | for el in $(COMPILE_FIRST); do \ | |
256 | echo Compiling $$el; \ | |
8b9a5623 | 257 | $(emacs) -l loaddefs $(BYTE_COMPILE_EXTRA_FLAGS) -f batch-byte-compile-if-not-done $$el; \ |
9b006cb2 AI |
258 | done |
259 | for dir in $(lisp) $(WINS); do \ | |
260 | for el in $$dir/*.el; do \ | |
261 | if test -f $$el; \ | |
262 | then \ | |
263 | echo Compiling $$el; \ | |
8b9a5623 | 264 | $(emacs) -l loaddefs $(BYTE_COMPILE_EXTRA_FLAGS) -f batch-byte-compile-if-not-done $$el; \ |
9b006cb2 AI |
265 | fi \ |
266 | done; \ | |
267 | done | |
268 | ||
8f801552 LK |
269 | # Compile all Lisp files. This is like `compile' but compiles files |
270 | # unconditionally. Some files don't actually get compiled because they | |
271 | # set the local variable no-byte-compile. | |
272 | ||
bad197f0 | 273 | compile-always: $(lisp)/subdirs.el compile-always-$(SHELLTYPE) doit |
9b006cb2 AI |
274 | |
275 | compile-always-CMD: | |
80bb1e21 | 276 | # -for %%f in ($(lisp) $(WINS)) do for %%g in (%%f\*.elc) do @attrib -r %%g |
8b9a5623 EZ |
277 | for %%f in ($(COMPILE_FIRST)) do $(emacs) $(BYTE_COMPILE_EXTRA_FLAGS) -f batch-byte-compile %%f |
278 | for %%f in (. $(WINS)) do for %%g in (%%f/*.el) do $(emacs) $(BYTE_COMPILE_EXTRA_FLAGS) -f batch-byte-compile %%f/%%g | |
7bbaaedd | 279 | |
9b006cb2 | 280 | compile-always-SH: |
7bbaaedd AI |
281 | # for elc in $(lisp)/*.elc $(lisp)/*/*.elc; do attrib -r $$elc; done |
282 | for el in $(COMPILE_FIRST); do \ | |
283 | echo Compiling $$el; \ | |
8b9a5623 | 284 | $(emacs) $(BYTE_COMPILE_EXTRA_FLAGS) -f batch-byte-compile $$el || exit 1; \ |
7bbaaedd AI |
285 | done |
286 | for dir in $(lisp) $(WINS); do \ | |
287 | for el in $$dir/*.el; do \ | |
288 | echo Compiling $$el; \ | |
8b9a5623 | 289 | $(emacs) $(BYTE_COMPILE_EXTRA_FLAGS) -f batch-byte-compile $$el || exit 1; \ |
7bbaaedd AI |
290 | done; \ |
291 | done | |
292 | ||
9b006cb2 AI |
293 | compile-calc: compile-calc-$(SHELLTYPE) |
294 | ||
295 | compile-calc-CMD: | |
8b9a5623 | 296 | for %%f in ($(lisp)/calc/*.el) do $(emacs) $(BYTE_COMPILE_EXTRA_FLAGS) -f batch-byte-compile %%f |
9b006cb2 | 297 | |
c45dbde8 | 298 | compile-calc-SH: |
9b006cb2 AI |
299 | for el in $(lisp)/calc/*.el; do \ |
300 | echo Compiling $$el; \ | |
8b9a5623 | 301 | $(emacs) $(BYTE_COMPILE_EXTRA_FLAGS) -f batch-byte-compile $$el || exit 1; \ |
9b006cb2 AI |
302 | done |
303 | ||
7bbaaedd AI |
304 | # Backup compiled Lisp files in elc.tar.gz. If that file already |
305 | # exists, make a backup of it. | |
306 | ||
307 | backup-compiled-files: | |
308 | -mv $(lisp)/elc.tar.gz $(lisp)/elc.tar.gz~ | |
309 | -tar czf $(lisp)/elc.tar.gz $(lisp)/*.elc $(lisp)/*/*.elc | |
310 | ||
311 | # Compile Lisp files, but save old compiled files first. | |
312 | ||
d198b6f5 | 313 | compile-after-backup: backup-compiled-files compile-always |
7bbaaedd AI |
314 | |
315 | # Recompile all Lisp files which are newer than their .elc files. | |
316 | # Note that this doesn't create .elc files. It only recompiles if an | |
317 | # .elc is present. | |
53fad1e4 EZ |
318 | # WARNING: Do NOT split the part inside $(ARGQUOTE)s into multiple lines as |
319 | # this can break with GNU Make 3.81 and later if sh.exe is used. | |
320 | recompile: mh-autoloads doit $(lisp)/progmodes/cc-mode.elc | |
321 | $(emacs) --eval $(ARGQUOTE)(batch-byte-recompile-directory 0)$(ARGQUOTE) $(lisp) | |
7bbaaedd | 322 | |
8b9a5623 EZ |
323 | # CC Mode uses a compile time macro system which causes a compile time |
324 | # dependency in cc-mode.elc on the macros in cc-langs.el and the | |
325 | # version string in cc-defs.el. | |
326 | $(lisp)/progmodes/cc-mode.elc: \ | |
327 | $(lisp)/progmodes/cc-mode.el \ | |
328 | $(lisp)/progmodes/cc-langs.el \ | |
329 | $(lisp)/progmodes/cc-defs.el | |
330 | $(emacs) $(BYTE_COMPILE_EXTRA_FLAGS) -f batch-byte-compile $(lisp)/progmodes/cc-mode.el | |
331 | ||
c79a07d7 EZ |
332 | $(lisp)/calendar/cal-loaddefs.el: |
333 | "$(EMACS)" $(EMACSOPT) -l autoload \ | |
334 | --eval "(setq generate-autoload-cookie \";;;###cal-autoload\")" \ | |
335 | --eval "(setq find-file-suppress-same-file-warnings t)" \ | |
336 | --eval "(setq make-backup-files nil)" \ | |
337 | -f w32-batch-update-autoloads "$(lisp)/calendar/cal-loaddefs.el" \ | |
338 | ./calendar | |
339 | ||
340 | $(lisp)/calendar/diary-loaddefs.el: | |
341 | "$(EMACS)" $(EMACSOPT) -l autoload \ | |
342 | --eval "(setq generate-autoload-cookie \";;;###diary-autoload\")" \ | |
343 | --eval "(setq find-file-suppress-same-file-warnings t)" \ | |
344 | --eval "(setq make-backup-files nil)" \ | |
345 | -f w32-batch-update-autoloads $(lisp)/calendar/diary-loaddefs.el \ | |
346 | ./calendar | |
347 | ||
348 | $(lisp)/calendar/hol-loaddefs.el: | |
349 | "$(EMACS)" $(EMACSOPT) -l autoload \ | |
350 | --eval "(setq generate-autoload-cookie \";;;###holiday-autoload\")" \ | |
351 | --eval "(setq find-file-suppress-same-file-warnings t)" \ | |
352 | --eval "(setq make-backup-files nil)" \ | |
353 | -f w32-batch-update-autoloads $(lisp)/calendar/hol-loaddefs.el \ | |
354 | ./calendar | |
355 | ||
ba2b2673 BW |
356 | # Update MH-E internal autoloads. These are not to be confused with |
357 | # the autoloads for the MH-E entry points, which are already in | |
358 | # loaddefs.el. | |
e9b28650 | 359 | MH_E_SRC = $(lisp)/mh-e/mh-acros.el $(lisp)/mh-e/mh-alias.el \ |
3e66f07c JB |
360 | $(lisp)/mh-e/mh-buffers.el $(lisp)/mh-e/mh-compat.el \ |
361 | $(lisp)/mh-e/mh-comp.el $(lisp)/mh-e/mh-e.el \ | |
362 | $(lisp)/mh-e/mh-folder.el $(lisp)/mh-e/mh-funcs.el \ | |
363 | $(lisp)/mh-e/mh-gnus.el $(lisp)/mh-e/mh-identity.el \ | |
364 | $(lisp)/mh-e/mh-inc.el $(lisp)/mh-e/mh-junk.el \ | |
365 | $(lisp)/mh-e/mh-letter.el $(lisp)/mh-e/mh-limit.el \ | |
366 | $(lisp)/mh-e/mh-mime.el $(lisp)/mh-e/mh-print.el \ | |
367 | $(lisp)/mh-e/mh-scan.el $(lisp)/mh-e/mh-search.el \ | |
368 | $(lisp)/mh-e/mh-seq.el $(lisp)/mh-e/mh-show.el \ | |
369 | $(lisp)/mh-e/mh-speed.el $(lisp)/mh-e/mh-thread.el \ | |
370 | $(lisp)/mh-e/mh-tool-bar.el $(lisp)/mh-e/mh-utils.el \ | |
371 | $(lisp)/mh-e/mh-xface.el | |
ba2b2673 | 372 | |
43618a57 EZ |
373 | # See the commentary for autoloads above for why we use ./mh-e below |
374 | # instead of $(lisp)/mh-e. | |
ba2b2673 | 375 | mh-autoloads: $(lisp)/mh-e/mh-loaddefs.el |
e9b28650 | 376 | $(lisp)/mh-e/mh-loaddefs.el: $(MH_E_SRC) |
3152b1eb | 377 | "$(EMACS)" $(EMACSOPT) \ |
e3188d80 | 378 | -l autoload \ |
3dc94c30 JR |
379 | --eval $(ARGQUOTE)(setq generate-autoload-cookie $(DQUOTE);;;###mh-autoload$(DQUOTE))$(ARGQUOTE) \ |
380 | --eval $(ARGQUOTE)(setq find-file-suppress-same-file-warnings t)$(ARGQUOTE) \ | |
381 | --eval $(ARGQUOTE)(setq make-backup-files nil)$(ARGQUOTE) \ | |
7c417300 | 382 | -f w32-batch-update-autoloads \ |
3dc94c30 | 383 | $(ARGQUOTE)$(lisp)/mh-e/mh-loaddefs.el$(ARGQUOTE) ./mh-e |
e3188d80 | 384 | |
54ab09c4 MB |
385 | # Prepare a bootstrap in the lisp subdirectory. |
386 | # | |
e8dbbf6f EZ |
387 | # Build loaddefs.el to make sure it's up-to-date. If it's not, that |
388 | # might lead to errors during the bootstrap because something fails to | |
389 | # autoload as expected. If there is no emacs binary, then we can't | |
390 | # build autoloads yet. In that case we have to use ldefs-boot.el; | |
391 | # bootstrap should always work with ldefs-boot.el. (Because | |
392 | # loaddefs.el is an automatically generated file, we don't want to | |
393 | # store it in the source repository). | |
54ab09c4 MB |
394 | # |
395 | # Remove compiled Lisp files so that bootstrap-emacs will be built from | |
396 | # sources only. | |
7bbaaedd AI |
397 | |
398 | # Need separate version for sh and native cmd.exe | |
329b2661 JB |
399 | bootstrap-clean: |
400 | - $(DEL) $(lisp)/loaddefs.el | |
512dd711 | 401 | $(MAKE) $(MFLAGS) bootstrap-clean-$(SHELLTYPE) |
7bbaaedd AI |
402 | |
403 | bootstrap-clean-CMD: | |
3152b1eb | 404 | # if exist "$(EMACS)" $(MAKE) $(MFLAGS) autoloads |
80bb1e21 | 405 | -for %%f in (. $(WINS)) do for %%g in (%%f\*.elc) do @$(DEL) %%g |
7bbaaedd AI |
406 | |
407 | bootstrap-clean-SH: | |
3152b1eb | 408 | # if test -f "$(EMACS)"; then $(MAKE) $(MFLAGS) autoloads; fi |
a3599c30 AI |
409 | # -rm -f $(lisp)/*.elc $(lisp)/*/*.elc |
410 | -for dir in . $(WINS); do rm -f $$dir/*.elc; done | |
7bbaaedd AI |
411 | |
412 | # Generate/update files for the bootstrap process. | |
014b37b6 EZ |
413 | # When done, remove bootstrap-emacs from ../bin, so that |
414 | # it will not be mistaken for an installed binary. | |
7bbaaedd | 415 | |
ba2b2673 | 416 | bootstrap: update-subdirs autoloads mh-autoloads compile finder-data custom-deps |
3152b1eb | 417 | - $(DEL) "$(EMACS)" |
7bbaaedd AI |
418 | |
419 | # | |
420 | # Assuming INSTALL_DIR is defined, copy the elisp files to it | |
421 | # Windows 95 makes this harder than it should be. | |
422 | # | |
423 | install: | |
424 | - mkdir "$(INSTALL_DIR)/lisp" | |
425 | - $(DEL) ../same-dir.tst | |
426 | - $(DEL) "$(INSTALL_DIR)/same-dir.tst" | |
427 | echo SameDirTest > "$(INSTALL_DIR)/same-dir.tst" | |
428 | #ifdef COPY_LISP_SOURCE | |
564a3032 | 429 | $(IFNOTSAMEDIR) $(MAKE) $(MFLAGS) install-lisp-$(SHELLTYPE) $(ENDIF) |
7bbaaedd AI |
430 | #else |
431 | # $(IFNOTSAMEDIR) $(CP_DIR) *.elc "$(INSTALL_DIR)/lisp" $(ENDIF) | |
432 | # $(IFNOTSAMEDIR) $(CP) cus-load.el "$(INSTALL_DIR)/lisp" $(ENDIF) | |
433 | # $(IFNOTSAMEDIR) $(CP) forms*.el "$(INSTALL_DIR)/lisp" $(ENDIF) | |
434 | # $(IFNOTSAMEDIR) $(CP) patcomp.el "$(INSTALL_DIR)/lisp" $(ENDIF) | |
435 | # $(IFNOTSAMEDIR) $(CP) subdirs.el "$(INSTALL_DIR)/lisp" $(ENDIF) | |
436 | # $(IFNOTSAMEDIR) $(CP) version.el "$(INSTALL_DIR)/lisp" $(ENDIF) | |
437 | # $(IFNOTSAMEDIR) $(CP) mail/blessmail.el "$(INSTALL_DIR)/lisp/mail" $(ENDIF) | |
438 | # $(IFNOTSAMEDIR) $(CP) mail/sc.el "$(INSTALL_DIR)/lisp/mail" $(ENDIF) | |
439 | # $(IFNOTSAMEDIR) $(CP) play/bruce.el "$(INSTALL_DIR)/lisp/play" $(ENDIF) | |
440 | # $(IFNOTSAMEDIR) $(CP) international/latin-*.el "$(INSTALL_DIR)/lisp/international" $(ENDIF) | |
441 | # $(IFNOTSAMEDIR) $(CP) international/mule-conf.el "$(INSTALL_DIR)/lisp/international" $(ENDIF) | |
442 | #endif | |
443 | - $(DEL) ../same-dir.tst | |
444 | - $(DEL) "$(INSTALL_DIR)/same-dir.tst" | |
445 | ||
564a3032 EZ |
446 | # Need to copy *.el files first, to avoid "source file is newer" annoyance |
447 | # since cp does not preserve time stamps | |
448 | install-lisp-SH: | |
449 | cp -f *.el "$(INSTALL_DIR)/lisp" | |
ec9bbc6c EZ |
450 | for dir in $(WINS); do [ -d "$(INSTALL_DIR)/lisp/$$dir" ] || mkdir "$(INSTALL_DIR)/lisp/$$dir"; done |
451 | for dir in $(WINS); do cp -f $$dir/*.el "$(INSTALL_DIR)/lisp/$$dir"; done | |
564a3032 EZ |
452 | for dir in . $(WINS); do cp $$dir/*.elc "$(INSTALL_DIR)/lisp/$$dir"; done |
453 | ||
454 | install-lisp-CMD: | |
455 | cp -f *.el "$(INSTALL_DIR)/lisp" | |
ec9bbc6c | 456 | for %%f in ($(WINS)) do if not exist "$(INSTALL_DIR)/lisp/%%f" mkdir "$(INSTALL_DIR)/lisp/%%f" |
564a3032 EZ |
457 | for %%f in ($(WINS)) do cp -f %%f/*.el "$(INSTALL_DIR)/lisp/%%f" |
458 | for %%f in (. $(WINS)) do cp -f %%f/*.elc "$(INSTALL_DIR)/lisp/%%f" | |
459 | ||
8b9a5623 EZ |
460 | # WARNING: Do NOT split the part inside $(ARGQUOTE)s into multiple lines as |
461 | # this can break with GNU Make 3.81 and later if sh.exe is used. | |
462 | check-declare: | |
463 | $(emacs) -l $(lisp)/emacs-lisp/check-declare --eval $(ARGQUOTE)(check-declare-directory $(DQUOTE)$(lisp)$(DQUOTE))$(ARGQUOTE) | |
464 | ||
7bbaaedd AI |
465 | # |
466 | # Maintenance | |
c45dbde8 | 467 | # |
a055c272 EZ |
468 | # We used to delete *~ here, but that might inadvertently remove |
469 | # precious files if it happens to match their short 8+3 aliases. | |
7bbaaedd | 470 | clean: |
3dc94c30 | 471 | - $(DEL) *.el~ |
6eb5ddb8 EZ |
472 | - $(DEL) calc/calc-loaddefs.el~ |
473 | - $(DEL) eshell/esh-groups.el~ | |
3dc94c30 | 474 | |
6eb5ddb8 | 475 | distclean: clean |
3dc94c30 JR |
476 | - $(DEL) $(lisp)/Makefile |
477 | ||
478 | maintainer-clean: bootstrap-clean distclean | |
479 | - $(DEL) $(AUTOGENEL) |