]> code.delx.au - gnu-emacs/blob - lisp/makefile.w32-in
Revision: miles@gnu.org--gnu-2005/emacs--unicode--0--patch-25
[gnu-emacs] / lisp / makefile.w32-in
1 # -*- Makefile -*- for GNU Emacs on the Microsoft W32 API.
2 # Copyright (c) 2000,2001,2004 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 srcdir = $(CURDIR)/..
31
32 # You can specify a different executable on the make command line,
33 # e.g. "make EMACS=../src/emacs ...".
34
35 EMACS = "$(THISDIR)/../bin/emacs.exe"
36
37 # Command line flags for Emacs. This must include --multibyte,
38 # otherwise some files will not compile.
39
40 EMACSOPT = -batch --no-init-file --no-site-file --multibyte
41
42 # Set EMACSLOADPATH correctly (already defined in environment).
43 EMACSLOADPATH=$(lisp)
44
45 # Use C locale
46 LC_ALL = C
47
48 lisptagsfiles1 = $(lisp)/*.el
49 lisptagsfiles2 = $(lisp)/*/*.el
50 ETAGS = "../lib-src/$(BLD)/etags"
51
52 # Files which should not be compiled. If you change the name `DONTCOMPILE'
53 # to something different, you'll have to change make-dist as well, and
54 # modify the lists in $lisp and $shortlisp on src/Makefile.in.
55 #
56 # - emacs-lisp/cl-specs.el: only contains `def-edebug-spec's so there's
57 # no point compiling it, although it doesn't hurt.
58
59 DONTCOMPILE = \
60 $(lisp)/cus-load.el \
61 $(lisp)/emacs-lisp/cl-specs.el \
62 $(lisp)/eshell/esh-maint.el \
63 $(lisp)/eshell/esh-groups.el \
64 $(lisp)/finder-inf.el \
65 $(lisp)/forms-d2.el \
66 $(lisp)/forms-pass.el \
67 $(lisp)/generic-x.el \
68 $(lisp)/international/latin1-disp.el \
69 $(lisp)/international/mule-conf.el \
70 $(lisp)/language/czech.el \
71 $(lisp)/language/devanagari.el \
72 $(lisp)/language/kannada.el \
73 $(lisp)/language/malayalam.el \
74 $(lisp)/language/tamil.el \
75 $(lisp)/language/english.el \
76 $(lisp)/language/greek.el \
77 $(lisp)/language/hebrew.el \
78 $(lisp)/language/japanese.el \
79 $(lisp)/language/korean.el \
80 $(lisp)/language/lao.el \
81 $(lisp)/language/misc-lang.el \
82 $(lisp)/language/romanian.el \
83 $(lisp)/language/slovak.el \
84 $(lisp)/language/thai.el \
85 $(lisp)/language/utf-8-lang.el \
86 $(lisp)/language/georgian.el \
87 $(lisp)/language/vietnamese.el \
88 $(lisp)/language/cyrillic.el \
89 $(lisp)/language/chinese.el \
90 $(lisp)/language/indian.el \
91 $(lisp)/loaddefs.el \
92 $(lisp)/ldefs-boot.el \
93 $(lisp)/loadup.el \
94 $(lisp)/mail/blessmail.el \
95 $(lisp)/patcomp.el \
96 $(lisp)/paths.el \
97 $(lisp)/play/bruce.el \
98 $(lisp)/subdirs.el \
99 $(lisp)/term/internal.el \
100 $(lisp)/term/AT386.el \
101 $(lisp)/term/apollo.el \
102 $(lisp)/term/bobcat.el \
103 $(lisp)/term/iris-ansi.el \
104 $(lisp)/term/keyswap.el \
105 $(lisp)/term/linux.el \
106 $(lisp)/term/lk201.el \
107 $(lisp)/term/news.el \
108 $(lisp)/term/vt102.el \
109 $(lisp)/term/vt125.el \
110 $(lisp)/term/vt200.el \
111 $(lisp)/term/vt201.el \
112 $(lisp)/term/vt220.el \
113 $(lisp)/term/vt240.el \
114 $(lisp)/term/vt300.el \
115 $(lisp)/term/vt320.el \
116 $(lisp)/term/vt400.el \
117 $(lisp)/term/vt420.el \
118 $(lisp)/term/wyse50.el \
119 $(lisp)/version.el
120
121 # Files to compile before others during a bootstrap. This is done to
122 # speed up the bootstrap process. The CC files are compiled first
123 # because CC mode tweaks the compilation process, and requiring
124 # cc-mode when it is not compiled doesn't work during the
125 # bootstrapping.
126
127 COMPILE_FIRST = \
128 $(lisp)/emacs-lisp/byte-opt.el \
129 $(lisp)/emacs-lisp/bytecomp.el \
130 $(lisp)/subr.el \
131 $(lisp)/progmodes/cc-mode.el \
132 $(lisp)/progmodes/cc-vars.el
133
134 # The actual Emacs command run in the targets below.
135
136 emacs = $(EMACS) $(EMACSOPT)
137
138 # Common command to find subdirectories
139
140 setwins=subdirs=`find $$wd -type d -print`; \
141 for file in $$subdirs; do \
142 case $$file in */Old | */RCS | */CVS | */CVS/* | */=* ) ;; \
143 *) wins="$$wins $$file" ;; \
144 esac; \
145 done
146
147 # Have to define the list of subdirs manually when not using sh.
148 WINS=\
149 calc \
150 calendar \
151 emacs-lisp \
152 emulation \
153 eshell \
154 gnus \
155 international \
156 language \
157 mail \
158 mh-e \
159 net \
160 obsolete \
161 play \
162 progmodes \
163 term \
164 textmodes \
165 toolbar \
166 url
167
168 doit:
169
170 cus-load.el:
171 touch $@
172 custom-deps: cus-load.el doit
173 @echo Directories: $(WINS)
174 -$(emacs) -l cus-dep --eval $(ARGQUOTE)(setq find-file-hook nil)$(ARGQUOTE) -f custom-make-dependencies $(lisp) $(WINS)
175
176 finder-data: doit
177 @echo Directories: $(WINS)
178 $(emacs) -l finder -f finder-compile-keywords-make-dist $(lisp) $(WINS)
179
180 loaddefs.el:
181 $(MAKE) $(MFLAGS) loaddefs.el-$(SHELLTYPE)
182 cp loaddefs.el-$(SHELLTYPE) $@
183 rm loaddefs.el-$(SHELLTYPE)
184
185 loaddefs.el-SH:
186 echo ";;; loaddefs.el --- automatically extracted autoloads" > $@
187 echo ";;" >> $@; echo ";;; Code:" >> $@
188 echo "(autoload 'define-minor-mode \"easy-mmode\")" >>$@
189 echo "(autoload 'define-ccl-program \"ccl\")" >>$@
190 echo "(autoload 'regexp-opt \"regexp-opt\")" >>$@
191 echo "(autoload 'string-to-list \"mule-util\")" >>$@
192 echo "(autoload 'define-derived-mode \"derived\")" >>$@
193 echo "(autoload 'encoded-kbd-mode \"encoded-kb\")" >>$@
194 echo "(defvar cvs-global-menu nil)" >>$@
195 echo "\f" >> $@
196 echo ";;; Local Variables:" >> $@
197 echo ";;; version-control: never" >> $@
198 echo ";;; no-byte-compile: t" >> $@
199 echo ";;; no-update-autoloads: t" >> $@
200 echo ";;; End:" >> $@
201 echo ";;; loaddefs.el ends here" >> $@
202
203 loaddefs.el-CMD:
204 echo ;;; loaddefs.el --- automatically extracted autoloads> $@
205 echo ;;; Code:>> $@
206 echo (autoload 'define-minor-mode "easy-mmode")>> $@
207 echo (autoload 'define-ccl-program "ccl")>> $@
208 echo (autoload 'regexp-opt "regexp-opt")>> $@
209 echo (autoload 'string-to-list "mule-util")>> $@
210 echo (autoload 'define-derived-mode "derived")>> $@
211 echo (autoload 'encoded-kbd-mode "encoded-kb")>> $@
212 echo (defvar cvs-global-menu nil)>> $@
213 echo ;;; >> $@
214 echo ;;; Local Variables:>> $@
215 echo ;;; version-control: never>> $@
216 echo ;;; no-byte-compile: t>> $@
217 echo ;;; no-update-autoloads: t>> $@
218 echo ;;; End:>> $@
219 echo ;;; loaddefs.el ends here>> $@
220
221 autoloads: loaddefs.el doit
222 @echo Directories: $(WINS)
223 $(emacs) -l autoload \
224 --eval $(ARGQUOTE)(setq find-file-hook nil \
225 find-file-suppress-same-file-warnings t \
226 generated-autoload-file \
227 $(DQUOTE)$(lisp)/loaddefs.el$(DQUOTE))$(ARGQUOTE) \
228 -f batch-update-autoloads $(lisp) $(WINS)
229
230 subdirs.el:
231 $(MAKE) $(MFLAGS) update-subdirs
232
233 # Need separate version for sh and native cmd.exe
234 update-subdirs: update-subdirs-$(SHELLTYPE)
235
236 update-subdirs-CMD: doit
237 echo ;; -*- no-byte-compile: t -*->subdirs.el
238 echo ;; In load-path, after this directory should come>> subdirs.el
239 echo ;; certain of its subdirectories. Here we specify them.>> subdirs.el
240 echo (normal-top-level-add-to-load-path $(SQUOTE)(>> subdirs.el
241 @for %%d in ($(WINS)) do if not (%%d)==(term) echo "%%d">> subdirs.el
242 echo ))>> subdirs.el
243
244 update-subdirs-SH: doit
245 $(srcdir)/update-subdirs $(lisp); \
246 for file in $(WINS); do \
247 $(srcdir)/update-subdirs $$file; \
248 done;
249
250 updates: update-subdirs autoloads finder-data custom-deps
251
252 # Update the AUTHORS file.
253
254 update-authors:
255 $(emacs) -f batch-update-authors $(srcdir)/AUTHORS $(srcdir)
256
257 TAGS: $(lisptagsfiles1) $(lisptagsfiles2)
258 $(ETAGS) $(lisptagsfiles1) $(lisptagsfiles2)
259
260 TAGS-LISP: $(lisptagsfiles1) $(lisptagsfiles2)
261 $(ETAGS) -o TAGS-LISP $(lisptagsfiles1) $(lisptagsfiles2)
262
263 .SUFFIXES: .elc .el
264
265 .el.elc:
266 -$(emacs) -f batch-byte-compile $<
267
268 $(DONTCOMPILE:.el=.elc):
269 -$(DEL) $@
270
271 # Compile all Lisp files, except those from DONTCOMPILE,
272 # but don't recompile those that are up to date.
273
274 # All .elc files are made writable
275 # before compilation in case we checked out read-only (CVS option -r).
276 # Files MUST be compiled one by one. If we compile several files in a
277 # row we can't make sure that the compilation environment is clean.
278 # We also set the load-path of the Emacs used for compilation to the
279 # current directory and its subdirectories, to make sure require's and
280 # load's in the files being compiled find the right files.
281
282 # Need separate version for sh and native cmd.exe
283 compile: subdirs.el compile-$(SHELLTYPE) doit
284
285 compile-CMD:
286 # -for %%f in ($(lisp) $(WINS)) do for %%g in (%%f\*.elc) do @attrib -r %%g
287 for %%f in ($(COMPILE_FIRST)) do \
288 $(emacs) -l loaddefs -f batch-byte-compile-if-not-done %%f
289 for %%f in (. $(WINS)) do for %%g in (%%f/*.el) do \
290 $(emacs) -l loaddefs -f batch-byte-compile-if-not-done %%f/%%g
291
292 compile-SH:
293 # for elc in $(lisp)/*.elc $(lisp)/*/*.elc; do attrib -r $$elc; done
294 for el in $(COMPILE_FIRST); do \
295 echo Compiling $$el; \
296 $(emacs) -l loaddefs -f batch-byte-compile-if-not-done $$el; \
297 done
298 for dir in $(lisp) $(WINS); do \
299 for el in $$dir/*.el; do \
300 if test -f $$el; \
301 then \
302 echo Compiling $$el; \
303 $(emacs) -l loaddefs -f batch-byte-compile-if-not-done $$el; \
304 fi \
305 done; \
306 done
307
308 # Compile all Lisp files, except those from DONTCOMPILE. This
309 # is like `compile' but compiles files unconditionally.
310 compile-always: subdirs.el compile-always-$(SHELLTYPE) doit
311
312 compile-always-CMD:
313 # -for %%f in ($(lisp) $(WINS)) do for %%g in (%%f\*.elc) do @attrib -r %%g
314 for %%f in ($(COMPILE_FIRST)) do $(emacs) -f batch-byte-compile %%f
315 for %%f in (. $(WINS)) do for %%g in (%%f/*.el) do $(emacs) -f batch-byte-compile %%f/%%g
316
317 compile-always-SH:
318 # for elc in $(lisp)/*.elc $(lisp)/*/*.elc; do attrib -r $$elc; done
319 for el in $(COMPILE_FIRST); do \
320 echo Compiling $$el; \
321 $(emacs) -f batch-byte-compile $$el || exit 1; \
322 done
323 for dir in $(lisp) $(WINS); do \
324 for el in $$dir/*.el; do \
325 echo Compiling $$el; \
326 $(emacs) -f batch-byte-compile $$el || exit 1; \
327 done; \
328 done
329
330 compile-calc: compile-calc-$(SHELLTYPE)
331
332 compile-calc-CMD:
333 for %%f in ($(lisp)/calc/*.el) do $(emacs) -f batch-byte-compile %%f
334
335 compile-calc-SH:
336 for el in $(lisp)/calc/*.el; do \
337 echo Compiling $$el; \
338 $(emacs) -f batch-byte-compile $$el || exit 1; \
339 done
340
341 # Backup compiled Lisp files in elc.tar.gz. If that file already
342 # exists, make a backup of it.
343
344 backup-compiled-files:
345 -mv $(lisp)/elc.tar.gz $(lisp)/elc.tar.gz~
346 -tar czf $(lisp)/elc.tar.gz $(lisp)/*.elc $(lisp)/*/*.elc
347
348 # Compile Lisp files, but save old compiled files first.
349
350 compile-after-backup: backup-compiled-files compile-always
351
352 # Recompile all Lisp files which are newer than their .elc files.
353 # Note that this doesn't create .elc files. It only recompiles if an
354 # .elc is present.
355
356 recompile: doit
357 $(emacs) -f batch-byte-recompile-directory $(lisp)
358
359 # Prepare a bootstrap in the lisp subdirectory.
360 #
361 # Build loaddefs.el, because it's not sure it's up-to-date, and if it's not,
362 # that might lead to errors during the bootstrap because something fails to
363 # autoload as expected. However, if there is no emacs binary, then we can't
364 # build autoloads yet, so just make sure there's some loaddefs.el file, as
365 # it's necessary for generating the binary (because loaddefs.el is an
366 # automatically generated file, we don't want to store it in the source
367 # repository).
368 #
369 # Remove compiled Lisp files so that bootstrap-emacs will be built from
370 # sources only.
371
372 # Need separate version for sh and native cmd.exe
373 bootstrap-clean: bootstrap-clean-$(SHELLTYPE) loaddefs.el
374
375 bootstrap-clean-CMD:
376 # if exist $(EMACS) $(MAKE) $(MFLAGS) autoloads
377 if not exist $(lisp)\loaddefs.el cp $(lisp)/ldefs-boot.el $(lisp)/loaddefs.el
378 -for %%f in (. $(WINS)) do for %%g in (%%f\*.elc) do @$(DEL) %%g
379
380 bootstrap-clean-SH:
381 # if test -f $(EMACS); then $(MAKE) $(MFLAGS) autoloads; fi
382 # -rm -f $(lisp)/*.elc $(lisp)/*/*.elc
383 if ! test -r $(lisp)/loaddefs.el; then \
384 cp $(lisp)/ldefs-boot.el $(lisp)/loaddefs.el; \
385 fi
386 -for dir in . $(WINS); do rm -f $$dir/*.elc; done
387
388 # Generate/update files for the bootstrap process.
389
390 bootstrap: update-subdirs autoloads compile finder-data custom-deps
391
392 #
393 # Assuming INSTALL_DIR is defined, copy the elisp files to it
394 # Windows 95 makes this harder than it should be.
395 #
396 install:
397 - mkdir "$(INSTALL_DIR)/lisp"
398 - $(DEL) ../same-dir.tst
399 - $(DEL) "$(INSTALL_DIR)/same-dir.tst"
400 echo SameDirTest > "$(INSTALL_DIR)/same-dir.tst"
401 #ifdef COPY_LISP_SOURCE
402 $(IFNOTSAMEDIR) $(CP_DIR) . "$(INSTALL_DIR)/lisp" $(ENDIF)
403 #else
404 # $(IFNOTSAMEDIR) $(CP_DIR) *.elc "$(INSTALL_DIR)/lisp" $(ENDIF)
405 # $(IFNOTSAMEDIR) $(CP) cus-load.el "$(INSTALL_DIR)/lisp" $(ENDIF)
406 # $(IFNOTSAMEDIR) $(CP) forms*.el "$(INSTALL_DIR)/lisp" $(ENDIF)
407 # $(IFNOTSAMEDIR) $(CP) patcomp.el "$(INSTALL_DIR)/lisp" $(ENDIF)
408 # $(IFNOTSAMEDIR) $(CP) subdirs.el "$(INSTALL_DIR)/lisp" $(ENDIF)
409 # $(IFNOTSAMEDIR) $(CP) version.el "$(INSTALL_DIR)/lisp" $(ENDIF)
410 # $(IFNOTSAMEDIR) $(CP) mail/blessmail.el "$(INSTALL_DIR)/lisp/mail" $(ENDIF)
411 # $(IFNOTSAMEDIR) $(CP) mail/sc.el "$(INSTALL_DIR)/lisp/mail" $(ENDIF)
412 # $(IFNOTSAMEDIR) $(CP) play/bruce.el "$(INSTALL_DIR)/lisp/play" $(ENDIF)
413 # $(IFNOTSAMEDIR) $(CP) international/latin-*.el "$(INSTALL_DIR)/lisp/international" $(ENDIF)
414 # $(IFNOTSAMEDIR) $(CP) international/mule-conf.el "$(INSTALL_DIR)/lisp/international" $(ENDIF)
415 #endif
416 - $(DEL) ../same-dir.tst
417 - $(DEL) "$(INSTALL_DIR)/same-dir.tst"
418
419 #
420 # Maintenance
421 #
422 clean:
423 - $(DEL) *~