Trailing whitespace deleted.
[bpt/emacs.git] / lisp / makefile.nt
CommitLineData
95ed0025
RS
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.
f1180544 6#
95ed0025
RS
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.
f1180544 11#
95ed0025
RS
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.
f1180544 16#
95ed0025 17# You should have received a copy of the GNU General Public License
1fb87c77
KH
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.
95ed0025
RS
21#
22
23!include ..\nt\makefile.def
24
25all:
26
de32572e
AI
27#lisp=$(MAKEDIR:\=/)
28lisp=.
29
3c5b0995
AI
30# You can specify a different executable on the make command line,
31# e.g. "make EMACS=../src/emacs ...".
32
de32572e 33EMACS = ..\bin\emacs.exe
3c5b0995
AI
34
35# Command line flags for Emacs. This must include --multibyte,
36# otherwise some files will not compile.
37
de32572e
AI
38EMACSOPT = -batch --no-init-file --no-site-file --multibyte
39
40lisptagsfiles1 = $(lisp)/*.el
41lisptagsfiles2 = $(lisp)/*/*.el
42ETAGS = ..\lib-src\$(BLD)\etags
3c5b0995 43
de32572e 44# Files which should not be compiled.
3c5b0995
AI
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
de32572e 48DONTCOMPILE = \
de32572e
AI
49 $(lisp)/cus-load.el \
50 $(lisp)/cus-start.el \
51 $(lisp)/emacs-lisp/cl-specs.el \
52 $(lisp)/eshell/esh-maint.el \
52481729 53 $(lisp)/eshell/esh-groups.el \
de32572e
AI
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 \
de32572e
AI
69 $(lisp)/patcomp.el \
70 $(lisp)/paths.el \
71 $(lisp)/play/bruce.el \
72 $(lisp)/subdirs.el \
73 $(lisp)/term/internal.el \
14454f96
AI
74 $(lisp)/term/AT386.el \
75 $(lisp)/term/apollo.el \
76 $(lisp)/term/bobcat.el \
77 $(lisp)/term/iris-ansi.el \
78 $(lisp)/term/keyswap.el \
79 $(lisp)/term/linux.el \
80 $(lisp)/term/lk201.el \
81 $(lisp)/term/news.el \
82 $(lisp)/term/vt102.el \
83 $(lisp)/term/vt125.el \
84 $(lisp)/term/vt200.el \
85 $(lisp)/term/vt201.el \
86 $(lisp)/term/vt220.el \
87 $(lisp)/term/vt240.el \
88 $(lisp)/term/vt300.el \
89 $(lisp)/term/vt320.el \
90 $(lisp)/term/vt400.el \
91 $(lisp)/term/vt420.el \
92 $(lisp)/term/wyse50.el \
93 $(lisp)/term/xterm.el \
de32572e
AI
94 $(lisp)/version.el
95
96# Files to compile before others during a bootstrap. This is done
97# to speed up the bootstrap process.
98
99COMPILE_FIRST = \
100 $(lisp)/emacs-lisp/byte-opt.el \
101 $(lisp)/emacs-lisp/bytecomp.el \
102 $(lisp)/subr.el
3c5b0995
AI
103
104# The actual Emacs command run in the targets below.
105
106emacs = $(EMACS) $(EMACSOPT)
107
de32572e
AI
108# Common command to find subdirectories
109
110# setwins=subdirs=`find $$wd -type d -print`; \
111# for file in $$subdirs; do \
112# case $$file in */Old | */RCS | */CVS | */CVS/* | */=* ) ;; \
113# *) wins="$$wins $$file" ;; \
114# esac; \
115# done
116
117# Have to define the list of subdirs manually
118WINS=\
119 calendar \
120 emacs-lisp \
121 emulation \
122 eshell \
123 gnus \
124 international \
125 language \
126 mail \
942da20c 127 mh-e \
de32572e
AI
128 net \
129 play \
130 progmodes \
131 term \
132 textmodes
133
134doit:
135
136cus-load.el:
137 touch $@
138custom-deps: cus-load.el doit
139 @echo Directories: $(WINS)
140 $(emacs) -l cus-dep --eval "(setq find-file-hooks nil)" -f custom-make-dependencies $(lisp) $(WINS)
141
142finder-inf.el:
143 echo (provide 'finder-inf)>> $@
144
145finder-data: finder-inf.el doit
146 @echo Directories: $(WINS)
147 $(emacs) -l finder -f finder-compile-keywords-make-dist $(lisp) $(WINS)
148
149loaddefs.el:
150 echo ;;; loaddefs.el --- automatically extracted autoloads> $@
151 echo ;;; Code:>> $@
152 echo \f>> $@
153 echo ;;; Local Variables:>> $@
154 echo ;;; version-control: never>> $@
155 echo ;;; no-byte-compile: t>> $@
156 echo ;;; no-update-autoloads: t>> $@
157 echo ;;; End:>> $@
158 echo ;;; loaddefs.el ends here>> $@
159
160autoloads: loaddefs.el doit
161 @echo Directories: $(WINS)
162 $(emacs) -l autoload --eval "(setq find-file-hooks nil generated-autoload-file \"$(lisp)/loaddefs.el\")" -f batch-update-autoloads $(lisp) $(WINS)
163
164subdirs.el:
165 $(MAKE) $(MFLAGS) -f makefile.nt update-subdirs
166update-subdirs: doit
167 @set QWINS=
168 @for %d in ($(WINS)) do if not (%d)==(term) set QWINS=%QWINS% "%d"
169 echo ;; In load-path, after this directory should come> subdirs.el
170 echo ;; certain of its subdirectories. Here we specify them.>> subdirs.el
171 echo (normal-top-level-add-to-load-path '(%QWINS%))>> subdirs.el
172
173updates: update-subdirs autoloads finder-data custom-deps
174
175TAGS: $(lisptagsfiles1) $(lisptagsfiles2)
176 $(ETAGS) $(lisptagsfiles1) $(lisptagsfiles2)
177
178TAGS-LISP: $(lispsource)$(lisptagsfiles1) $(lispsource)$(lisptagsfiles2)
179 $(ETAGS) -o TAGS-LISP $(lispsource)$(lisptagsfiles1) $(lispsource)$(lisptagsfiles2)
180
49060c51
AI
181.SUFFIXES: .elc .el
182
3c5b0995
AI
183.el.elc:
184 -$(emacs) -f batch-byte-compile $<
185
186$(DONTCOMPILE:.el=.elc):
187 -$(DEL) $@
188
de32572e
AI
189# Compile all Lisp files, except those from DONTCOMPILE. This
190# compiles files unconditionally. All .elc files are made writable
191# before compilation in case we checked out read-only (CVS option -r).
192# Files MUST be compiled one by one. If we compile several files in a
193# row we can't make sure that the compilation environment is clean.
194# We also set the load-path of the Emacs used for compilation to the
195# current directory and its subdirectories, to make sure require's and
196# load's in the files being compiled find the right files.
197
198compile-files: subdirs.el doit
202c7edc 199# -for %f in ($(lisp) $(WINS)) do for %g in (%f\*.elc) do @attrib -r %g
de32572e
AI
200 for %f in ($(COMPILE_FIRST)) do $(emacs) -f batch-byte-compile %f
201 for %f in ($(lisp) $(WINS)) do for %g in (%f/*.el) do $(emacs) -f batch-byte-compile %f/%g
202
203# Backup compiled Lisp files in elc.tar.gz. If that file already
204# exists, make a backup of it.
205
206backup-compiled-files:
207 -mv $(lisp)/elc.tar.gz $(lisp)/elc.tar.gz~
208 -tar czf $(lisp)/elc.tar.gz $(lisp)/*.elc $(lisp)/*/*.elc
209
210# Compile Lisp files, but save old compiled files first.
211
212compile: backup-compiled-files compile-files
213
3c5b0995
AI
214# Recompile all Lisp files which are newer than their .elc files.
215# Note that this doesn't create .elc files. It only recompiles if an
216# .elc is present.
217
de32572e 218recompile: doit
3c5b0995 219 $(emacs) -f batch-byte-recompile-directory .
5edd6aee 220
de32572e
AI
221# Prepare a bootstrap in the lisp subdirectory. Build loaddefs.el,
222# because it's not sure it's up-to-date, and if it's not, that might
223# lead to errors during the bootstrap because something fails to
224# autoload as expected. Remove compiled Lisp files so that
225# bootstrap-emacs will be built from sources only.
226
227bootstrap-clean:
228 if exist $(EMACS) $(MAKE) $(MFLAGS) -f makefile.nt autoloads
229 -for %f in ($(lisp) $(WINS)) do for %g in (%f\*.elc) do @$(DEL) %g
230
231# Generate/update files for the bootstrap process.
232
233bootstrap: autoloads compile-files custom-deps
234
95ed0025
RS
235#
236# Assuming INSTALL_DIR is defined, copy the elisp files to it
2359dd35 237# Windows 95 makes this harder than it should be.
95ed0025 238#
3c5b0995 239install:
de32572e
AI
240 - mkdir $(INSTALL_DIR)\lisp
241 - $(DEL) .\same-dir.tst
242 - $(DEL) $(INSTALL_DIR)\lisp\same-dir.tst
243 echo SameDirTest > $(INSTALL_DIR)\lisp\same-dir.tst
5edd6aee 244!ifdef COPY_LISP_SOURCE
de32572e 245 if not exist .\same-dir.tst $(CP_DIR) . $(INSTALL_DIR)\lisp
5edd6aee 246!else
de32572e
AI
247 if not exist .\same-dir.tst $(CP_DIR) *.elc $(INSTALL_DIR)\lisp
248 if not exist .\same-dir.tst $(CP) cus-load.el $(INSTALL_DIR)\lisp
0f76ca04
EZ
249 if not exist .\same-dir.tst $(CP) cus-start.el $(INSTALL_DIR)\lisp
250 if not exist .\same-dir.tst $(CP) emacs-lisp\cl-specs.el $(INSTALL_DIR)\lisp\emacs-lisp
251 if not exist .\same-dir.tst $(CP) eshell\esh-maint.el $(INSTALL_DIR)\lisp\eshell
252 if not exist .\same-dir.tst $(CP) eshell\esh-groups.el $(INSTALL_DIR)\lisp\eshell
253 if not exist .\same-dir.tst $(CP) finder-inf.el $(INSTALL_DIR)\lisp
de32572e 254 if not exist .\same-dir.tst $(CP) forms*.el $(INSTALL_DIR)\lisp
0f76ca04 255 if not exist .\same-dir.tst $(CP) generic-x.el $(INSTALL_DIR)\lisp
de32572e
AI
256 if not exist .\same-dir.tst $(CP) patcomp.el $(INSTALL_DIR)\lisp
257 if not exist .\same-dir.tst $(CP) subdirs.el $(INSTALL_DIR)\lisp
258 if not exist .\same-dir.tst $(CP) version.el $(INSTALL_DIR)\lisp
259 if not exist .\same-dir.tst $(CP) mail\blessmail.el $(INSTALL_DIR)\lisp\mail
de32572e
AI
260 if not exist .\same-dir.tst $(CP) play\bruce.el $(INSTALL_DIR)\lisp\play
261 if not exist .\same-dir.tst $(CP) international\latin-*.el $(INSTALL_DIR)\lisp\international
262 if not exist .\same-dir.tst $(CP) international\mule-conf.el $(INSTALL_DIR)\lisp\international
263 - $(DEL) $(INSTALL_DIR)\lisp\same-dir.tst
e4f553e6 264!endif
23de5c5c 265
95ed0025
RS
266#
267# Maintenance
f1180544 268#
de32572e
AI
269clean:
270 - $(DEL) *~ term\*~
271 - $(DEL) *.orig *.rej *.crlf
272 - $(DEL) emacs-lisp\*.orig emacs-lisp\*.rej emacs-lisp\*.crlf
273 - $(DEL) emulation\*.orig emulation\*.rej emulation\*.crlf
274 - $(DEL) gnus\*.orig gnus\*.rej gnus\*.crlf
275 - $(DEL) international\*.orig international\*.rej international\*.crlf
276 - $(DEL) language\*.orig language\*.rej language\*.crlf
277 - $(DEL) mail\*.orig mail\*.rej mail\*.crlf
278 - $(DEL) play\*.orig play\*.rej play\*.crlf
279 - $(DEL) progmodes\*.orig progmodes\*.rej progmodes\*.crlf
280 - $(DEL) term\*.orig term\*.rej term\*.crlf
281 - $(DEL) textmodes\*.orig textmodes\*.rej textmodes\*.crlf
282 - $(DEL_TREE) deleted