2 # Maintenance productions for the Lisp directory
5 # You can specify a different executable on the make command line,
6 # e.g. "make EMACS=../src/emacs ...".
10 # Command line flags for Emacs. This must include --multibyte,
11 # otherwise some files will not compile.
13 EMACSOPT
= --no-init-file
--no-site-file
--multibyte
-batch
15 SOURCES
= *.el COPYING Makefile
16 lisptagsfiles1
= [a-zA-Z
]*.el
17 lisptagsfiles2
= [a-zA-Z
]*/[a-zA-Z
]*.el
18 ETAGS
= ..
/lib-src
/etags
20 # Files which should not be compiled. All file names must be relative
21 # to the `lisp' directory.
22 # - emacs-lisp/cl-specs.el: only contains `def-edebug-spec's so there's
23 # no point compiling it, although it doesn't hurt.
25 DONTCOMPILE
= bindings.el mail
/blessmail.el play
/bruce.el cus-load.el \
26 cus-start.el forms-d2.el forms-pass.el \
27 international
/latin-1.el international
/latin-2.el \
28 international
/latin-3.el international
/latin-4.el \
29 international
/latin-5.el \
30 loaddefs.el loadup.el international
/mule-conf.el patcomp.el \
31 paths.el mail
/sc.el subdirs.el version.el \
32 generic-x.el international
/latin-8.el international
/latin-9.el \
33 emacs-lisp
/cl-specs.el finder-inf.el term
/internal.el
35 # Files to compile before others during a bootstrap. This is done
36 # to speed up the bootstrap process.
38 COMPILE_FIRST
= emacs-lisp
/bytecomp.el emacs-lisp
/byte-opt.el subr.el
40 # The actual Emacs command run in the targets below.
42 emacs
= $(EMACS
) $(EMACSOPT
)
44 # Common command to find subdirectories
46 setwins
=subdirs
=`find $$wd -type d -print`; \
47 for file in
$$subdirs; do \
48 case
$$file in
*/Old |
*/RCS |
*/CVS |
*/CVS
/* |
*/=* ) ;; \
49 *) wins
="$$wins $$file" ;; \
57 custom-deps
: cus-load.el doit
59 echo Directories
: $$wins; \
60 $(emacs
) -l cus-dep
-f custom-make-dependencies
$$wins
63 echo
"(provide 'finder-inf)" >> $@
64 finder-data
: finder-inf.el doit
66 echo Directories
: $$wins; \
67 $(emacs
) -l finder
-f finder-compile-keywords-make-dist
$$wins
70 echo
";;; loaddefs.el --- automatically extracted autoloads" >> $@
71 echo
";;" >> $@
; echo
";;; Code:" >> $@
73 echo
";;; Local Variables:" >> $@
74 echo
";;; version-control: never" >> $@
75 echo
";;; no-byte-compile: t" >> $@
76 echo
";;; no-update-autoloads: t" >> $@
78 echo
";;; loaddefs.el ends here" >> $@
79 autoloads
: loaddefs.el doit
81 echo Directories
: $$wins; \
82 $(emacs
) --eval
'(setq generated-autoload-file "'`pwd`'/loaddefs.el")' -f batch-update-autoloads
$$wins
85 $(MAKE
) $(MFLAGS
) update-subdirs
88 for file in
$$wins; do \
89 ..
/update-subdirs
$$file; \
92 updates
: update-subdirs autoloads finder-data custom-deps
94 TAGS
: $(lisptagsfiles1
) $(lisptagsfiles2
)
95 ${ETAGS} $(lisptagsfiles1
) $(lisptagsfiles2
)
97 TAGS-LISP
: $(lispsource
)$(lisptagsfiles1
) $(lispsource
)$(lisptagsfiles2
)
98 ${ETAGS} -o TAGS-LISP \
99 $(lispsource
)$(lisptagsfiles1
) $(lispsource
)$(lisptagsfiles2
)
102 -EMACSLOADPATH
=`pwd` $(emacs
) -f batch-byte-compile
$<
104 $(DONTCOMPILE
:.el
=.elc
):
107 # Compile all Lisp files, except those from DONTCOMPILE. This
108 # compiles files unconditionally. All .elc files are made writable
109 # before compilation in case we checked out read-only (CVS option -r).
110 # Files MUST be compiled one by one. If we compile several files in a
111 # row we can't make sure that the compilation environment is clean.
112 # We also set the load-path of the Emacs used for compilation to the
113 # current directory and its subdirectories, to make sure require's and
114 # load's in the files being compiled find the right files.
116 compile-files
: subdirs.el doit
117 find .
-name
"*.elc" -print | xargs chmod
+w
; \
119 elpat
=`echo $$wins | tr ' ' '\012\012' | \
120 sed -e 's|\(.\)$$|\1/|' -e 's|^\./||' -e 's|$$|*.el|'`; \
121 els
=`echo $$elpat $(DONTCOMPILE) $(COMPILE_FIRST) | \
122 tr ' ' '\012\012' | sort | uniq -u`; \
123 for el in
$(COMPILE_FIRST
) $$els; do \
124 echo Compiling
$$el; \
125 EMACSLOADPATH
=`pwd` $(emacs
) -f batch-byte-compile
$$el ;\
128 # Backup compiled Lisp files in elc.tar.gz. If that file already
129 # exists, make a backup of it.
131 backup-compiled-files
:
132 -mv elc.
tar.gz elc.
tar.gz~
133 tar czf elc.
tar.gz
*.elc
*/*.elc
135 # Compile Lisp files, but save old compiled files first.
137 compile
: backup-compiled-files compile-files
139 # Recompile all Lisp files which are newer than their .elc files.
140 # Note that this doesn't create .elc files. It only recompiles if an
144 $(emacs
) -f batch-byte-recompile-directory .
146 # Prepare a bootstrap in the lisp subdirectory. Build loaddefs.el,
147 # because it's not sure it's up-to-date, and if it's not, that might
148 # lead to errors during the bootstrap because something fails to
149 # autoload as expected. Remove compiled Lisp files so that
150 # bootstrap-emacs will be built from sources only.
153 if
test -f
$(emacs
); then
$(MAKE
) $(MFLAGS
) autoloads
; fi
156 # Generate/update files for the bootstrap process.
158 bootstrap
: compile-files autoloads custom-deps
160 # Makefile ends here.