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