29657
|
1 # Maintenance productions for the Lisp directory
|
68651
|
2 # Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005,
|
|
3 # 2006 Free Software Foundation, Inc.
|
36226
|
4
|
|
5 # This file is part of GNU Emacs.
|
|
6
|
|
7 # GNU Emacs is free software; you can redistribute it and/or modify
|
|
8 # it under the terms of the GNU General Public License as published by
|
|
9 # the Free Software Foundation; either version 2, or (at your option)
|
|
10 # any later version.
|
|
11
|
|
12 # GNU Emacs is distributed in the hope that it will be useful,
|
|
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
15 # GNU General Public License for more details.
|
|
16
|
|
17 # You should have received a copy of the GNU General Public License
|
|
18 # along with GNU Emacs; see the file COPYING. If not, write to
|
64091
|
19 # the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
|
20 # Boston, MA 02110-1301, USA.
|
29657
|
21
|
29679
|
22 SHELL = /bin/sh
|
|
23
|
29657
|
24 lisp=@srcdir@
|
|
25 VPATH=@srcdir@
|
29704
|
26 srcdir=@srcdir@/..
|
29657
|
27
|
|
28 # You can specify a different executable on the make command line,
|
|
29 # e.g. "make EMACS=../src/emacs ...".
|
|
30
|
|
31 EMACS = ../src/emacs
|
|
32
|
|
33 # Command line flags for Emacs. This must include --multibyte,
|
|
34 # otherwise some files will not compile.
|
|
35
|
|
36 EMACSOPT = -batch --no-site-file --multibyte
|
|
37
|
|
38 SOURCES = *.el COPYING Makefile
|
|
39 lisptagsfiles1 = $(lisp)/[a-zA-Z]*.el
|
|
40 lisptagsfiles2 = $(lisp)/[a-zA-Z]*/[a-zA-Z]*.el
|
|
41 ETAGS = ../lib-src/etags
|
|
42
|
54244
|
43 # Elisp files auto-generated.
|
|
44 AUTOGENEL = loaddefs.el \
|
|
45 cus-load.el \
|
|
46 finder-inf.el \
|
|
47 subdirs.el \
|
65887
|
48 eshell/esh-groups.el \
|
|
49 mh-e/mh-loaddefs.el
|
54244
|
50
|
36918
|
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.
|
29657
|
56
|
|
57 COMPILE_FIRST = \
|
|
58 $(lisp)/emacs-lisp/byte-opt.el \
|
|
59 $(lisp)/emacs-lisp/bytecomp.el \
|
36918
|
60 $(lisp)/subr.el \
|
|
61 $(lisp)/progmodes/cc-mode.el \
|
|
62 $(lisp)/progmodes/cc-vars.el
|
29657
|
63
|
|
64 # The actual Emacs command run in the targets below.
|
|
65
|
33158
|
66 emacs = EMACSLOADPATH=$(lisp) $(EMACS) $(EMACSOPT)
|
29657
|
67
|
|
68 # Common command to find subdirectories
|
|
69
|
54632
|
70 setwins=subdirs=`(cd $$wd; find . -type d -print)`; \
|
29657
|
71 for file in $$subdirs; do \
|
54248
28e8d2c26aa1
(setwins, setwins_almost): Skip .arch-ids and other hidden files/directories.
Stefan Monnier <monnier@iro.umontreal.ca>
diff
changeset
|
72 case $$file in */Old | */RCS | */CVS | */CVS/* | */.* | */.*/* | */=* ) ;; \
|
54632
|
73 *) wins="$$wins $$wd/$$file" ;; \
|
29657
|
74 esac; \
|
|
75 done
|
38819
|
76
|
54632
|
77 setwins_almost=subdirs=`(cd $$wd; find . -type d -print)`; \
|
37275
|
78 for file in $$subdirs; do \
|
54248
28e8d2c26aa1
(setwins, setwins_almost): Skip .arch-ids and other hidden files/directories.
Stefan Monnier <monnier@iro.umontreal.ca>
diff
changeset
|
79 case $$file in */Old | */RCS | */CVS | */CVS/* | */.* | */.*/* | */=* | */obsolete | */term ) ;; \
|
54632
|
80 *) wins="$$wins $$wd/$$file" ;; \
|
37275
|
81 esac; \
|
|
82 done
|
29657
|
83
|
|
84 doit:
|
|
85
|
48993
|
86 $(lisp)/cus-load.el:
|
29657
|
87 touch $@
|
48993
|
88 custom-deps: $(lisp)/cus-load.el doit
|
48471
|
89 wd=$(lisp); $(setwins_almost); \
|
29657
|
90 echo Directories: $$wins; \
|
48993
|
91 $(EMACS) $(EMACSOPT) -l cus-dep --eval '(setq generated-custom-dependencies-file "$(lisp)/cus-load.el")' -f custom-make-dependencies $$wins
|
29657
|
92
|
44106
|
93 finder-data: doit
|
48471
|
94 wd=$(lisp); $(setwins_almost); \
|
29657
|
95 echo Directories: $$wins; \
|
48993
|
96 $(EMACS) $(EMACSOPT) -l finder --eval '(setq generated-finder-keywords-file "$(lisp)/finder-inf.el")' -f finder-compile-keywords-make-dist $$wins
|
29657
|
97
|
48993
|
98 $(lisp)/loaddefs.el:
|
29657
|
99 echo ";;; loaddefs.el --- automatically extracted autoloads" >> $@
|
|
100 echo ";;" >> $@; echo ";;; Code:" >> $@
|
|
101 echo "" >> $@
|
66789
f03f8ff82435
(mh-loaddefs.el, loaddefs.el): Better follow the commenting conventions.
Stefan Monnier <monnier@iro.umontreal.ca>
diff
changeset
|
102 echo ";; Local Variables:" >> $@
|
f03f8ff82435
(mh-loaddefs.el, loaddefs.el): Better follow the commenting conventions.
Stefan Monnier <monnier@iro.umontreal.ca>
diff
changeset
|
103 echo ";; version-control: never" >> $@
|
f03f8ff82435
(mh-loaddefs.el, loaddefs.el): Better follow the commenting conventions.
Stefan Monnier <monnier@iro.umontreal.ca>
diff
changeset
|
104 echo ";; no-byte-compile: t" >> $@
|
f03f8ff82435
(mh-loaddefs.el, loaddefs.el): Better follow the commenting conventions.
Stefan Monnier <monnier@iro.umontreal.ca>
diff
changeset
|
105 echo ";; no-update-autoloads: t" >> $@
|
f03f8ff82435
(mh-loaddefs.el, loaddefs.el): Better follow the commenting conventions.
Stefan Monnier <monnier@iro.umontreal.ca>
diff
changeset
|
106 echo ";; End:" >> $@
|
29657
|
107 echo ";;; loaddefs.el ends here" >> $@
|
48993
|
108 autoloads: $(lisp)/loaddefs.el doit
|
29657
|
109 wd=$(lisp); $(setwins); \
|
|
110 echo Directories: $$wins; \
|
33505
2b0399706883
(custom-deps, finder-data, autoloads, recompile): Don't set EMACSLOADPATH.
Eli Zaretskii <eliz@gnu.org>
diff
changeset
|
111 $(EMACS) $(EMACSOPT) -l autoload --eval '(setq generated-autoload-file "$(lisp)/loaddefs.el")' -f batch-update-autoloads $$wins
|
29657
|
112
|
48993
|
113 $(lisp)/subdirs.el:
|
29657
|
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
|
68058
|
121 updates: update-subdirs autoloads finder-data custom-deps
|
29657
|
122
|
67952
|
123 # This is useful after "cvs up".
|
|
124 cvs-update: recompile autoloads finder-data custom-deps
|
|
125
|
32884
|
126 # Update the AUTHORS file.
|
|
127
|
|
128 update-authors:
|
61526
|
129 $(emacs) -l authors -f batch-update-authors $(srcdir)/AUTHORS $(srcdir)
|
32884
|
130
|
29657
|
131 TAGS: $(lisptagsfiles1) $(lisptagsfiles2)
|
53972
2627b0171f3d
(TAGS, TAGS-LISP): Filter out of `els' only loaddefs* and ldefs-boot*.
Eli Zaretskii <eliz@is.elta.co.il>
diff
changeset
|
132 els=`echo $(lisptagsfiles1) $(lisptagsfiles2) | sed -e "s,$(lisp)/loaddefs[^ ]*,," -e "s,$(lisp)/ldefs-boot[^ ]*,,"`; \
|
38653
|
133 ${ETAGS} $$els
|
29657
|
134
|
30095
|
135 TAGS-LISP: $(lisptagsfiles1) $(lisptagsfiles2)
|
53972
2627b0171f3d
(TAGS, TAGS-LISP): Filter out of `els' only loaddefs* and ldefs-boot*.
Eli Zaretskii <eliz@is.elta.co.il>
diff
changeset
|
136 els=`echo $(lisptagsfiles1) $(lisptagsfiles2) | sed -e "s,$(lisp)/loaddefs[^ ]*,," -e "s,$(lisp)/ldefs-boot[^ ]*,,"`; \
|
38653
|
137 ${ETAGS} -o TAGS-LISP $$els
|
29657
|
138
|
33667
|
139 .SUFFIXES: .elc .el
|
|
140
|
48993
|
141 .el.elc: $(lisp)/subdirs.el
|
33158
|
142 -$(emacs) -f batch-byte-compile $<
|
29657
|
143
|
61526
|
144 # Compile all Lisp files, but don't recompile those that are up to
|
|
145 # date. Some files don't actually get compiled because they set the
|
|
146 # local variable no-byte-compile.
|
43026
|
147
|
61526
|
148 # All .elc files are made writable before compilation in case we
|
|
149 # checked out read-only (CVS option -r). Files MUST be compiled one by
|
|
150 # one. If we compile several files in a row we can't make sure that
|
|
151 # the compilation environment is clean. We also set the load-path of
|
|
152 # the Emacs used for compilation to the current directory and its
|
|
153 # subdirectories, to make sure require's and load's in the files being
|
|
154 # compiled find the right files.
|
44106
|
155
|
68729
|
156 # `|| true' below prevents old Bash versions from getting confused
|
|
157 # by an error.
|
65887
|
158 compile: $(lisp)/subdirs.el mh-autoloads doit
|
68729
|
159 find $(lisp) -name "*.elc" -print | xargs chmod +w >/dev/null 2>&1 || true; \
|
43026
|
160 wd=$(lisp); $(setwins); \
|
61526
|
161 els=`echo $$wins | tr ' \011' '\012\012' | \
|
43026
|
162 sed -e 's|\(.\)$$|\1/|' -e 's|^\./||' -e 's|$$|*.el|'`; \
|
|
163 for el in $(COMPILE_FIRST) $$els; do \
|
44174
|
164 if test -f $$el; \
|
|
165 then \
|
|
166 echo Compiling $$el; \
|
58345
|
167 $(emacs) -f batch-byte-compile-if-not-done $$el || exit 1; \
|
44174
|
168 fi \
|
43026
|
169 done
|
|
170
|
61526
|
171 # Compile all Lisp files. This is like `compile' but compiles files
|
|
172 # unconditionally. Some files don't actually get compiled because they
|
|
173 # set the local variable no-byte-compile.
|
|
174
|
68057
|
175 compile-always: $(lisp)/subdirs.el mh-autoloads doit
|
48006
|
176 # `|| true' prevents old Bash versions from getting confused
|
|
177 # by an error.
|
48005
|
178 find $(lisp) -name "*.elc" -print | xargs chmod +w >/dev/null 2>&1 || true; \
|
29657
|
179 wd=$(lisp); $(setwins); \
|
61526
|
180 els=`echo $$wins | tr ' \011' '\012\012' | \
|
29657
|
181 sed -e 's|\(.\)$$|\1/|' -e 's|^\./||' -e 's|$$|*.el|'`; \
|
|
182 for el in $(COMPILE_FIRST) $$els; do \
|
44174
|
183 if test -f $$el; \
|
|
184 then \
|
|
185 echo Compiling $$el; \
|
|
186 $(emacs) -f batch-byte-compile $$el || exit 1; \
|
|
187 fi \
|
29657
|
188 done
|
|
189
|
49597
|
190 compile-calc:
|
48993
|
191 for el in `find $(lisp)/calc -name '*.el'`; do \
|
41408
|
192 echo Compiling $$el; \
|
|
193 $(emacs) -f batch-byte-compile $$el || exit 1; \
|
|
194 done
|
|
195
|
29657
|
196 # Backup compiled Lisp files in elc.tar.gz. If that file already
|
|
197 # exists, make a backup of it.
|
|
198
|
|
199 backup-compiled-files:
|
|
200 -mv $(lisp)/elc.tar.gz $(lisp)/elc.tar.gz~
|
|
201 -tar czf $(lisp)/elc.tar.gz $(lisp)/*.elc $(lisp)/*/*.elc
|
|
202
|
|
203 # Compile Lisp files, but save old compiled files first.
|
|
204
|
43026
|
205 compile-after-backup: backup-compiled-files compile-always
|
29657
|
206
|
|
207 # Recompile all Lisp files which are newer than their .elc files.
|
|
208 # Note that this doesn't create .elc files. It only recompiles if an
|
|
209 # .elc is present.
|
|
210
|
65887
|
211 recompile: doit mh-autoloads $(lisp)/progmodes/cc-mode.elc
|
58345
|
212 $(EMACS) $(EMACSOPT) --eval "(batch-byte-recompile-directory 0)" $(lisp)
|
29657
|
213
|
53892
f3098a6fd4f0
Added extra dependencies in the recompile target needed to cope with
Martin Stjernholm <mast@lysator.liu.se>
diff
changeset
|
214 # CC Mode uses a compile time macro system which causes a compile time
|
f3098a6fd4f0
Added extra dependencies in the recompile target needed to cope with
Martin Stjernholm <mast@lysator.liu.se>
diff
changeset
|
215 # dependency in cc-mode.elc on the macros in cc-langs.el and the
|
f3098a6fd4f0
Added extra dependencies in the recompile target needed to cope with
Martin Stjernholm <mast@lysator.liu.se>
diff
changeset
|
216 # version string in cc-defs.el.
|
53941
f381d8277172
* Makefile.in: Fixed the CC Mode recompile kludge so it works
Martin Stjernholm <mast@lysator.liu.se>
diff
changeset
|
217 $(lisp)/progmodes/cc-mode.elc: \
|
f381d8277172
* Makefile.in: Fixed the CC Mode recompile kludge so it works
Martin Stjernholm <mast@lysator.liu.se>
diff
changeset
|
218 $(lisp)/progmodes/cc-mode.el \
|
f381d8277172
* Makefile.in: Fixed the CC Mode recompile kludge so it works
Martin Stjernholm <mast@lysator.liu.se>
diff
changeset
|
219 $(lisp)/progmodes/cc-langs.el \
|
f381d8277172
* Makefile.in: Fixed the CC Mode recompile kludge so it works
Martin Stjernholm <mast@lysator.liu.se>
diff
changeset
|
220 $(lisp)/progmodes/cc-defs.el
|
f381d8277172
* Makefile.in: Fixed the CC Mode recompile kludge so it works
Martin Stjernholm <mast@lysator.liu.se>
diff
changeset
|
221 $(EMACS) $(EMACSOPT) -f batch-byte-compile $(lisp)/progmodes/cc-mode.el
|
53892
f3098a6fd4f0
Added extra dependencies in the recompile target needed to cope with
Martin Stjernholm <mast@lysator.liu.se>
diff
changeset
|
222
|
65887
|
223 # Update MH-E internal autoloads. These are not to be confused with
|
|
224 # the autoloads for the MH-E entry points, which are already in
|
|
225 # loaddefs.el.
|
68135
|
226 MH_E_SRC = $(lisp)/mh-e/mh-acros.el $(lisp)/mh-e/mh-alias.el \
|
68466
|
227 $(lisp)/mh-e/mh-buffers.el $(lisp)/mh-e/mh-compat.el \
|
|
228 $(lisp)/mh-e/mh-comp.el $(lisp)/mh-e/mh-e.el \
|
|
229 $(lisp)/mh-e/mh-folder.el $(lisp)/mh-e/mh-funcs.el \
|
|
230 $(lisp)/mh-e/mh-gnus.el $(lisp)/mh-e/mh-identity.el \
|
|
231 $(lisp)/mh-e/mh-inc.el $(lisp)/mh-e/mh-junk.el \
|
|
232 $(lisp)/mh-e/mh-letter.el $(lisp)/mh-e/mh-limit.el \
|
|
233 $(lisp)/mh-e/mh-mime.el $(lisp)/mh-e/mh-print.el \
|
|
234 $(lisp)/mh-e/mh-scan.el $(lisp)/mh-e/mh-search.el \
|
|
235 $(lisp)/mh-e/mh-seq.el $(lisp)/mh-e/mh-show.el \
|
|
236 $(lisp)/mh-e/mh-speed.el $(lisp)/mh-e/mh-thread.el \
|
|
237 $(lisp)/mh-e/mh-tool-bar.el $(lisp)/mh-e/mh-utils.el \
|
|
238 $(lisp)/mh-e/mh-xface.el
|
65887
|
239
|
|
240 mh-autoloads: $(lisp)/mh-e/mh-loaddefs.el
|
68135
|
241 $(lisp)/mh-e/mh-loaddefs.el: $(MH_E_SRC)
|
65887
|
242 echo ";;; mh-loaddefs.el --- automatically extracted autoloads" > $@
|
68466
|
243 echo "" >> $@
|
68135
|
244 echo ";; Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc." >> $@
|
66789
f03f8ff82435
(mh-loaddefs.el, loaddefs.el): Better follow the commenting conventions.
Stefan Monnier <monnier@iro.umontreal.ca>
diff
changeset
|
245 echo ";; Author: Bill Wohler <wohler@newt.com>" >> $@
|
f03f8ff82435
(mh-loaddefs.el, loaddefs.el): Better follow the commenting conventions.
Stefan Monnier <monnier@iro.umontreal.ca>
diff
changeset
|
246 echo ";; Keywords: mail" >> $@
|
65887
|
247 echo ";;; Commentary:" >> $@
|
67242
|
248 echo ";;; Change Log:" >> $@
|
65887
|
249 echo ";;; Code:" >> $@
|
|
250 $(EMACS) $(EMACSOPT) \
|
|
251 -l autoload \
|
|
252 --eval "(setq generate-autoload-cookie \";;;###mh-autoload\")" \
|
65967
|
253 --eval "(setq generated-autoload-file \"$(lisp)/mh-e/mh-loaddefs.el\")" \
|
65887
|
254 --eval "(setq make-backup-files nil)" \
|
65967
|
255 -f batch-update-autoloads $(lisp)/mh-e
|
65887
|
256 echo "" >> $@
|
|
257 echo "(provide 'mh-loaddefs)" >> $@
|
66789
f03f8ff82435
(mh-loaddefs.el, loaddefs.el): Better follow the commenting conventions.
Stefan Monnier <monnier@iro.umontreal.ca>
diff
changeset
|
258 echo ";; Local Variables:" >> $@
|
f03f8ff82435
(mh-loaddefs.el, loaddefs.el): Better follow the commenting conventions.
Stefan Monnier <monnier@iro.umontreal.ca>
diff
changeset
|
259 echo ";; version-control: never" >> $@
|
f03f8ff82435
(mh-loaddefs.el, loaddefs.el): Better follow the commenting conventions.
Stefan Monnier <monnier@iro.umontreal.ca>
diff
changeset
|
260 echo ";; no-byte-compile: t" >> $@
|
f03f8ff82435
(mh-loaddefs.el, loaddefs.el): Better follow the commenting conventions.
Stefan Monnier <monnier@iro.umontreal.ca>
diff
changeset
|
261 echo ";; no-update-autoloads: t" >> $@
|
f03f8ff82435
(mh-loaddefs.el, loaddefs.el): Better follow the commenting conventions.
Stefan Monnier <monnier@iro.umontreal.ca>
diff
changeset
|
262 echo ";; End:" >> $@
|
65887
|
263 echo ";;; mh-loaddefs.el ends here" >> $@
|
|
264
|
52505
|
265 # Prepare a bootstrap in the lisp subdirectory.
|
|
266 #
|
63338
|
267 # Build loaddefs.el to make sure it's up-to-date. If it's not, that
|
|
268 # might lead to errors during the bootstrap because something fails to
|
|
269 # autoload as expected. If there is no emacs binary, then we can't
|
65010
|
270 # build autoloads yet. In that case we have to use ldefs-boot.el.
|
|
271 # Bootstrap should always work with ldefs-boot.el. Therefore,
|
|
272 # whenever a new autoload cookie gets added that is necessary during
|
|
273 # bootstrapping, ldefs-boot.el should be updated by overwriting it with
|
|
274 # an up-to-date copy of loaddefs.el that is uncorrupted by
|
|
275 # local changes. (Because loaddefs.el is an automatically generated
|
|
276 # file, we don't want to store it in the source repository).
|
29657
|
277
|
54244
|
278 bootstrap-prepare:
|
52505
|
279 if test -x $(EMACS); then \
|
|
280 $(MAKE) $(MFLAGS) autoloads; \
|
|
281 else \
|
63338
|
282 cp $(lisp)/ldefs-boot.el $(lisp)/loaddefs.el; \
|
52505
|
283 fi
|
54244
|
284
|
58080
|
285 maintainer-clean: distclean
|
54244
|
286 cd $(lisp); rm -f *.elc */*.elc $(AUTOGENEL)
|
29657
|
287
|
58020
|
288 bootstrap-clean:
|
|
289 cd $(lisp); rm -f *.elc */*.elc
|
|
290
|
29657
|
291 # Generate/update files for the bootstrap process.
|
|
292
|
68057
|
293 bootstrap: update-subdirs autoloads compile
|
49382
|
294
|
|
295 # Generate/update files after the bootstrap process.
|
|
296 # custom-deps needs `preloaded-file-list'.
|
|
297
|
|
298 bootstrap-after: finder-data custom-deps
|
29657
|
299
|
29703
|
300 distclean:
|
42222
2f835f4a8ef8
(distclean): Remove Makefile in the build directory, not in the source
Eli Zaretskii <eliz@gnu.org>
diff
changeset
|
301 -rm -f ./Makefile
|
29703
|
302
|
29657
|
303 # Makefile ends here.
|