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