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