Commit | Line | Data |
---|---|---|
5288ec68 | 1 | # -*- Makefile -*- for GNU Emacs on the Microsoft W32 API. |
73b0cd50 | 2 | # Copyright (C) 2000-2011 Free Software Foundation, Inc. |
eb3fa2cf | 3 | |
5288ec68 | 4 | # This file is part of GNU Emacs. |
eb3fa2cf GM |
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 3 of the License, or | |
9 | # (at your option) 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. If not, see <http://www.gnu.org/licenses/>. | |
7bbaaedd AI |
18 | |
19 | ALL = | |
20 | ||
21 | all: $(ALL) | |
22 | ||
23 | SQUOTE=' | |
24 | # ' | |
25 | ||
6610f4b2 | 26 | lisp = $(CURDIR) |
9b006cb2 | 27 | srcdir = $(CURDIR)/.. |
7bbaaedd AI |
28 | |
29 | # You can specify a different executable on the make command line, | |
30 | # e.g. "make EMACS=../src/emacs ...". | |
31 | ||
3196bfd2 | 32 | EMACS = $(THISDIR)/../bin/emacs.exe |
7bbaaedd | 33 | |
198a7a97 | 34 | # Command line flags for Emacs. |
7bbaaedd | 35 | |
e7a42417 | 36 | EMACSOPT = -batch --no-site-file --no-site-lisp |
7bbaaedd | 37 | |
8b9a5623 EZ |
38 | # Extra flags to pass to the byte compiler |
39 | BYTE_COMPILE_EXTRA_FLAGS = | |
40 | # For example to not display the undefined function warnings you can use this: | |
41 | # BYTE_COMPILE_EXTRA_FLAGS = --eval '(setq byte-compile-warnings (quote (not unresolved)))' | |
42 | # The example above is just for developers, it should not be used by default. | |
43 | ||
cc7aa053 AI |
44 | # Set EMACSLOADPATH correctly (already defined in environment). |
45 | EMACSLOADPATH=$(lisp) | |
46 | ||
dd6ab82f MB |
47 | # Use C locale |
48 | LC_ALL = C | |
49 | ||
7bbaaedd AI |
50 | lisptagsfiles1 = $(lisp)/*.el |
51 | lisptagsfiles2 = $(lisp)/*/*.el | |
73077a9a EZ |
52 | lisptagsfiles3 = $(lisp)/*/*/*.el |
53 | lisptagsfiles4 = $(lisp)/*/*/*/*.el | |
54 | ETAGS = "../lib-src/$(BLD)/etags.exe" | |
55 | ## $(DEST) is overridden by ../src/makefile.w32-in. | |
56 | DEST=$(lisp) | |
7bbaaedd | 57 | |
c79a07d7 EZ |
58 | # Automatically generated autoload files, apart from lisp/loaddefs.el. |
59 | LOADDEFS = $(lisp)/calendar/cal-loaddefs.el \ | |
3dc94c30 | 60 | $(lisp)/calendar/diary-loaddefs.el $(lisp)/calendar/hol-loaddefs.el \ |
5d921df2 | 61 | $(lisp)/mh-e/mh-loaddefs.el $(lisp)/net/tramp-loaddefs.el |
3dc94c30 JR |
62 | |
63 | AUTOGENEL = $(lisp)/loaddefs.el $(LOADDEFS) $(lisp)/cus-load.el \ | |
f01d54ca | 64 | $(lisp)/finder-inf.el $(lisp)/subdirs.el $(lisp)/eshell/esh-groups.el \ |
8f885d01 EZ |
65 | $(lisp)/calc/calc-loaddefs.el $(lisp)/nxml/subdirs.el \ |
66 | $(lisp)/cedet/semantic/loaddefs.el $(lisp)/cedet/ede/loaddefs.el \ | |
67 | $(lisp)/cedet/srecode/loaddefs.el | |
c79a07d7 | 68 | |
2ec42da9 SM |
69 | # Value of max-lisp-eval-depth when compiling initially. |
70 | # During bootstrapping the byte-compiler is run interpreted when compiling | |
71 | # itself, and uses more stack than usual. | |
72 | # | |
73 | BIG_STACK_DEPTH = 1200 | |
74 | BIG_STACK_OPTS = --eval "(setq max-lisp-eval-depth $(BIG_STACK_DEPTH))" | |
75 | ||
76 | BYTE_COMPILE_FLAGS = $(BIG_STACK_OPTS) $(BYTE_COMPILE_EXTRA_FLAGS) | |
77 | ||
170a9e70 GM |
78 | # Files to compile before others during a bootstrap. This is done to |
79 | # speed up the bootstrap process. The CC files are compiled first | |
80 | # because CC mode tweaks the compilation process, and requiring | |
81 | # cc-mode when it is not compiled doesn't work during the | |
82 | # bootstrapping. | |
7bbaaedd AI |
83 | |
84 | COMPILE_FIRST = \ | |
85 | $(lisp)/emacs-lisp/byte-opt.el \ | |
86 | $(lisp)/emacs-lisp/bytecomp.el \ | |
2ec42da9 SM |
87 | $(lisp)/emacs-lisp/pcase.elc \ |
88 | $(lisp)/emacs-lisp/macroexp.elc \ | |
89 | $(lisp)/emacs-lisp/cconv.elc \ | |
170a9e70 GM |
90 | $(lisp)/subr.el \ |
91 | $(lisp)/progmodes/cc-mode.el \ | |
92 | $(lisp)/progmodes/cc-vars.el | |
7bbaaedd AI |
93 | |
94 | # The actual Emacs command run in the targets below. | |
3196bfd2 EZ |
95 | # The quotes around $(EMACS) are here because the user could type |
96 | # it with forward slashes and without quotes, which will fail if | |
97 | # the shell is cmd.exe. | |
7bbaaedd | 98 | |
3196bfd2 | 99 | emacs = "$(EMACS)" $(EMACSOPT) |
7bbaaedd | 100 | |
7bbaaedd | 101 | # Have to define the list of subdirs manually when not using sh. |
79711e36 | 102 | WINS_CEDET=\ |
d2bda74f | 103 | cedet \ |
79711e36 JB |
104 | cedet/ede \ |
105 | cedet/semantic \ | |
82d3343c | 106 | cedet/srecode \ |
b4a74f30 EZ |
107 | cedet/semantic/analyze \ |
108 | cedet/semantic/bovine \ | |
109 | cedet/semantic/decorate \ | |
110 | cedet/semantic/symref \ | |
111 | cedet/semantic/wisent | |
112 | ||
79711e36 | 113 | WINS_BASIC=\ |
1142be39 | 114 | calc \ |
7bbaaedd AI |
115 | calendar \ |
116 | emacs-lisp \ | |
117 | emulation \ | |
3e66f07c | 118 | erc \ |
7bbaaedd AI |
119 | eshell \ |
120 | gnus \ | |
121 | international \ | |
122 | language \ | |
123 | mail \ | |
942da20c | 124 | mh-e \ |
7bbaaedd | 125 | net \ |
14521da1 | 126 | nxml \ |
41d7a854 | 127 | org \ |
7bbaaedd AI |
128 | play \ |
129 | progmodes \ | |
b036f5d8 | 130 | textmodes \ |
5fee75d4 JB |
131 | url \ |
132 | vc | |
7bbaaedd | 133 | |
82d3343c CY |
134 | # Directories with lisp files to compile, and to extract data from |
135 | # (customs, autoloads, etc.) | |
136 | WINS_UPDATES=$(WINS_BASIC) \ | |
79711e36 JB |
137 | $(WINS_CEDET) |
138 | ||
8c4afe20 | 139 | # Directories to add to subdirs.el |
79711e36 JB |
140 | WINS_SUBDIR=$(WINS_BASIC) \ |
141 | obsolete | |
142 | ||
82d3343c CY |
143 | # All directories |
144 | WINS= $(WINS_UPDATES) \ | |
cba3dac5 | 145 | term \ |
3aeca4ac JB |
146 | obsolete |
147 | ||
7bbaaedd AI |
148 | doit: |
149 | ||
d2373df5 EZ |
150 | cus-load.el-SH: |
151 | echo ";;; cus-load.el --- automatically extracted custom dependencies" > $@ | |
152 | echo ";;" >> $@; echo ";;; Code:" >> $@ | |
153 | echo "\f" >> $@ | |
154 | echo ";; Local Variables:" >> $@ | |
155 | echo ";; version-control: never" >> $@ | |
156 | echo ";; no-byte-compile: t" >> $@ | |
157 | echo ";; no-update-autoloads: t" >> $@ | |
158 | echo ";; End:" >> $@ | |
159 | ||
160 | cus-load.el-CMD: | |
161 | echo ;;; cus-load.el --- automatically extracted custom dependencies> $@ | |
162 | echo ;;>> $@ | |
163 | echo ;;; Code:>> $@ | |
164 | echo.\f>> $@ | |
165 | echo ;; Local Variables:>> $@ | |
166 | echo ;; version-control: never>> $@ | |
167 | echo ;; no-byte-compile: t>> $@ | |
168 | echo ;; no-update-autoloads: t>> $@ | |
169 | echo ;; End:>> $@ | |
170 | ||
bad197f0 | 171 | $(lisp)/cus-load.el: |
d2373df5 EZ |
172 | $(MAKE) $(MFLAGS) cus-load.el-$(SHELLTYPE) |
173 | mv cus-load.el-$(SHELLTYPE) $@ | |
174 | ||
c3d49b7a EZ |
175 | # WARNING: Do NOT split the part inside $(ARGQUOTE)s into multiple lines as |
176 | # this can break with GNU Make 3.81 and later if sh.exe is used. | |
f2133d9e | 177 | custom-deps: $(lisp)/cus-load.el $(lisp)/loaddefs.el doit |
8c4afe20 JB |
178 | @echo Directories: $(WINS_UPDATES) |
179 | -$(emacs) -l cus-dep --eval $(ARGQUOTE)(setq find-file-hook nil)$(ARGQUOTE) \ | |
180 | -f custom-make-dependencies $(lisp) $(WINS_UPDATES) | |
7bbaaedd | 181 | |
f2133d9e | 182 | finder-data: $(lisp)/loaddefs.el doit |
8c4afe20 JB |
183 | @echo Directories: $(WINS_UPDATES) |
184 | $(emacs) -l finder -f finder-compile-keywords-make-dist $(lisp) $(WINS_UPDATES) | |
7bbaaedd | 185 | |
bad197f0 | 186 | $(lisp)/loaddefs.el: |
e22b24eb AI |
187 | $(MAKE) $(MFLAGS) loaddefs.el-$(SHELLTYPE) |
188 | cp loaddefs.el-$(SHELLTYPE) $@ | |
189 | rm loaddefs.el-$(SHELLTYPE) | |
190 | ||
191 | loaddefs.el-SH: | |
192 | echo ";;; loaddefs.el --- automatically extracted autoloads" > $@ | |
193 | echo ";;" >> $@; echo ";;; Code:" >> $@ | |
e22b24eb | 194 | echo "\f" >> $@ |
329b2661 JB |
195 | echo ";; Local Variables:" >> $@ |
196 | echo ";; version-control: never" >> $@ | |
197 | echo ";; no-byte-compile: t" >> $@ | |
198 | echo ";; no-update-autoloads: t" >> $@ | |
199 | echo ";; coding: utf-8" >> $@ | |
200 | echo ";; End:" >> $@ | |
e22b24eb AI |
201 | echo ";;; loaddefs.el ends here" >> $@ |
202 | ||
203 | loaddefs.el-CMD: | |
7bbaaedd | 204 | echo ;;; loaddefs.el --- automatically extracted autoloads> $@ |
329b2661 | 205 | echo ;;>> $@ |
7bbaaedd | 206 | echo ;;; Code:>> $@ |
bad197f0 | 207 | echo.\f>> $@ |
329b2661 JB |
208 | echo ;; Local Variables:>> $@ |
209 | echo ;; version-control: never>> $@ | |
210 | echo ;; no-byte-compile: t>> $@ | |
211 | echo ;; no-update-autoloads: t>> $@ | |
212 | echo ;; coding: utf-8>> $@ | |
213 | echo ;; End:>> $@ | |
7bbaaedd AI |
214 | echo ;;; loaddefs.el ends here>> $@ |
215 | ||
81293113 EZ |
216 | # Use . instead of $(lisp) because $(lisp) is an absolute file name, |
217 | # including a drive letter and any leading directories, so the generated | |
218 | # loaddefs.el will mention file names that on other machine reference | |
219 | # possibly non-existent directories. | |
c3d49b7a EZ |
220 | # |
221 | # WARNING: Do NOT split the part inside $(ARGQUOTE)s into multiple lines as | |
222 | # this can break with GNU Make 3.81 and later if sh.exe is used. | |
c79a07d7 | 223 | autoloads: $(lisp)/loaddefs.el $(LOADDEFS) doit |
8c4afe20 | 224 | @echo Directories: . $(WINS_UPDATES) |
c5bdb93d | 225 | $(emacs) -l autoload \ |
7c417300 | 226 | --eval $(ARGQUOTE)(setq find-file-hook nil find-file-suppress-same-file-warnings t)$(ARGQUOTE) \ |
5288ec68 | 227 | -f w32-batch-update-autoloads "$(lisp)/loaddefs.el" $(MAKE) . $(WINS_UPDATES) |
7bbaaedd | 228 | |
bad197f0 | 229 | $(lisp)/subdirs.el: |
7bbaaedd AI |
230 | $(MAKE) $(MFLAGS) update-subdirs |
231 | ||
232 | # Need separate version for sh and native cmd.exe | |
233 | update-subdirs: update-subdirs-$(SHELLTYPE) | |
234 | ||
235 | update-subdirs-CMD: doit | |
bad197f0 JR |
236 | echo ;; -*- no-byte-compile: t -*-> $(lisp)/subdirs.el |
237 | echo ;; In load-path, after this directory should come>> $(lisp)/subdirs.el | |
238 | echo ;; certain of its subdirectories. Here we specify them.>> $(lisp)/subdirs.el | |
239 | echo (normal-top-level-add-to-load-path $(SQUOTE)(>> $(lisp)/subdirs.el | |
a5b7b0eb | 240 | @for %%d in ($(WINS_SUBDIR) cedet) do echo "%%d">> $(lisp)/subdirs.el |
bad197f0 | 241 | echo ))>> $(lisp)/subdirs.el |
7bbaaedd AI |
242 | |
243 | update-subdirs-SH: doit | |
0cfc4b54 | 244 | $(srcdir)/update-subdirs $(lisp); \ |
d2bda74f | 245 | for file in $(WINS_SUBDIR); do \ |
7bbaaedd AI |
246 | $(srcdir)/update-subdirs $$file; \ |
247 | done; | |
248 | ||
ba2b2673 | 249 | updates: update-subdirs autoloads mh-autoloads finder-data custom-deps |
7bbaaedd | 250 | |
38c1ba62 EZ |
251 | # This is useful after "bzr up". |
252 | bzr-update: recompile autoloads finder-data custom-deps | |
253 | ||
254 | # For backwards compatibility: | |
255 | cvs-update: bzr-update | |
a9d25c79 | 256 | |
9b006cb2 AI |
257 | # Update the AUTHORS file. |
258 | ||
259 | update-authors: | |
ed5e0894 | 260 | $(emacs) -l authors -f batch-update-authors $(srcdir)/etc/AUTHORS $(srcdir) |
9b006cb2 | 261 | |
73077a9a | 262 | TAGS: TAGS-$(MAKETYPE) |
7bbaaedd | 263 | |
73077a9a EZ |
264 | TAGS-LISP: TAGS-LISP-$(MAKETYPE) |
265 | ||
266 | TAGS-nmake: | |
267 | echo This target is not supported with NMake | |
268 | exit -1 | |
269 | ||
270 | TAGS-LISP-nmake: | |
271 | echo This target is not supported with NMake | |
272 | exit -1 | |
273 | ||
274 | TAGS-gmake: TAGS-$(SHELLTYPE) | |
275 | ||
276 | TAGS-LISP-gmake: TAGS-LISP-$(SHELLTYPE) | |
277 | ||
278 | TAGS-SH: $(lisptagsfiles1) $(lisptagsfiles2) $(lisptagsfiles3) $(lisptagsfiles4) | |
279 | - $(DEL) TAGS | |
280 | for dir in . $(WINS_UPDATES); do \ | |
281 | $(ETAGS) -a $(lisp)/$$dir/*.el; \ | |
282 | done | |
283 | ||
284 | TAGS-LISP-SH: $(lisptagsfiles1) $(lisptagsfiles2) $(lisptagsfiles3) $(lisptagsfiles4) | |
285 | - $(DEL) $(DEST)/TAGS-LISP | |
286 | for dir in . $(WINS_UPDATES); do \ | |
287 | $(ETAGS) -a -o $(DEST)/TAGS-LISP $(lisp)/$$dir/*.el; \ | |
288 | done | |
289 | ||
290 | TAGS-CMD: $(lisptagsfiles1) $(lisptagsfiles2) $(lisptagsfiles3) $(lisptagsfiles4) | |
291 | - $(DEL) TAGS | |
292 | for %%d in (. $(WINS_UPDATES)) do $(ETAGS) -a $(lisp)/%%d/*.el | |
293 | ||
294 | TAGS-LISP-CMD: $(lisptagsfiles1) $(lisptagsfiles2) $(lisptagsfiles3) $(lisptagsfiles4) | |
295 | - $(DEL) $(DEST)/TAGS-LISP | |
296 | for %%d in (. $(WINS_UPDATES)) do \ | |
297 | $(ETAGS) -a -o $(DEST)/TAGS-LISP $(lisp)/%%d/*.el | |
7bbaaedd | 298 | |
49060c51 AI |
299 | .SUFFIXES: .elc .el |
300 | ||
7bbaaedd | 301 | .el.elc: |
2ec42da9 | 302 | -$(emacs) $(BYTE_COMPILE_FLAGS) -f batch-byte-compile $< |
7bbaaedd | 303 | |
8f801552 LK |
304 | # Compile all Lisp files, but don't recompile those that are up to |
305 | # date. Some files don't actually get compiled because they set the | |
306 | # local variable no-byte-compile. | |
7bbaaedd | 307 | |
8f801552 LK |
308 | # All .elc files are made writable before compilation in case we |
309 | # checked out read-only (CVS option -r). Files MUST be compiled one by | |
310 | # one. If we compile several files in a row we can't make sure that | |
311 | # the compilation environment is clean. We also set the load-path of | |
312 | # the Emacs used for compilation to the current directory and its | |
313 | # subdirectories, to make sure require's and load's in the files being | |
314 | # compiled find the right files. | |
7bbaaedd AI |
315 | |
316 | # Need separate version for sh and native cmd.exe | |
bad197f0 | 317 | compile: $(lisp)/subdirs.el mh-autoloads compile-$(SHELLTYPE) doit |
7bbaaedd | 318 | |
d198b6f5 | 319 | compile-CMD: |
80bb1e21 JR |
320 | # -for %%f in ($(lisp) $(WINS)) do for %%g in (%%f\*.elc) do @attrib -r %%g |
321 | for %%f in ($(COMPILE_FIRST)) do \ | |
2ec42da9 | 322 | $(emacs) -l loaddefs $(BYTE_COMPILE_FLAGS) -f batch-byte-compile-if-not-done %%f |
80bb1e21 | 323 | for %%f in (. $(WINS)) do for %%g in (%%f/*.el) do \ |
2ec42da9 | 324 | $(emacs) -l loaddefs $(BYTE_COMPILE_FLAGS) -f batch-byte-compile-if-not-done %%f/%%g |
0702b995 | 325 | |
d198b6f5 | 326 | compile-SH: |
9b006cb2 AI |
327 | # for elc in $(lisp)/*.elc $(lisp)/*/*.elc; do attrib -r $$elc; done |
328 | for el in $(COMPILE_FIRST); do \ | |
329 | echo Compiling $$el; \ | |
2ec42da9 | 330 | $(emacs) -l loaddefs $(BYTE_COMPILE_FLAGS) -f batch-byte-compile-if-not-done $$el; \ |
9b006cb2 AI |
331 | done |
332 | for dir in $(lisp) $(WINS); do \ | |
333 | for el in $$dir/*.el; do \ | |
334 | if test -f $$el; \ | |
335 | then \ | |
336 | echo Compiling $$el; \ | |
2ec42da9 | 337 | $(emacs) -l loaddefs $(BYTE_COMPILE_FLAGS) -f batch-byte-compile-if-not-done $$el; \ |
9b006cb2 AI |
338 | fi \ |
339 | done; \ | |
340 | done | |
341 | ||
8f801552 LK |
342 | # Compile all Lisp files. This is like `compile' but compiles files |
343 | # unconditionally. Some files don't actually get compiled because they | |
344 | # set the local variable no-byte-compile. | |
345 | ||
bad197f0 | 346 | compile-always: $(lisp)/subdirs.el compile-always-$(SHELLTYPE) doit |
9b006cb2 AI |
347 | |
348 | compile-always-CMD: | |
80bb1e21 | 349 | # -for %%f in ($(lisp) $(WINS)) do for %%g in (%%f\*.elc) do @attrib -r %%g |
2ec42da9 SM |
350 | for %%f in ($(COMPILE_FIRST)) do $(emacs) $(BYTE_COMPILE_FLAGS) -f batch-byte-compile %%f |
351 | for %%f in (. $(WINS)) do for %%g in (%%f/*.el) do $(emacs) $(BYTE_COMPILE_FLAGS) -f batch-byte-compile %%f/%%g | |
7bbaaedd | 352 | |
9b006cb2 | 353 | compile-always-SH: |
7bbaaedd AI |
354 | # for elc in $(lisp)/*.elc $(lisp)/*/*.elc; do attrib -r $$elc; done |
355 | for el in $(COMPILE_FIRST); do \ | |
356 | echo Compiling $$el; \ | |
2ec42da9 | 357 | $(emacs) $(BYTE_COMPILE_FLAGS) -f batch-byte-compile $$el || exit 1; \ |
7bbaaedd AI |
358 | done |
359 | for dir in $(lisp) $(WINS); do \ | |
360 | for el in $$dir/*.el; do \ | |
361 | echo Compiling $$el; \ | |
2ec42da9 | 362 | $(emacs) $(BYTE_COMPILE_FLAGS) -f batch-byte-compile $$el || exit 1; \ |
7bbaaedd AI |
363 | done; \ |
364 | done | |
365 | ||
9b006cb2 AI |
366 | compile-calc: compile-calc-$(SHELLTYPE) |
367 | ||
368 | compile-calc-CMD: | |
2ec42da9 | 369 | for %%f in ($(lisp)/calc/*.el) do $(emacs) $(BYTE_COMPILE_FLAGS) -f batch-byte-compile %%f |
9b006cb2 | 370 | |
c45dbde8 | 371 | compile-calc-SH: |
9b006cb2 AI |
372 | for el in $(lisp)/calc/*.el; do \ |
373 | echo Compiling $$el; \ | |
2ec42da9 | 374 | $(emacs) $(BYTE_COMPILE_FLAGS) -f batch-byte-compile $$el || exit 1; \ |
9b006cb2 AI |
375 | done |
376 | ||
7bbaaedd AI |
377 | # Backup compiled Lisp files in elc.tar.gz. If that file already |
378 | # exists, make a backup of it. | |
379 | ||
380 | backup-compiled-files: | |
381 | -mv $(lisp)/elc.tar.gz $(lisp)/elc.tar.gz~ | |
382 | -tar czf $(lisp)/elc.tar.gz $(lisp)/*.elc $(lisp)/*/*.elc | |
383 | ||
384 | # Compile Lisp files, but save old compiled files first. | |
385 | ||
d198b6f5 | 386 | compile-after-backup: backup-compiled-files compile-always |
7bbaaedd | 387 | |
0b8e2d21 EZ |
388 | compile-first: $(lisp)/emacs-lisp/bytecomp.elc $(lisp)/emacs-lisp/byte-opt.elc \ |
389 | $(lisp)/emacs-lisp/autoload.elc | |
390 | ||
7bbaaedd AI |
391 | # Recompile all Lisp files which are newer than their .elc files. |
392 | # Note that this doesn't create .elc files. It only recompiles if an | |
393 | # .elc is present. | |
53fad1e4 EZ |
394 | # WARNING: Do NOT split the part inside $(ARGQUOTE)s into multiple lines as |
395 | # this can break with GNU Make 3.81 and later if sh.exe is used. | |
0b8e2d21 | 396 | recompile: compile-first autoloads doit $(lisp)/progmodes/cc-mode.elc |
53fad1e4 | 397 | $(emacs) --eval $(ARGQUOTE)(batch-byte-recompile-directory 0)$(ARGQUOTE) $(lisp) |
7bbaaedd | 398 | |
c79a07d7 EZ |
399 | $(lisp)/calendar/cal-loaddefs.el: |
400 | "$(EMACS)" $(EMACSOPT) -l autoload \ | |
401 | --eval "(setq generate-autoload-cookie \";;;###cal-autoload\")" \ | |
402 | --eval "(setq find-file-suppress-same-file-warnings t)" \ | |
403 | --eval "(setq make-backup-files nil)" \ | |
404 | -f w32-batch-update-autoloads "$(lisp)/calendar/cal-loaddefs.el" \ | |
5288ec68 | 405 | $(MAKE) ./calendar |
c79a07d7 EZ |
406 | |
407 | $(lisp)/calendar/diary-loaddefs.el: | |
408 | "$(EMACS)" $(EMACSOPT) -l autoload \ | |
409 | --eval "(setq generate-autoload-cookie \";;;###diary-autoload\")" \ | |
410 | --eval "(setq find-file-suppress-same-file-warnings t)" \ | |
411 | --eval "(setq make-backup-files nil)" \ | |
412 | -f w32-batch-update-autoloads $(lisp)/calendar/diary-loaddefs.el \ | |
5288ec68 | 413 | $(MAKE) ./calendar |
c79a07d7 EZ |
414 | |
415 | $(lisp)/calendar/hol-loaddefs.el: | |
416 | "$(EMACS)" $(EMACSOPT) -l autoload \ | |
417 | --eval "(setq generate-autoload-cookie \";;;###holiday-autoload\")" \ | |
418 | --eval "(setq find-file-suppress-same-file-warnings t)" \ | |
419 | --eval "(setq make-backup-files nil)" \ | |
420 | -f w32-batch-update-autoloads $(lisp)/calendar/hol-loaddefs.el \ | |
5288ec68 | 421 | $(MAKE) ./calendar |
c79a07d7 | 422 | |
ba2b2673 BW |
423 | # Update MH-E internal autoloads. These are not to be confused with |
424 | # the autoloads for the MH-E entry points, which are already in | |
425 | # loaddefs.el. | |
e9b28650 | 426 | MH_E_SRC = $(lisp)/mh-e/mh-acros.el $(lisp)/mh-e/mh-alias.el \ |
3e66f07c JB |
427 | $(lisp)/mh-e/mh-buffers.el $(lisp)/mh-e/mh-compat.el \ |
428 | $(lisp)/mh-e/mh-comp.el $(lisp)/mh-e/mh-e.el \ | |
429 | $(lisp)/mh-e/mh-folder.el $(lisp)/mh-e/mh-funcs.el \ | |
430 | $(lisp)/mh-e/mh-gnus.el $(lisp)/mh-e/mh-identity.el \ | |
431 | $(lisp)/mh-e/mh-inc.el $(lisp)/mh-e/mh-junk.el \ | |
432 | $(lisp)/mh-e/mh-letter.el $(lisp)/mh-e/mh-limit.el \ | |
433 | $(lisp)/mh-e/mh-mime.el $(lisp)/mh-e/mh-print.el \ | |
434 | $(lisp)/mh-e/mh-scan.el $(lisp)/mh-e/mh-search.el \ | |
435 | $(lisp)/mh-e/mh-seq.el $(lisp)/mh-e/mh-show.el \ | |
436 | $(lisp)/mh-e/mh-speed.el $(lisp)/mh-e/mh-thread.el \ | |
437 | $(lisp)/mh-e/mh-tool-bar.el $(lisp)/mh-e/mh-utils.el \ | |
438 | $(lisp)/mh-e/mh-xface.el | |
ba2b2673 | 439 | |
43618a57 EZ |
440 | # See the commentary for autoloads above for why we use ./mh-e below |
441 | # instead of $(lisp)/mh-e. | |
ba2b2673 | 442 | mh-autoloads: $(lisp)/mh-e/mh-loaddefs.el |
e9b28650 | 443 | $(lisp)/mh-e/mh-loaddefs.el: $(MH_E_SRC) |
3152b1eb | 444 | "$(EMACS)" $(EMACSOPT) \ |
e3188d80 | 445 | -l autoload \ |
3dc94c30 JR |
446 | --eval $(ARGQUOTE)(setq generate-autoload-cookie $(DQUOTE);;;###mh-autoload$(DQUOTE))$(ARGQUOTE) \ |
447 | --eval $(ARGQUOTE)(setq find-file-suppress-same-file-warnings t)$(ARGQUOTE) \ | |
448 | --eval $(ARGQUOTE)(setq make-backup-files nil)$(ARGQUOTE) \ | |
7c417300 | 449 | -f w32-batch-update-autoloads \ |
5288ec68 | 450 | $(ARGQUOTE)$(lisp)/mh-e/mh-loaddefs.el$(ARGQUOTE) $(MAKE) ./mh-e |
e3188d80 | 451 | |
5d921df2 JB |
452 | # Update TRAMP internal autoloads. Maybe we could move tramp*.el into |
453 | # its own subdirectory. OTOH, it does not hurt to keep them in | |
454 | # lisp/net. | |
455 | TRAMP_SRC = $(lisp)/net/tramp.el $(lisp)/net/tramp-cache.el \ | |
456 | $(lisp)/net/tramp-cmds.el $(lisp)/net/tramp-compat.el \ | |
457 | $(lisp)/net/tramp-ftp.el $(lisp)/net/tramp-gvfs.el \ | |
35f52ed6 JB |
458 | $(lisp)/net/tramp-gw.el $(lisp)/net/tramp-sh.el \ |
459 | $(lisp)/net/tramp-smb.el $(lisp)/net/tramp-uu.el \ | |
460 | $(lisp)/net/trampver.el | |
5d921df2 JB |
461 | |
462 | $(lisp)/net/tramp-loaddefs.el: $(TRAMP_SRC) | |
463 | "$(EMACS)" $(EMACSOPT) \ | |
464 | -l autoload \ | |
465 | --eval $(ARGQUOTE)(setq generate-autoload-cookie $(DQUOTE);;;###tramp-autoload$(DQUOTE))$(ARGQUOTE) \ | |
466 | --eval $(ARGQUOTE)(setq find-file-suppress-same-file-warnings t)$(ARGQUOTE) \ | |
467 | --eval $(ARGQUOTE)(setq make-backup-files nil)$(ARGQUOTE) \ | |
468 | -f w32-batch-update-autoloads \ | |
469 | $(ARGQUOTE)$(lisp)/net/tramp-loaddefs.el$(ARGQUOTE) $(MAKE) ./net | |
470 | ||
54ab09c4 MB |
471 | # Prepare a bootstrap in the lisp subdirectory. |
472 | # | |
e8dbbf6f EZ |
473 | # Build loaddefs.el to make sure it's up-to-date. If it's not, that |
474 | # might lead to errors during the bootstrap because something fails to | |
475 | # autoload as expected. If there is no emacs binary, then we can't | |
476 | # build autoloads yet. In that case we have to use ldefs-boot.el; | |
477 | # bootstrap should always work with ldefs-boot.el. (Because | |
478 | # loaddefs.el is an automatically generated file, we don't want to | |
479 | # store it in the source repository). | |
54ab09c4 MB |
480 | # |
481 | # Remove compiled Lisp files so that bootstrap-emacs will be built from | |
482 | # sources only. | |
7bbaaedd AI |
483 | |
484 | # Need separate version for sh and native cmd.exe | |
329b2661 JB |
485 | bootstrap-clean: |
486 | - $(DEL) $(lisp)/loaddefs.el | |
512dd711 | 487 | $(MAKE) $(MFLAGS) bootstrap-clean-$(SHELLTYPE) |
7bbaaedd AI |
488 | |
489 | bootstrap-clean-CMD: | |
3152b1eb | 490 | # if exist "$(EMACS)" $(MAKE) $(MFLAGS) autoloads |
80bb1e21 | 491 | -for %%f in (. $(WINS)) do for %%g in (%%f\*.elc) do @$(DEL) %%g |
7bbaaedd AI |
492 | |
493 | bootstrap-clean-SH: | |
3152b1eb | 494 | # if test -f "$(EMACS)"; then $(MAKE) $(MFLAGS) autoloads; fi |
a3599c30 | 495 | # -rm -f $(lisp)/*.elc $(lisp)/*/*.elc |
82d3343c | 496 | -for dir in . $(WINS); do rm -f $$dir/*.elc $$dir/*/*.elc $$dir/*/*/*.elc; done |
7bbaaedd AI |
497 | |
498 | # Generate/update files for the bootstrap process. | |
014b37b6 EZ |
499 | # When done, remove bootstrap-emacs from ../bin, so that |
500 | # it will not be mistaken for an installed binary. | |
7bbaaedd | 501 | |
ba2b2673 | 502 | bootstrap: update-subdirs autoloads mh-autoloads compile finder-data custom-deps |
3152b1eb | 503 | - $(DEL) "$(EMACS)" |
7bbaaedd AI |
504 | |
505 | # | |
506 | # Assuming INSTALL_DIR is defined, copy the elisp files to it | |
507 | # Windows 95 makes this harder than it should be. | |
508 | # | |
509 | install: | |
510 | - mkdir "$(INSTALL_DIR)/lisp" | |
511 | - $(DEL) ../same-dir.tst | |
512 | - $(DEL) "$(INSTALL_DIR)/same-dir.tst" | |
513 | echo SameDirTest > "$(INSTALL_DIR)/same-dir.tst" | |
514 | #ifdef COPY_LISP_SOURCE | |
564a3032 | 515 | $(IFNOTSAMEDIR) $(MAKE) $(MFLAGS) install-lisp-$(SHELLTYPE) $(ENDIF) |
7bbaaedd AI |
516 | #else |
517 | # $(IFNOTSAMEDIR) $(CP_DIR) *.elc "$(INSTALL_DIR)/lisp" $(ENDIF) | |
518 | # $(IFNOTSAMEDIR) $(CP) cus-load.el "$(INSTALL_DIR)/lisp" $(ENDIF) | |
519 | # $(IFNOTSAMEDIR) $(CP) forms*.el "$(INSTALL_DIR)/lisp" $(ENDIF) | |
520 | # $(IFNOTSAMEDIR) $(CP) patcomp.el "$(INSTALL_DIR)/lisp" $(ENDIF) | |
521 | # $(IFNOTSAMEDIR) $(CP) subdirs.el "$(INSTALL_DIR)/lisp" $(ENDIF) | |
522 | # $(IFNOTSAMEDIR) $(CP) version.el "$(INSTALL_DIR)/lisp" $(ENDIF) | |
523 | # $(IFNOTSAMEDIR) $(CP) mail/blessmail.el "$(INSTALL_DIR)/lisp/mail" $(ENDIF) | |
524 | # $(IFNOTSAMEDIR) $(CP) mail/sc.el "$(INSTALL_DIR)/lisp/mail" $(ENDIF) | |
525 | # $(IFNOTSAMEDIR) $(CP) play/bruce.el "$(INSTALL_DIR)/lisp/play" $(ENDIF) | |
526 | # $(IFNOTSAMEDIR) $(CP) international/latin-*.el "$(INSTALL_DIR)/lisp/international" $(ENDIF) | |
527 | # $(IFNOTSAMEDIR) $(CP) international/mule-conf.el "$(INSTALL_DIR)/lisp/international" $(ENDIF) | |
528 | #endif | |
529 | - $(DEL) ../same-dir.tst | |
530 | - $(DEL) "$(INSTALL_DIR)/same-dir.tst" | |
531 | ||
564a3032 EZ |
532 | # Need to copy *.el files first, to avoid "source file is newer" annoyance |
533 | # since cp does not preserve time stamps | |
534 | install-lisp-SH: | |
535 | cp -f *.el "$(INSTALL_DIR)/lisp" | |
ec9bbc6c EZ |
536 | for dir in $(WINS); do [ -d "$(INSTALL_DIR)/lisp/$$dir" ] || mkdir "$(INSTALL_DIR)/lisp/$$dir"; done |
537 | for dir in $(WINS); do cp -f $$dir/*.el "$(INSTALL_DIR)/lisp/$$dir"; done | |
564a3032 EZ |
538 | for dir in . $(WINS); do cp $$dir/*.elc "$(INSTALL_DIR)/lisp/$$dir"; done |
539 | ||
540 | install-lisp-CMD: | |
541 | cp -f *.el "$(INSTALL_DIR)/lisp" | |
ec9bbc6c | 542 | for %%f in ($(WINS)) do if not exist "$(INSTALL_DIR)/lisp/%%f" mkdir "$(INSTALL_DIR)/lisp/%%f" |
564a3032 EZ |
543 | for %%f in ($(WINS)) do cp -f %%f/*.el "$(INSTALL_DIR)/lisp/%%f" |
544 | for %%f in (. $(WINS)) do cp -f %%f/*.elc "$(INSTALL_DIR)/lisp/%%f" | |
545 | ||
8b9a5623 EZ |
546 | # WARNING: Do NOT split the part inside $(ARGQUOTE)s into multiple lines as |
547 | # this can break with GNU Make 3.81 and later if sh.exe is used. | |
548 | check-declare: | |
549 | $(emacs) -l $(lisp)/emacs-lisp/check-declare --eval $(ARGQUOTE)(check-declare-directory $(DQUOTE)$(lisp)$(DQUOTE))$(ARGQUOTE) | |
550 | ||
7bbaaedd AI |
551 | # |
552 | # Maintenance | |
c45dbde8 | 553 | # |
a055c272 EZ |
554 | # We used to delete *~ here, but that might inadvertently remove |
555 | # precious files if it happens to match their short 8+3 aliases. | |
7bbaaedd | 556 | clean: |
3dc94c30 | 557 | - $(DEL) *.el~ |
6eb5ddb8 EZ |
558 | - $(DEL) calc/calc-loaddefs.el~ |
559 | - $(DEL) eshell/esh-groups.el~ | |
3dc94c30 | 560 | |
6eb5ddb8 | 561 | distclean: clean |
3dc94c30 JR |
562 | - $(DEL) $(lisp)/Makefile |
563 | ||
564 | maintainer-clean: bootstrap-clean distclean | |
565 | - $(DEL) $(AUTOGENEL) | |
1ed6e04d EZ |
566 | |
567 | # Dependencies | |
568 | ||
569 | # CC Mode uses a compile time macro system which causes a compile time | |
570 | # dependency in cc-*.elc files on the macros in other cc-*.el and the | |
571 | # version string in cc-defs.el. | |
572 | $(lisp)/progmodes/cc-align.elc $(lisp)/progmodes/cc-awk.elc\ | |
573 | $(lisp)/progmodes/cc-cmds.elc $(lisp)/progmodes/cc-compat.elc\ | |
574 | $(lisp)/progmodes/cc-engine.elc $(lisp)/progmodes/cc-fonts.elc\ | |
575 | $(lisp)/progmodes/cc-langs.elc $(lisp)/progmodes/cc-menus.elc\ | |
576 | $(lisp)/progmodes/cc-mode.elc $(lisp)/progmodes/cc-styles.elc\ | |
1f35fda9 | 577 | $(lisp)/progmodes/cc-vars.elc: \ |
1ed6e04d EZ |
578 | $(lisp)/progmodes/cc-bytecomp.elc $(lisp)/progmodes/cc-defs.elc |
579 | ||
580 | $(lisp)/progmodes/cc-align.elc: \ | |
581 | $(lisp)/progmodes/cc-vars.elc $(lisp)/progmodes/cc-engine.elc | |
582 | ||
583 | $(lisp)/progmodes/cc-cmds.elc: \ | |
584 | $(lisp)/progmodes/cc-vars.elc $(lisp)/progmodes/cc-engine.elc | |
585 | ||
586 | $(lisp)/progmodes/cc-compat.elc: \ | |
587 | $(lisp)/progmodes/cc-vars.elc $(lisp)/progmodes/cc-styles.elc \ | |
588 | $(lisp)/progmodes/cc-engine.elc | |
589 | ||
590 | $(lisp)/progmodes/cc-defs.elc: $(lisp)/progmodes/cc-bytecomp.elc \ | |
591 | $(lisp)/emacs-lisp/cl.elc $(lisp)/emacs-lisp/regexp-opt.elc | |
592 | ||
593 | $(lisp)/progmodes/cc-engine.elc: $(lisp)/progmodes/cc-langs.elc \ | |
594 | $(lisp)/progmodes/cc-vars.elc | |
595 | ||
596 | $(lisp)/progmodes/cc-fonts.elc: $(lisp)/progmodes/cc-langs.elc \ | |
597 | $(lisp)/progmodes/cc-vars.elc $(lisp)/progmodes/cc-engine.elc \ | |
598 | $(lisp)/font-lock.elc | |
599 | ||
600 | $(lisp)/progmodes/cc-langs.elc: $(lisp)/progmodes/cc-vars.elc \ | |
601 | $(lisp)/emacs-lisp/cl.elc | |
602 | ||
603 | $(lisp)/progmodes/cc-mode.elc: $(lisp)/progmodes/cc-langs.elc \ | |
604 | $(lisp)/progmodes/cc-vars.elc $(lisp)/progmodes/cc-engine.elc \ | |
605 | $(lisp)/progmodes/cc-styles.elc $(lisp)/progmodes/cc-cmds.elc \ | |
606 | $(lisp)/progmodes/cc-align.elc $(lisp)/progmodes/cc-menus.elc | |
607 | ||
608 | $(lisp)/progmodes/cc-styles.elc: $(lisp)/progmodes/cc-vars.elc \ | |
609 | $(lisp)/progmodes/cc-align.elc | |
610 | ||
1ed6e04d | 611 | $(lisp)/progmodes/cc-vars.elc: $(lisp)/custom.elc $(lisp)/widget.elc |
6c4d5dd3 EZ |
612 | |
613 | # MH-E dependencies, mainly to prevent failures with parallel | |
614 | # compilation, due to race conditions between writing a given FOO.elc | |
615 | # file and another file being compiled that says "(require FOO)", | |
616 | # which causes Emacs to try to read FOO.elc. | |
617 | MH_E_DIR = ./mh-e | |
618 | $(MH_E_DIR)/mh-alias.elc $(MH_E_DIR)/mh-comp.elc $(MH_E_DIR)/mh-folder.elc\ | |
619 | $(MH_E_DIR)/mh-funcs.elc $(MH_E_DIR)/mh-identity.elc $(MH_E_DIR)/mh-inc.elc\ | |
620 | $(MH_E_DIR)/mh-junk.elc $(MH_E_DIR)/mh-letter.elc $(MH_E_DIR)/mh-limit.elc\ | |
621 | $(MH_E_DIR)/mh-mime.elc $(MH_E_DIR)/mh-print.elc $(MH_E_DIR)/mh-scan.elc\ | |
622 | $(MH_E_DIR)/mh-search.elc $(MH_E_DIR)/mh-seq.elc $(MH_E_DIR)/mh-show.elc\ | |
623 | $(MH_E_DIR)/mh-speed.elc $(MH_E_DIR)/mh-thread.elc $(MH_E_DIR)/mh-tool-bar.elc\ | |
624 | $(MH_E_DIR)/mh-utils.elc $(MH_E_DIR)/mh-xface.elc:\ | |
625 | $(MH_E_DIR)/mh-e.elc | |
626 | ||
627 | $(MH_E_DIR)/mh-alias.elc $(MH_E_DIR)/mh-e.elc $(MH_E_DIR)/mh-folder.elc\ | |
628 | $(MH_E_DIR)/mh-inc.elc $(MH_E_DIR)/mh-junk.elc $(MH_E_DIR)/mh-limit.elc\ | |
629 | $(MH_E_DIR)/mh-search.elc $(MH_E_DIR)/mh-seq.elc $(MH_E_DIR)/mh-speed.elc\ | |
630 | $(MH_E_DIR)/mh-utils.elc $(MH_E_DIR)/mh-xface.elc:\ | |
631 | $(lisp)/emacs-lisp/cl.elc | |
632 | ||
633 | $(MH_E_DIR)/mh-comp.elc $(MH_E_DIR)/mh-folder.elc $(MH_E_DIR)/mh-funcs.elc\ | |
634 | $(MH_E_DIR)/mh-junk.elc $(MH_E_DIR)/mh-limit.elc $(MH_E_DIR)/mh-print.elc\ | |
635 | $(MH_E_DIR)/mh-seq.elc $(MH_E_DIR)/mh-show.elc $(MH_E_DIR)/mh-thread.elc:\ | |
636 | $(MH_E_DIR)/mh-scan.elc | |
637 | ||
638 | $(MH_E_DIR)/mh-folder.elc $(MH_E_DIR)/mh-letter.elc $(MH_E_DIR)/mh-mime.elc\ | |
639 | $(MH_E_DIR)/mh-search.elc $(MH_E_DIR)/mh-show.elc $(MH_E_DIR)/mh-speed.elc:\ | |
640 | $(lisp)/gnus/gnus-util.elc | |
641 | ||
642 | $(MH_E_DIR)/mh-folder.elc $(MH_E_DIR)/mh-search.elc:\ | |
643 | $(lisp)/progmodes/which-func.elc | |
644 | ||
645 | $(MH_E_DIR)/mh-letter.elc $(MH_E_DIR)/mh-seq.elc $(MH_E_DIR)/mh-show.elc\ | |
646 | $(MH_E_DIR)/mh-utils.elc:\ | |
647 | $(lisp)/font-lock.elc | |
648 | ||
649 | $(MH_E_DIR)/mh-alias.elc $(MH_E_DIR)/mh-show.elc: $(lisp)/net/goto-addr.elc | |
650 | ||
651 | $(MH_E_DIR)/mh-comp.elc: $(lisp)/mail/sendmail.elc | |
652 | ||
653 | $(MH_E_DIR)/mh-e.elc: $(MH_E_DIR)/mh-buffers.elc $(lisp)/gnus/gnus.elc \ | |
654 | $(lisp)/cus-face.elc | |
655 | ||
656 | $(MH_E_DIR)/mh-letter.elc: $(lisp)/gnus/mailcap.elc $(lisp)/gnus/mm-decode.elc \ | |
657 | $(lisp)/gnus/mm-view.elc $(lisp)/gnus/mml.elc $(lisp)/gnus/message.elc | |
658 | ||
659 | $(MH_E_DIR)/mh-print.elc: $(lisp)/ps-print.elc | |
660 | ||
661 | $(MH_E_DIR)/mh-search.elc: $(lisp)/imenu.elc | |
662 | ||
663 | $(MH_E_DIR)/mh-show.elc: $(lisp)/gnus/gnus-cite.elc | |
664 | ||
665 | $(MH_E_DIR)/mh-speed.elc: $(lisp)/speedbar.elc $(lisp)/emacs-lisp/timer.elc | |
666 | ||
667 | $(MH_E_DIR)/mh-tool-bar.elc: $(lisp)/tool-bar.elc |