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