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