Makefile.in 20.4 KB
Newer Older
1 2
### @configure_input@

Paul Eggert's avatar
Paul Eggert committed
3
# Copyright (C) 2000-2015 Free Software Foundation, Inc.
Gerd Moellmann's avatar
Gerd Moellmann committed
4 5 6

# This file is part of GNU Emacs.

7
# GNU Emacs is free software: you can redistribute it and/or modify
Gerd Moellmann's avatar
Gerd Moellmann committed
8
# it under the terms of the GNU General Public License as published by
9 10
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
Gerd Moellmann's avatar
Gerd Moellmann committed
11 12 13 14 15 16 17

# 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
18
# along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
19

20
SHELL = @SHELL@
21

22 23 24 25
srcdir = @srcdir@
top_srcdir = @top_srcdir@
lisp = $(srcdir)
VPATH = $(srcdir)
Gerd Moellmann's avatar
Gerd Moellmann committed
26

27 28 29 30
# Empty for all systems except MinGW, where xargs needs an explicit
# limitation.
XARGS_LIMIT = @XARGS_LIMIT@

31 32 33
# 'make' verbosity.
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@

34 35 36 37 38
AM_V_ELC = $(am__v_ELC_@AM_V@)
am__v_ELC_ = $(am__v_ELC_@AM_DEFAULT_V@)
am__v_ELC_0 = @echo "  ELC     " $@;
am__v_ELC_1 =

39 40 41 42 43
AM_V_GEN = $(am__v_GEN_@AM_V@)
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
am__v_GEN_0 = @echo "  GEN     " $@;
am__v_GEN_1 =

44 45 46 47 48
AM_V_at = $(am__v_at_@AM_V@)
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
am__v_at_0 = @
am__v_at_1 =

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

52 53 54
# We never change directory before running Emacs, so a relative file
# name is fine, and makes life easier.  If we need to change
# directory, we can use emacs --chdir.
55
EMACS = ../src/emacs${EXEEXT}
56

57
# Command line flags for Emacs.
58

59
EMACSOPT = -batch --no-site-file --no-site-lisp
60

61
# Extra flags to pass to the byte compiler
62
BYTE_COMPILE_EXTRA_FLAGS =
63 64 65 66
# 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.

Glenn Morris's avatar
Glenn Morris committed
67
# Automatically generated autoload files, apart from lisp/loaddefs.el.
Glenn Morris's avatar
Glenn Morris committed
68 69 70
# Note this includes only those files that need special rules to
# build; ie it does not need to include things created via
# generated-autoload-file (eg calc/calc-loaddefs.el).
Glenn Morris's avatar
Glenn Morris committed
71
LOADDEFS = $(lisp)/calendar/cal-loaddefs.el \
Glenn Morris's avatar
Glenn Morris committed
72 73
	$(lisp)/calendar/diary-loaddefs.el \
	$(lisp)/calendar/hol-loaddefs.el \
74 75
	$(lisp)/mh-e/mh-loaddefs.el \
	$(lisp)/net/tramp-loaddefs.el
Glenn Morris's avatar
Glenn Morris committed
76

Kenichi Handa's avatar
Kenichi Handa committed
77 78
# Elisp files auto-generated.
AUTOGENEL = loaddefs.el \
Glenn Morris's avatar
Glenn Morris committed
79
	$(LOADDEFS) \
Kenichi Handa's avatar
Kenichi Handa committed
80 81 82
	cus-load.el \
	finder-inf.el \
	subdirs.el \
83
	emacs-lisp/cl-loaddefs.el \
84
	calc/calc-loaddefs.el \
Glenn Morris's avatar
Glenn Morris committed
85 86 87
	eshell/esh-groups.el \
	cedet/semantic/loaddefs.el \
	cedet/ede/loaddefs.el \
88 89
	cedet/srecode/loaddefs.el \
	org/org-loaddefs.el
Kenichi Handa's avatar
Kenichi Handa committed
90

91 92 93 94
# Value of max-lisp-eval-depth when compiling initially.
# During bootstrapping the byte-compiler is run interpreted when compiling
# itself, and uses more stack than usual.
#
95
BIG_STACK_DEPTH = 2200
96 97
BIG_STACK_OPTS = --eval "(setq max-lisp-eval-depth $(BIG_STACK_DEPTH))"

98
# Set load-prefer-newer for the benefit of the non-bootstrappers.
99 100
BYTE_COMPILE_FLAGS = $(BIG_STACK_OPTS) \
  --eval '(setq load-prefer-newer t)' $(BYTE_COMPILE_EXTRA_FLAGS)
101

102
# Files to compile before others during a bootstrap.  This is done to
Stefan Monnier's avatar
Stefan Monnier committed
103 104 105 106 107
# speed up the bootstrap process.  They're ordered by size, so we use
# the slowest-compiler on the smallest file and move to larger files as the
# compiler gets faster.  `autoload.elc' comes last because it is not used by
# the compiler (so its compilation does not speed up subsequent compilations),
# it's only placed here so as to speed up generation of the loaddefs.el file.
Gerd Moellmann's avatar
Gerd Moellmann committed
108

Gerd Moellmann's avatar
Gerd Moellmann committed
109
COMPILE_FIRST = \
Stefan Monnier's avatar
Stefan Monnier committed
110
	$(lisp)/emacs-lisp/macroexp.elc \
Stefan Monnier's avatar
Stefan Monnier committed
111 112 113
	$(lisp)/emacs-lisp/cconv.elc    \
	$(lisp)/emacs-lisp/byte-opt.elc \
	$(lisp)/emacs-lisp/bytecomp.elc \
114
	$(lisp)/emacs-lisp/autoload.elc
Gerd Moellmann's avatar
Gerd Moellmann committed
115

116 117 118
# Prevent any settings in the user environment causing problems.
unexport EMACSDATA EMACSDOC EMACSPATH

119
# The actual Emacs command run in the targets below.
120 121
# Prevent any setting of EMACSLOADPATH in user environment causing problems.
emacs = EMACSLOADPATH= '$(EMACS)' $(EMACSOPT)
122

123 124 125 126
## Subdirectories, relative to builddir.
SUBDIRS = $(sort $(shell find ${srcdir} -type d -print))
## Subdirectories, relative to srcdir.
SUBDIRS_REL = $(patsubst ${srcdir}%,.%,${SUBDIRS})
127
## All subdirectories except 'obsolete' and 'term'.
128
SUBDIRS_ALMOST = $(filter-out ${srcdir}/obsolete ${srcdir}/term,${SUBDIRS})
129 130 131 132 133
## All subdirectories except 'obsolete', 'term', and 'leim' (and subdirs).
## We don't want the leim files listed as packages, especially
## since many share basenames with files in language/.
SUBDIRS_FINDER = $(filter-out ${srcdir}/leim%,${SUBDIRS_ALMOST})
## All subdirectories in which we might want to create subdirs.el.
134
SUBDIRS_SUBDIRS = $(filter-out ${srcdir}/cedet% ${srcdir}/leim%,${SUBDIRS})
135

Glenn Morris's avatar
Glenn Morris committed
136
# cus-load and finder-inf are not explicitly requested by anything, so
137
# we add them here to make sure they get built.
138
all: compile-main $(lisp)/cus-load.el $(lisp)/finder-inf.el
139

140 141
PHONY_EXTRAS =
.PHONY: all custom-deps finder-data autoloads update-subdirs $(PHONY_EXTRAS)
142

143
# custom-deps and finder-data both used to scan _all_ the *.el files.
Glenn Morris's avatar
Glenn Morris committed
144 145
# This could lead to problems in parallel builds if automatically
# generated *.el files (eg loaddefs etc) were being changed at the same time.
146 147 148
# One solution was to add autoloads as a prerequisite:
# http://lists.gnu.org/archive/html/emacs-pretest-bug/2007-01/msg00469.html
# http://lists.gnu.org/archive/html/bug-gnu-emacs/2007-12/msg00171.html
Glenn Morris's avatar
Glenn Morris committed
149
# However, this meant that running these targets modified loaddefs.el,
150 151 152 153
# every time (due to time-stamping).  Calling these rules from
# bootstrap-after would modify loaddefs after src/emacs, resulting
# in make install remaking src/emacs for no real reason:
# http://lists.gnu.org/archive/html/emacs-devel/2008-02/msg00311.html
Glenn Morris's avatar
Glenn Morris committed
154 155 156
# Nowadays these commands don't scan automatically generated files,
# since they will never contain any useful information
# (see finder-no-scan-regexp and custom-dependencies-no-scan-regexp).
157
custom-deps:
158 159
	$(AM_V_at)$(MAKE) PHONY_EXTRAS=$(lisp)/cus-load.el $(lisp)/cus-load.el
$(lisp)/cus-load.el:
160
	$(AM_V_GEN)$(emacs) -l cus-dep \
Eli Zaretskii's avatar
Eli Zaretskii committed
161
	  --eval '(setq generated-custom-dependencies-file (unmsys--file-name "$(srcdir)/cus-load.el"))' \
162
	  -f custom-make-dependencies ${SUBDIRS_ALMOST}
163

164
finder-data:
165 166 167
	$(AM_V_at)$(MAKE) PHONY_EXTRAS=$(lisp)/finder-inf.el \
	  $(lisp)/finder-inf.el
$(lisp)/finder-inf.el:
168
	$(AM_V_GEN)$(emacs) -l finder \
Eli Zaretskii's avatar
Eli Zaretskii committed
169
	  --eval '(setq generated-finder-keywords-file (unmsys--file-name "$(srcdir)/finder-inf.el"))' \
170
	  -f finder-compile-keywords-make-dist ${SUBDIRS_FINDER}
171

172
# Use expand-file-name rather than $abs_scrdir so that Emacs does not
173
# get confused when it compares file-names for equality.
174 175 176 177
#
# Note that we set no-update-autoloads in _generated_ leim files.
# If you want to allow autoloads in such files, remove that,
# and make this depend on leim.
178 179
autoloads .PHONY: $(lisp)/loaddefs.el
$(lisp)/loaddefs.el: $(LOADDEFS)
Glenn Morris's avatar
Glenn Morris committed
180
	@echo Directories for loaddefs: ${SUBDIRS_ALMOST}
181
	$(AM_V_GEN)$(emacs) -l autoload \
182
	    --eval '(setq autoload-ensure-writable t)' \
183
	    --eval '(setq autoload-builtin-package-versions t)' \
184
	    --eval '(setq generated-autoload-file (expand-file-name (unmsys--file-name "$@")))' \
185
	    -f batch-update-autoloads ${SUBDIRS_ALMOST}
186

187
# This is required by the bootstrap-emacs target in ../src/Makefile, so
188
# we know that if we have an emacs executable, we also have a subdirs.el.
189
$(lisp)/subdirs.el:
190
	$(AM_V_GEN)$(MAKE) update-subdirs
191
update-subdirs:
192
	$(AM_V_at)for file in ${SUBDIRS_SUBDIRS}; do \
193
	   $(srcdir)/../build-aux/update-subdirs $$file; \
194 195
	done;

196
.PHONY: updates repo-update update-authors
197

198
# Some modes of make-dist use this.
199
updates: update-subdirs autoloads finder-data custom-deps
Per Abrahamsen's avatar
Per Abrahamsen committed
200

201 202 203 204 205 206
# This is useful after updating from the repository; but it doesn't do
# anything that a plain "make" at top-level doesn't.  The only
# difference between this and this directory's "all" rule is that this
# runs "autoloads" as well (because it uses "compile" rather than
# "compile-main").  In a bootstrap, $(lisp) in src/Makefile triggers
# this directory's autoloads rule.
207
repo-update: compile finder-data custom-deps
208

209 210 211
# Update the AUTHORS file.

update-authors:
212 213
	$(emacs) -L "$(top_srcdir)/admin" -l authors \
	  -f batch-update-authors "$(top_srcdir)/etc/AUTHORS" "$(top_srcdir)"
214

215 216 217

ETAGS = ../lib-src/etags

218 219 220 221
lisptagsfiles1 = $(srcdir)/*.el
lisptagsfiles2 = $(srcdir)/*/*.el
lisptagsfiles3 = $(srcdir)/*/*/*.el
lisptagsfiles4 = $(srcdir)/*/*/*/*.el
222

223 224 225 226 227
## The echo | sed | xargs is to stop the command line getting too long
## on MS Windows, when the MSYS Bash passes it to a MinGW compiled
## etags.  It might be better to use find in a similar way to
## compile-main.  But maybe this is not even necessary any more now
## that this uses relative filenames.
228
TAGS: $(lisptagsfiles1) $(lisptagsfiles2) $(lisptagsfiles3) $(lisptagsfiles4)
229 230 231
	rm -f $@
	touch $@
	echo $(lisptagsfiles1) $(lisptagsfiles2) $(lisptagsfiles3) $(lisptagsfiles4) | \
232 233 234
	  sed -e 's,$(srcdir)/[^ ]*loaddefs[^ ]*,,g' \
	    -e 's,$(srcdir)/ldefs-boot[^ ]*,,' \
	    -e 's,$(srcdir)/[^ ]*esh-groups.el[^ ]*,,' | \
235 236
	    xargs $(XARGS_LIMIT) "$(ETAGS)" -a -o $@

237

238 239 240 241 242 243 244 245 246
# The src/Makefile.in has its own set of dependencies and when they decide
# that one Lisp file needs to be re-compiled, we had better recompile it as
# well, otherwise every subsequent make will again call us, until we finally
# end up deciding that yes, the file deserves recompilation.
# One option is to try and reproduce exactly the same dependencies here as
# we have in src/Makefile.in, but it turns out to be painful
# (e.g. src/Makefile.in may have a dependency for ../lisp/foo.elc where we
# only know of $(lisp)/foo.elc).  So instead we provide a direct way for
# src/Makefile.in to rebuild a particular Lisp file, no questions asked.
247 248
# Use byte-compile-refresh-preloaded to try and work around some of
# the most common problems of not bootstrapping from a clean state.
Paul Eggert's avatar
Paul Eggert committed
249 250 251
THEFILE = no-such-file
.PHONY: $(THEFILE)c
$(THEFILE)c:
252
	$(AM_V_ELC)$(emacs) $(BYTE_COMPILE_FLAGS) \
253
		-l bytecomp -f byte-compile-refresh-preloaded \
254
		-f batch-byte-compile $(THEFILE)
255

256 257
# Files MUST be compiled one by one. If we compile several files in a
# row (i.e., in the same instance of Emacs) we can't make sure that
Lute Kamstra's avatar
Lute Kamstra committed
258 259 260 261
# 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.
Stefan Monnier's avatar
Stefan Monnier committed
262

263 264 265 266 267
.SUFFIXES: .elc .el

# An old-fashioned suffix rule, which, according to the GNU Make manual,
# cannot have prerequisites.
.el.elc:
268
	$(AM_V_ELC)$(emacs) $(BYTE_COMPILE_FLAGS) -f batch-byte-compile $<
269

270
.PHONY: compile-first compile-main compile compile-always
271

272
compile-first: $(COMPILE_FIRST)
Richard M. Stallman's avatar
Richard M. Stallman committed
273

274
# In `compile-main' we could directly do
275
#    ... | xargs $(MAKE)
276
# and it works, but it generates a lot of messages like
277
#    make[2]: gnus/gnus-mlspl.elc is up to date.
278 279 280 281 282 283 284 285 286 287 288 289
# so instead, we use "xargs echo" to split the list of file into manageable
# chunks and then use an intermediate `compile-targets' target so the
# actual targets (the .elc files) are not mentioned as targets on the
# make command line.


.PHONY: compile-targets
# TARGETS is set dynamically in the recursive call from `compile-main'.
compile-targets: $(TARGETS)

# Compile all the Elisp files that need it.  Beware: it approximates
# `no-byte-compile', so watch out for false-positives!
290
compile-main: leim semantic compile-clean
291 292
	@(cd $(lisp) && \
	els=`echo "${SUBDIRS_REL} " | sed -e 's|/\./|/|g' -e 's|/\. | |g' -e 's| |/*.el |g'`; \
293 294 295 296
	for el in $$els; do \
	  test -f $$el || continue; \
	  test ! -f $${el}c && GREP_OPTIONS= grep '^;.*no-byte-compile: t' $$el > /dev/null && continue; \
	  echo "$${el}c"; \
297
	done | xargs $(XARGS_LIMIT) echo) | \
298
	while read chunk; do \
299
	  $(MAKE) compile-targets TARGETS="$$chunk"; \
300
	done
301

302 303 304
.PHONY: compile-clean
# Erase left-over .elc files that do not have a corresponding .el file.
compile-clean:
305 306
	@cd $(lisp) && \
	elcs=`echo "${SUBDIRS_REL} " | sed -e 's|/\./|/|g' -e 's|/\. | |g' -e 's| |/*.elc |g'`; \
307
	for el in `echo $$elcs | sed -e 's/\.elc/\.el/g'`; do \
308
	  if test -f "$$el" || test ! -f "$${el}c"; then :; else \
309 310 311 312 313
	    echo rm "$${el}c"; \
	    rm "$${el}c"; \
	  fi \
	done

314
.PHONY: leim semantic
315
leim:
316
	$(MAKE) -C ../leim all EMACS="$(EMACS)"
317

318
semantic:
319
	$(MAKE) -C ../admin/grammars all EMACS="$(EMACS:.%=../.%)"
320

321 322 323 324
# Compile all Lisp files, but don't recompile those that are up to
# date.  Some .el files don't get compiled because they set the
# local variable no-byte-compile.
# Calling make recursively because suffix rule cannot have prerequisites.
325
compile: $(LOADDEFS) autoloads compile-first
326
	$(MAKE) compile-main
327

Lute Kamstra's avatar
Lute Kamstra committed
328 329 330
# 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.
331
compile-always:
Glenn Morris's avatar
Glenn Morris committed
332
	cd $(lisp) && rm -f *.elc */*.elc */*/*.elc */*/*/*.elc
333
	$(MAKE) compile
Lute Kamstra's avatar
Lute Kamstra committed
334

Glenn Morris's avatar
Glenn Morris committed
335
.PHONY: backup-compiled-files compile-after-backup
336

337 338 339 340
# Backup compiled Lisp files in elc.tar.gz.  If that file already
# exists, make a backup of it.

backup-compiled-files:
Gerd Moellmann's avatar
Gerd Moellmann committed
341
	-mv $(lisp)/elc.tar.gz $(lisp)/elc.tar.gz~
Glenn Morris's avatar
Glenn Morris committed
342
	-tar czf $(lisp)/elc.tar.gz $(lisp)/*.elc $(lisp)/*/*.elc $(lisp)/*/*/*.elc $(lisp)/*/*/*/*.elc
343 344 345

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

Richard M. Stallman's avatar
Richard M. Stallman committed
346
compile-after-backup: backup-compiled-files compile-always
347

348 349 350 351 352 353 354
# This does the same job as the "compile" rule, but in a different way.
# Rather than spawning a separate Emacs instance to compile each file,
# it uses the same Emacs instance to compile everything.
# This is faster on a single core, since it avoids the overhead of
# starting Emacs many times (it was 33% faster on a test with a
# random 10% of the .el files needing recompilation).
# Unlike compile, this is not parallelizable; so if you have more than
Glenn Morris's avatar
Glenn Morris committed
355
# one core and use make -j#, compile will be (much) faster.
356 357 358 359 360 361 362
# This rule also produces less accurate compilation warnings.
# The environment of later files is affected by definitions in
# earlier ones, so it does not produce some warnings that it should.
# It can also produces spurious warnings about "invalid byte code" if
# files that use byte-compile-dynamic are updated.
# There is no reason to use this rule unless you only have a single
# core and CPU time is an issue.
363
.PHONY: compile-one-process
364
compile-one-process: $(LOADDEFS) compile-first
365 366
	$(emacs) $(BYTE_COMPILE_FLAGS) \
	    --eval "(batch-byte-recompile-directory 0)" $(lisp)
367

368
# Update MH-E internal autoloads. These are not to be confused with
Glenn Morris's avatar
Glenn Morris committed
369
# the autoloads for the MH-E entry points, which are already in loaddefs.el.
Glenn Morris's avatar
Glenn Morris committed
370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385
MH_E_DIR = $(lisp)/mh-e
## MH_E_SRC avoids a circular dependency warning for mh-loaddefs.el.
MH_E_SRC = $(MH_E_DIR)/mh-acros.el $(MH_E_DIR)/mh-alias.el    \
	$(MH_E_DIR)/mh-buffers.el  $(MH_E_DIR)/mh-compat.el   \
	$(MH_E_DIR)/mh-comp.el     $(MH_E_DIR)/mh-e.el        \
	$(MH_E_DIR)/mh-folder.el   $(MH_E_DIR)/mh-funcs.el    \
	$(MH_E_DIR)/mh-gnus.el     $(MH_E_DIR)/mh-identity.el \
	$(MH_E_DIR)/mh-inc.el      $(MH_E_DIR)/mh-junk.el     \
	$(MH_E_DIR)/mh-letter.el   $(MH_E_DIR)/mh-limit.el    \
	$(MH_E_DIR)/mh-mime.el     $(MH_E_DIR)/mh-print.el    \
	$(MH_E_DIR)/mh-scan.el     $(MH_E_DIR)/mh-search.el   \
	$(MH_E_DIR)/mh-seq.el      $(MH_E_DIR)/mh-show.el     \
	$(MH_E_DIR)/mh-speed.el    $(MH_E_DIR)/mh-thread.el   \
	$(MH_E_DIR)/mh-tool-bar.el $(MH_E_DIR)/mh-utils.el    \
	$(MH_E_DIR)/mh-xface.el

386
.PHONY: mh-autoloads
Glenn Morris's avatar
Glenn Morris committed
387
mh-autoloads: $(MH_E_DIR)/mh-loaddefs.el
388
$(MH_E_DIR)/mh-loaddefs.el: $(MH_E_SRC)
Paul Eggert's avatar
Paul Eggert committed
389
	$(AM_V_GEN)$(emacs) -l autoload \
390
	   --eval "(setq generate-autoload-cookie \";;;###mh-autoload\")" \
391
	   --eval "(setq generated-autoload-file (expand-file-name (unmsys--file-name \"$@\")))" \
Glenn Morris's avatar
Glenn Morris committed
392 393
	   -f batch-update-autoloads $(MH_E_DIR)

394
# Update TRAMP internal autoloads. Maybe we could move tramp*.el into
395 396 397
# an own subdirectory. OTOH, it does not hurt to keep them in
# lisp/net.
TRAMP_DIR = $(lisp)/net
Michael Albinus's avatar
Michael Albinus committed
398 399 400 401 402 403
TRAMP_SRC = $(TRAMP_DIR)/tramp.el    $(TRAMP_DIR)/tramp-adb.el	\
	$(TRAMP_DIR)/tramp-cache.el  $(TRAMP_DIR)/tramp-cmds.el	\
	$(TRAMP_DIR)/tramp-compat.el $(TRAMP_DIR)/tramp-ftp.el	\
	$(TRAMP_DIR)/tramp-gvfs.el   $(TRAMP_DIR)/tramp-gw.el	\
	$(TRAMP_DIR)/tramp-sh.el     $(TRAMP_DIR)/tramp-smb.el	\
	$(TRAMP_DIR)/tramp-uu.el     $(TRAMP_DIR)/trampver.el
404 405

$(TRAMP_DIR)/tramp-loaddefs.el: $(TRAMP_SRC)
Paul Eggert's avatar
Paul Eggert committed
406
	$(AM_V_GEN)$(emacs) -l autoload \
407
	   --eval "(setq generate-autoload-cookie \";;;###tramp-autoload\")" \
408
	   --eval "(setq generated-autoload-file (expand-file-name (unmsys--file-name \"$@\")))" \
409 410
	   -f batch-update-autoloads $(TRAMP_DIR)

Glenn Morris's avatar
Glenn Morris committed
411 412 413 414 415 416 417 418 419 420 421 422 423 424 425
CAL_DIR = $(lisp)/calendar
## Those files that may contain internal calendar autoload cookies.
## Avoids circular dependency warning for *-loaddefs.el.
CAL_SRC = $(CAL_DIR)/cal-bahai.el $(CAL_DIR)/cal-china.el  \
	$(CAL_DIR)/cal-coptic.el  $(CAL_DIR)/cal-dst.el    \
	$(CAL_DIR)/cal-french.el  $(CAL_DIR)/cal-hebrew.el \
	$(CAL_DIR)/cal-html.el    $(CAL_DIR)/cal-islam.el  \
	$(CAL_DIR)/cal-iso.el     $(CAL_DIR)/cal-julian.el \
	$(CAL_DIR)/cal-mayan.el   $(CAL_DIR)/cal-menu.el   \
	$(CAL_DIR)/cal-move.el    $(CAL_DIR)/cal-persia.el \
	$(CAL_DIR)/cal-tex.el     $(CAL_DIR)/cal-x.el      \
	$(CAL_DIR)/calendar.el    $(CAL_DIR)/diary-lib.el  \
	$(CAL_DIR)/holidays.el    $(CAL_DIR)/lunar.el      \
	$(CAL_DIR)/solar.el

426
$(CAL_DIR)/cal-loaddefs.el: $(CAL_SRC)
Paul Eggert's avatar
Paul Eggert committed
427
	$(AM_V_GEN)$(emacs) -l autoload \
Glenn Morris's avatar
Glenn Morris committed
428
	   --eval "(setq generate-autoload-cookie \";;;###cal-autoload\")" \
429
	   --eval "(setq generated-autoload-file (expand-file-name (unmsys--file-name \"$@\")))" \
Glenn Morris's avatar
Glenn Morris committed
430
	   -f batch-update-autoloads $(CAL_DIR)
Glenn Morris's avatar
Glenn Morris committed
431

432
$(CAL_DIR)/diary-loaddefs.el: $(CAL_SRC) $(CAL_DIR)/cal-loaddefs.el
Paul Eggert's avatar
Paul Eggert committed
433
	$(AM_V_GEN)$(emacs) -l autoload \
Glenn Morris's avatar
Glenn Morris committed
434
	   --eval "(setq generate-autoload-cookie \";;;###diary-autoload\")" \
435
	   --eval "(setq generated-autoload-file (expand-file-name (unmsys--file-name \"$@\")))" \
Glenn Morris's avatar
Glenn Morris committed
436
	   -f batch-update-autoloads $(CAL_DIR)
Glenn Morris's avatar
Glenn Morris committed
437

438
$(CAL_DIR)/hol-loaddefs.el: $(CAL_SRC) $(CAL_DIR)/diary-loaddefs.el
Paul Eggert's avatar
Paul Eggert committed
439
	$(AM_V_GEN)$(emacs) -l autoload \
Glenn Morris's avatar
Glenn Morris committed
440
	   --eval "(setq generate-autoload-cookie \";;;###holiday-autoload\")" \
441
	   --eval "(setq generated-autoload-file (expand-file-name (unmsys--file-name \"$@\")))" \
Glenn Morris's avatar
Glenn Morris committed
442
	   -f batch-update-autoloads $(CAL_DIR)
Glenn Morris's avatar
Glenn Morris committed
443

444 445
.PHONY: bootstrap-clean distclean maintainer-clean

446
bootstrap-clean:
Glenn Morris's avatar
Glenn Morris committed
447
	-cd $(lisp) && rm -f *.elc */*.elc */*/*.elc */*/*/*.elc $(AUTOGENEL)
448

449
distclean:
450
	-rm -f ./Makefile $(lisp)/loaddefs.el~
451 452

maintainer-clean: distclean bootstrap-clean
453
	rm -f TAGS
Gerd Moellmann's avatar
Gerd Moellmann committed
454

Glenn Morris's avatar
Glenn Morris committed
455 456 457
.PHONY: check-declare

check-declare:
458
	$(emacs) -l check-declare --eval '(check-declare-directory "$(lisp)")'
Glenn Morris's avatar
Glenn Morris committed
459

460
## This finds a lot of duplicates between foo.el and obsolete/foo.el.
461 462
check-defun-dups:
	sed -n -e '/^(defun /s/\(.\)(.*/\1/p' \
463 464
	  $$(find . -name '*.el' -print | \
	  grep -Ev '(loaddefs|ldefs-boot)\.el') | sort | uniq -d
465

466 467
# Dependencies

468 469 470 471 472 473 474
## None of the following matters for bootstrap, which is the only way
## to ensure a correct compilation of all lisp files.
## Manually specifying dependencies of a handful of lisp files, (and
## ones that don't change very often at that) seems pretty pointless
## to me.

# http://debbugs.gnu.org/1004
475 476 477
# CC Mode uses a compile time macro system which causes a compile time
# dependency in cc-*.elc files on the macros in other cc-*.el and the
# version string in cc-defs.el.
478
$(lisp)/progmodes/cc-align.elc\
479 480 481 482
 $(lisp)/progmodes/cc-cmds.elc $(lisp)/progmodes/cc-compat.elc\
 $(lisp)/progmodes/cc-engine.elc $(lisp)/progmodes/cc-fonts.elc\
 $(lisp)/progmodes/cc-langs.elc $(lisp)/progmodes/cc-menus.elc\
 $(lisp)/progmodes/cc-mode.elc $(lisp)/progmodes/cc-styles.elc\
483
 $(lisp)/progmodes/cc-vars.elc: \
484 485
   $(lisp)/progmodes/cc-bytecomp.elc $(lisp)/progmodes/cc-defs.elc

486
$(lisp)/progmodes/cc-align.elc $(lisp)/progmodes/cc-cmds.elc: \
487 488 489 490 491 492
   $(lisp)/progmodes/cc-vars.elc $(lisp)/progmodes/cc-engine.elc

$(lisp)/progmodes/cc-compat.elc: \
   $(lisp)/progmodes/cc-vars.elc $(lisp)/progmodes/cc-styles.elc \
   $(lisp)/progmodes/cc-engine.elc

493
$(lisp)/progmodes/cc-defs.elc: $(lisp)/progmodes/cc-bytecomp.elc
494 495 496 497 498

$(lisp)/progmodes/cc-engine.elc: $(lisp)/progmodes/cc-langs.elc \
   $(lisp)/progmodes/cc-vars.elc

$(lisp)/progmodes/cc-fonts.elc: $(lisp)/progmodes/cc-langs.elc \
499
   $(lisp)/progmodes/cc-vars.elc $(lisp)/progmodes/cc-engine.elc
500

501
$(lisp)/progmodes/cc-langs.elc: $(lisp)/progmodes/cc-vars.elc
502 503 504 505 506 507 508 509 510

$(lisp)/progmodes/cc-mode.elc: $(lisp)/progmodes/cc-langs.elc \
   $(lisp)/progmodes/cc-vars.elc $(lisp)/progmodes/cc-engine.elc \
   $(lisp)/progmodes/cc-styles.elc $(lisp)/progmodes/cc-cmds.elc \
   $(lisp)/progmodes/cc-align.elc $(lisp)/progmodes/cc-menus.elc

$(lisp)/progmodes/cc-styles.elc: $(lisp)/progmodes/cc-vars.elc \
   $(lisp)/progmodes/cc-align.elc

511
# Makefile ends here.