(ad-special-forms): Correct the conditional inclusion of `track-mouse'.
[bpt/emacs.git] / lisp / Makefile.in
CommitLineData
c7685c8d
PA
1#
2# Maintenance productions for the Lisp directory
3#
7ec641b8 4
261f3289
EZ
5SHELL = /bin/sh
6
dce6b995
GM
7lisp=@srcdir@
8VPATH=@srcdir@
0df68e9f 9srcdir=@srcdir@/..
dce6b995 10
7ec641b8
GM
11# You can specify a different executable on the make command line,
12# e.g. "make EMACS=../src/emacs ...".
13
e3384ae7 14EMACS = ../src/emacs
7ec641b8
GM
15
16# Command line flags for Emacs. This must include --multibyte,
17# otherwise some files will not compile.
18
1499d2dd 19EMACSOPT = -batch --no-site-file --multibyte
7ec641b8 20
c7685c8d 21SOURCES = *.el COPYING Makefile
dce6b995
GM
22lisptagsfiles1 = $(lisp)/[a-zA-Z]*.el
23lisptagsfiles2 = $(lisp)/[a-zA-Z]*/[a-zA-Z]*.el
3975988b 24ETAGS = ../lib-src/etags
c7685c8d 25
da7d597f
GM
26# Files which should not be compiled. If you change the name `DONTCOMPILE'
27# to something different, you'll have to change make-dist as well.
28#
cc953d27
SM
29# - emacs-lisp/cl-specs.el: only contains `def-edebug-spec's so there's
30# no point compiling it, although it doesn't hurt.
a9b67cf4 31
dce6b995 32DONTCOMPILE = \
dce6b995
GM
33 $(lisp)/cus-load.el \
34 $(lisp)/cus-start.el \
35 $(lisp)/emacs-lisp/cl-specs.el \
c47e9302 36 $(lisp)/eshell/esh-maint.el \
39efdf3f 37 $(lisp)/eshell/esh-groups.el \
dce6b995
GM
38 $(lisp)/finder-inf.el \
39 $(lisp)/forms-d2.el \
40 $(lisp)/forms-pass.el \
41 $(lisp)/generic-x.el \
42 $(lisp)/international/latin-1.el \
43 $(lisp)/international/latin-2.el \
44 $(lisp)/international/latin-3.el \
45 $(lisp)/international/latin-4.el \
46 $(lisp)/international/latin-5.el \
47 $(lisp)/international/latin-8.el \
48 $(lisp)/international/latin-9.el \
49 $(lisp)/international/mule-conf.el \
50 $(lisp)/loaddefs.el \
51 $(lisp)/loadup.el \
52 $(lisp)/mail/blessmail.el \
53 $(lisp)/mail/sc.el \
54 $(lisp)/patcomp.el \
55 $(lisp)/paths.el \
56 $(lisp)/play/bruce.el \
57 $(lisp)/subdirs.el \
58 $(lisp)/term/internal.el \
59 $(lisp)/version.el
7ec641b8 60
d849789b
GM
61# Files to compile before others during a bootstrap. This is done
62# to speed up the bootstrap process.
63
dce6b995
GM
64COMPILE_FIRST = \
65 $(lisp)/emacs-lisp/byte-opt.el \
66 $(lisp)/emacs-lisp/bytecomp.el \
67 $(lisp)/subr.el
d849789b 68
7ec641b8
GM
69# The actual Emacs command run in the targets below.
70
7f25090d 71emacs = EMACSLOADPATH=$(lisp) $(EMACS) $(EMACSOPT)
7ec641b8 72
80c382e5 73# Common command to find subdirectories
7ec641b8 74
3f4c23f9 75setwins=subdirs=`find $$wd -type d -print`; \
f83a4f35 76 for file in $$subdirs; do \
80c382e5 77 case $$file in */Old | */RCS | */CVS | */CVS/* | */=* ) ;; \
f83a4f35
RS
78 *) wins="$$wins $$file" ;; \
79 esac; \
80c382e5
SM
80 done
81
82doit:
83
cc953d27
SM
84cus-load.el:
85 touch $@
86custom-deps: cus-load.el doit
dce6b995 87 wd=$(lisp); $(setwins); \
4746aeeb 88 echo Directories: $$wins; \
49ac2ac5 89 $(EMACS) $(EMACSOPT) -l cus-dep -f custom-make-dependencies $$wins
009368b9 90
cc953d27
SM
91finder-inf.el:
92 echo "(provide 'finder-inf)" >> $@
93finder-data: finder-inf.el doit
dce6b995 94 wd=$(lisp); $(setwins); \
4746aeeb 95 echo Directories: $$wins; \
49ac2ac5 96 $(EMACS) $(EMACSOPT) -l finder -f finder-compile-keywords-make-dist $$wins
009368b9 97
cc953d27
SM
98loaddefs.el:
99 echo ";;; loaddefs.el --- automatically extracted autoloads" >> $@
100 echo ";;" >> $@; echo ";;; Code:" >> $@
101 echo "\f" >> $@
102 echo ";;; Local Variables:" >> $@
103 echo ";;; version-control: never" >> $@
104 echo ";;; no-byte-compile: t" >> $@
105 echo ";;; no-update-autoloads: t" >> $@
106 echo ";;; End:" >> $@
107 echo ";;; loaddefs.el ends here" >> $@
108autoloads: loaddefs.el doit
dce6b995 109 wd=$(lisp); $(setwins); \
4746aeeb 110 echo Directories: $$wins; \
49ac2ac5 111 $(EMACS) $(EMACSOPT) -l autoload --eval '(setq generated-autoload-file "$(lisp)/loaddefs.el")' -f batch-update-autoloads $$wins
f83a4f35 112
cc953d27
SM
113subdirs.el:
114 $(MAKE) $(MFLAGS) update-subdirs
98b918b6 115update-subdirs: doit
dce6b995 116 wd=$(lisp); $(setwins); \
98b918b6 117 for file in $$wins; do \
dce6b995 118 $(srcdir)/update-subdirs $$file; \
98b918b6
RS
119 done;
120
cc953d27 121updates: update-subdirs autoloads finder-data custom-deps
c48c3772 122
fbb43902
GM
123# Update the AUTHORS file.
124
125update-authors:
7f25090d 126 $(emacs) -f batch-update-authors $(srcdir)/AUTHORS $(srcdir)
fbb43902 127
7ab2c289
RS
128TAGS: $(lisptagsfiles1) $(lisptagsfiles2)
129 ${ETAGS} $(lisptagsfiles1) $(lisptagsfiles2)
130
4136efcb
GM
131TAGS-LISP: $(lisptagsfiles1) $(lisptagsfiles2)
132 ${ETAGS} -o TAGS-LISP $(lisptagsfiles1) $(lisptagsfiles2)
7ec641b8 133
cc953d27 134.el.elc: subdirs.el
7f25090d 135 -$(emacs) -f batch-byte-compile $<
cc953d27
SM
136
137$(DONTCOMPILE:.el=.elc):
138 -rm -f $@
139
7ec641b8
GM
140# Compile all Lisp files, except those from DONTCOMPILE. This
141# compiles files unconditionally. All .elc files are made writable
142# before compilation in case we checked out read-only (CVS option -r).
8256e31b
GM
143# Files MUST be compiled one by one. If we compile several files in a
144# row we can't make sure that the compilation environment is clean.
145# We also set the load-path of the Emacs used for compilation to the
146# current directory and its subdirectories, to make sure require's and
147# load's in the files being compiled find the right files.
7ec641b8 148
a9b67cf4 149compile-files: subdirs.el doit
dce6b995
GM
150 find $(lisp) -name "*.elc" -print | xargs chmod +w; \
151 wd=$(lisp); $(setwins); \
152 elpat=`echo $$wins | tr ' ' '\012\012' | \
cc953d27 153 sed -e 's|\(.\)$$|\1/|' -e 's|^\./||' -e 's|$$|*.el|'`; \
d849789b
GM
154 els=`echo $$elpat $(DONTCOMPILE) $(COMPILE_FIRST) | \
155 tr ' ' '\012\012' | sort | uniq -u`; \
156 for el in $(COMPILE_FIRST) $$els; do \
8256e31b 157 echo Compiling $$el; \
7f25090d 158 $(emacs) -f batch-byte-compile $$el || exit 1; \
8256e31b 159 done
96ff0f09 160
a9b67cf4
GM
161# Backup compiled Lisp files in elc.tar.gz. If that file already
162# exists, make a backup of it.
163
164backup-compiled-files:
dce6b995
GM
165 -mv $(lisp)/elc.tar.gz $(lisp)/elc.tar.gz~
166 -tar czf $(lisp)/elc.tar.gz $(lisp)/*.elc $(lisp)/*/*.elc
a9b67cf4
GM
167
168# Compile Lisp files, but save old compiled files first.
169
170compile: backup-compiled-files compile-files
171
7ec641b8
GM
172# Recompile all Lisp files which are newer than their .elc files.
173# Note that this doesn't create .elc files. It only recompiles if an
174# .elc is present.
175
176recompile: doit
49ac2ac5 177 $(EMACS) $(EMACSOPT) -f batch-byte-recompile-directory $(lisp)
7ec641b8 178
03adf1ee
GM
179# Prepare a bootstrap in the lisp subdirectory. Build loaddefs.el,
180# because it's not sure it's up-to-date, and if it's not, that might
181# lead to errors during the bootstrap because something fails to
182# autoload as expected. Remove compiled Lisp files so that
183# bootstrap-emacs will be built from sources only.
a9b67cf4
GM
184
185bootstrap-clean:
dce6b995
GM
186 if test -f $(EMACS); then $(MAKE) $(MFLAGS) autoloads; fi
187 -rm -f $(lisp)/*.elc $(lisp)/*/*.elc
a9b67cf4
GM
188
189# Generate/update files for the bootstrap process.
190
1499d2dd 191bootstrap: autoloads compile-files custom-deps
a9b67cf4 192
43280888
GM
193distclean:
194 -rm -f $(lisp)/Makefile
195
7ec641b8 196# Makefile ends here.