(x_update_menu_appearance): Don't call
[bpt/emacs.git] / lisp / Makefile.in
CommitLineData
c7685c8d 1# Maintenance productions for the Lisp directory
b3ae7a0a
GM
2# Copyright (C) 2000, 2001 Free Software Foundation, Inc.
3
4# This file is part of GNU Emacs.
5
6# GNU Emacs is free software; you can redistribute it and/or modify
7# it under the terms of the GNU General Public License as published by
8# the Free Software Foundation; either version 2, or (at your option)
9# any later version.
10
11# GNU Emacs is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14# GNU General Public License for more details.
15
16# You should have received a copy of the GNU General Public License
17# along with GNU Emacs; see the file COPYING. If not, write to
18# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19# Boston, MA 02111-1307, USA.
7ec641b8 20
261f3289
EZ
21SHELL = /bin/sh
22
dce6b995
GM
23lisp=@srcdir@
24VPATH=@srcdir@
0df68e9f 25srcdir=@srcdir@/..
dce6b995 26
7ec641b8
GM
27# You can specify a different executable on the make command line,
28# e.g. "make EMACS=../src/emacs ...".
29
e3384ae7 30EMACS = ../src/emacs
7ec641b8
GM
31
32# Command line flags for Emacs. This must include --multibyte,
33# otherwise some files will not compile.
34
1499d2dd 35EMACSOPT = -batch --no-site-file --multibyte
7ec641b8 36
c7685c8d 37SOURCES = *.el COPYING Makefile
dce6b995
GM
38lisptagsfiles1 = $(lisp)/[a-zA-Z]*.el
39lisptagsfiles2 = $(lisp)/[a-zA-Z]*/[a-zA-Z]*.el
3975988b 40ETAGS = ../lib-src/etags
c7685c8d 41
da7d597f
GM
42# Files which should not be compiled. If you change the name `DONTCOMPILE'
43# to something different, you'll have to change make-dist as well.
44#
cc953d27
SM
45# - emacs-lisp/cl-specs.el: only contains `def-edebug-spec's so there's
46# no point compiling it, although it doesn't hurt.
a9b67cf4 47
dce6b995 48DONTCOMPILE = \
dce6b995
GM
49 $(lisp)/cus-load.el \
50 $(lisp)/cus-start.el \
51 $(lisp)/emacs-lisp/cl-specs.el \
c47e9302 52 $(lisp)/eshell/esh-maint.el \
39efdf3f 53 $(lisp)/eshell/esh-groups.el \
dce6b995
GM
54 $(lisp)/finder-inf.el \
55 $(lisp)/forms-d2.el \
56 $(lisp)/forms-pass.el \
57 $(lisp)/generic-x.el \
58 $(lisp)/international/latin-1.el \
59 $(lisp)/international/latin-2.el \
60 $(lisp)/international/latin-3.el \
61 $(lisp)/international/latin-4.el \
62 $(lisp)/international/latin-5.el \
63 $(lisp)/international/latin-8.el \
64 $(lisp)/international/latin-9.el \
65 $(lisp)/international/mule-conf.el \
66 $(lisp)/loaddefs.el \
67 $(lisp)/loadup.el \
68 $(lisp)/mail/blessmail.el \
69 $(lisp)/mail/sc.el \
70 $(lisp)/patcomp.el \
71 $(lisp)/paths.el \
72 $(lisp)/play/bruce.el \
73 $(lisp)/subdirs.el \
74 $(lisp)/term/internal.el \
6c317bd2
GM
75 $(lisp)/term/AT386.el \
76 $(lisp)/term/apollo.el \
77 $(lisp)/term/bobcat.el \
78 $(lisp)/term/iris-ansi.el \
79 $(lisp)/term/keyswap.el \
80 $(lisp)/term/linux.el \
81 $(lisp)/term/lk201.el \
82 $(lisp)/term/news.el \
83 $(lisp)/term/vt102.el \
84 $(lisp)/term/vt125.el \
85 $(lisp)/term/vt200.el \
86 $(lisp)/term/vt201.el \
87 $(lisp)/term/vt220.el \
88 $(lisp)/term/vt240.el \
89 $(lisp)/term/vt300.el \
90 $(lisp)/term/vt320.el \
91 $(lisp)/term/vt400.el \
92 $(lisp)/term/vt420.el \
93 $(lisp)/term/wyse50.el \
94 $(lisp)/term/xterm.el \
dce6b995 95 $(lisp)/version.el
7ec641b8 96
170a9e70
GM
97# Files to compile before others during a bootstrap. This is done to
98# speed up the bootstrap process. The CC files are compiled first
99# because CC mode tweaks the compilation process, and requiring
100# cc-mode when it is not compiled doesn't work during the
101# bootstrapping.
d849789b 102
dce6b995
GM
103COMPILE_FIRST = \
104 $(lisp)/emacs-lisp/byte-opt.el \
105 $(lisp)/emacs-lisp/bytecomp.el \
170a9e70
GM
106 $(lisp)/subr.el \
107 $(lisp)/progmodes/cc-mode.el \
108 $(lisp)/progmodes/cc-vars.el
d849789b 109
7ec641b8
GM
110# The actual Emacs command run in the targets below.
111
7f25090d 112emacs = EMACSLOADPATH=$(lisp) $(EMACS) $(EMACSOPT)
7ec641b8 113
80c382e5 114# Common command to find subdirectories
7ec641b8 115
3f4c23f9 116setwins=subdirs=`find $$wd -type d -print`; \
f83a4f35 117 for file in $$subdirs; do \
80c382e5 118 case $$file in */Old | */RCS | */CVS | */CVS/* | */=* ) ;; \
f83a4f35
RS
119 *) wins="$$wins $$file" ;; \
120 esac; \
80c382e5 121 done
865e97c1
GM
122nonobsolete_setwins=subdirs=`find $$wd -type d -print`; \
123 for file in $$subdirs; do \
124 case $$file in */Old | */RCS | */CVS | */CVS/* | */=* | */obsolete ) ;; \
125 *) wins="$$wins $$file" ;; \
126 esac; \
127 done
80c382e5
SM
128
129doit:
130
cc953d27
SM
131cus-load.el:
132 touch $@
133custom-deps: cus-load.el doit
dce6b995 134 wd=$(lisp); $(setwins); \
4746aeeb 135 echo Directories: $$wins; \
49ac2ac5 136 $(EMACS) $(EMACSOPT) -l cus-dep -f custom-make-dependencies $$wins
009368b9 137
cc953d27
SM
138finder-inf.el:
139 echo "(provide 'finder-inf)" >> $@
140finder-data: finder-inf.el doit
865e97c1 141 wd=$(lisp); $(nonobsolete_setwins); \
4746aeeb 142 echo Directories: $$wins; \
49ac2ac5 143 $(EMACS) $(EMACSOPT) -l finder -f finder-compile-keywords-make-dist $$wins
009368b9 144
cc953d27
SM
145loaddefs.el:
146 echo ";;; loaddefs.el --- automatically extracted autoloads" >> $@
147 echo ";;" >> $@; echo ";;; Code:" >> $@
148 echo "\f" >> $@
149 echo ";;; Local Variables:" >> $@
150 echo ";;; version-control: never" >> $@
151 echo ";;; no-byte-compile: t" >> $@
152 echo ";;; no-update-autoloads: t" >> $@
153 echo ";;; End:" >> $@
154 echo ";;; loaddefs.el ends here" >> $@
155autoloads: loaddefs.el doit
dce6b995 156 wd=$(lisp); $(setwins); \
4746aeeb 157 echo Directories: $$wins; \
49ac2ac5 158 $(EMACS) $(EMACSOPT) -l autoload --eval '(setq generated-autoload-file "$(lisp)/loaddefs.el")' -f batch-update-autoloads $$wins
f83a4f35 159
cc953d27
SM
160subdirs.el:
161 $(MAKE) $(MFLAGS) update-subdirs
98b918b6 162update-subdirs: doit
dce6b995 163 wd=$(lisp); $(setwins); \
98b918b6 164 for file in $$wins; do \
dce6b995 165 $(srcdir)/update-subdirs $$file; \
98b918b6
RS
166 done;
167
cc953d27 168updates: update-subdirs autoloads finder-data custom-deps
c48c3772 169
fbb43902
GM
170# Update the AUTHORS file.
171
172update-authors:
7f25090d 173 $(emacs) -f batch-update-authors $(srcdir)/AUTHORS $(srcdir)
fbb43902 174
7ab2c289 175TAGS: $(lisptagsfiles1) $(lisptagsfiles2)
39895bae 176 els=`echo $(lisptagsfiles1) $(lisptagsfiles2) | sed -e "s,$(lisp)/loaddefs.el,,"`; \
77389930 177 ${ETAGS} $$els
7ab2c289 178
4136efcb 179TAGS-LISP: $(lisptagsfiles1) $(lisptagsfiles2)
39895bae 180 els=`echo $(lisptagsfiles1) $(lisptagsfiles2) | sed -e "s,$(lisp)/loaddefs.el,,"`; \
77389930 181 ${ETAGS} -o TAGS-LISP $$els
7ec641b8 182
67292de0
GM
183.SUFFIXES: .elc .el
184
cc953d27 185.el.elc: subdirs.el
7f25090d 186 -$(emacs) -f batch-byte-compile $<
cc953d27
SM
187
188$(DONTCOMPILE:.el=.elc):
189 -rm -f $@
190
7ec641b8
GM
191# Compile all Lisp files, except those from DONTCOMPILE. This
192# compiles files unconditionally. All .elc files are made writable
193# before compilation in case we checked out read-only (CVS option -r).
8256e31b
GM
194# Files MUST be compiled one by one. If we compile several files in a
195# row we can't make sure that the compilation environment is clean.
196# We also set the load-path of the Emacs used for compilation to the
197# current directory and its subdirectories, to make sure require's and
198# load's in the files being compiled find the right files.
7ec641b8 199
a9b67cf4 200compile-files: subdirs.el doit
2ac5ecc6 201 find $(lisp) -name "*.elc" -print | xargs chmod +w >/dev/null 2>&1; \
dce6b995
GM
202 wd=$(lisp); $(setwins); \
203 elpat=`echo $$wins | tr ' ' '\012\012' | \
cc953d27 204 sed -e 's|\(.\)$$|\1/|' -e 's|^\./||' -e 's|$$|*.el|'`; \
d849789b
GM
205 els=`echo $$elpat $(DONTCOMPILE) $(COMPILE_FIRST) | \
206 tr ' ' '\012\012' | sort | uniq -u`; \
207 for el in $(COMPILE_FIRST) $$els; do \
8256e31b 208 echo Compiling $$el; \
7f25090d 209 $(emacs) -f batch-byte-compile $$el || exit 1; \
8256e31b 210 done
96ff0f09 211
a9b67cf4
GM
212# Backup compiled Lisp files in elc.tar.gz. If that file already
213# exists, make a backup of it.
214
215backup-compiled-files:
dce6b995
GM
216 -mv $(lisp)/elc.tar.gz $(lisp)/elc.tar.gz~
217 -tar czf $(lisp)/elc.tar.gz $(lisp)/*.elc $(lisp)/*/*.elc
a9b67cf4
GM
218
219# Compile Lisp files, but save old compiled files first.
220
221compile: backup-compiled-files compile-files
222
7ec641b8
GM
223# Recompile all Lisp files which are newer than their .elc files.
224# Note that this doesn't create .elc files. It only recompiles if an
225# .elc is present.
226
227recompile: doit
49ac2ac5 228 $(EMACS) $(EMACSOPT) -f batch-byte-recompile-directory $(lisp)
7ec641b8 229
03adf1ee
GM
230# Prepare a bootstrap in the lisp subdirectory. Build loaddefs.el,
231# because it's not sure it's up-to-date, and if it's not, that might
232# lead to errors during the bootstrap because something fails to
233# autoload as expected. Remove compiled Lisp files so that
234# bootstrap-emacs will be built from sources only.
a9b67cf4
GM
235
236bootstrap-clean:
dce6b995
GM
237 if test -f $(EMACS); then $(MAKE) $(MFLAGS) autoloads; fi
238 -rm -f $(lisp)/*.elc $(lisp)/*/*.elc
a9b67cf4
GM
239
240# Generate/update files for the bootstrap process.
241
1499d2dd 242bootstrap: autoloads compile-files custom-deps
a9b67cf4 243
43280888
GM
244distclean:
245 -rm -f $(lisp)/Makefile
246
7ec641b8 247# Makefile ends here.