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