(font-lock-comment-face, font-lock-doc-face, font-lock-string-face):
[emacs.git] / lisp / makefile.w32-in
blob6d3cacecc6ad651c6de730ea2ea49a28ac9229db
1 #  -*- Makefile -*- for GNU Emacs on the Microsoft W32 API.
2 #  Copyright (C) 2000, 2001, 2002, 2003, 2004,
3 #                2005 Free Software Foundation, Inc.
5 #  This file is part of GNU Emacs.
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
9 #  the Free Software Foundation; either version 2, or (at your option)
10 #  any later version.
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.
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
19 #  Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20 #  Boston, MA 02110-1301, USA.
23 ALL =
25 all: $(ALL)
27 SQUOTE='
28 # '
30 lisp = $(CURDIR)
31 srcdir = $(CURDIR)/..
33 # You can specify a different executable on the make command line,
34 # e.g. "make EMACS=../src/emacs ...".
36 EMACS = "$(THISDIR)/../bin/emacs.exe"
38 # Command line flags for Emacs.  This must include --multibyte,
39 # otherwise some files will not compile.
41 EMACSOPT = -batch --no-init-file --no-site-file --multibyte
43 # Set EMACSLOADPATH correctly (already defined in environment).
44 EMACSLOADPATH=$(lisp)
46 lisptagsfiles1 = $(lisp)/*.el
47 lisptagsfiles2 = $(lisp)/*/*.el
48 ETAGS = "../lib-src/$(BLD)/etags"
50 # Files to compile before others during a bootstrap.  This is done to
51 # speed up the bootstrap process.  The CC files are compiled first
52 # because CC mode tweaks the compilation process, and requiring
53 # cc-mode when it is not compiled doesn't work during the
54 # bootstrapping.
56 COMPILE_FIRST = \
57         $(lisp)/emacs-lisp/byte-opt.el \
58         $(lisp)/emacs-lisp/bytecomp.el \
59         $(lisp)/subr.el \
60         $(lisp)/progmodes/cc-mode.el \
61         $(lisp)/progmodes/cc-vars.el
63 # The actual Emacs command run in the targets below.
65 emacs = $(EMACS) $(EMACSOPT)
67 # Common command to find subdirectories
69 setwins=subdirs=`find $$wd -type d -print`; \
70         for file in $$subdirs; do \
71            case $$file in */Old | */RCS | */CVS | */CVS/* | */=* ) ;; \
72                 *) wins="$$wins $$file" ;; \
73            esac; \
74         done
76 # Have to define the list of subdirs manually when not using sh.
77 WINS=\
78         calc \
79         calendar \
80         emacs-lisp \
81         emulation \
82         eshell \
83         gnus \
84         international \
85         language \
86         mail \
87         mh-e \
88         net \
89         obsolete \
90         play \
91         progmodes \
92         term \
93         textmodes \
94         toolbar \
95         url
97 doit:
99 cus-load.el:
100         touch $@
101 custom-deps: cus-load.el doit
102         @echo Directories: $(WINS)
103         -$(emacs) -l cus-dep --eval $(ARGQUOTE)(setq find-file-hook nil)$(ARGQUOTE) -f custom-make-dependencies $(lisp) $(WINS)
105 finder-data: doit
106         @echo Directories: $(WINS)
107         $(emacs) -l finder -f finder-compile-keywords-make-dist $(lisp) $(WINS)
109 loaddefs.el:
110         $(MAKE) $(MFLAGS) loaddefs.el-$(SHELLTYPE)
111         cp loaddefs.el-$(SHELLTYPE) $@
112         rm loaddefs.el-$(SHELLTYPE)
114 loaddefs.el-SH:
115         echo ";;; loaddefs.el --- automatically extracted autoloads" > $@
116         echo ";;" >> $@; echo ";;; Code:" >> $@
117         echo "(autoload 'define-minor-mode \"easy-mmode\")" >>$@
118         echo "(autoload 'define-ccl-program \"ccl\")" >>$@
119         echo "(autoload 'regexp-opt \"regexp-opt\")" >>$@
120         echo "(autoload 'string-to-list \"mule-util\")" >>$@
121         echo "(autoload 'define-derived-mode \"derived\")" >>$@
122         echo "(autoload 'encoded-kbd-mode \"encoded-kb\")" >>$@
123         echo "(defvar cvs-global-menu nil)" >>$@
124         echo "\f" >> $@
125         echo ";;; Local Variables:" >> $@
126         echo ";;; version-control: never" >> $@
127         echo ";;; no-byte-compile: t" >> $@
128         echo ";;; no-update-autoloads: t" >> $@
129         echo ";;; End:" >> $@
130         echo ";;; loaddefs.el ends here" >> $@
132 loaddefs.el-CMD:
133         echo ;;; loaddefs.el --- automatically extracted autoloads> $@
134         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 ;;; >> $@
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>> $@
150 autoloads: loaddefs.el doit
151         @echo Directories: $(WINS)
152         $(emacs) -l autoload \
153                 --eval $(ARGQUOTE)(setq find-file-hook nil \
154                         find-file-suppress-same-file-warnings t \
155                         generated-autoload-file \
156                           $(DQUOTE)$(lisp)/loaddefs.el$(DQUOTE))$(ARGQUOTE) \
157                 -f batch-update-autoloads $(lisp) $(WINS)
159 subdirs.el:
160         $(MAKE) $(MFLAGS) update-subdirs
162 # Need separate version for sh and native cmd.exe
163 update-subdirs: update-subdirs-$(SHELLTYPE)
165 update-subdirs-CMD: doit
166         echo ;; -*- no-byte-compile: t -*->subdirs.el
167         echo ;; In load-path, after this directory should come>> subdirs.el
168         echo ;; certain of its subdirectories.  Here we specify them.>> subdirs.el
169         echo (normal-top-level-add-to-load-path $(SQUOTE)(>> subdirs.el
170         @for %%d in ($(WINS)) do if not (%%d)==(term) echo "%%d">> subdirs.el
171         echo ))>> subdirs.el
173 update-subdirs-SH: doit
174         $(srcdir)/update-subdirs $(lisp); \
175         for file in $(WINS); do \
176            $(srcdir)/update-subdirs $$file; \
177         done;
179 updates: update-subdirs autoloads finder-data custom-deps
181 # Update the AUTHORS file.
183 update-authors:
184         $(emacs) -l authors -f batch-update-authors $(srcdir)/AUTHORS $(srcdir)
186 TAGS: $(lisptagsfiles1) $(lisptagsfiles2)
187         $(ETAGS) $(lisptagsfiles1) $(lisptagsfiles2)
189 TAGS-LISP: $(lisptagsfiles1) $(lisptagsfiles2)
190         $(ETAGS) -o TAGS-LISP $(lisptagsfiles1) $(lisptagsfiles2)
192 .SUFFIXES: .elc .el
194 .el.elc:
195         -$(emacs) -f batch-byte-compile $<
197 # Compile all Lisp files, but don't recompile those that are up to
198 # date.  Some files don't actually get compiled because they set the
199 # local variable no-byte-compile.
201 # All .elc files are made writable before compilation in case we
202 # checked out read-only (CVS option -r).  Files MUST be compiled one by
203 # one.  If we compile several files in a row we can't make sure that
204 # the compilation environment is clean.  We also set the load-path of
205 # the Emacs used for compilation to the current directory and its
206 # subdirectories, to make sure require's and load's in the files being
207 # compiled find the right files.
209 # Need separate version for sh and native cmd.exe
210 compile: subdirs.el compile-$(SHELLTYPE) doit
212 compile-CMD:
213 #       -for %%f in ($(lisp) $(WINS)) do for %%g in (%%f\*.elc) do @attrib -r %%g
214         for %%f in ($(COMPILE_FIRST)) do \
215           $(emacs) -l loaddefs -f batch-byte-compile-if-not-done %%f
216         for %%f in (. $(WINS)) do for %%g in (%%f/*.el) do \
217           $(emacs) -l loaddefs -f batch-byte-compile-if-not-done %%f/%%g
219 compile-SH:
220 #       for elc in $(lisp)/*.elc $(lisp)/*/*.elc; do attrib -r $$elc; done
221         for el in $(COMPILE_FIRST); do \
222           echo Compiling $$el; \
223           $(emacs) -l loaddefs -f batch-byte-compile-if-not-done $$el; \
224         done
225         for dir in $(lisp) $(WINS); do \
226           for el in $$dir/*.el; do \
227             if test -f $$el; \
228             then \
229               echo Compiling $$el; \
230               $(emacs) -l loaddefs -f batch-byte-compile-if-not-done $$el; \
231             fi \
232           done; \
233         done
235 # Compile all Lisp files.  This is like `compile' but compiles files
236 # unconditionally.  Some files don't actually get compiled because they
237 # set the local variable no-byte-compile.
239 compile-always: subdirs.el compile-always-$(SHELLTYPE) doit
241 compile-always-CMD:
242 #       -for %%f in ($(lisp) $(WINS)) do for %%g in (%%f\*.elc) do @attrib -r %%g
243         for %%f in ($(COMPILE_FIRST)) do $(emacs) -f batch-byte-compile %%f
244         for %%f in (. $(WINS)) do for %%g in (%%f/*.el) do $(emacs) -f batch-byte-compile %%f/%%g
246 compile-always-SH:
247 #       for elc in $(lisp)/*.elc $(lisp)/*/*.elc; do attrib -r $$elc; done
248         for el in $(COMPILE_FIRST); do \
249           echo Compiling $$el; \
250           $(emacs) -f batch-byte-compile $$el || exit 1; \
251         done
252         for dir in $(lisp) $(WINS); do \
253           for el in $$dir/*.el; do \
254             echo Compiling $$el; \
255             $(emacs) -f batch-byte-compile $$el || exit 1; \
256           done; \
257         done
259 compile-calc: compile-calc-$(SHELLTYPE)
261 compile-calc-CMD:
262         for %%f in ($(lisp)/calc/*.el) do $(emacs) -f batch-byte-compile %%f
264 compile-calc-SH:
265         for el in $(lisp)/calc/*.el; do \
266           echo Compiling $$el; \
267           $(emacs) -f batch-byte-compile $$el || exit 1; \
268         done
270 # Backup compiled Lisp files in elc.tar.gz.  If that file already
271 # exists, make a backup of it.
273 backup-compiled-files:
274         -mv $(lisp)/elc.tar.gz $(lisp)/elc.tar.gz~
275         -tar czf $(lisp)/elc.tar.gz $(lisp)/*.elc $(lisp)/*/*.elc
277 # Compile Lisp files, but save old compiled files first.
279 compile-after-backup: backup-compiled-files compile-always
281 # Recompile all Lisp files which are newer than their .elc files.
282 # Note that this doesn't create .elc files.  It only recompiles if an
283 # .elc is present.
285 recompile: doit
286         $(emacs) -f batch-byte-recompile-directory $(lisp)
288 # Prepare a bootstrap in the lisp subdirectory.
290 # Build loaddefs.el to make sure it's up-to-date.  If it's not, that
291 # might lead to errors during the bootstrap because something fails to
292 # autoload as expected.  If there is no emacs binary, then we can't
293 # build autoloads yet.  In that case we have to use ldefs-boot.el;
294 # bootstrap should always work with ldefs-boot.el.  (Because
295 # loaddefs.el is an automatically generated file, we don't want to
296 # store it in the source repository).
298 # Remove compiled Lisp files so that bootstrap-emacs will be built from
299 # sources only.
301 # Need separate version for sh and native cmd.exe
302 bootstrap-clean: bootstrap-clean-$(SHELLTYPE) loaddefs.el
304 bootstrap-clean-CMD:
305 #       if exist $(EMACS) $(MAKE) $(MFLAGS) autoloads
306         cp $(lisp)/ldefs-boot.el $(lisp)/loaddefs.el
307         -for %%f in (. $(WINS)) do for %%g in (%%f\*.elc) do @$(DEL) %%g
309 bootstrap-clean-SH:
310 #       if test -f $(EMACS); then $(MAKE) $(MFLAGS) autoloads; fi
311 #       -rm -f $(lisp)/*.elc $(lisp)/*/*.elc
312         cp $(lisp)/ldefs-boot.el $(lisp)/loaddefs.el
313         -for dir in . $(WINS); do rm -f $$dir/*.elc; done
315 # Generate/update files for the bootstrap process.
316 # When done, remove bootstrap-emacs from ../bin, so that
317 # it will not be mistaken for an installed binary.
319 bootstrap: update-subdirs autoloads compile finder-data custom-deps
320         - $(DEL) $(EMACS)
323 # Assuming INSTALL_DIR is defined, copy the elisp files to it
324 # Windows 95 makes this harder than it should be.
326 install:
327                 - mkdir "$(INSTALL_DIR)/lisp"
328                 - $(DEL) ../same-dir.tst
329                 - $(DEL) "$(INSTALL_DIR)/same-dir.tst"
330                 echo SameDirTest > "$(INSTALL_DIR)/same-dir.tst"
331 #ifdef COPY_LISP_SOURCE
332                 $(IFNOTSAMEDIR) $(CP_DIR) . "$(INSTALL_DIR)/lisp" $(ENDIF)
333 #else
334 #               $(IFNOTSAMEDIR) $(CP_DIR) *.elc "$(INSTALL_DIR)/lisp" $(ENDIF)
335 #               $(IFNOTSAMEDIR) $(CP) cus-load.el "$(INSTALL_DIR)/lisp" $(ENDIF)
336 #               $(IFNOTSAMEDIR) $(CP) forms*.el "$(INSTALL_DIR)/lisp" $(ENDIF)
337 #               $(IFNOTSAMEDIR) $(CP) patcomp.el "$(INSTALL_DIR)/lisp" $(ENDIF)
338 #               $(IFNOTSAMEDIR) $(CP) subdirs.el "$(INSTALL_DIR)/lisp" $(ENDIF)
339 #               $(IFNOTSAMEDIR) $(CP) version.el "$(INSTALL_DIR)/lisp" $(ENDIF)
340 #               $(IFNOTSAMEDIR) $(CP) mail/blessmail.el "$(INSTALL_DIR)/lisp/mail" $(ENDIF)
341 #               $(IFNOTSAMEDIR) $(CP) mail/sc.el "$(INSTALL_DIR)/lisp/mail" $(ENDIF)
342 #               $(IFNOTSAMEDIR) $(CP) play/bruce.el "$(INSTALL_DIR)/lisp/play" $(ENDIF)
343 #               $(IFNOTSAMEDIR) $(CP) international/latin-*.el "$(INSTALL_DIR)/lisp/international" $(ENDIF)
344 #               $(IFNOTSAMEDIR) $(CP) international/mule-conf.el "$(INSTALL_DIR)/lisp/international" $(ENDIF)
345 #endif
346                 - $(DEL) ../same-dir.tst
347                 - $(DEL) "$(INSTALL_DIR)/same-dir.tst"
350 # Maintenance
352 clean:
353                 - $(DEL) *~