1 # Maintenance productions for the Lisp directory
2 # Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005,
3 # 2006, 2007, 2008 Free Software Foundation, Inc.
5 # This file is part of GNU Emacs.
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 3, or (at your option)
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.
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
19 # the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20 # Boston, MA 02110-1301, USA.
28 # You can specify a different executable on the make command line,
29 # e.g. "make EMACS=../src/emacs ...".
33 # Command line flags for Emacs. This must include --multibyte,
34 # otherwise some files will not compile.
36 EMACSOPT
= -batch
--no-site-file
--multibyte
38 # Extra flags to pass to the byte compiler
39 BYTE_COMPILE_EXTRA_FLAGS
=
40 # For example to not display the undefined function warnings you can use this:
41 # BYTE_COMPILE_EXTRA_FLAGS = --eval '(setq byte-compile-warnings (quote (not unresolved)))'
42 # The example above is just for developers, it should not be used by default.
44 SOURCES
= *.el COPYING Makefile
45 lisptagsfiles1
= $(lisp
)/[a-zA-Z
]*.el
46 lisptagsfiles2
= $(lisp
)/[a-zA-Z
]*/[a-zA-Z
]*.el
47 ETAGS
= ..
/lib-src
/etags
49 # Elisp files auto-generated.
50 AUTOGENEL
= loaddefs.el \
54 eshell
/esh-groups.el \
56 international
/charprop.el \
57 international
/uni-
*.el
59 # Files to compile before others during a bootstrap. This is done to
60 # speed up the bootstrap process. The CC files are compiled first
61 # because CC mode tweaks the compilation process, and requiring
62 # cc-mode when it is not compiled doesn't work during the
66 $(lisp
)/emacs-lisp
/byte-opt.el \
67 $(lisp
)/emacs-lisp
/bytecomp.el \
69 $(lisp
)/progmodes
/cc-mode.el \
70 $(lisp
)/progmodes
/cc-vars.el
72 # The actual Emacs command run in the targets below.
74 emacs
= EMACSLOADPATH
=$(lisp
) LC_ALL
=C
$(EMACS
) $(EMACSOPT
)
76 # Common command to find subdirectories
78 setwins
=subdirs
=`(cd $$wd; find . -type d -print)`; \
79 for file in
$$subdirs; do \
80 case
$$file in
*/Old |
*/RCS |
*/CVS |
*/CVS
/* |
*/.
* |
*/.
*/* |
*/=* ) ;; \
81 *) wins
="$$wins $$wd/$$file" ;; \
85 # Find all subdirectories except `obsolete'.
87 setwins_almost
=subdirs
=`(cd $$wd; find . -type d -print)`; \
88 for file in
$$subdirs; do \
89 case
$$file in
*/Old |
*/RCS |
*/CVS |
*/CVS
/* |
*/.
* |
*/.
*/* |
*/=* |
*/obsolete |
*/term
) ;; \
90 *) wins
="$$wins $$wd/$$file" ;; \
98 # Note that custom-deps and finder-data depend on autoloads rather
99 # than on loaddefs.el, so that autoloads does not run in parallel with
100 # them under "make -j", because that could delete loaddefs.el from
102 custom-deps
: $(lisp
)/subdirs.el autoloads
$(lisp
)/cus-load.el doit
103 wd
=$(lisp
); $(setwins_almost
); \
104 echo Directories
: $$wins; \
105 LC_ALL
=C
$(emacs
) -l cus-dep
--eval
'(setq generated-custom-dependencies-file "$(lisp)/cus-load.el")' -f custom-make-dependencies
$$wins
107 finder-data
: $(lisp
)/subdirs.el autoloads doit
108 wd
=$(lisp
); $(setwins_almost
); \
109 echo Directories
: $$wins; \
110 LC_ALL
=C
$(emacs
) -l finder
--eval
'(setq generated-finder-keywords-file "$(lisp)/finder-inf.el")' -f finder-compile-keywords-make-dist
$$wins
113 echo
";;; loaddefs.el --- automatically extracted autoloads" >> $@
114 echo
";;" >> $@
; echo
";;; Code:" >> $@
116 echo
";; Local Variables:" >> $@
117 echo
";; version-control: never" >> $@
118 echo
";; no-byte-compile: t" >> $@
119 echo
";; no-update-autoloads: t" >> $@
121 echo
";;; loaddefs.el ends here" >> $@
122 autoloads
: $(lisp
)/subdirs.el
$(lisp
)/loaddefs.el doit
123 wd
=$(lisp
); $(setwins_almost
); \
124 echo Directories
: $$wins; \
125 LC_ALL
=C
$(emacs
) -l autoload
--eval
'(setq generated-autoload-file "$(lisp)/loaddefs.el")' -f batch-update-autoloads
$$wins
128 $(MAKE
) $(MFLAGS
) update-subdirs
130 wd
=$(lisp
); $(setwins
); \
131 for file in
$$wins; do \
132 $(srcdir)/update-subdirs
$$file; \
135 updates
: update-subdirs autoloads finder-data custom-deps
137 # This is useful after "cvs up".
138 cvs-update
: recompile autoloads finder-data custom-deps
140 # Update the AUTHORS file.
143 $(emacs
) -l authors
-f batch-update-authors
$(srcdir)/etc
/AUTHORS
$(srcdir)
145 TAGS
: $(lisptagsfiles1
) $(lisptagsfiles2
)
146 els
=`echo $(lisptagsfiles1) $(lisptagsfiles2) | sed -e "s,$(lisp)/loaddefs[^ ]*,," -e "s,$(lisp)/ldefs-boot[^ ]*,,"`; \
149 TAGS-LISP
: $(lisptagsfiles1
) $(lisptagsfiles2
)
150 els
=`echo $(lisptagsfiles1) $(lisptagsfiles2) | sed -e "s,$(lisp)/loaddefs[^ ]*,," -e "s,$(lisp)/ldefs-boot[^ ]*,,"`; \
151 ${ETAGS} -o TAGS-LISP
$$els
155 .el.elc
: $(lisp
)/subdirs.el
156 -$(emacs
) $(BYTE_COMPILE_EXTRA_FLAGS
) -f batch-byte-compile
$<
158 # Compile all Lisp files, but don't recompile those that are up to
159 # date. Some files don't actually get compiled because they set the
160 # local variable no-byte-compile.
162 # All .elc files are made writable before compilation in case we
163 # checked out read-only (CVS option -r). Files MUST be compiled one by
164 # one. If we compile several files in a row we can't make sure that
165 # the compilation environment is clean. We also set the load-path of
166 # the Emacs used for compilation to the current directory and its
167 # subdirectories, to make sure require's and load's in the files being
168 # compiled find the right files.
170 # `|| true' below prevents old Bash versions from getting confused
172 compile
: $(lisp
)/subdirs.el mh-autoloads doit
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 \
180 echo Compiling
$$el; \
181 $(emacs
) $(BYTE_COMPILE_EXTRA_FLAGS
) -f batch-byte-compile-if-not-done
$$el || exit
1; \
185 # Compile all Lisp files. This is like `compile' but compiles files
186 # unconditionally. Some files don't actually get compiled because they
187 # set the local variable no-byte-compile.
189 compile-always
: $(lisp
)/subdirs.el mh-autoloads doit
190 # `|| true' prevents old Bash versions from getting confused
192 find
$(lisp
) -name
"*.elc" -print | xargs chmod
+w
>/dev
/null
2>&1 || true
; \
193 wd
=$(lisp
); $(setwins
); \
194 els
=`echo $$wins | tr ' \011' '\012\012' | \
195 sed -e 's|\(.\)$$|\1/|' -e 's|^\./||' -e 's|$$|*.el|'`; \
196 for el in
$(COMPILE_FIRST
) $$els; do \
199 echo Compiling
$$el; \
200 $(emacs
) $(BYTE_COMPILE_EXTRA_FLAGS
) -f batch-byte-compile
$$el || exit
1; \
205 for el in
`find $(lisp)/calc -name '*.el'`; do \
206 echo Compiling
$$el; \
207 $(emacs
) $(BYTE_COMPILE_EXTRA_FLAGS
) -f batch-byte-compile
$$el || exit
1; \
210 # Backup compiled Lisp files in elc.tar.gz. If that file already
211 # exists, make a backup of it.
213 backup-compiled-files
:
214 -mv
$(lisp
)/elc.
tar.gz
$(lisp
)/elc.
tar.gz~
215 -tar czf
$(lisp
)/elc.
tar.gz
$(lisp
)/*.elc
$(lisp
)/*/*.elc
217 # Compile Lisp files, but save old compiled files first.
219 compile-after-backup
: backup-compiled-files compile-always
221 # Recompile all Lisp files which are newer than their .elc files and compile
224 recompile
: doit mh-autoloads
$(lisp
)/progmodes
/cc-mode.elc
225 LC_ALL
=C
$(emacs
) --eval
"(batch-byte-recompile-directory 0)" $(lisp
)
227 # CC Mode uses a compile time macro system which causes a compile time
228 # dependency in cc-mode.elc on the macros in cc-langs.el and the
229 # version string in cc-defs.el.
230 $(lisp
)/progmodes
/cc-mode.elc
: \
231 $(lisp
)/progmodes
/cc-mode.el \
232 $(lisp
)/progmodes
/cc-langs.el \
233 $(lisp
)/progmodes
/cc-defs.el
234 $(emacs
) $(BYTE_COMPILE_EXTRA_FLAGS
) -f batch-byte-compile
$(lisp
)/progmodes
/cc-mode.el
236 # Update MH-E internal autoloads. These are not to be confused with
237 # the autoloads for the MH-E entry points, which are already in
239 MH_E_SRC
= $(lisp
)/mh-e
/mh-acros.el
$(lisp
)/mh-e
/mh-alias.el \
240 $(lisp
)/mh-e
/mh-buffers.el
$(lisp
)/mh-e
/mh-compat.el \
241 $(lisp
)/mh-e
/mh-comp.el
$(lisp
)/mh-e
/mh-e.el \
242 $(lisp
)/mh-e
/mh-folder.el
$(lisp
)/mh-e
/mh-funcs.el \
243 $(lisp
)/mh-e
/mh-gnus.el
$(lisp
)/mh-e
/mh-identity.el \
244 $(lisp
)/mh-e
/mh-inc.el
$(lisp
)/mh-e
/mh-junk.el \
245 $(lisp
)/mh-e
/mh-letter.el
$(lisp
)/mh-e
/mh-limit.el \
246 $(lisp
)/mh-e
/mh-mime.el
$(lisp
)/mh-e
/mh-print.el \
247 $(lisp
)/mh-e
/mh-scan.el
$(lisp
)/mh-e
/mh-search.el \
248 $(lisp
)/mh-e
/mh-seq.el
$(lisp
)/mh-e
/mh-show.el \
249 $(lisp
)/mh-e
/mh-speed.el
$(lisp
)/mh-e
/mh-thread.el \
250 $(lisp
)/mh-e
/mh-tool-bar.el
$(lisp
)/mh-e
/mh-utils.el \
251 $(lisp
)/mh-e
/mh-xface.el
253 mh-autoloads
: $(lisp
)/mh-e
/mh-loaddefs.el
254 $(lisp
)/mh-e
/mh-loaddefs.el
: $(lisp
)/subdirs.el
$(MH_E_SRC
)
255 echo
";;; mh-loaddefs.el --- automatically extracted autoloads" > $@
257 echo
";; Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc." >> $@
258 echo
";; Author: Bill Wohler <wohler@newt.com>" >> $@
259 echo
";; Keywords: mail" >> $@
260 echo
";;; Commentary:" >> $@
261 echo
";;; Change Log:" >> $@
262 echo
";;; Code:" >> $@
264 echo
"(provide 'mh-loaddefs)" >> $@
265 echo
";; Local Variables:" >> $@
266 echo
";; version-control: never" >> $@
267 echo
";; no-byte-compile: t" >> $@
268 echo
";; no-update-autoloads: t" >> $@
270 echo
";;; mh-loaddefs.el ends here" >> $@
273 --eval
"(setq generate-autoload-cookie \";;;###mh-autoload\")" \
274 --eval
"(setq generated-autoload-file \"$(lisp)/mh-e/mh-loaddefs.el\")" \
275 --eval
"(setq make-backup-files nil)" \
276 -f batch-update-autoloads
$(lisp
)/mh-e
278 # Prepare a bootstrap in the lisp subdirectory.
280 # Build loaddefs.el to make sure it's up-to-date. If it's not, that
281 # might lead to errors during the bootstrap because something fails to
282 # autoload as expected. If there is no emacs binary, then we can't
283 # build autoloads yet. In that case we have to use ldefs-boot.el.
284 # Bootstrap should always work with ldefs-boot.el. Therefore,
285 # whenever a new autoload cookie gets added that is necessary during
286 # bootstrapping, ldefs-boot.el should be updated by overwriting it with
287 # an up-to-date copy of loaddefs.el that is uncorrupted by
288 # local changes. (Because loaddefs.el is an automatically generated
289 # file, we don't want to store it in the source repository).
291 # The chmod +w is to handle env var CVSREAD=1. Files named
292 # are identified by being the value of `generated-autoload-file'.
295 if
test -x
$(EMACS
); then \
296 $(MAKE
) $(MFLAGS
) autoloads
; \
298 cp
$(lisp
)/ldefs-boot.el
$(lisp
)/loaddefs.el
; \
300 chmod
+w
$(lisp
)/loaddefs.el \
301 $(lisp
)/ps-print.el \
302 $(lisp
)/emacs-lisp
/cl-loaddefs.el
304 maintainer-clean
: distclean bootstrap-clean
305 cd
$(lisp
); rm -f
$(AUTOGENEL
)
307 ## NB note that this rules assume only one level of subdirs below lisp/.
308 ## If nested subdirs are added, it's probably time to switch to:
309 ## find $(lisp) -name "*.elc" -exec rm -f '{}' ';'
311 cd
$(lisp
); rm -f
*.elc
*/*.elc
313 # Generate/update files for the bootstrap process.
315 bootstrap
: update-subdirs autoloads compile
317 # Generate/update files after the bootstrap process.
318 # custom-deps needs `preloaded-file-list'.
320 bootstrap-after
: finder-data custom-deps
325 .PHONY
: check-declare
328 $(emacs
) -l
$(lisp
)/emacs-lisp
/check-declare \
329 --eval
'(check-declare-directory "$(lisp)")'
331 # Makefile ends here.