makefile.w32-in 16.6 KB
Newer Older
1
#  -*- Makefile -*- for GNU Emacs on the Microsoft W32 API.
2
#  Copyright (C) 2000, 2001, 2002, 2003, 2004,
Glenn Morris's avatar
Glenn Morris committed
3
#                2005, 2006, 2007, 2008  Free Software Foundation, Inc.
4

Andrew Innes's avatar
Andrew Innes committed
5
#  This file is part of GNU Emacs.
6 7 8 9 10 11 12 13 14 15 16 17 18

# GNU Emacs is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.

# GNU Emacs is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
Andrew Innes's avatar
Andrew Innes committed
19 20 21 22 23 24 25 26

ALL =

all: $(ALL)

SQUOTE='
# '

27
lisp = $(CURDIR)
28
srcdir = $(CURDIR)/..
Andrew Innes's avatar
Andrew Innes committed
29 30 31 32

# You can specify a different executable on the make command line,
# e.g. "make EMACS=../src/emacs ...".

33
EMACS = $(THISDIR)/../bin/emacs.exe
Andrew Innes's avatar
Andrew Innes committed
34 35 36 37 38 39

# Command line flags for Emacs.  This must include --multibyte,
# otherwise some files will not compile.

EMACSOPT = -batch --no-init-file --no-site-file --multibyte

Eli Zaretskii's avatar
Eli Zaretskii committed
40 41 42 43 44 45
# Extra flags to pass to the byte compiler
BYTE_COMPILE_EXTRA_FLAGS =
# For example to not display the undefined function warnings you can use this:
# BYTE_COMPILE_EXTRA_FLAGS = --eval '(setq byte-compile-warnings (quote (not unresolved)))'
# The example above is just for developers, it should not be used by default.

Andrew Innes's avatar
Andrew Innes committed
46 47 48
# Set EMACSLOADPATH correctly (already defined in environment).
EMACSLOADPATH=$(lisp)

49 50 51
# Use C locale
LC_ALL = C

Andrew Innes's avatar
Andrew Innes committed
52 53 54 55
lisptagsfiles1 = $(lisp)/*.el
lisptagsfiles2 = $(lisp)/*/*.el
ETAGS = "../lib-src/$(BLD)/etags"

56 57
# Automatically generated autoload files, apart from lisp/loaddefs.el.
LOADDEFS = $(lisp)/calendar/cal-loaddefs.el \
Jason Rumney's avatar
Jason Rumney committed
58 59 60 61
	$(lisp)/calendar/diary-loaddefs.el $(lisp)/calendar/hol-loaddefs.el \
	$(lisp)/mh-e/mh-loaddefs.el

AUTOGENEL = $(lisp)/loaddefs.el $(LOADDEFS) $(lisp)/cus-load.el \
62
	$(lisp)/finder-inf.el $(lisp)/subdirs.el $(lisp)/eshell/esh-groups.el \
63
	$(lisp)/calc/calc-loaddefs.el $(lisp)/nxml/subdirs.el
64

65 66 67 68 69
# Files to compile before others during a bootstrap.  This is done to
# speed up the bootstrap process.  The CC files are compiled first
# because CC mode tweaks the compilation process, and requiring
# cc-mode when it is not compiled doesn't work during the
# bootstrapping.
Andrew Innes's avatar
Andrew Innes committed
70 71 72 73

COMPILE_FIRST = \
	$(lisp)/emacs-lisp/byte-opt.el \
	$(lisp)/emacs-lisp/bytecomp.el \
74 75 76
	$(lisp)/subr.el \
	$(lisp)/progmodes/cc-mode.el \
	$(lisp)/progmodes/cc-vars.el
Andrew Innes's avatar
Andrew Innes committed
77 78

# The actual Emacs command run in the targets below.
79 80 81
# The quotes around $(EMACS) are here because the user could type
# it with forward slashes and without quotes, which will fail if
# the shell is cmd.exe.
Andrew Innes's avatar
Andrew Innes committed
82

83
emacs = "$(EMACS)" $(EMACSOPT)
Andrew Innes's avatar
Andrew Innes committed
84 85

# Have to define the list of subdirs manually when not using sh.
Juanma Barranquero's avatar
Juanma Barranquero committed
86
WINS_ALMOST=\
87
	calc \
Andrew Innes's avatar
Andrew Innes committed
88 89 90
	calendar \
	emacs-lisp \
	emulation \
Juanma Barranquero's avatar
Juanma Barranquero committed
91
	erc \
Andrew Innes's avatar
Andrew Innes committed
92 93 94 95 96
	eshell \
	gnus \
	international \
	language \
	mail \
97
	mh-e \
Andrew Innes's avatar
Andrew Innes committed
98
	net \
99
	nxml \
Juanma Barranquero's avatar
Juanma Barranquero committed
100
	org \
Andrew Innes's avatar
Andrew Innes committed
101 102
	play \
	progmodes \
103
	textmodes \
104
	url
Andrew Innes's avatar
Andrew Innes committed
105

Juanma Barranquero's avatar
Juanma Barranquero committed
106
WINS= $(WINS_ALMOST) \
Jason Rumney's avatar
Jason Rumney committed
107
	term \
Juanma Barranquero's avatar
Juanma Barranquero committed
108 109
	obsolete

Andrew Innes's avatar
Andrew Innes committed
110 111
doit:

112
$(lisp)/cus-load.el:
Andrew Innes's avatar
Andrew Innes committed
113
	touch $@
114 115
# WARNING: Do NOT split the part inside $(ARGQUOTE)s into multiple lines as
#          this can break with GNU Make 3.81 and later if sh.exe is used.
116
custom-deps: $(lisp)/cus-load.el $(lisp)/loaddefs.el doit
Jason Rumney's avatar
Jason Rumney committed
117 118
	@echo Directories: $(WINS_ALMOST)
	-$(emacs) -l cus-dep --eval $(ARGQUOTE)(setq find-file-hook nil)$(ARGQUOTE) -f custom-make-dependencies $(lisp) $(WINS_ALMOST)
Andrew Innes's avatar
Andrew Innes committed
119

120
finder-data: $(lisp)/loaddefs.el doit
Jason Rumney's avatar
Jason Rumney committed
121 122
	@echo Directories: $(WINS_ALMOST)
	$(emacs) -l finder -f finder-compile-keywords-make-dist $(lisp) $(WINS_ALMOST)
Andrew Innes's avatar
Andrew Innes committed
123

124
$(lisp)/loaddefs.el:
125 126 127 128 129 130 131 132
	$(MAKE) $(MFLAGS) loaddefs.el-$(SHELLTYPE)
	cp loaddefs.el-$(SHELLTYPE) $@
	rm loaddefs.el-$(SHELLTYPE)

loaddefs.el-SH:
	echo ";;; loaddefs.el --- automatically extracted autoloads" > $@
	echo ";;" >> $@; echo ";;; Code:" >> $@
	echo "" >> $@
133 134 135 136 137 138
	echo ";; Local Variables:" >> $@
	echo ";; version-control: never" >> $@
	echo ";; no-byte-compile: t" >> $@
	echo ";; no-update-autoloads: t" >> $@
	echo ";; coding: utf-8" >> $@
	echo ";; End:" >> $@
139 140 141
	echo ";;; loaddefs.el ends here" >> $@

loaddefs.el-CMD:
Andrew Innes's avatar
Andrew Innes committed
142
	echo ;;; loaddefs.el --- automatically extracted autoloads> $@
143
	echo ;;>> $@
Andrew Innes's avatar
Andrew Innes committed
144
	echo ;;; Code:>> $@
145
	echo.>> $@
146 147 148 149 150 151
	echo ;; Local Variables:>> $@
	echo ;; version-control: never>> $@
	echo ;; no-byte-compile: t>> $@
	echo ;; no-update-autoloads: t>> $@
	echo ;; coding: utf-8>> $@
	echo ;; End:>> $@
Andrew Innes's avatar
Andrew Innes committed
152 153
	echo ;;; loaddefs.el ends here>> $@

154 155 156 157
# Use . instead of $(lisp) because $(lisp) is an absolute file name,
# including a drive letter and any leading directories, so the generated
# loaddefs.el will mention file names that on other machine reference
# possibly non-existent directories.
158 159 160
#
# WARNING: Do NOT split the part inside $(ARGQUOTE)s into multiple lines as
#          this can break with GNU Make 3.81 and later if sh.exe is used.
161
autoloads: $(lisp)/loaddefs.el $(LOADDEFS) doit
Juanma Barranquero's avatar
Juanma Barranquero committed
162
	@echo Directories: . $(WINS_ALMOST)
163
	$(emacs) -l autoload \
164
		--eval $(ARGQUOTE)(setq find-file-hook nil find-file-suppress-same-file-warnings t)$(ARGQUOTE) \
Juanma Barranquero's avatar
Juanma Barranquero committed
165
		-f w32-batch-update-autoloads "$(lisp)/loaddefs.el" . $(WINS_ALMOST)
Andrew Innes's avatar
Andrew Innes committed
166

167
$(lisp)/subdirs.el:
Andrew Innes's avatar
Andrew Innes committed
168 169 170 171 172 173
	$(MAKE) $(MFLAGS) update-subdirs

# Need separate version for sh and native cmd.exe
update-subdirs: update-subdirs-$(SHELLTYPE)

update-subdirs-CMD: doit
174 175 176 177 178 179
	echo ;; -*- no-byte-compile: t -*-> $(lisp)/subdirs.el
	echo ;; In load-path, after this directory should come>> $(lisp)/subdirs.el
	echo ;; certain of its subdirectories.  Here we specify them.>> $(lisp)/subdirs.el
	echo (normal-top-level-add-to-load-path $(SQUOTE)(>> $(lisp)/subdirs.el
	@for %%d in ($(WINS)) do if not (%%d)==(term) echo "%%d">> $(lisp)/subdirs.el
	echo ))>> $(lisp)/subdirs.el
Andrew Innes's avatar
Andrew Innes committed
180 181

update-subdirs-SH: doit
182
	$(srcdir)/update-subdirs $(lisp); \
183
	for file in $(WINS); do \
Andrew Innes's avatar
Andrew Innes committed
184 185 186
	   $(srcdir)/update-subdirs $$file; \
	done;

187
updates: update-subdirs autoloads mh-autoloads finder-data custom-deps
Andrew Innes's avatar
Andrew Innes committed
188

Eli Zaretskii's avatar
Eli Zaretskii committed
189 190 191
# This is useful after "cvs up".
cvs-update: recompile autoloads finder-data custom-deps

192 193 194
# Update the AUTHORS file.

update-authors:
195
	$(emacs) -l authors -f batch-update-authors $(srcdir)/etc/AUTHORS $(srcdir)
196

Andrew Innes's avatar
Andrew Innes committed
197 198 199
TAGS: $(lisptagsfiles1) $(lisptagsfiles2)
	$(ETAGS) $(lisptagsfiles1) $(lisptagsfiles2)

200 201
TAGS-LISP: $(lisptagsfiles1) $(lisptagsfiles2)
	$(ETAGS) -o TAGS-LISP $(lisptagsfiles1) $(lisptagsfiles2)
Andrew Innes's avatar
Andrew Innes committed
202

Andrew Innes's avatar
Andrew Innes committed
203 204
.SUFFIXES: .elc .el

Andrew Innes's avatar
Andrew Innes committed
205
.el.elc:
Eli Zaretskii's avatar
Eli Zaretskii committed
206
	-$(emacs) $(BYTE_COMPILE_EXTRA_FLAGS) -f batch-byte-compile $<
Andrew Innes's avatar
Andrew Innes committed
207

Lute Kamstra's avatar
Lute Kamstra committed
208 209 210
# Compile all Lisp files, but don't recompile those that are up to
# date.  Some files don't actually get compiled because they set the
# local variable no-byte-compile.
Andrew Innes's avatar
Andrew Innes committed
211

Lute Kamstra's avatar
Lute Kamstra committed
212 213 214 215 216 217 218
# All .elc files are made writable before compilation in case we
# checked out read-only (CVS option -r).  Files MUST be compiled one by
# one.  If we compile several files in a row we can't make sure that
# the compilation environment is clean.  We also set the load-path of
# the Emacs used for compilation to the current directory and its
# subdirectories, to make sure require's and load's in the files being
# compiled find the right files.
Andrew Innes's avatar
Andrew Innes committed
219 220

# Need separate version for sh and native cmd.exe
221
compile: $(lisp)/subdirs.el mh-autoloads compile-$(SHELLTYPE) doit
Andrew Innes's avatar
Andrew Innes committed
222

223
compile-CMD:
224 225
#	-for %%f in ($(lisp) $(WINS)) do for %%g in (%%f\*.elc) do @attrib -r %%g
	for %%f in ($(COMPILE_FIRST)) do \
Eli Zaretskii's avatar
Eli Zaretskii committed
226
	  $(emacs) -l loaddefs $(BYTE_COMPILE_EXTRA_FLAGS) -f batch-byte-compile-if-not-done %%f
227
	for %%f in (. $(WINS)) do for %%g in (%%f/*.el) do \
Eli Zaretskii's avatar
Eli Zaretskii committed
228
	  $(emacs) -l loaddefs $(BYTE_COMPILE_EXTRA_FLAGS) -f batch-byte-compile-if-not-done %%f/%%g
229

230
compile-SH:
231 232 233
#	for elc in $(lisp)/*.elc $(lisp)/*/*.elc; do attrib -r $$elc; done
	for el in $(COMPILE_FIRST); do \
	  echo Compiling $$el; \
Eli Zaretskii's avatar
Eli Zaretskii committed
234
	  $(emacs) -l loaddefs $(BYTE_COMPILE_EXTRA_FLAGS) -f batch-byte-compile-if-not-done $$el; \
235 236 237 238 239 240
	done
	for dir in $(lisp) $(WINS); do \
	  for el in $$dir/*.el; do \
	    if test -f $$el; \
	    then \
	      echo Compiling $$el; \
Eli Zaretskii's avatar
Eli Zaretskii committed
241
	      $(emacs) -l loaddefs $(BYTE_COMPILE_EXTRA_FLAGS) -f batch-byte-compile-if-not-done $$el; \
242 243 244 245
	    fi \
	  done; \
	done

Lute Kamstra's avatar
Lute Kamstra committed
246 247 248 249
# Compile all Lisp files.  This is like `compile' but compiles files
# unconditionally.  Some files don't actually get compiled because they
# set the local variable no-byte-compile.

250
compile-always: $(lisp)/subdirs.el compile-always-$(SHELLTYPE) doit
251 252

compile-always-CMD:
253
#	-for %%f in ($(lisp) $(WINS)) do for %%g in (%%f\*.elc) do @attrib -r %%g
Eli Zaretskii's avatar
Eli Zaretskii committed
254 255
	for %%f in ($(COMPILE_FIRST)) do $(emacs) $(BYTE_COMPILE_EXTRA_FLAGS) -f batch-byte-compile %%f
	for %%f in (. $(WINS)) do for %%g in (%%f/*.el) do $(emacs) $(BYTE_COMPILE_EXTRA_FLAGS) -f batch-byte-compile %%f/%%g
Andrew Innes's avatar
Andrew Innes committed
256

257
compile-always-SH:
Andrew Innes's avatar
Andrew Innes committed
258 259 260
#	for elc in $(lisp)/*.elc $(lisp)/*/*.elc; do attrib -r $$elc; done
	for el in $(COMPILE_FIRST); do \
	  echo Compiling $$el; \
Eli Zaretskii's avatar
Eli Zaretskii committed
261
	  $(emacs) $(BYTE_COMPILE_EXTRA_FLAGS) -f batch-byte-compile $$el || exit 1; \
Andrew Innes's avatar
Andrew Innes committed
262 263 264 265
	done
	for dir in $(lisp) $(WINS); do \
	  for el in $$dir/*.el; do \
	    echo Compiling $$el; \
Eli Zaretskii's avatar
Eli Zaretskii committed
266
	    $(emacs) $(BYTE_COMPILE_EXTRA_FLAGS) -f batch-byte-compile $$el || exit 1; \
Andrew Innes's avatar
Andrew Innes committed
267 268 269
	  done; \
	done

270 271 272
compile-calc: compile-calc-$(SHELLTYPE)

compile-calc-CMD:
Eli Zaretskii's avatar
Eli Zaretskii committed
273
	for %%f in ($(lisp)/calc/*.el) do $(emacs) $(BYTE_COMPILE_EXTRA_FLAGS) -f batch-byte-compile %%f
274

275
compile-calc-SH:
276 277
	for el in $(lisp)/calc/*.el; do \
	  echo Compiling $$el; \
Eli Zaretskii's avatar
Eli Zaretskii committed
278
	  $(emacs) $(BYTE_COMPILE_EXTRA_FLAGS) -f batch-byte-compile $$el || exit 1; \
279 280
	done

Andrew Innes's avatar
Andrew Innes committed
281 282 283 284 285 286 287 288 289
# Backup compiled Lisp files in elc.tar.gz.  If that file already
# exists, make a backup of it.

backup-compiled-files:
	-mv $(lisp)/elc.tar.gz $(lisp)/elc.tar.gz~
	-tar czf $(lisp)/elc.tar.gz $(lisp)/*.elc $(lisp)/*/*.elc

# Compile Lisp files, but save old compiled files first.

290
compile-after-backup: backup-compiled-files compile-always
Andrew Innes's avatar
Andrew Innes committed
291 292 293 294

# Recompile all Lisp files which are newer than their .elc files.
# Note that this doesn't create .elc files.  It only recompiles if an
# .elc is present.
295 296 297 298
# WARNING: Do NOT split the part inside $(ARGQUOTE)s into multiple lines as
#          this can break with GNU Make 3.81 and later if sh.exe is used.
recompile: mh-autoloads doit $(lisp)/progmodes/cc-mode.elc
	$(emacs) --eval $(ARGQUOTE)(batch-byte-recompile-directory 0)$(ARGQUOTE) $(lisp)
Andrew Innes's avatar
Andrew Innes committed
299

Eli Zaretskii's avatar
Eli Zaretskii committed
300 301 302 303 304 305 306 307 308
# CC Mode uses a compile time macro system which causes a compile time
# dependency in cc-mode.elc on the macros in cc-langs.el and the
# version string in cc-defs.el.
$(lisp)/progmodes/cc-mode.elc: \
	$(lisp)/progmodes/cc-mode.el \
	$(lisp)/progmodes/cc-langs.el \
	$(lisp)/progmodes/cc-defs.el
	$(emacs) $(BYTE_COMPILE_EXTRA_FLAGS) -f batch-byte-compile $(lisp)/progmodes/cc-mode.el

309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332
$(lisp)/calendar/cal-loaddefs.el:
	"$(EMACS)" $(EMACSOPT) -l autoload \
	   --eval "(setq generate-autoload-cookie \";;;###cal-autoload\")" \
	   --eval "(setq find-file-suppress-same-file-warnings t)" \
	   --eval "(setq make-backup-files nil)" \
	   -f w32-batch-update-autoloads "$(lisp)/calendar/cal-loaddefs.el" \
	      ./calendar

$(lisp)/calendar/diary-loaddefs.el:
	"$(EMACS)" $(EMACSOPT) -l autoload \
	   --eval "(setq generate-autoload-cookie \";;;###diary-autoload\")" \
	   --eval "(setq find-file-suppress-same-file-warnings t)" \
	   --eval "(setq make-backup-files nil)" \
	   -f w32-batch-update-autoloads $(lisp)/calendar/diary-loaddefs.el \
	      ./calendar

$(lisp)/calendar/hol-loaddefs.el:
	"$(EMACS)" $(EMACSOPT) -l autoload \
	   --eval "(setq generate-autoload-cookie \";;;###holiday-autoload\")" \
	   --eval "(setq find-file-suppress-same-file-warnings t)" \
	   --eval "(setq make-backup-files nil)" \
	   -f w32-batch-update-autoloads $(lisp)/calendar/hol-loaddefs.el \
	      ./calendar

333 334 335
# Update MH-E internal autoloads. These are not to be confused with
# the autoloads for the MH-E entry points, which are already in
# loaddefs.el.
336
MH_E_SRC = $(lisp)/mh-e/mh-acros.el $(lisp)/mh-e/mh-alias.el	\
Juanma Barranquero's avatar
Juanma Barranquero committed
337 338 339 340 341 342 343 344 345 346 347 348
	$(lisp)/mh-e/mh-buffers.el $(lisp)/mh-e/mh-compat.el	\
	$(lisp)/mh-e/mh-comp.el $(lisp)/mh-e/mh-e.el		\
	$(lisp)/mh-e/mh-folder.el $(lisp)/mh-e/mh-funcs.el	\
	$(lisp)/mh-e/mh-gnus.el $(lisp)/mh-e/mh-identity.el	\
	$(lisp)/mh-e/mh-inc.el $(lisp)/mh-e/mh-junk.el		\
	$(lisp)/mh-e/mh-letter.el $(lisp)/mh-e/mh-limit.el	\
	$(lisp)/mh-e/mh-mime.el $(lisp)/mh-e/mh-print.el	\
	$(lisp)/mh-e/mh-scan.el $(lisp)/mh-e/mh-search.el	\
	$(lisp)/mh-e/mh-seq.el $(lisp)/mh-e/mh-show.el		\
	$(lisp)/mh-e/mh-speed.el $(lisp)/mh-e/mh-thread.el	\
	$(lisp)/mh-e/mh-tool-bar.el $(lisp)/mh-e/mh-utils.el	\
	$(lisp)/mh-e/mh-xface.el
349

350 351
# See the commentary for autoloads above for why we use ./mh-e below
# instead of $(lisp)/mh-e.
352
mh-autoloads: $(lisp)/mh-e/mh-loaddefs.el
353
$(lisp)/mh-e/mh-loaddefs.el: $(MH_E_SRC)
354
	"$(EMACS)" $(EMACSOPT) \
355
	   -l autoload \
Jason Rumney's avatar
Jason Rumney committed
356 357 358
	   --eval $(ARGQUOTE)(setq generate-autoload-cookie $(DQUOTE);;;###mh-autoload$(DQUOTE))$(ARGQUOTE) \
	   --eval $(ARGQUOTE)(setq find-file-suppress-same-file-warnings t)$(ARGQUOTE) \
	   --eval $(ARGQUOTE)(setq make-backup-files nil)$(ARGQUOTE) \
359
	   -f w32-batch-update-autoloads \
Jason Rumney's avatar
Jason Rumney committed
360
	   $(ARGQUOTE)$(lisp)/mh-e/mh-loaddefs.el$(ARGQUOTE) ./mh-e
361

362 363
# Prepare a bootstrap in the lisp subdirectory.
#
364 365 366 367 368 369 370
# Build loaddefs.el to make sure it's up-to-date.  If it's not, that
# might lead to errors during the bootstrap because something fails to
# autoload as expected.  If there is no emacs binary, then we can't
# build autoloads yet.  In that case we have to use ldefs-boot.el;
# bootstrap should always work with ldefs-boot.el.  (Because
# loaddefs.el is an automatically generated file, we don't want to
# store it in the source repository).
371 372 373
#
# Remove compiled Lisp files so that bootstrap-emacs will be built from
# sources only.
Andrew Innes's avatar
Andrew Innes committed
374 375

# Need separate version for sh and native cmd.exe
376 377
bootstrap-clean:
	- $(DEL) $(lisp)/loaddefs.el
378
	$(MAKE) $(MFLAGS) bootstrap-clean-$(SHELLTYPE)
Andrew Innes's avatar
Andrew Innes committed
379 380

bootstrap-clean-CMD:
381
#	if exist "$(EMACS)" $(MAKE) $(MFLAGS) autoloads
382
	-for %%f in (. $(WINS)) do for %%g in (%%f\*.elc) do @$(DEL) %%g
Andrew Innes's avatar
Andrew Innes committed
383 384

bootstrap-clean-SH:
385
#	if test -f "$(EMACS)"; then $(MAKE) $(MFLAGS) autoloads; fi
386 387
#	-rm -f $(lisp)/*.elc $(lisp)/*/*.elc
	-for dir in . $(WINS); do rm -f $$dir/*.elc; done
Andrew Innes's avatar
Andrew Innes committed
388 389

# Generate/update files for the bootstrap process.
390 391
# When done, remove bootstrap-emacs from ../bin, so that
# it will not be mistaken for an installed binary.
Andrew Innes's avatar
Andrew Innes committed
392

393
bootstrap: update-subdirs autoloads mh-autoloads compile finder-data custom-deps
394
	- $(DEL) "$(EMACS)"
Andrew Innes's avatar
Andrew Innes committed
395 396 397 398 399 400 401 402 403 404 405

#
# Assuming INSTALL_DIR is defined, copy the elisp files to it
# Windows 95 makes this harder than it should be.
#
install:
		- mkdir "$(INSTALL_DIR)/lisp"
		- $(DEL) ../same-dir.tst
		- $(DEL) "$(INSTALL_DIR)/same-dir.tst"
		echo SameDirTest > "$(INSTALL_DIR)/same-dir.tst"
#ifdef COPY_LISP_SOURCE
406
		$(IFNOTSAMEDIR) $(MAKE) $(MFLAGS) install-lisp-$(SHELLTYPE) $(ENDIF)
Andrew Innes's avatar
Andrew Innes committed
407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422
#else
#		$(IFNOTSAMEDIR) $(CP_DIR) *.elc "$(INSTALL_DIR)/lisp" $(ENDIF)
#		$(IFNOTSAMEDIR) $(CP) cus-load.el "$(INSTALL_DIR)/lisp" $(ENDIF)
#		$(IFNOTSAMEDIR) $(CP) forms*.el "$(INSTALL_DIR)/lisp" $(ENDIF)
#		$(IFNOTSAMEDIR) $(CP) patcomp.el "$(INSTALL_DIR)/lisp" $(ENDIF)
#		$(IFNOTSAMEDIR) $(CP) subdirs.el "$(INSTALL_DIR)/lisp" $(ENDIF)
#		$(IFNOTSAMEDIR) $(CP) version.el "$(INSTALL_DIR)/lisp" $(ENDIF)
#		$(IFNOTSAMEDIR) $(CP) mail/blessmail.el "$(INSTALL_DIR)/lisp/mail" $(ENDIF)
#		$(IFNOTSAMEDIR) $(CP) mail/sc.el "$(INSTALL_DIR)/lisp/mail" $(ENDIF)
#		$(IFNOTSAMEDIR) $(CP) play/bruce.el "$(INSTALL_DIR)/lisp/play" $(ENDIF)
#		$(IFNOTSAMEDIR) $(CP) international/latin-*.el "$(INSTALL_DIR)/lisp/international" $(ENDIF)
#		$(IFNOTSAMEDIR) $(CP) international/mule-conf.el "$(INSTALL_DIR)/lisp/international" $(ENDIF)
#endif
		- $(DEL) ../same-dir.tst
		- $(DEL) "$(INSTALL_DIR)/same-dir.tst"

423 424 425 426
# Need to copy *.el files first, to avoid "source file is newer" annoyance
# since cp does not preserve time stamps
install-lisp-SH:
	cp -f *.el "$(INSTALL_DIR)/lisp"
427 428
	for dir in $(WINS); do [ -d "$(INSTALL_DIR)/lisp/$$dir" ] || mkdir "$(INSTALL_DIR)/lisp/$$dir"; done
	for dir in $(WINS); do cp -f $$dir/*.el "$(INSTALL_DIR)/lisp/$$dir"; done
429 430 431 432
	for dir in . $(WINS); do cp $$dir/*.elc "$(INSTALL_DIR)/lisp/$$dir"; done

install-lisp-CMD:
	cp -f *.el "$(INSTALL_DIR)/lisp"
433
	for %%f in ($(WINS)) do if not exist "$(INSTALL_DIR)/lisp/%%f" mkdir "$(INSTALL_DIR)/lisp/%%f"
434 435 436
	for %%f in ($(WINS)) do cp -f %%f/*.el "$(INSTALL_DIR)/lisp/%%f"
	for %%f in (. $(WINS)) do cp -f %%f/*.elc "$(INSTALL_DIR)/lisp/%%f"

Eli Zaretskii's avatar
Eli Zaretskii committed
437 438 439 440 441
# WARNING: Do NOT split the part inside $(ARGQUOTE)s into multiple lines as
#          this can break with GNU Make 3.81 and later if sh.exe is used.
check-declare:
	$(emacs) -l $(lisp)/emacs-lisp/check-declare --eval $(ARGQUOTE)(check-declare-directory $(DQUOTE)$(lisp)$(DQUOTE))$(ARGQUOTE)

Andrew Innes's avatar
Andrew Innes committed
442 443
#
# Maintenance
444
#
Eli Zaretskii's avatar
Eli Zaretskii committed
445 446
# We used to delete *~ here, but that might inadvertently remove
# precious files if it happens to match their short 8+3 aliases.
Andrew Innes's avatar
Andrew Innes committed
447
clean:
Jason Rumney's avatar
Jason Rumney committed
448
	- $(DEL) *.el~
449 450
	- $(DEL) calc/calc-loaddefs.el~
	- $(DEL) eshell/esh-groups.el~
Jason Rumney's avatar
Jason Rumney committed
451

452
distclean: clean
Jason Rumney's avatar
Jason Rumney committed
453 454 455 456
	- $(DEL) $(lisp)/Makefile

maintainer-clean: bootstrap-clean distclean
	- $(DEL) $(AUTOGENEL)