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