Add --bzip2. Update copyright.
[bpt/emacs.git] / lisp / makefile.w32-in
CommitLineData
bd6766d3 1# -*- Makefile -*- for GNU Emacs on the Microsoft W32 API.
92b47a4a 2# Copyright (C) 2000, 2001, 2002, 2003, 2004,
d7a0267c 3# 2005, 2006, 2007 Free Software Foundation, Inc.
7bbaaedd
AI
4#
5# This file is part of GNU Emacs.
c45dbde8 6#
7bbaaedd
AI
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
b4aa6026 9# the Free Software Foundation; either version 3, or (at your option)
7bbaaedd 10# any later version.
c45dbde8 11#
7bbaaedd
AI
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.
c45dbde8 16#
7bbaaedd
AI
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
086add15
LK
19# Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20# Boston, MA 02110-1301, USA.
7bbaaedd
AI
21#
22
23ALL =
24
25all: $(ALL)
26
27SQUOTE='
28# '
29
6610f4b2 30lisp = $(CURDIR)
9b006cb2 31srcdir = $(CURDIR)/..
7bbaaedd
AI
32
33# You can specify a different executable on the make command line,
34# e.g. "make EMACS=../src/emacs ...".
35
3196bfd2 36EMACS = $(THISDIR)/../bin/emacs.exe
7bbaaedd
AI
37
38# Command line flags for Emacs. This must include --multibyte,
39# otherwise some files will not compile.
40
41EMACSOPT = -batch --no-init-file --no-site-file --multibyte
42
8b9a5623
EZ
43# Extra flags to pass to the byte compiler
44BYTE_COMPILE_EXTRA_FLAGS =
45# For example to not display the undefined function warnings you can use this:
46# BYTE_COMPILE_EXTRA_FLAGS = --eval '(setq byte-compile-warnings (quote (not unresolved)))'
47# The example above is just for developers, it should not be used by default.
48
cc7aa053
AI
49# Set EMACSLOADPATH correctly (already defined in environment).
50EMACSLOADPATH=$(lisp)
51
7bbaaedd
AI
52lisptagsfiles1 = $(lisp)/*.el
53lisptagsfiles2 = $(lisp)/*/*.el
54ETAGS = "../lib-src/$(BLD)/etags"
55
170a9e70
GM
56# Files to compile before others during a bootstrap. This is done to
57# speed up the bootstrap process. The CC files are compiled first
58# because CC mode tweaks the compilation process, and requiring
59# cc-mode when it is not compiled doesn't work during the
60# bootstrapping.
7bbaaedd
AI
61
62COMPILE_FIRST = \
63 $(lisp)/emacs-lisp/byte-opt.el \
64 $(lisp)/emacs-lisp/bytecomp.el \
170a9e70
GM
65 $(lisp)/subr.el \
66 $(lisp)/progmodes/cc-mode.el \
67 $(lisp)/progmodes/cc-vars.el
7bbaaedd
AI
68
69# The actual Emacs command run in the targets below.
3196bfd2
EZ
70# The quotes around $(EMACS) are here because the user could type
71# it with forward slashes and without quotes, which will fail if
72# the shell is cmd.exe.
7bbaaedd 73
3196bfd2 74emacs = "$(EMACS)" $(EMACSOPT)
7bbaaedd 75
7bbaaedd 76# Have to define the list of subdirs manually when not using sh.
3aeca4ac 77WINS_ALMOST=\
1142be39 78 calc \
7bbaaedd
AI
79 calendar \
80 emacs-lisp \
81 emulation \
3e66f07c 82 erc \
7bbaaedd
AI
83 eshell \
84 gnus \
85 international \
86 language \
87 mail \
942da20c 88 mh-e \
7bbaaedd 89 net \
14521da1 90 nxml \
7bbaaedd
AI
91 play \
92 progmodes \
93 term \
b036f5d8 94 textmodes \
05cecc58 95 url
7bbaaedd 96
3aeca4ac
JB
97WINS= $(WINS_ALMOST) \
98 obsolete
99
7bbaaedd
AI
100doit:
101
bad197f0 102$(lisp)/cus-load.el:
7bbaaedd 103 touch $@
c3d49b7a
EZ
104# WARNING: Do NOT split the part inside $(ARGQUOTE)s into multiple lines as
105# this can break with GNU Make 3.81 and later if sh.exe is used.
f2133d9e 106custom-deps: $(lisp)/cus-load.el $(lisp)/loaddefs.el doit
7bbaaedd 107 @echo Directories: $(WINS)
5459bcdf 108 -$(emacs) -l cus-dep --eval $(ARGQUOTE)(setq find-file-hook nil)$(ARGQUOTE) -f custom-make-dependencies $(lisp) $(WINS)
7bbaaedd 109
f2133d9e 110finder-data: $(lisp)/loaddefs.el doit
7bbaaedd
AI
111 @echo Directories: $(WINS)
112 $(emacs) -l finder -f finder-compile-keywords-make-dist $(lisp) $(WINS)
113
bad197f0 114$(lisp)/loaddefs.el:
e22b24eb
AI
115 $(MAKE) $(MFLAGS) loaddefs.el-$(SHELLTYPE)
116 cp loaddefs.el-$(SHELLTYPE) $@
117 rm loaddefs.el-$(SHELLTYPE)
118
119loaddefs.el-SH:
120 echo ";;; loaddefs.el --- automatically extracted autoloads" > $@
121 echo ";;" >> $@; echo ";;; Code:" >> $@
122 echo "(autoload 'define-minor-mode \"easy-mmode\")" >>$@
123 echo "(autoload 'define-ccl-program \"ccl\")" >>$@
124 echo "(autoload 'regexp-opt \"regexp-opt\")" >>$@
125 echo "(autoload 'string-to-list \"mule-util\")" >>$@
126 echo "(autoload 'define-derived-mode \"derived\")" >>$@
127 echo "(autoload 'encoded-kbd-mode \"encoded-kb\")" >>$@
128 echo "(defvar cvs-global-menu nil)" >>$@
129 echo "\f" >> $@
130 echo ";;; Local Variables:" >> $@
131 echo ";;; version-control: never" >> $@
132 echo ";;; no-byte-compile: t" >> $@
133 echo ";;; no-update-autoloads: t" >> $@
134 echo ";;; End:" >> $@
135 echo ";;; loaddefs.el ends here" >> $@
136
137loaddefs.el-CMD:
7bbaaedd
AI
138 echo ;;; loaddefs.el --- automatically extracted autoloads> $@
139 echo ;;; Code:>> $@
e22b24eb
AI
140 echo (autoload 'define-minor-mode "easy-mmode")>> $@
141 echo (autoload 'define-ccl-program "ccl")>> $@
142 echo (autoload 'regexp-opt "regexp-opt")>> $@
143 echo (autoload 'string-to-list "mule-util")>> $@
144 echo (autoload 'define-derived-mode "derived")>> $@
145 echo (autoload 'encoded-kbd-mode "encoded-kb")>> $@
146 echo (defvar cvs-global-menu nil)>> $@
bad197f0 147 echo.\f>> $@
7bbaaedd
AI
148 echo ;;; Local Variables:>> $@
149 echo ;;; version-control: never>> $@
150 echo ;;; no-byte-compile: t>> $@
151 echo ;;; no-update-autoloads: t>> $@
152 echo ;;; End:>> $@
153 echo ;;; loaddefs.el ends here>> $@
154
81293113
EZ
155# Use . instead of $(lisp) because $(lisp) is an absolute file name,
156# including a drive letter and any leading directories, so the generated
157# loaddefs.el will mention file names that on other machine reference
158# possibly non-existent directories.
c3d49b7a
EZ
159#
160# WARNING: Do NOT split the part inside $(ARGQUOTE)s into multiple lines as
161# this can break with GNU Make 3.81 and later if sh.exe is used.
bad197f0 162autoloads: $(lisp)/loaddefs.el doit
3aeca4ac 163 @echo Directories: . $(WINS_ALMOST)
c5bdb93d 164 $(emacs) -l autoload \
7c417300 165 --eval $(ARGQUOTE)(setq find-file-hook nil find-file-suppress-same-file-warnings t)$(ARGQUOTE) \
3aeca4ac 166 -f w32-batch-update-autoloads "$(lisp)/loaddefs.el" . $(WINS_ALMOST)
7bbaaedd 167
bad197f0 168$(lisp)/subdirs.el:
7bbaaedd
AI
169 $(MAKE) $(MFLAGS) update-subdirs
170
171# Need separate version for sh and native cmd.exe
172update-subdirs: update-subdirs-$(SHELLTYPE)
173
174update-subdirs-CMD: doit
bad197f0
JR
175 echo ;; -*- no-byte-compile: t -*-> $(lisp)/subdirs.el
176 echo ;; In load-path, after this directory should come>> $(lisp)/subdirs.el
177 echo ;; certain of its subdirectories. Here we specify them.>> $(lisp)/subdirs.el
178 echo (normal-top-level-add-to-load-path $(SQUOTE)(>> $(lisp)/subdirs.el
179 @for %%d in ($(WINS)) do if not (%%d)==(term) echo "%%d">> $(lisp)/subdirs.el
180 echo ))>> $(lisp)/subdirs.el
7bbaaedd
AI
181
182update-subdirs-SH: doit
0cfc4b54 183 $(srcdir)/update-subdirs $(lisp); \
e22b24eb 184 for file in $(WINS); do \
7bbaaedd
AI
185 $(srcdir)/update-subdirs $$file; \
186 done;
187
ba2b2673 188updates: update-subdirs autoloads mh-autoloads finder-data custom-deps
7bbaaedd 189
a9d25c79
EZ
190# This is useful after "cvs up".
191cvs-update: recompile autoloads finder-data custom-deps
192
9b006cb2
AI
193# Update the AUTHORS file.
194
195update-authors:
ed5e0894 196 $(emacs) -l authors -f batch-update-authors $(srcdir)/etc/AUTHORS $(srcdir)
9b006cb2 197
7bbaaedd
AI
198TAGS: $(lisptagsfiles1) $(lisptagsfiles2)
199 $(ETAGS) $(lisptagsfiles1) $(lisptagsfiles2)
200
9b006cb2
AI
201TAGS-LISP: $(lisptagsfiles1) $(lisptagsfiles2)
202 $(ETAGS) -o TAGS-LISP $(lisptagsfiles1) $(lisptagsfiles2)
7bbaaedd 203
49060c51
AI
204.SUFFIXES: .elc .el
205
7bbaaedd 206.el.elc:
8b9a5623 207 -$(emacs) $(BYTE_COMPILE_EXTRA_FLAGS) -f batch-byte-compile $<
7bbaaedd 208
8f801552
LK
209# Compile all Lisp files, but don't recompile those that are up to
210# date. Some files don't actually get compiled because they set the
211# local variable no-byte-compile.
7bbaaedd 212
8f801552
LK
213# All .elc files are made writable before compilation in case we
214# checked out read-only (CVS option -r). Files MUST be compiled one by
215# one. If we compile several files in a row we can't make sure that
216# the compilation environment is clean. We also set the load-path of
217# the Emacs used for compilation to the current directory and its
218# subdirectories, to make sure require's and load's in the files being
219# compiled find the right files.
7bbaaedd
AI
220
221# Need separate version for sh and native cmd.exe
bad197f0 222compile: $(lisp)/subdirs.el mh-autoloads compile-$(SHELLTYPE) doit
7bbaaedd 223
d198b6f5 224compile-CMD:
80bb1e21
JR
225# -for %%f in ($(lisp) $(WINS)) do for %%g in (%%f\*.elc) do @attrib -r %%g
226 for %%f in ($(COMPILE_FIRST)) do \
8b9a5623 227 $(emacs) -l loaddefs $(BYTE_COMPILE_EXTRA_FLAGS) -f batch-byte-compile-if-not-done %%f
80bb1e21 228 for %%f in (. $(WINS)) do for %%g in (%%f/*.el) do \
8b9a5623 229 $(emacs) -l loaddefs $(BYTE_COMPILE_EXTRA_FLAGS) -f batch-byte-compile-if-not-done %%f/%%g
0702b995 230
d198b6f5 231compile-SH:
9b006cb2
AI
232# for elc in $(lisp)/*.elc $(lisp)/*/*.elc; do attrib -r $$elc; done
233 for el in $(COMPILE_FIRST); do \
234 echo Compiling $$el; \
8b9a5623 235 $(emacs) -l loaddefs $(BYTE_COMPILE_EXTRA_FLAGS) -f batch-byte-compile-if-not-done $$el; \
9b006cb2
AI
236 done
237 for dir in $(lisp) $(WINS); do \
238 for el in $$dir/*.el; do \
239 if test -f $$el; \
240 then \
241 echo Compiling $$el; \
8b9a5623 242 $(emacs) -l loaddefs $(BYTE_COMPILE_EXTRA_FLAGS) -f batch-byte-compile-if-not-done $$el; \
9b006cb2
AI
243 fi \
244 done; \
245 done
246
8f801552
LK
247# Compile all Lisp files. This is like `compile' but compiles files
248# unconditionally. Some files don't actually get compiled because they
249# set the local variable no-byte-compile.
250
bad197f0 251compile-always: $(lisp)/subdirs.el compile-always-$(SHELLTYPE) doit
9b006cb2
AI
252
253compile-always-CMD:
80bb1e21 254# -for %%f in ($(lisp) $(WINS)) do for %%g in (%%f\*.elc) do @attrib -r %%g
8b9a5623
EZ
255 for %%f in ($(COMPILE_FIRST)) do $(emacs) $(BYTE_COMPILE_EXTRA_FLAGS) -f batch-byte-compile %%f
256 for %%f in (. $(WINS)) do for %%g in (%%f/*.el) do $(emacs) $(BYTE_COMPILE_EXTRA_FLAGS) -f batch-byte-compile %%f/%%g
7bbaaedd 257
9b006cb2 258compile-always-SH:
7bbaaedd
AI
259# for elc in $(lisp)/*.elc $(lisp)/*/*.elc; do attrib -r $$elc; done
260 for el in $(COMPILE_FIRST); do \
261 echo Compiling $$el; \
8b9a5623 262 $(emacs) $(BYTE_COMPILE_EXTRA_FLAGS) -f batch-byte-compile $$el || exit 1; \
7bbaaedd
AI
263 done
264 for dir in $(lisp) $(WINS); do \
265 for el in $$dir/*.el; do \
266 echo Compiling $$el; \
8b9a5623 267 $(emacs) $(BYTE_COMPILE_EXTRA_FLAGS) -f batch-byte-compile $$el || exit 1; \
7bbaaedd
AI
268 done; \
269 done
270
9b006cb2
AI
271compile-calc: compile-calc-$(SHELLTYPE)
272
273compile-calc-CMD:
8b9a5623 274 for %%f in ($(lisp)/calc/*.el) do $(emacs) $(BYTE_COMPILE_EXTRA_FLAGS) -f batch-byte-compile %%f
9b006cb2 275
c45dbde8 276compile-calc-SH:
9b006cb2
AI
277 for el in $(lisp)/calc/*.el; do \
278 echo Compiling $$el; \
8b9a5623 279 $(emacs) $(BYTE_COMPILE_EXTRA_FLAGS) -f batch-byte-compile $$el || exit 1; \
9b006cb2
AI
280 done
281
7bbaaedd
AI
282# Backup compiled Lisp files in elc.tar.gz. If that file already
283# exists, make a backup of it.
284
285backup-compiled-files:
286 -mv $(lisp)/elc.tar.gz $(lisp)/elc.tar.gz~
287 -tar czf $(lisp)/elc.tar.gz $(lisp)/*.elc $(lisp)/*/*.elc
288
289# Compile Lisp files, but save old compiled files first.
290
d198b6f5 291compile-after-backup: backup-compiled-files compile-always
7bbaaedd
AI
292
293# Recompile all Lisp files which are newer than their .elc files.
294# Note that this doesn't create .elc files. It only recompiles if an
295# .elc is present.
53fad1e4
EZ
296# WARNING: Do NOT split the part inside $(ARGQUOTE)s into multiple lines as
297# this can break with GNU Make 3.81 and later if sh.exe is used.
298recompile: mh-autoloads doit $(lisp)/progmodes/cc-mode.elc
299 $(emacs) --eval $(ARGQUOTE)(batch-byte-recompile-directory 0)$(ARGQUOTE) $(lisp)
7bbaaedd 300
8b9a5623
EZ
301# CC Mode uses a compile time macro system which causes a compile time
302# dependency in cc-mode.elc on the macros in cc-langs.el and the
303# version string in cc-defs.el.
304$(lisp)/progmodes/cc-mode.elc: \
305 $(lisp)/progmodes/cc-mode.el \
306 $(lisp)/progmodes/cc-langs.el \
307 $(lisp)/progmodes/cc-defs.el
308 $(emacs) $(BYTE_COMPILE_EXTRA_FLAGS) -f batch-byte-compile $(lisp)/progmodes/cc-mode.el
309
ba2b2673
BW
310# Update MH-E internal autoloads. These are not to be confused with
311# the autoloads for the MH-E entry points, which are already in
312# loaddefs.el.
e9b28650 313MH_E_SRC = $(lisp)/mh-e/mh-acros.el $(lisp)/mh-e/mh-alias.el \
3e66f07c
JB
314 $(lisp)/mh-e/mh-buffers.el $(lisp)/mh-e/mh-compat.el \
315 $(lisp)/mh-e/mh-comp.el $(lisp)/mh-e/mh-e.el \
316 $(lisp)/mh-e/mh-folder.el $(lisp)/mh-e/mh-funcs.el \
317 $(lisp)/mh-e/mh-gnus.el $(lisp)/mh-e/mh-identity.el \
318 $(lisp)/mh-e/mh-inc.el $(lisp)/mh-e/mh-junk.el \
319 $(lisp)/mh-e/mh-letter.el $(lisp)/mh-e/mh-limit.el \
320 $(lisp)/mh-e/mh-mime.el $(lisp)/mh-e/mh-print.el \
321 $(lisp)/mh-e/mh-scan.el $(lisp)/mh-e/mh-search.el \
322 $(lisp)/mh-e/mh-seq.el $(lisp)/mh-e/mh-show.el \
323 $(lisp)/mh-e/mh-speed.el $(lisp)/mh-e/mh-thread.el \
324 $(lisp)/mh-e/mh-tool-bar.el $(lisp)/mh-e/mh-utils.el \
325 $(lisp)/mh-e/mh-xface.el
ba2b2673 326
f2fd2cf5
EZ
327# See the commentary for autoloads above for why we use ./mh-e below
328# instead of $(lisp)/mh-e.
ba2b2673 329mh-autoloads: $(lisp)/mh-e/mh-loaddefs.el
e9b28650 330$(lisp)/mh-e/mh-loaddefs.el: $(MH_E_SRC)
e3188d80
JR
331 $(MAKE) $(MFLAGS) pre-mh-loaddefs.el-$(SHELLTYPE)
332 cp pre-mh-loaddefs.el-$(SHELLTYPE) $@
bad197f0 333 rm pre-mh-loaddefs.el-$(SHELLTYPE)
3152b1eb 334 "$(EMACS)" $(EMACSOPT) \
e3188d80
JR
335 -l autoload \
336 --eval "(setq generate-autoload-cookie \";;;###mh-autoload\")" \
a5f271ab 337 --eval "(setq find-file-suppress-same-file-warnings t)" \
e3188d80 338 --eval "(setq make-backup-files nil)" \
7c417300 339 -f w32-batch-update-autoloads \
f2fd2cf5 340 "$(lisp)/mh-e/mh-loaddefs.el" ./mh-e
e3188d80
JR
341
342pre-mh-loaddefs.el-SH:
ba2b2673
BW
343 echo ";;; mh-loaddefs.el --- automatically extracted autoloads" > $@
344 echo ";;" >> $@
d7a0267c 345 echo ";; Copyright (C) 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc." >> $@
53fad1e4
EZ
346 echo ";; Author: Bill Wohler <wohler@newt.com>" >> $@
347 echo ";; Keywords: mail" >> $@
ba2b2673
BW
348 echo ";;; Commentary:" >> $@
349 echo ";;; Change Log:" >> $@
350 echo ";;; Code:" >> $@
ba2b2673
BW
351 echo "\f" >> $@
352 echo "(provide 'mh-loaddefs)" >> $@
53fad1e4
EZ
353 echo ";; Local Variables:" >> $@
354 echo ";; version-control: never" >> $@
355 echo ";; no-byte-compile: t" >> $@
356 echo ";; no-update-autoloads: t" >> $@
357 echo ";; End:" >> $@
ba2b2673
BW
358 echo ";;; mh-loaddefs.el ends here" >> $@
359
e3188d80
JR
360pre-mh-loaddefs.el-CMD:
361 echo ;;; mh-loaddefs.el --- automatically extracted autoloads> $@
362 echo ;;>> $@
d7a0267c 363 echo ;; Copyright (C) 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.>> $@
53fad1e4
EZ
364 echo ;; Author: Bill Wohler (wohler@newt.com)>> $@
365 echo ;; Keywords: mail>> $@
e3188d80
JR
366 echo ;;; Commentary:>> $@
367 echo ;;; Change Log:>> $@
368 echo ;;; Code:>> $@
369 echo.\f>> $@
370 echo (provide 'mh-loaddefs)>> $@
53fad1e4
EZ
371 echo ;; Local Variables:>> $@
372 echo ;; version-control: never>> $@
373 echo ;; no-byte-compile: t>> $@
374 echo ;; no-update-autoloads: t>> $@
375 echo ;; End:>> $@
e3188d80
JR
376 echo ;;; mh-loaddefs.el ends here>> $@
377
54ab09c4
MB
378# Prepare a bootstrap in the lisp subdirectory.
379#
e8dbbf6f
EZ
380# Build loaddefs.el to make sure it's up-to-date. If it's not, that
381# might lead to errors during the bootstrap because something fails to
382# autoload as expected. If there is no emacs binary, then we can't
383# build autoloads yet. In that case we have to use ldefs-boot.el;
384# bootstrap should always work with ldefs-boot.el. (Because
385# loaddefs.el is an automatically generated file, we don't want to
386# store it in the source repository).
54ab09c4
MB
387#
388# Remove compiled Lisp files so that bootstrap-emacs will be built from
389# sources only.
7bbaaedd
AI
390
391# Need separate version for sh and native cmd.exe
512dd711
EZ
392# Note that bootstrap-clean-$(SHELLTYPE) copies ldefs-boot.el to loaddefs.el,
393# and thus the almost-empty loaddefs.el crafted by the $(lisp)/loaddefs.el
394# target can NOT be built _after_ bootstrap-clean-$(SHELLTYPE) does its
395# thing, or else an empty loaddefs.el will overwrite the full one.
396bootstrap-clean: $(lisp)/loaddefs.el
397 $(MAKE) $(MFLAGS) bootstrap-clean-$(SHELLTYPE)
7bbaaedd
AI
398
399bootstrap-clean-CMD:
3152b1eb 400# if exist "$(EMACS)" $(MAKE) $(MFLAGS) autoloads
e8dbbf6f 401 cp $(lisp)/ldefs-boot.el $(lisp)/loaddefs.el
80bb1e21 402 -for %%f in (. $(WINS)) do for %%g in (%%f\*.elc) do @$(DEL) %%g
7bbaaedd
AI
403
404bootstrap-clean-SH:
3152b1eb 405# if test -f "$(EMACS)"; then $(MAKE) $(MFLAGS) autoloads; fi
a3599c30 406# -rm -f $(lisp)/*.elc $(lisp)/*/*.elc
e8dbbf6f 407 cp $(lisp)/ldefs-boot.el $(lisp)/loaddefs.el
a3599c30 408 -for dir in . $(WINS); do rm -f $$dir/*.elc; done
7bbaaedd
AI
409
410# Generate/update files for the bootstrap process.
014b37b6
EZ
411# When done, remove bootstrap-emacs from ../bin, so that
412# it will not be mistaken for an installed binary.
7bbaaedd 413
ba2b2673 414bootstrap: update-subdirs autoloads mh-autoloads compile finder-data custom-deps
3152b1eb 415 - $(DEL) "$(EMACS)"
7bbaaedd
AI
416
417#
418# Assuming INSTALL_DIR is defined, copy the elisp files to it
419# Windows 95 makes this harder than it should be.
420#
421install:
422 - mkdir "$(INSTALL_DIR)/lisp"
423 - $(DEL) ../same-dir.tst
424 - $(DEL) "$(INSTALL_DIR)/same-dir.tst"
425 echo SameDirTest > "$(INSTALL_DIR)/same-dir.tst"
426#ifdef COPY_LISP_SOURCE
86d92518 427 $(IFNOTSAMEDIR) $(MAKE) $(MFLAGS) install-lisp-$(SHELLTYPE) $(ENDIF)
7bbaaedd
AI
428#else
429# $(IFNOTSAMEDIR) $(CP_DIR) *.elc "$(INSTALL_DIR)/lisp" $(ENDIF)
430# $(IFNOTSAMEDIR) $(CP) cus-load.el "$(INSTALL_DIR)/lisp" $(ENDIF)
431# $(IFNOTSAMEDIR) $(CP) forms*.el "$(INSTALL_DIR)/lisp" $(ENDIF)
432# $(IFNOTSAMEDIR) $(CP) patcomp.el "$(INSTALL_DIR)/lisp" $(ENDIF)
433# $(IFNOTSAMEDIR) $(CP) subdirs.el "$(INSTALL_DIR)/lisp" $(ENDIF)
434# $(IFNOTSAMEDIR) $(CP) version.el "$(INSTALL_DIR)/lisp" $(ENDIF)
435# $(IFNOTSAMEDIR) $(CP) mail/blessmail.el "$(INSTALL_DIR)/lisp/mail" $(ENDIF)
436# $(IFNOTSAMEDIR) $(CP) mail/sc.el "$(INSTALL_DIR)/lisp/mail" $(ENDIF)
437# $(IFNOTSAMEDIR) $(CP) play/bruce.el "$(INSTALL_DIR)/lisp/play" $(ENDIF)
438# $(IFNOTSAMEDIR) $(CP) international/latin-*.el "$(INSTALL_DIR)/lisp/international" $(ENDIF)
439# $(IFNOTSAMEDIR) $(CP) international/mule-conf.el "$(INSTALL_DIR)/lisp/international" $(ENDIF)
440#endif
441 - $(DEL) ../same-dir.tst
442 - $(DEL) "$(INSTALL_DIR)/same-dir.tst"
443
86d92518
EZ
444# Need to copy *.el files first, to avoid "source file is newer" annoyance
445# since cp does not preserve time stamps
446install-lisp-SH:
447 cp -f *.el "$(INSTALL_DIR)/lisp"
e4fe7e5e
EZ
448 for dir in $(WINS); do [ -d "$(INSTALL_DIR)/lisp/$$dir" ] || mkdir "$(INSTALL_DIR)/lisp/$$dir"; done
449 for dir in $(WINS); do cp -f $$dir/*.el "$(INSTALL_DIR)/lisp/$$dir"; done
86d92518
EZ
450 for dir in . $(WINS); do cp $$dir/*.elc "$(INSTALL_DIR)/lisp/$$dir"; done
451
452install-lisp-CMD:
453 cp -f *.el "$(INSTALL_DIR)/lisp"
e4fe7e5e 454 for %%f in ($(WINS)) do if not exist "$(INSTALL_DIR)/lisp/%%f" mkdir "$(INSTALL_DIR)/lisp/%%f"
86d92518
EZ
455 for %%f in ($(WINS)) do cp -f %%f/*.el "$(INSTALL_DIR)/lisp/%%f"
456 for %%f in (. $(WINS)) do cp -f %%f/*.elc "$(INSTALL_DIR)/lisp/%%f"
457
8b9a5623
EZ
458# WARNING: Do NOT split the part inside $(ARGQUOTE)s into multiple lines as
459# this can break with GNU Make 3.81 and later if sh.exe is used.
460check-declare:
461 $(emacs) -l $(lisp)/emacs-lisp/check-declare --eval $(ARGQUOTE)(check-declare-directory $(DQUOTE)$(lisp)$(DQUOTE))$(ARGQUOTE)
462
7bbaaedd
AI
463#
464# Maintenance
c45dbde8 465#
e4fe7e5e
EZ
466# We used to delete *~ here, but that might inadvertently remove
467# precious files if it happens to match their short 8+3 aliases.
7bbaaedd 468clean:
e4fe7e5e 469 - $(DEL) *.el~