Commit | Line | Data |
---|---|---|
53b67fa0 AI |
1 | # Makefile for GNU Emacs on the Microsoft W32 API. |
2 | # Copyright (c) 2000-2001 Free Software Foundation, Inc. | |
7bbaaedd AI |
3 | # |
4 | # This file is part of GNU Emacs. | |
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 2, or (at your option) | |
9 | # 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; see the file COPYING. If not, write to the | |
18 | # Free Software Foundation, Inc., 59 Temple Place - Suite 330, | |
19 | # Boston, MA 02111-1307, USA. | |
20 | # | |
21 | ||
22 | ALL = | |
23 | ||
24 | all: $(ALL) | |
25 | ||
26 | SQUOTE=' | |
27 | # ' | |
28 | ||
6610f4b2 | 29 | lisp = $(CURDIR) |
7bbaaedd AI |
30 | |
31 | # You can specify a different executable on the make command line, | |
32 | # e.g. "make EMACS=../src/emacs ...". | |
33 | ||
587b5737 | 34 | EMACS = "$(THISDIR)/../bin/emacs.exe" |
7bbaaedd AI |
35 | |
36 | # Command line flags for Emacs. This must include --multibyte, | |
37 | # otherwise some files will not compile. | |
38 | ||
39 | EMACSOPT = -batch --no-init-file --no-site-file --multibyte | |
40 | ||
41 | lisptagsfiles1 = $(lisp)/*.el | |
42 | lisptagsfiles2 = $(lisp)/*/*.el | |
43 | ETAGS = "../lib-src/$(BLD)/etags" | |
44 | ||
45 | # Files which should not be compiled. | |
46 | # - emacs-lisp/cl-specs.el: only contains `def-edebug-spec's so there's | |
47 | # no point compiling it, although it doesn't hurt. | |
48 | ||
49 | DONTCOMPILE = \ | |
50 | $(lisp)/bindings.el \ | |
51 | $(lisp)/cus-load.el \ | |
52 | $(lisp)/cus-start.el \ | |
53 | $(lisp)/emacs-lisp/cl-specs.el \ | |
54 | $(lisp)/eshell/esh-maint.el \ | |
55 | $(lisp)/eshell/esh-groups.el \ | |
56 | $(lisp)/finder-inf.el \ | |
57 | $(lisp)/forms-d2.el \ | |
58 | $(lisp)/forms-pass.el \ | |
59 | $(lisp)/generic-x.el \ | |
60 | $(lisp)/international/latin-1.el \ | |
61 | $(lisp)/international/latin-2.el \ | |
62 | $(lisp)/international/latin-3.el \ | |
63 | $(lisp)/international/latin-4.el \ | |
64 | $(lisp)/international/latin-5.el \ | |
65 | $(lisp)/international/latin-8.el \ | |
66 | $(lisp)/international/latin-9.el \ | |
67 | $(lisp)/international/mule-conf.el \ | |
68 | $(lisp)/loaddefs.el \ | |
69 | $(lisp)/loadup.el \ | |
70 | $(lisp)/mail/blessmail.el \ | |
71 | $(lisp)/mail/sc.el \ | |
72 | $(lisp)/patcomp.el \ | |
73 | $(lisp)/paths.el \ | |
74 | $(lisp)/play/bruce.el \ | |
75 | $(lisp)/subdirs.el \ | |
76 | $(lisp)/term/internal.el \ | |
6c317bd2 GM |
77 | $(lisp)/term/AT386.el \ |
78 | $(lisp)/term/apollo.el \ | |
79 | $(lisp)/term/bobcat.el \ | |
80 | $(lisp)/term/iris-ansi.el \ | |
81 | $(lisp)/term/keyswap.el \ | |
82 | $(lisp)/term/linux.el \ | |
83 | $(lisp)/term/lk201.el \ | |
84 | $(lisp)/term/news.el \ | |
85 | $(lisp)/term/vt102.el \ | |
86 | $(lisp)/term/vt125.el \ | |
87 | $(lisp)/term/vt200.el \ | |
88 | $(lisp)/term/vt201.el \ | |
89 | $(lisp)/term/vt220.el \ | |
90 | $(lisp)/term/vt240.el \ | |
91 | $(lisp)/term/vt300.el \ | |
92 | $(lisp)/term/vt320.el \ | |
93 | $(lisp)/term/vt400.el \ | |
94 | $(lisp)/term/vt420.el \ | |
95 | $(lisp)/term/wyse50.el \ | |
96 | $(lisp)/term/xterm.el \ | |
7bbaaedd AI |
97 | $(lisp)/version.el |
98 | ||
99 | # Files to compile before others during a bootstrap. This is done | |
100 | # to speed up the bootstrap process. | |
101 | ||
102 | COMPILE_FIRST = \ | |
103 | $(lisp)/emacs-lisp/byte-opt.el \ | |
104 | $(lisp)/emacs-lisp/bytecomp.el \ | |
105 | $(lisp)/subr.el | |
106 | ||
107 | # The actual Emacs command run in the targets below. | |
108 | ||
109 | emacs = $(EMACS) $(EMACSOPT) | |
110 | ||
111 | # Common command to find subdirectories | |
112 | ||
113 | setwins=subdirs=`find $$wd -type d -print`; \ | |
114 | for file in $$subdirs; do \ | |
115 | case $$file in */Old | */RCS | */CVS | */CVS/* | */=* ) ;; \ | |
116 | *) wins="$$wins $$file" ;; \ | |
117 | esac; \ | |
118 | done | |
119 | ||
120 | # Have to define the list of subdirs manually when not using sh. | |
121 | WINS=\ | |
122 | calendar \ | |
123 | emacs-lisp \ | |
124 | emulation \ | |
125 | eshell \ | |
126 | gnus \ | |
127 | international \ | |
128 | language \ | |
129 | mail \ | |
130 | net \ | |
131 | play \ | |
132 | progmodes \ | |
133 | term \ | |
134 | textmodes | |
135 | ||
136 | doit: | |
137 | ||
138 | cus-load.el: | |
139 | touch $@ | |
140 | custom-deps: cus-load.el doit | |
141 | @echo Directories: $(WINS) | |
77f16cc6 AI |
142 | set EMACSLOADPATH=$(lisp) |
143 | -$(SETLOADPATH) $(emacs) -l cus-dep --eval $(ARGQUOTE)(setq find-file-hooks nil)$(ARGQUOTE) -f custom-make-dependencies $(lisp) $(WINS) | |
7bbaaedd AI |
144 | |
145 | finder-inf.el: | |
146 | echo (provide $(SQUOTE)finder-inf)>> $@ | |
147 | ||
148 | finder-data: finder-inf.el doit | |
149 | @echo Directories: $(WINS) | |
150 | $(emacs) -l finder -f finder-compile-keywords-make-dist $(lisp) $(WINS) | |
151 | ||
152 | loaddefs.el: | |
153 | echo ;;; loaddefs.el --- automatically extracted autoloads> $@ | |
154 | echo ;;; Code:>> $@ | |
155 | echo \f>> $@ | |
156 | echo ;;; Local Variables:>> $@ | |
157 | echo ;;; version-control: never>> $@ | |
158 | echo ;;; no-byte-compile: t>> $@ | |
159 | echo ;;; no-update-autoloads: t>> $@ | |
160 | echo ;;; End:>> $@ | |
161 | echo ;;; loaddefs.el ends here>> $@ | |
162 | ||
163 | autoloads: loaddefs.el doit | |
164 | @echo Directories: $(WINS) | |
165 | set EMACSLOADPATH=$(lisp) | |
166 | $(SETLOADPATH) $(emacs) -l autoload --eval $(ARGQUOTE)(setq find-file-hooks nil generated-autoload-file $(DQUOTE)$(lisp)/loaddefs.el$(DQUOTE))$(ARGQUOTE) -f batch-update-autoloads $(lisp) $(WINS) | |
167 | ||
168 | subdirs.el: | |
169 | $(MAKE) $(MFLAGS) update-subdirs | |
170 | ||
171 | # Need separate version for sh and native cmd.exe | |
172 | update-subdirs: update-subdirs-$(SHELLTYPE) | |
173 | ||
174 | update-subdirs-CMD: doit | |
175 | @set QWINS= | |
176 | @for %d in ($(WINS)) do if not (%d)==(term) set QWINS=%QWINS% "%d" | |
177 | echo ;; In load-path, after this directory should come> subdirs.el | |
178 | echo ;; certain of its subdirectories. Here we specify them.>> subdirs.el | |
179 | echo (normal-top-level-add-to-load-path $(SQUOTE)(%QWINS%))>> subdirs.el | |
180 | ||
181 | update-subdirs-SH: doit | |
182 | wd=$(lisp); $(setwins); \ | |
183 | for file in $$wins; do \ | |
184 | $(srcdir)/update-subdirs $$file; \ | |
185 | done; | |
186 | ||
187 | updates: update-subdirs autoloads finder-data custom-deps | |
188 | ||
189 | TAGS: $(lisptagsfiles1) $(lisptagsfiles2) | |
190 | $(ETAGS) $(lisptagsfiles1) $(lisptagsfiles2) | |
191 | ||
192 | TAGS-LISP: $(lispsource)$(lisptagsfiles1) $(lispsource)$(lisptagsfiles2) | |
193 | $(ETAGS) -o TAGS-LISP $(lispsource)$(lisptagsfiles1) $(lispsource)$(lisptagsfiles2) | |
194 | ||
49060c51 AI |
195 | .SUFFIXES: .elc .el |
196 | ||
7bbaaedd AI |
197 | .el.elc: |
198 | set EMACSLOADPATH=$(lisp) | |
199 | -$(SETLOADPATH) $(emacs) -f batch-byte-compile $< | |
200 | ||
201 | $(DONTCOMPILE:.el=.elc): | |
202 | -$(DEL) $@ | |
203 | ||
204 | # Compile all Lisp files, except those from DONTCOMPILE. This | |
205 | # compiles files unconditionally. All .elc files are made writable | |
206 | # before compilation in case we checked out read-only (CVS option -r). | |
207 | # Files MUST be compiled one by one. If we compile several files in a | |
208 | # row we can't make sure that the compilation environment is clean. | |
209 | # We also set the load-path of the Emacs used for compilation to the | |
210 | # current directory and its subdirectories, to make sure require's and | |
211 | # load's in the files being compiled find the right files. | |
212 | ||
213 | # Need separate version for sh and native cmd.exe | |
214 | compile-files: subdirs.el compile-files-$(SHELLTYPE) doit | |
215 | ||
216 | compile-files-CMD: | |
217 | set EMACSLOADPATH=$(lisp) | |
202c7edc | 218 | # -for %f in ($(lisp) $(WINS)) do for %g in (%f\*.elc) do @attrib -r %g |
7bbaaedd AI |
219 | for %f in ($(COMPILE_FIRST)) do $(emacs) -f batch-byte-compile %f |
220 | for %f in ($(lisp) $(WINS)) do for %g in (%f/*.el) do $(emacs) -f batch-byte-compile %f/%g | |
221 | ||
222 | compile-files-SH: | |
223 | # for elc in $(lisp)/*.elc $(lisp)/*/*.elc; do attrib -r $$elc; done | |
224 | for el in $(COMPILE_FIRST); do \ | |
225 | echo Compiling $$el; \ | |
226 | EMACSLOADPATH=$(lisp) $(emacs) -f batch-byte-compile $$el; \ | |
227 | done | |
228 | for dir in $(lisp) $(WINS); do \ | |
229 | for el in $$dir/*.el; do \ | |
230 | echo Compiling $$el; \ | |
231 | EMACSLOADPATH=$(lisp) $(emacs) -f batch-byte-compile $$el; \ | |
232 | done; \ | |
233 | done | |
234 | ||
235 | # Backup compiled Lisp files in elc.tar.gz. If that file already | |
236 | # exists, make a backup of it. | |
237 | ||
238 | backup-compiled-files: | |
239 | -mv $(lisp)/elc.tar.gz $(lisp)/elc.tar.gz~ | |
240 | -tar czf $(lisp)/elc.tar.gz $(lisp)/*.elc $(lisp)/*/*.elc | |
241 | ||
242 | # Compile Lisp files, but save old compiled files first. | |
243 | ||
244 | compile: backup-compiled-files compile-files | |
245 | ||
246 | # Recompile all Lisp files which are newer than their .elc files. | |
247 | # Note that this doesn't create .elc files. It only recompiles if an | |
248 | # .elc is present. | |
249 | ||
250 | recompile: doit | |
251 | set EMACSLOADPATH=$(lisp) | |
252 | $(SETLOADPATH) $(emacs) -f batch-byte-recompile-directory . | |
253 | ||
254 | # Prepare a bootstrap in the lisp subdirectory. Build loaddefs.el, | |
255 | # because it's not sure it's up-to-date, and if it's not, that might | |
256 | # lead to errors during the bootstrap because something fails to | |
257 | # autoload as expected. Remove compiled Lisp files so that | |
258 | # bootstrap-emacs will be built from sources only. | |
259 | ||
260 | # Need separate version for sh and native cmd.exe | |
261 | bootstrap-clean: bootstrap-clean-$(SHELLTYPE) | |
262 | ||
263 | bootstrap-clean-CMD: | |
264 | if exist $(EMACS) $(MAKE) $(MFLAGS) autoloads | |
265 | -for %f in ($(lisp) $(WINS)) do for %g in (%f\*.elc) do @$(DEL) %g | |
266 | ||
267 | bootstrap-clean-SH: | |
268 | if test -f $(EMACS); then $(MAKE) $(MFLAGS) autoloads; fi | |
269 | -rm -f $(lisp)/*.elc $(lisp)/*/*.elc | |
270 | ||
271 | # Generate/update files for the bootstrap process. | |
272 | ||
273 | bootstrap: autoloads compile-files custom-deps | |
274 | ||
275 | # | |
276 | # Assuming INSTALL_DIR is defined, copy the elisp files to it | |
277 | # Windows 95 makes this harder than it should be. | |
278 | # | |
279 | install: | |
280 | - mkdir "$(INSTALL_DIR)/lisp" | |
281 | - $(DEL) ../same-dir.tst | |
282 | - $(DEL) "$(INSTALL_DIR)/same-dir.tst" | |
283 | echo SameDirTest > "$(INSTALL_DIR)/same-dir.tst" | |
284 | #ifdef COPY_LISP_SOURCE | |
285 | $(IFNOTSAMEDIR) $(CP_DIR) . "$(INSTALL_DIR)/lisp" $(ENDIF) | |
286 | #else | |
287 | # $(IFNOTSAMEDIR) $(CP_DIR) *.elc "$(INSTALL_DIR)/lisp" $(ENDIF) | |
288 | # $(IFNOTSAMEDIR) $(CP) cus-load.el "$(INSTALL_DIR)/lisp" $(ENDIF) | |
289 | # $(IFNOTSAMEDIR) $(CP) forms*.el "$(INSTALL_DIR)/lisp" $(ENDIF) | |
290 | # $(IFNOTSAMEDIR) $(CP) patcomp.el "$(INSTALL_DIR)/lisp" $(ENDIF) | |
291 | # $(IFNOTSAMEDIR) $(CP) subdirs.el "$(INSTALL_DIR)/lisp" $(ENDIF) | |
292 | # $(IFNOTSAMEDIR) $(CP) version.el "$(INSTALL_DIR)/lisp" $(ENDIF) | |
293 | # $(IFNOTSAMEDIR) $(CP) mail/blessmail.el "$(INSTALL_DIR)/lisp/mail" $(ENDIF) | |
294 | # $(IFNOTSAMEDIR) $(CP) mail/sc.el "$(INSTALL_DIR)/lisp/mail" $(ENDIF) | |
295 | # $(IFNOTSAMEDIR) $(CP) play/bruce.el "$(INSTALL_DIR)/lisp/play" $(ENDIF) | |
296 | # $(IFNOTSAMEDIR) $(CP) international/latin-*.el "$(INSTALL_DIR)/lisp/international" $(ENDIF) | |
297 | # $(IFNOTSAMEDIR) $(CP) international/mule-conf.el "$(INSTALL_DIR)/lisp/international" $(ENDIF) | |
298 | #endif | |
299 | - $(DEL) ../same-dir.tst | |
300 | - $(DEL) "$(INSTALL_DIR)/same-dir.tst" | |
301 | ||
302 | # | |
303 | # Maintenance | |
304 | # | |
305 | clean: | |
306 | - $(DEL) *~ |