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 JB |
62 | $(lisp)/finder-inf.el $(lisp)/subdirs.el $(lisp)/eshell/esh-groups.el \ |
63 | $(lisp)/calc/calc-loaddefs.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 | ||
bad197f0 | 112 | $(lisp)/cus-load.el: |
7bbaaedd | 113 | touch $@ |
c3d49b7a EZ |
114 | # WARNING: Do NOT split the part inside $(ARGQUOTE)s into multiple lines as |
115 | # this can break with GNU Make 3.81 and later if sh.exe is used. | |
f2133d9e | 116 | custom-deps: $(lisp)/cus-load.el $(lisp)/loaddefs.el doit |
cba3dac5 JR |
117 | @echo Directories: $(WINS_ALMOST) |
118 | -$(emacs) -l cus-dep --eval $(ARGQUOTE)(setq find-file-hook nil)$(ARGQUOTE) -f custom-make-dependencies $(lisp) $(WINS_ALMOST) | |
7bbaaedd | 119 | |
f2133d9e | 120 | finder-data: $(lisp)/loaddefs.el doit |
cba3dac5 JR |
121 | @echo Directories: $(WINS_ALMOST) |
122 | $(emacs) -l finder -f finder-compile-keywords-make-dist $(lisp) $(WINS_ALMOST) | |
7bbaaedd | 123 | |
bad197f0 | 124 | $(lisp)/loaddefs.el: |
e22b24eb AI |
125 | $(MAKE) $(MFLAGS) loaddefs.el-$(SHELLTYPE) |
126 | cp loaddefs.el-$(SHELLTYPE) $@ | |
127 | rm loaddefs.el-$(SHELLTYPE) | |
128 | ||
129 | loaddefs.el-SH: | |
130 | echo ";;; loaddefs.el --- automatically extracted autoloads" > $@ | |
131 | echo ";;" >> $@; echo ";;; Code:" >> $@ | |
e22b24eb | 132 | echo "\f" >> $@ |
329b2661 JB |
133 | echo ";; Local Variables:" >> $@ |
134 | echo ";; version-control: never" >> $@ | |
135 | echo ";; no-byte-compile: t" >> $@ | |
136 | echo ";; no-update-autoloads: t" >> $@ | |
137 | echo ";; coding: utf-8" >> $@ | |
138 | echo ";; End:" >> $@ | |
e22b24eb AI |
139 | echo ";;; loaddefs.el ends here" >> $@ |
140 | ||
141 | loaddefs.el-CMD: | |
7bbaaedd | 142 | echo ;;; loaddefs.el --- automatically extracted autoloads> $@ |
329b2661 | 143 | echo ;;>> $@ |
7bbaaedd | 144 | echo ;;; Code:>> $@ |
bad197f0 | 145 | echo.\f>> $@ |
329b2661 JB |
146 | echo ;; Local Variables:>> $@ |
147 | echo ;; version-control: never>> $@ | |
148 | echo ;; no-byte-compile: t>> $@ | |
149 | echo ;; no-update-autoloads: t>> $@ | |
150 | echo ;; coding: utf-8>> $@ | |
151 | echo ;; End:>> $@ | |
7bbaaedd AI |
152 | echo ;;; loaddefs.el ends here>> $@ |
153 | ||
81293113 EZ |
154 | # Use . instead of $(lisp) because $(lisp) is an absolute file name, |
155 | # including a drive letter and any leading directories, so the generated | |
156 | # loaddefs.el will mention file names that on other machine reference | |
157 | # possibly non-existent directories. | |
c3d49b7a EZ |
158 | # |
159 | # WARNING: Do NOT split the part inside $(ARGQUOTE)s into multiple lines as | |
160 | # this can break with GNU Make 3.81 and later if sh.exe is used. | |
c79a07d7 | 161 | autoloads: $(lisp)/loaddefs.el $(LOADDEFS) doit |
3aeca4ac | 162 | @echo Directories: . $(WINS_ALMOST) |
c5bdb93d | 163 | $(emacs) -l autoload \ |
7c417300 | 164 | --eval $(ARGQUOTE)(setq find-file-hook nil find-file-suppress-same-file-warnings t)$(ARGQUOTE) \ |
3aeca4ac | 165 | -f w32-batch-update-autoloads "$(lisp)/loaddefs.el" . $(WINS_ALMOST) |
7bbaaedd | 166 | |
bad197f0 | 167 | $(lisp)/subdirs.el: |
7bbaaedd AI |
168 | $(MAKE) $(MFLAGS) update-subdirs |
169 | ||
170 | # Need separate version for sh and native cmd.exe | |
171 | update-subdirs: update-subdirs-$(SHELLTYPE) | |
172 | ||
173 | update-subdirs-CMD: doit | |
bad197f0 JR |
174 | echo ;; -*- no-byte-compile: t -*-> $(lisp)/subdirs.el |
175 | echo ;; In load-path, after this directory should come>> $(lisp)/subdirs.el | |
176 | echo ;; certain of its subdirectories. Here we specify them.>> $(lisp)/subdirs.el | |
177 | echo (normal-top-level-add-to-load-path $(SQUOTE)(>> $(lisp)/subdirs.el | |
178 | @for %%d in ($(WINS)) do if not (%%d)==(term) echo "%%d">> $(lisp)/subdirs.el | |
179 | echo ))>> $(lisp)/subdirs.el | |
7bbaaedd AI |
180 | |
181 | update-subdirs-SH: doit | |
0cfc4b54 | 182 | $(srcdir)/update-subdirs $(lisp); \ |
e22b24eb | 183 | for file in $(WINS); do \ |
7bbaaedd AI |
184 | $(srcdir)/update-subdirs $$file; \ |
185 | done; | |
186 | ||
ba2b2673 | 187 | updates: update-subdirs autoloads mh-autoloads finder-data custom-deps |
7bbaaedd | 188 | |
a9d25c79 EZ |
189 | # This is useful after "cvs up". |
190 | cvs-update: recompile autoloads finder-data custom-deps | |
191 | ||
9b006cb2 AI |
192 | # Update the AUTHORS file. |
193 | ||
194 | update-authors: | |
ed5e0894 | 195 | $(emacs) -l authors -f batch-update-authors $(srcdir)/etc/AUTHORS $(srcdir) |
9b006cb2 | 196 | |
7bbaaedd AI |
197 | TAGS: $(lisptagsfiles1) $(lisptagsfiles2) |
198 | $(ETAGS) $(lisptagsfiles1) $(lisptagsfiles2) | |
199 | ||
9b006cb2 AI |
200 | TAGS-LISP: $(lisptagsfiles1) $(lisptagsfiles2) |
201 | $(ETAGS) -o TAGS-LISP $(lisptagsfiles1) $(lisptagsfiles2) | |
7bbaaedd | 202 | |
49060c51 AI |
203 | .SUFFIXES: .elc .el |
204 | ||
7bbaaedd | 205 | .el.elc: |
8b9a5623 | 206 | -$(emacs) $(BYTE_COMPILE_EXTRA_FLAGS) -f batch-byte-compile $< |
7bbaaedd | 207 | |
8f801552 LK |
208 | # Compile all Lisp files, but don't recompile those that are up to |
209 | # date. Some files don't actually get compiled because they set the | |
210 | # local variable no-byte-compile. | |
7bbaaedd | 211 | |
8f801552 LK |
212 | # All .elc files are made writable before compilation in case we |
213 | # checked out read-only (CVS option -r). Files MUST be compiled one by | |
214 | # one. If we compile several files in a row we can't make sure that | |
215 | # the compilation environment is clean. We also set the load-path of | |
216 | # the Emacs used for compilation to the current directory and its | |
217 | # subdirectories, to make sure require's and load's in the files being | |
218 | # compiled find the right files. | |
7bbaaedd AI |
219 | |
220 | # Need separate version for sh and native cmd.exe | |
bad197f0 | 221 | compile: $(lisp)/subdirs.el mh-autoloads compile-$(SHELLTYPE) doit |
7bbaaedd | 222 | |
d198b6f5 | 223 | compile-CMD: |
80bb1e21 JR |
224 | # -for %%f in ($(lisp) $(WINS)) do for %%g in (%%f\*.elc) do @attrib -r %%g |
225 | for %%f in ($(COMPILE_FIRST)) do \ | |
8b9a5623 | 226 | $(emacs) -l loaddefs $(BYTE_COMPILE_EXTRA_FLAGS) -f batch-byte-compile-if-not-done %%f |
80bb1e21 | 227 | for %%f in (. $(WINS)) do for %%g in (%%f/*.el) do \ |
8b9a5623 | 228 | $(emacs) -l loaddefs $(BYTE_COMPILE_EXTRA_FLAGS) -f batch-byte-compile-if-not-done %%f/%%g |
0702b995 | 229 | |
d198b6f5 | 230 | compile-SH: |
9b006cb2 AI |
231 | # for elc in $(lisp)/*.elc $(lisp)/*/*.elc; do attrib -r $$elc; done |
232 | for el in $(COMPILE_FIRST); do \ | |
233 | echo Compiling $$el; \ | |
8b9a5623 | 234 | $(emacs) -l loaddefs $(BYTE_COMPILE_EXTRA_FLAGS) -f batch-byte-compile-if-not-done $$el; \ |
9b006cb2 AI |
235 | done |
236 | for dir in $(lisp) $(WINS); do \ | |
237 | for el in $$dir/*.el; do \ | |
238 | if test -f $$el; \ | |
239 | then \ | |
240 | echo Compiling $$el; \ | |
8b9a5623 | 241 | $(emacs) -l loaddefs $(BYTE_COMPILE_EXTRA_FLAGS) -f batch-byte-compile-if-not-done $$el; \ |
9b006cb2 AI |
242 | fi \ |
243 | done; \ | |
244 | done | |
245 | ||
8f801552 LK |
246 | # Compile all Lisp files. This is like `compile' but compiles files |
247 | # unconditionally. Some files don't actually get compiled because they | |
248 | # set the local variable no-byte-compile. | |
249 | ||
bad197f0 | 250 | compile-always: $(lisp)/subdirs.el compile-always-$(SHELLTYPE) doit |
9b006cb2 AI |
251 | |
252 | compile-always-CMD: | |
80bb1e21 | 253 | # -for %%f in ($(lisp) $(WINS)) do for %%g in (%%f\*.elc) do @attrib -r %%g |
8b9a5623 EZ |
254 | for %%f in ($(COMPILE_FIRST)) do $(emacs) $(BYTE_COMPILE_EXTRA_FLAGS) -f batch-byte-compile %%f |
255 | for %%f in (. $(WINS)) do for %%g in (%%f/*.el) do $(emacs) $(BYTE_COMPILE_EXTRA_FLAGS) -f batch-byte-compile %%f/%%g | |
7bbaaedd | 256 | |
9b006cb2 | 257 | compile-always-SH: |
7bbaaedd AI |
258 | # for elc in $(lisp)/*.elc $(lisp)/*/*.elc; do attrib -r $$elc; done |
259 | for el in $(COMPILE_FIRST); do \ | |
260 | echo Compiling $$el; \ | |
8b9a5623 | 261 | $(emacs) $(BYTE_COMPILE_EXTRA_FLAGS) -f batch-byte-compile $$el || exit 1; \ |
7bbaaedd AI |
262 | done |
263 | for dir in $(lisp) $(WINS); do \ | |
264 | for el in $$dir/*.el; do \ | |
265 | echo Compiling $$el; \ | |
8b9a5623 | 266 | $(emacs) $(BYTE_COMPILE_EXTRA_FLAGS) -f batch-byte-compile $$el || exit 1; \ |
7bbaaedd AI |
267 | done; \ |
268 | done | |
269 | ||
9b006cb2 AI |
270 | compile-calc: compile-calc-$(SHELLTYPE) |
271 | ||
272 | compile-calc-CMD: | |
8b9a5623 | 273 | for %%f in ($(lisp)/calc/*.el) do $(emacs) $(BYTE_COMPILE_EXTRA_FLAGS) -f batch-byte-compile %%f |
9b006cb2 | 274 | |
c45dbde8 | 275 | compile-calc-SH: |
9b006cb2 AI |
276 | for el in $(lisp)/calc/*.el; do \ |
277 | echo Compiling $$el; \ | |
8b9a5623 | 278 | $(emacs) $(BYTE_COMPILE_EXTRA_FLAGS) -f batch-byte-compile $$el || exit 1; \ |
9b006cb2 AI |
279 | done |
280 | ||
7bbaaedd AI |
281 | # Backup compiled Lisp files in elc.tar.gz. If that file already |
282 | # exists, make a backup of it. | |
283 | ||
284 | backup-compiled-files: | |
285 | -mv $(lisp)/elc.tar.gz $(lisp)/elc.tar.gz~ | |
286 | -tar czf $(lisp)/elc.tar.gz $(lisp)/*.elc $(lisp)/*/*.elc | |
287 | ||
288 | # Compile Lisp files, but save old compiled files first. | |
289 | ||
d198b6f5 | 290 | compile-after-backup: backup-compiled-files compile-always |
7bbaaedd AI |
291 | |
292 | # Recompile all Lisp files which are newer than their .elc files. | |
293 | # Note that this doesn't create .elc files. It only recompiles if an | |
294 | # .elc is present. | |
53fad1e4 EZ |
295 | # WARNING: Do NOT split the part inside $(ARGQUOTE)s into multiple lines as |
296 | # this can break with GNU Make 3.81 and later if sh.exe is used. | |
297 | recompile: mh-autoloads doit $(lisp)/progmodes/cc-mode.elc | |
298 | $(emacs) --eval $(ARGQUOTE)(batch-byte-recompile-directory 0)$(ARGQUOTE) $(lisp) | |
7bbaaedd | 299 | |
8b9a5623 EZ |
300 | # CC Mode uses a compile time macro system which causes a compile time |
301 | # dependency in cc-mode.elc on the macros in cc-langs.el and the | |
302 | # version string in cc-defs.el. | |
303 | $(lisp)/progmodes/cc-mode.elc: \ | |
304 | $(lisp)/progmodes/cc-mode.el \ | |
305 | $(lisp)/progmodes/cc-langs.el \ | |
306 | $(lisp)/progmodes/cc-defs.el | |
307 | $(emacs) $(BYTE_COMPILE_EXTRA_FLAGS) -f batch-byte-compile $(lisp)/progmodes/cc-mode.el | |
308 | ||
c79a07d7 EZ |
309 | $(lisp)/calendar/cal-loaddefs.el: |
310 | "$(EMACS)" $(EMACSOPT) -l autoload \ | |
311 | --eval "(setq generate-autoload-cookie \";;;###cal-autoload\")" \ | |
312 | --eval "(setq find-file-suppress-same-file-warnings t)" \ | |
313 | --eval "(setq make-backup-files nil)" \ | |
314 | -f w32-batch-update-autoloads "$(lisp)/calendar/cal-loaddefs.el" \ | |
315 | ./calendar | |
316 | ||
317 | $(lisp)/calendar/diary-loaddefs.el: | |
318 | "$(EMACS)" $(EMACSOPT) -l autoload \ | |
319 | --eval "(setq generate-autoload-cookie \";;;###diary-autoload\")" \ | |
320 | --eval "(setq find-file-suppress-same-file-warnings t)" \ | |
321 | --eval "(setq make-backup-files nil)" \ | |
322 | -f w32-batch-update-autoloads $(lisp)/calendar/diary-loaddefs.el \ | |
323 | ./calendar | |
324 | ||
325 | $(lisp)/calendar/hol-loaddefs.el: | |
326 | "$(EMACS)" $(EMACSOPT) -l autoload \ | |
327 | --eval "(setq generate-autoload-cookie \";;;###holiday-autoload\")" \ | |
328 | --eval "(setq find-file-suppress-same-file-warnings t)" \ | |
329 | --eval "(setq make-backup-files nil)" \ | |
330 | -f w32-batch-update-autoloads $(lisp)/calendar/hol-loaddefs.el \ | |
331 | ./calendar | |
332 | ||
ba2b2673 BW |
333 | # Update MH-E internal autoloads. These are not to be confused with |
334 | # the autoloads for the MH-E entry points, which are already in | |
335 | # loaddefs.el. | |
e9b28650 | 336 | MH_E_SRC = $(lisp)/mh-e/mh-acros.el $(lisp)/mh-e/mh-alias.el \ |
3e66f07c JB |
337 | $(lisp)/mh-e/mh-buffers.el $(lisp)/mh-e/mh-compat.el \ |
338 | $(lisp)/mh-e/mh-comp.el $(lisp)/mh-e/mh-e.el \ | |
339 | $(lisp)/mh-e/mh-folder.el $(lisp)/mh-e/mh-funcs.el \ | |
340 | $(lisp)/mh-e/mh-gnus.el $(lisp)/mh-e/mh-identity.el \ | |
341 | $(lisp)/mh-e/mh-inc.el $(lisp)/mh-e/mh-junk.el \ | |
342 | $(lisp)/mh-e/mh-letter.el $(lisp)/mh-e/mh-limit.el \ | |
343 | $(lisp)/mh-e/mh-mime.el $(lisp)/mh-e/mh-print.el \ | |
344 | $(lisp)/mh-e/mh-scan.el $(lisp)/mh-e/mh-search.el \ | |
345 | $(lisp)/mh-e/mh-seq.el $(lisp)/mh-e/mh-show.el \ | |
346 | $(lisp)/mh-e/mh-speed.el $(lisp)/mh-e/mh-thread.el \ | |
347 | $(lisp)/mh-e/mh-tool-bar.el $(lisp)/mh-e/mh-utils.el \ | |
348 | $(lisp)/mh-e/mh-xface.el | |
ba2b2673 | 349 | |
43618a57 EZ |
350 | # See the commentary for autoloads above for why we use ./mh-e below |
351 | # instead of $(lisp)/mh-e. | |
ba2b2673 | 352 | mh-autoloads: $(lisp)/mh-e/mh-loaddefs.el |
e9b28650 | 353 | $(lisp)/mh-e/mh-loaddefs.el: $(MH_E_SRC) |
3152b1eb | 354 | "$(EMACS)" $(EMACSOPT) \ |
e3188d80 | 355 | -l autoload \ |
3dc94c30 JR |
356 | --eval $(ARGQUOTE)(setq generate-autoload-cookie $(DQUOTE);;;###mh-autoload$(DQUOTE))$(ARGQUOTE) \ |
357 | --eval $(ARGQUOTE)(setq find-file-suppress-same-file-warnings t)$(ARGQUOTE) \ | |
358 | --eval $(ARGQUOTE)(setq make-backup-files nil)$(ARGQUOTE) \ | |
7c417300 | 359 | -f w32-batch-update-autoloads \ |
3dc94c30 | 360 | $(ARGQUOTE)$(lisp)/mh-e/mh-loaddefs.el$(ARGQUOTE) ./mh-e |
e3188d80 | 361 | |
54ab09c4 MB |
362 | # Prepare a bootstrap in the lisp subdirectory. |
363 | # | |
e8dbbf6f EZ |
364 | # Build loaddefs.el to make sure it's up-to-date. If it's not, that |
365 | # might lead to errors during the bootstrap because something fails to | |
366 | # autoload as expected. If there is no emacs binary, then we can't | |
367 | # build autoloads yet. In that case we have to use ldefs-boot.el; | |
368 | # bootstrap should always work with ldefs-boot.el. (Because | |
369 | # loaddefs.el is an automatically generated file, we don't want to | |
370 | # store it in the source repository). | |
54ab09c4 MB |
371 | # |
372 | # Remove compiled Lisp files so that bootstrap-emacs will be built from | |
373 | # sources only. | |
7bbaaedd AI |
374 | |
375 | # Need separate version for sh and native cmd.exe | |
329b2661 JB |
376 | bootstrap-clean: |
377 | - $(DEL) $(lisp)/loaddefs.el | |
512dd711 | 378 | $(MAKE) $(MFLAGS) bootstrap-clean-$(SHELLTYPE) |
7bbaaedd AI |
379 | |
380 | bootstrap-clean-CMD: | |
3152b1eb | 381 | # if exist "$(EMACS)" $(MAKE) $(MFLAGS) autoloads |
80bb1e21 | 382 | -for %%f in (. $(WINS)) do for %%g in (%%f\*.elc) do @$(DEL) %%g |
7bbaaedd AI |
383 | |
384 | bootstrap-clean-SH: | |
3152b1eb | 385 | # if test -f "$(EMACS)"; then $(MAKE) $(MFLAGS) autoloads; fi |
a3599c30 AI |
386 | # -rm -f $(lisp)/*.elc $(lisp)/*/*.elc |
387 | -for dir in . $(WINS); do rm -f $$dir/*.elc; done | |
7bbaaedd AI |
388 | |
389 | # Generate/update files for the bootstrap process. | |
014b37b6 EZ |
390 | # When done, remove bootstrap-emacs from ../bin, so that |
391 | # it will not be mistaken for an installed binary. | |
7bbaaedd | 392 | |
ba2b2673 | 393 | bootstrap: update-subdirs autoloads mh-autoloads compile finder-data custom-deps |
3152b1eb | 394 | - $(DEL) "$(EMACS)" |
7bbaaedd AI |
395 | |
396 | # | |
397 | # Assuming INSTALL_DIR is defined, copy the elisp files to it | |
398 | # Windows 95 makes this harder than it should be. | |
399 | # | |
400 | install: | |
401 | - mkdir "$(INSTALL_DIR)/lisp" | |
402 | - $(DEL) ../same-dir.tst | |
403 | - $(DEL) "$(INSTALL_DIR)/same-dir.tst" | |
404 | echo SameDirTest > "$(INSTALL_DIR)/same-dir.tst" | |
405 | #ifdef COPY_LISP_SOURCE | |
564a3032 | 406 | $(IFNOTSAMEDIR) $(MAKE) $(MFLAGS) install-lisp-$(SHELLTYPE) $(ENDIF) |
7bbaaedd AI |
407 | #else |
408 | # $(IFNOTSAMEDIR) $(CP_DIR) *.elc "$(INSTALL_DIR)/lisp" $(ENDIF) | |
409 | # $(IFNOTSAMEDIR) $(CP) cus-load.el "$(INSTALL_DIR)/lisp" $(ENDIF) | |
410 | # $(IFNOTSAMEDIR) $(CP) forms*.el "$(INSTALL_DIR)/lisp" $(ENDIF) | |
411 | # $(IFNOTSAMEDIR) $(CP) patcomp.el "$(INSTALL_DIR)/lisp" $(ENDIF) | |
412 | # $(IFNOTSAMEDIR) $(CP) subdirs.el "$(INSTALL_DIR)/lisp" $(ENDIF) | |
413 | # $(IFNOTSAMEDIR) $(CP) version.el "$(INSTALL_DIR)/lisp" $(ENDIF) | |
414 | # $(IFNOTSAMEDIR) $(CP) mail/blessmail.el "$(INSTALL_DIR)/lisp/mail" $(ENDIF) | |
415 | # $(IFNOTSAMEDIR) $(CP) mail/sc.el "$(INSTALL_DIR)/lisp/mail" $(ENDIF) | |
416 | # $(IFNOTSAMEDIR) $(CP) play/bruce.el "$(INSTALL_DIR)/lisp/play" $(ENDIF) | |
417 | # $(IFNOTSAMEDIR) $(CP) international/latin-*.el "$(INSTALL_DIR)/lisp/international" $(ENDIF) | |
418 | # $(IFNOTSAMEDIR) $(CP) international/mule-conf.el "$(INSTALL_DIR)/lisp/international" $(ENDIF) | |
419 | #endif | |
420 | - $(DEL) ../same-dir.tst | |
421 | - $(DEL) "$(INSTALL_DIR)/same-dir.tst" | |
422 | ||
564a3032 EZ |
423 | # Need to copy *.el files first, to avoid "source file is newer" annoyance |
424 | # since cp does not preserve time stamps | |
425 | install-lisp-SH: | |
426 | cp -f *.el "$(INSTALL_DIR)/lisp" | |
ec9bbc6c EZ |
427 | for dir in $(WINS); do [ -d "$(INSTALL_DIR)/lisp/$$dir" ] || mkdir "$(INSTALL_DIR)/lisp/$$dir"; done |
428 | for dir in $(WINS); do cp -f $$dir/*.el "$(INSTALL_DIR)/lisp/$$dir"; done | |
564a3032 EZ |
429 | for dir in . $(WINS); do cp $$dir/*.elc "$(INSTALL_DIR)/lisp/$$dir"; done |
430 | ||
431 | install-lisp-CMD: | |
432 | cp -f *.el "$(INSTALL_DIR)/lisp" | |
ec9bbc6c | 433 | for %%f in ($(WINS)) do if not exist "$(INSTALL_DIR)/lisp/%%f" mkdir "$(INSTALL_DIR)/lisp/%%f" |
564a3032 EZ |
434 | for %%f in ($(WINS)) do cp -f %%f/*.el "$(INSTALL_DIR)/lisp/%%f" |
435 | for %%f in (. $(WINS)) do cp -f %%f/*.elc "$(INSTALL_DIR)/lisp/%%f" | |
436 | ||
8b9a5623 EZ |
437 | # WARNING: Do NOT split the part inside $(ARGQUOTE)s into multiple lines as |
438 | # this can break with GNU Make 3.81 and later if sh.exe is used. | |
439 | check-declare: | |
440 | $(emacs) -l $(lisp)/emacs-lisp/check-declare --eval $(ARGQUOTE)(check-declare-directory $(DQUOTE)$(lisp)$(DQUOTE))$(ARGQUOTE) | |
441 | ||
7bbaaedd AI |
442 | # |
443 | # Maintenance | |
c45dbde8 | 444 | # |
a055c272 EZ |
445 | # We used to delete *~ here, but that might inadvertently remove |
446 | # precious files if it happens to match their short 8+3 aliases. | |
7bbaaedd | 447 | clean: |
3dc94c30 JR |
448 | - $(DEL) *.el~ |
449 | ||
450 | distclean: | |
451 | - $(DEL) $(lisp)/Makefile | |
452 | ||
453 | maintainer-clean: bootstrap-clean distclean | |
454 | - $(DEL) $(AUTOGENEL) |