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