(DONTCOMPILE): Omit sc.el.
[bpt/emacs.git] / lisp / makefile.nt
1 # Hacked up Nmake makefile for GNU Emacs
2 # Geoff Voelker (voelker@cs.washington.edu)
3 # Copyright (c) 1994 Free Software Foundation, Inc.
4 #
5 # This file is part of GNU Emacs.
6 #
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.
11 #
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.
16 #
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., 59 Temple Place - Suite 330,
20 # Boston, MA 02111-1307, USA.
21 #
22
23 !include ..\nt\makefile.def
24
25 all:
26
27 #lisp=$(MAKEDIR:\=/)
28 lisp=.
29
30 # You can specify a different executable on the make command line,
31 # e.g. "make EMACS=../src/emacs ...".
32
33 EMACS = ..\bin\emacs.exe
34
35 # Command line flags for Emacs. This must include --multibyte,
36 # otherwise some files will not compile.
37
38 EMACSOPT = -batch --no-init-file --no-site-file --multibyte
39
40 lisptagsfiles1 = $(lisp)/*.el
41 lisptagsfiles2 = $(lisp)/*/*.el
42 ETAGS = ..\lib-src\$(BLD)\etags
43
44 # Files which should not be compiled.
45 # - emacs-lisp/cl-specs.el: only contains `def-edebug-spec's so there's
46 # no point compiling it, although it doesn't hurt.
47
48 DONTCOMPILE = \
49 $(lisp)/cus-load.el \
50 $(lisp)/cus-start.el \
51 $(lisp)/emacs-lisp/cl-specs.el \
52 $(lisp)/eshell/esh-maint.el \
53 $(lisp)/eshell/esh-groups.el \
54 $(lisp)/finder-inf.el \
55 $(lisp)/forms-d2.el \
56 $(lisp)/forms-pass.el \
57 $(lisp)/generic-x.el \
58 $(lisp)/international/latin-1.el \
59 $(lisp)/international/latin-2.el \
60 $(lisp)/international/latin-3.el \
61 $(lisp)/international/latin-4.el \
62 $(lisp)/international/latin-5.el \
63 $(lisp)/international/latin-8.el \
64 $(lisp)/international/latin-9.el \
65 $(lisp)/international/mule-conf.el \
66 $(lisp)/loaddefs.el \
67 $(lisp)/loadup.el \
68 $(lisp)/mail/blessmail.el \
69 $(lisp)/patcomp.el \
70 $(lisp)/paths.el \
71 $(lisp)/play/bruce.el \
72 $(lisp)/subdirs.el \
73 $(lisp)/term/internal.el \
74 $(lisp)/version.el
75
76 # Files to compile before others during a bootstrap. This is done
77 # to speed up the bootstrap process.
78
79 COMPILE_FIRST = \
80 $(lisp)/emacs-lisp/byte-opt.el \
81 $(lisp)/emacs-lisp/bytecomp.el \
82 $(lisp)/subr.el
83
84 # The actual Emacs command run in the targets below.
85
86 emacs = $(EMACS) $(EMACSOPT)
87
88 # Common command to find subdirectories
89
90 # setwins=subdirs=`find $$wd -type d -print`; \
91 # for file in $$subdirs; do \
92 # case $$file in */Old | */RCS | */CVS | */CVS/* | */=* ) ;; \
93 # *) wins="$$wins $$file" ;; \
94 # esac; \
95 # done
96
97 # Have to define the list of subdirs manually
98 WINS=\
99 calendar \
100 emacs-lisp \
101 emulation \
102 eshell \
103 gnus \
104 international \
105 language \
106 mail \
107 net \
108 play \
109 progmodes \
110 term \
111 textmodes
112
113 doit:
114
115 cus-load.el:
116 touch $@
117 custom-deps: cus-load.el doit
118 @echo Directories: $(WINS)
119 $(emacs) -l cus-dep --eval "(setq find-file-hooks nil)" -f custom-make-dependencies $(lisp) $(WINS)
120
121 finder-inf.el:
122 echo (provide 'finder-inf)>> $@
123
124 finder-data: finder-inf.el doit
125 @echo Directories: $(WINS)
126 $(emacs) -l finder -f finder-compile-keywords-make-dist $(lisp) $(WINS)
127
128 loaddefs.el:
129 echo ;;; loaddefs.el --- automatically extracted autoloads> $@
130 echo ;;; Code:>> $@
131 echo \f>> $@
132 echo ;;; Local Variables:>> $@
133 echo ;;; version-control: never>> $@
134 echo ;;; no-byte-compile: t>> $@
135 echo ;;; no-update-autoloads: t>> $@
136 echo ;;; End:>> $@
137 echo ;;; loaddefs.el ends here>> $@
138
139 autoloads: loaddefs.el doit
140 @echo Directories: $(WINS)
141 $(emacs) -l autoload --eval "(setq find-file-hooks nil generated-autoload-file \"$(lisp)/loaddefs.el\")" -f batch-update-autoloads $(lisp) $(WINS)
142
143 subdirs.el:
144 $(MAKE) $(MFLAGS) -f makefile.nt update-subdirs
145 update-subdirs: doit
146 @set QWINS=
147 @for %d in ($(WINS)) do if not (%d)==(term) set QWINS=%QWINS% "%d"
148 echo ;; In load-path, after this directory should come> subdirs.el
149 echo ;; certain of its subdirectories. Here we specify them.>> subdirs.el
150 echo (normal-top-level-add-to-load-path '(%QWINS%))>> subdirs.el
151
152 updates: update-subdirs autoloads finder-data custom-deps
153
154 TAGS: $(lisptagsfiles1) $(lisptagsfiles2)
155 $(ETAGS) $(lisptagsfiles1) $(lisptagsfiles2)
156
157 TAGS-LISP: $(lispsource)$(lisptagsfiles1) $(lispsource)$(lisptagsfiles2)
158 $(ETAGS) -o TAGS-LISP $(lispsource)$(lisptagsfiles1) $(lispsource)$(lisptagsfiles2)
159
160 .SUFFIXES: .elc .el
161
162 .el.elc:
163 -$(emacs) -f batch-byte-compile $<
164
165 $(DONTCOMPILE:.el=.elc):
166 -$(DEL) $@
167
168 # Compile all Lisp files, except those from DONTCOMPILE. This
169 # compiles files unconditionally. All .elc files are made writable
170 # before compilation in case we checked out read-only (CVS option -r).
171 # Files MUST be compiled one by one. If we compile several files in a
172 # row we can't make sure that the compilation environment is clean.
173 # We also set the load-path of the Emacs used for compilation to the
174 # current directory and its subdirectories, to make sure require's and
175 # load's in the files being compiled find the right files.
176
177 compile-files: subdirs.el doit
178 # -for %f in ($(lisp) $(WINS)) do for %g in (%f\*.elc) do @attrib -r %g
179 for %f in ($(COMPILE_FIRST)) do $(emacs) -f batch-byte-compile %f
180 for %f in ($(lisp) $(WINS)) do for %g in (%f/*.el) do $(emacs) -f batch-byte-compile %f/%g
181
182 # Backup compiled Lisp files in elc.tar.gz. If that file already
183 # exists, make a backup of it.
184
185 backup-compiled-files:
186 -mv $(lisp)/elc.tar.gz $(lisp)/elc.tar.gz~
187 -tar czf $(lisp)/elc.tar.gz $(lisp)/*.elc $(lisp)/*/*.elc
188
189 # Compile Lisp files, but save old compiled files first.
190
191 compile: backup-compiled-files compile-files
192
193 # Recompile all Lisp files which are newer than their .elc files.
194 # Note that this doesn't create .elc files. It only recompiles if an
195 # .elc is present.
196
197 recompile: doit
198 $(emacs) -f batch-byte-recompile-directory .
199
200 # Prepare a bootstrap in the lisp subdirectory. Build loaddefs.el,
201 # because it's not sure it's up-to-date, and if it's not, that might
202 # lead to errors during the bootstrap because something fails to
203 # autoload as expected. Remove compiled Lisp files so that
204 # bootstrap-emacs will be built from sources only.
205
206 bootstrap-clean:
207 if exist $(EMACS) $(MAKE) $(MFLAGS) -f makefile.nt autoloads
208 -for %f in ($(lisp) $(WINS)) do for %g in (%f\*.elc) do @$(DEL) %g
209
210 # Generate/update files for the bootstrap process.
211
212 bootstrap: autoloads compile-files custom-deps
213
214 #
215 # Assuming INSTALL_DIR is defined, copy the elisp files to it
216 # Windows 95 makes this harder than it should be.
217 #
218 install:
219 - mkdir $(INSTALL_DIR)\lisp
220 - $(DEL) .\same-dir.tst
221 - $(DEL) $(INSTALL_DIR)\lisp\same-dir.tst
222 echo SameDirTest > $(INSTALL_DIR)\lisp\same-dir.tst
223 !ifdef COPY_LISP_SOURCE
224 if not exist .\same-dir.tst $(CP_DIR) . $(INSTALL_DIR)\lisp
225 !else
226 if not exist .\same-dir.tst $(CP_DIR) *.elc $(INSTALL_DIR)\lisp
227 if not exist .\same-dir.tst $(CP) cus-load.el $(INSTALL_DIR)\lisp
228 if not exist .\same-dir.tst $(CP) forms*.el $(INSTALL_DIR)\lisp
229 if not exist .\same-dir.tst $(CP) patcomp.el $(INSTALL_DIR)\lisp
230 if not exist .\same-dir.tst $(CP) subdirs.el $(INSTALL_DIR)\lisp
231 if not exist .\same-dir.tst $(CP) version.el $(INSTALL_DIR)\lisp
232 if not exist .\same-dir.tst $(CP) mail\blessmail.el $(INSTALL_DIR)\lisp\mail
233 if not exist .\same-dir.tst $(CP) mail\sc.el $(INSTALL_DIR)\lisp\mail
234 if not exist .\same-dir.tst $(CP) play\bruce.el $(INSTALL_DIR)\lisp\play
235 if not exist .\same-dir.tst $(CP) international\latin-*.el $(INSTALL_DIR)\lisp\international
236 if not exist .\same-dir.tst $(CP) international\mule-conf.el $(INSTALL_DIR)\lisp\international
237 - $(DEL) $(INSTALL_DIR)\lisp\same-dir.tst
238 !endif
239
240 #
241 # Maintenance
242 #
243 clean:
244 - $(DEL) *~ term\*~
245 - $(DEL) *.orig *.rej *.crlf
246 - $(DEL) emacs-lisp\*.orig emacs-lisp\*.rej emacs-lisp\*.crlf
247 - $(DEL) emulation\*.orig emulation\*.rej emulation\*.crlf
248 - $(DEL) gnus\*.orig gnus\*.rej gnus\*.crlf
249 - $(DEL) international\*.orig international\*.rej international\*.crlf
250 - $(DEL) language\*.orig language\*.rej language\*.crlf
251 - $(DEL) mail\*.orig mail\*.rej mail\*.crlf
252 - $(DEL) play\*.orig play\*.rej play\*.crlf
253 - $(DEL) progmodes\*.orig progmodes\*.rej progmodes\*.crlf
254 - $(DEL) term\*.orig term\*.rej term\*.crlf
255 - $(DEL) textmodes\*.orig textmodes\*.rej textmodes\*.crlf
256 - $(DEL_TREE) deleted