]> code.delx.au - gnu-emacs/blob - lisp/Makefile.in
(font-lock-keywords): Add defvar.
[gnu-emacs] / lisp / Makefile.in
1 # Maintenance productions for the Lisp directory
2 # Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005 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., 51 Franklin Street, Fifth Floor,
19 # Boston, MA 02110-1301, USA.
20
21 SHELL = /bin/sh
22
23 lisp=@srcdir@
24 VPATH=@srcdir@
25 srcdir=@srcdir@/..
26
27 # You can specify a different executable on the make command line,
28 # e.g. "make EMACS=../src/emacs ...".
29
30 EMACS = ../src/emacs
31
32 # Command line flags for Emacs. This must include --multibyte,
33 # otherwise some files will not compile.
34
35 EMACSOPT = -batch --no-site-file --multibyte
36
37 SOURCES = *.el COPYING Makefile
38 lisptagsfiles1 = $(lisp)/[a-zA-Z]*.el
39 lisptagsfiles2 = $(lisp)/[a-zA-Z]*/[a-zA-Z]*.el
40 ETAGS = ../lib-src/etags
41
42 # Elisp files auto-generated.
43 AUTOGENEL = loaddefs.el \
44 cus-load.el \
45 finder-inf.el \
46 subdirs.el \
47 eshell/esh-groups.el
48
49 # Files to compile before others during a bootstrap. This is done to
50 # speed up the bootstrap process. The CC files are compiled first
51 # because CC mode tweaks the compilation process, and requiring
52 # cc-mode when it is not compiled doesn't work during the
53 # bootstrapping.
54
55 COMPILE_FIRST = \
56 $(lisp)/emacs-lisp/byte-opt.el \
57 $(lisp)/emacs-lisp/bytecomp.el \
58 $(lisp)/subr.el \
59 $(lisp)/progmodes/cc-mode.el \
60 $(lisp)/progmodes/cc-vars.el
61
62 # The actual Emacs command run in the targets below.
63
64 emacs = EMACSLOADPATH=$(lisp) $(EMACS) $(EMACSOPT)
65
66 # Common command to find subdirectories
67
68 setwins=subdirs=`(cd $$wd; find . -type d -print)`; \
69 for file in $$subdirs; do \
70 case $$file in */Old | */RCS | */CVS | */CVS/* | */.* | */.*/* | */=* ) ;; \
71 *) wins="$$wins $$wd/$$file" ;; \
72 esac; \
73 done
74
75 setwins_almost=subdirs=`(cd $$wd; find . -type d -print)`; \
76 for file in $$subdirs; do \
77 case $$file in */Old | */RCS | */CVS | */CVS/* | */.* | */.*/* | */=* | */obsolete | */term ) ;; \
78 *) wins="$$wins $$wd/$$file" ;; \
79 esac; \
80 done
81
82 doit:
83
84 $(lisp)/cus-load.el:
85 touch $@
86 custom-deps: $(lisp)/cus-load.el doit
87 wd=$(lisp); $(setwins_almost); \
88 echo Directories: $$wins; \
89 $(EMACS) $(EMACSOPT) -l cus-dep --eval '(setq generated-custom-dependencies-file "$(lisp)/cus-load.el")' -f custom-make-dependencies $$wins
90
91 finder-data: doit
92 wd=$(lisp); $(setwins_almost); \
93 echo Directories: $$wins; \
94 $(EMACS) $(EMACSOPT) -l finder --eval '(setq generated-finder-keywords-file "$(lisp)/finder-inf.el")' -f finder-compile-keywords-make-dist $$wins
95
96 $(lisp)/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: $(lisp)/loaddefs.el doit
107 wd=$(lisp); $(setwins); \
108 echo Directories: $$wins; \
109 $(EMACS) $(EMACSOPT) -l autoload --eval '(setq generated-autoload-file "$(lisp)/loaddefs.el")' -f batch-update-autoloads $$wins
110
111 $(lisp)/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 # Update the AUTHORS file.
122
123 update-authors:
124 $(emacs) -l authors -f batch-update-authors $(srcdir)/AUTHORS $(srcdir)
125
126 TAGS: $(lisptagsfiles1) $(lisptagsfiles2)
127 els=`echo $(lisptagsfiles1) $(lisptagsfiles2) | sed -e "s,$(lisp)/loaddefs[^ ]*,," -e "s,$(lisp)/ldefs-boot[^ ]*,,"`; \
128 ${ETAGS} $$els
129
130 TAGS-LISP: $(lisptagsfiles1) $(lisptagsfiles2)
131 els=`echo $(lisptagsfiles1) $(lisptagsfiles2) | sed -e "s,$(lisp)/loaddefs[^ ]*,," -e "s,$(lisp)/ldefs-boot[^ ]*,,"`; \
132 ${ETAGS} -o TAGS-LISP $$els
133
134 .SUFFIXES: .elc .el
135
136 .el.elc: $(lisp)/subdirs.el
137 -$(emacs) -f batch-byte-compile $<
138
139 # Compile all Lisp files, but don't recompile those that are up to
140 # date. Some files don't actually get compiled because they set the
141 # local variable no-byte-compile.
142
143 # All .elc files are made writable before compilation in case we
144 # checked out read-only (CVS option -r). Files MUST be compiled one by
145 # one. If we compile several files in a row we can't make sure that
146 # the compilation environment is clean. We also set the load-path of
147 # the Emacs used for compilation to the current directory and its
148 # subdirectories, to make sure require's and load's in the files being
149 # compiled find the right files.
150
151 compile: $(lisp)/subdirs.el doit
152 find $(lisp) -name "*.elc" -print | xargs chmod +w >/dev/null 2>&1; \
153 wd=$(lisp); $(setwins); \
154 els=`echo $$wins | tr ' \011' '\012\012' | \
155 sed -e 's|\(.\)$$|\1/|' -e 's|^\./||' -e 's|$$|*.el|'`; \
156 for el in $(COMPILE_FIRST) $$els; do \
157 if test -f $$el; \
158 then \
159 echo Compiling $$el; \
160 $(emacs) -f batch-byte-compile-if-not-done $$el || exit 1; \
161 fi \
162 done
163
164 # Compile all Lisp files. This is like `compile' but compiles files
165 # unconditionally. Some files don't actually get compiled because they
166 # set the local variable no-byte-compile.
167
168 compile-always: $(lisp)/subdirs.el doit
169 # `|| true' prevents old Bash versions from getting confused
170 # by an error.
171 find $(lisp) -name "*.elc" -print | xargs chmod +w >/dev/null 2>&1 || true; \
172 wd=$(lisp); $(setwins); \
173 els=`echo $$wins | tr ' \011' '\012\012' | \
174 sed -e 's|\(.\)$$|\1/|' -e 's|^\./||' -e 's|$$|*.el|'`; \
175 for el in $(COMPILE_FIRST) $$els; do \
176 if test -f $$el; \
177 then \
178 echo Compiling $$el; \
179 $(emacs) -f batch-byte-compile $$el || exit 1; \
180 fi \
181 done
182
183 compile-calc:
184 for el in `find $(lisp)/calc -name '*.el'`; do \
185 echo Compiling $$el; \
186 $(emacs) -f batch-byte-compile $$el || exit 1; \
187 done
188
189 # Backup compiled Lisp files in elc.tar.gz. If that file already
190 # exists, make a backup of it.
191
192 backup-compiled-files:
193 -mv $(lisp)/elc.tar.gz $(lisp)/elc.tar.gz~
194 -tar czf $(lisp)/elc.tar.gz $(lisp)/*.elc $(lisp)/*/*.elc
195
196 # Compile Lisp files, but save old compiled files first.
197
198 compile-after-backup: backup-compiled-files compile-always
199
200 # Recompile all Lisp files which are newer than their .elc files.
201 # Note that this doesn't create .elc files. It only recompiles if an
202 # .elc is present.
203
204 recompile: doit $(lisp)/progmodes/cc-mode.elc
205 $(EMACS) $(EMACSOPT) --eval "(batch-byte-recompile-directory 0)" $(lisp)
206
207 # CC Mode uses a compile time macro system which causes a compile time
208 # dependency in cc-mode.elc on the macros in cc-langs.el and the
209 # version string in cc-defs.el.
210 $(lisp)/progmodes/cc-mode.elc: \
211 $(lisp)/progmodes/cc-mode.el \
212 $(lisp)/progmodes/cc-langs.el \
213 $(lisp)/progmodes/cc-defs.el
214 $(EMACS) $(EMACSOPT) -f batch-byte-compile $(lisp)/progmodes/cc-mode.el
215
216 # Prepare a bootstrap in the lisp subdirectory.
217 #
218 # Build loaddefs.el to make sure it's up-to-date. If it's not, that
219 # might lead to errors during the bootstrap because something fails to
220 # autoload as expected. If there is no emacs binary, then we can't
221 # build autoloads yet. In that case we have to use ldefs-boot.el.
222 # Bootstrap should always work with ldefs-boot.el. Therefore,
223 # whenever a new autoload cookie gets added that is necessary during
224 # bootstrapping, ldefs-boot.el should be updated by overwriting it with
225 # an up-to-date copy of loaddefs.el that is uncorrupted by
226 # local changes. (Because loaddefs.el is an automatically generated
227 # file, we don't want to store it in the source repository).
228
229 bootstrap-prepare:
230 if test -x $(EMACS); then \
231 $(MAKE) $(MFLAGS) autoloads; \
232 else \
233 cp $(lisp)/ldefs-boot.el $(lisp)/loaddefs.el; \
234 fi
235
236 maintainer-clean: distclean
237 cd $(lisp); rm -f *.elc */*.elc $(AUTOGENEL)
238
239 bootstrap-clean:
240 cd $(lisp); rm -f *.elc */*.elc
241
242 # Generate/update files for the bootstrap process.
243
244 bootstrap: update-subdirs autoloads compile
245
246 # Generate/update files after the bootstrap process.
247 # custom-deps needs `preloaded-file-list'.
248
249 bootstrap-after: finder-data custom-deps
250
251 distclean:
252 -rm -f ./Makefile
253
254 # Makefile ends here.