1 # Hacked up Nmake makefile for GNU Emacs
2 # Geoff Voelker (voelker@cs.washington.edu)
3 # Copyright (c) 1994 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)
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., 59 Temple Place - Suite 330,
20 # Boston, MA 02111-1307, USA.
32 # You can specify a different executable on the make command line,
33 # e.g. "make EMACS=../src/emacs ...".
35 EMACS = "../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 lisptagsfiles1 = $(lisp)/*.el
43 lisptagsfiles2 = $(lisp)/*/*.el
44 ETAGS = "../lib-src/$(BLD)/etags"
46 # Files which should not be compiled.
47 # - emacs-lisp/cl-specs.el: only contains `def-edebug-spec's so there's
48 # no point compiling it, although it doesn't hurt.
53 $(lisp)/cus-start.el \
54 $(lisp)/emacs-lisp/cl-specs.el \
55 $(lisp)/eshell/esh-maint.el \
56 $(lisp)/eshell/esh-groups.el \
57 $(lisp)/finder-inf.el \
59 $(lisp)/forms-pass.el \
60 $(lisp)/generic-x.el \
61 $(lisp)/international/latin-1.el \
62 $(lisp)/international/latin-2.el \
63 $(lisp)/international/latin-3.el \
64 $(lisp)/international/latin-4.el \
65 $(lisp)/international/latin-5.el \
66 $(lisp)/international/latin-8.el \
67 $(lisp)/international/latin-9.el \
68 $(lisp)/international/mule-conf.el \
71 $(lisp)/mail/blessmail.el \
75 $(lisp)/play/bruce.el \
77 $(lisp)/term/internal.el \
78 $(lisp)/term/AT386.el \
79 $(lisp)/term/apollo.el \
80 $(lisp)/term/bobcat.el \
81 $(lisp)/term/iris-ansi.el \
82 $(lisp)/term/keyswap.el \
83 $(lisp)/term/linux.el \
84 $(lisp)/term/lk201.el \
85 $(lisp)/term/news.el \
86 $(lisp)/term/vt102.el \
87 $(lisp)/term/vt125.el \
88 $(lisp)/term/vt200.el \
89 $(lisp)/term/vt201.el \
90 $(lisp)/term/vt220.el \
91 $(lisp)/term/vt240.el \
92 $(lisp)/term/vt300.el \
93 $(lisp)/term/vt320.el \
94 $(lisp)/term/vt400.el \
95 $(lisp)/term/vt420.el \
96 $(lisp)/term/wyse50.el \
97 $(lisp)/term/xterm.el \
100 # Files to compile before others during a bootstrap. This is done
101 # to speed up the bootstrap process.
104 $(lisp)/emacs-lisp/byte-opt.el \
105 $(lisp)/emacs-lisp/bytecomp.el \
108 # The actual Emacs command run in the targets below.
110 emacs = $(EMACS) $(EMACSOPT)
112 # Common command to find subdirectories
114 setwins=subdirs=`find $$wd -type d -print`; \
115 for file in $$subdirs; do \
116 case $$file in */Old | */RCS | */CVS | */CVS/* | */=* ) ;; \
117 *) wins="$$wins $$file" ;; \
121 # Have to define the list of subdirs manually when not using sh.
141 custom-deps: cus-load.el doit
142 @echo Directories: $(WINS)
143 set EMACSLOADPATH=$(lisp)
144 -$(SETLOADPATH) $(emacs) -l cus-dep --eval $(ARGQUOTE)(setq find-file-hooks nil)$(ARGQUOTE) -f custom-make-dependencies $(lisp) $(WINS)
147 echo (provide $(SQUOTE)finder-inf)>> $@
149 finder-data: finder-inf.el doit
150 @echo Directories: $(WINS)
151 $(emacs) -l finder -f finder-compile-keywords-make-dist $(lisp) $(WINS)
154 echo ;;; loaddefs.el --- automatically extracted autoloads> $@
157 echo ;;; Local Variables:>> $@
158 echo ;;; version-control: never>> $@
159 echo ;;; no-byte-compile: t>> $@
160 echo ;;; no-update-autoloads: t>> $@
162 echo ;;; loaddefs.el ends here>> $@
164 autoloads: loaddefs.el doit
165 @echo Directories: $(WINS)
166 set EMACSLOADPATH=$(lisp)
167 $(SETLOADPATH) $(emacs) -l autoload --eval $(ARGQUOTE)(setq find-file-hooks nil generated-autoload-file $(DQUOTE)$(lisp)/loaddefs.el$(DQUOTE))$(ARGQUOTE) -f batch-update-autoloads $(lisp) $(WINS)
170 $(MAKE) $(MFLAGS) update-subdirs
172 # Need separate version for sh and native cmd.exe
173 update-subdirs: update-subdirs-$(SHELLTYPE)
175 update-subdirs-CMD: doit
177 @for %d in ($(WINS)) do if not (%d)==(term) set QWINS=%QWINS% "%d"
178 echo ;; In load-path, after this directory should come> subdirs.el
179 echo ;; certain of its subdirectories. Here we specify them.>> subdirs.el
180 echo (normal-top-level-add-to-load-path $(SQUOTE)(%QWINS%))>> subdirs.el
182 update-subdirs-SH: doit
183 wd=$(lisp); $(setwins); \
184 for file in $$wins; do \
185 $(srcdir)/update-subdirs $$file; \
188 updates: update-subdirs autoloads finder-data custom-deps
190 TAGS: $(lisptagsfiles1) $(lisptagsfiles2)
191 $(ETAGS) $(lisptagsfiles1) $(lisptagsfiles2)
193 TAGS-LISP: $(lispsource)$(lisptagsfiles1) $(lispsource)$(lisptagsfiles2)
194 $(ETAGS) -o TAGS-LISP $(lispsource)$(lisptagsfiles1) $(lispsource)$(lisptagsfiles2)
199 set EMACSLOADPATH=$(lisp)
200 -$(SETLOADPATH) $(emacs) -f batch-byte-compile $<
202 $(DONTCOMPILE:.el=.elc):
205 # Compile all Lisp files, except those from DONTCOMPILE. This
206 # compiles files unconditionally. All .elc files are made writable
207 # before compilation in case we checked out read-only (CVS option -r).
208 # Files MUST be compiled one by one. If we compile several files in a
209 # row we can't make sure that the compilation environment is clean.
210 # We also set the load-path of the Emacs used for compilation to the
211 # current directory and its subdirectories, to make sure require's and
212 # load's in the files being compiled find the right files.
214 # Need separate version for sh and native cmd.exe
215 compile-files: subdirs.el compile-files-$(SHELLTYPE) doit
218 set EMACSLOADPATH=$(lisp)
219 # -for %f in ($(lisp) $(WINS)) do for %g in (%f\*.elc) do @attrib -r %g
220 for %f in ($(COMPILE_FIRST)) do $(emacs) -f batch-byte-compile %f
221 for %f in ($(lisp) $(WINS)) do for %g in (%f/*.el) do $(emacs) -f batch-byte-compile %f/%g
224 # for elc in $(lisp)/*.elc $(lisp)/*/*.elc; do attrib -r $$elc; done
225 for el in $(COMPILE_FIRST); do \
226 echo Compiling $$el; \
227 EMACSLOADPATH=$(lisp) $(emacs) -f batch-byte-compile $$el; \
229 for dir in $(lisp) $(WINS); do \
230 for el in $$dir/*.el; do \
231 echo Compiling $$el; \
232 EMACSLOADPATH=$(lisp) $(emacs) -f batch-byte-compile $$el; \
236 # Backup compiled Lisp files in elc.tar.gz. If that file already
237 # exists, make a backup of it.
239 backup-compiled-files:
240 -mv $(lisp)/elc.tar.gz $(lisp)/elc.tar.gz~
241 -tar czf $(lisp)/elc.tar.gz $(lisp)/*.elc $(lisp)/*/*.elc
243 # Compile Lisp files, but save old compiled files first.
245 compile: backup-compiled-files compile-files
247 # Recompile all Lisp files which are newer than their .elc files.
248 # Note that this doesn't create .elc files. It only recompiles if an
252 set EMACSLOADPATH=$(lisp)
253 $(SETLOADPATH) $(emacs) -f batch-byte-recompile-directory .
255 # Prepare a bootstrap in the lisp subdirectory. Build loaddefs.el,
256 # because it's not sure it's up-to-date, and if it's not, that might
257 # lead to errors during the bootstrap because something fails to
258 # autoload as expected. Remove compiled Lisp files so that
259 # bootstrap-emacs will be built from sources only.
261 # Need separate version for sh and native cmd.exe
262 bootstrap-clean: bootstrap-clean-$(SHELLTYPE)
265 if exist $(EMACS) $(MAKE) $(MFLAGS) autoloads
266 -for %f in ($(lisp) $(WINS)) do for %g in (%f\*.elc) do @$(DEL) %g
269 if test -f $(EMACS); then $(MAKE) $(MFLAGS) autoloads; fi
270 -rm -f $(lisp)/*.elc $(lisp)/*/*.elc
272 # Generate/update files for the bootstrap process.
274 bootstrap: autoloads compile-files custom-deps
277 # Assuming INSTALL_DIR is defined, copy the elisp files to it
278 # Windows 95 makes this harder than it should be.
281 - mkdir "$(INSTALL_DIR)/lisp"
282 - $(DEL) ../same-dir.tst
283 - $(DEL) "$(INSTALL_DIR)/same-dir.tst"
284 echo SameDirTest > "$(INSTALL_DIR)/same-dir.tst"
285 #ifdef COPY_LISP_SOURCE
286 $(IFNOTSAMEDIR) $(CP_DIR) . "$(INSTALL_DIR)/lisp" $(ENDIF)
288 # $(IFNOTSAMEDIR) $(CP_DIR) *.elc "$(INSTALL_DIR)/lisp" $(ENDIF)
289 # $(IFNOTSAMEDIR) $(CP) cus-load.el "$(INSTALL_DIR)/lisp" $(ENDIF)
290 # $(IFNOTSAMEDIR) $(CP) forms*.el "$(INSTALL_DIR)/lisp" $(ENDIF)
291 # $(IFNOTSAMEDIR) $(CP) patcomp.el "$(INSTALL_DIR)/lisp" $(ENDIF)
292 # $(IFNOTSAMEDIR) $(CP) subdirs.el "$(INSTALL_DIR)/lisp" $(ENDIF)
293 # $(IFNOTSAMEDIR) $(CP) version.el "$(INSTALL_DIR)/lisp" $(ENDIF)
294 # $(IFNOTSAMEDIR) $(CP) mail/blessmail.el "$(INSTALL_DIR)/lisp/mail" $(ENDIF)
295 # $(IFNOTSAMEDIR) $(CP) mail/sc.el "$(INSTALL_DIR)/lisp/mail" $(ENDIF)
296 # $(IFNOTSAMEDIR) $(CP) play/bruce.el "$(INSTALL_DIR)/lisp/play" $(ENDIF)
297 # $(IFNOTSAMEDIR) $(CP) international/latin-*.el "$(INSTALL_DIR)/lisp/international" $(ENDIF)
298 # $(IFNOTSAMEDIR) $(CP) international/mule-conf.el "$(INSTALL_DIR)/lisp/international" $(ENDIF)
300 - $(DEL) ../same-dir.tst
301 - $(DEL) "$(INSTALL_DIR)/same-dir.tst"