2 # Maintenance productions for the Lisp directory
11 # You can specify a different executable on the make command line,
12 # e.g. "make EMACS=../src/emacs ...".
16 # Command line flags for Emacs. This must include --multibyte,
17 # otherwise some files will not compile.
19 EMACSOPT
= -batch
--no-site-file
--multibyte
21 SOURCES
= *.el COPYING Makefile
22 lisptagsfiles1
= $(lisp
)/[a-zA-Z
]*.el
23 lisptagsfiles2
= $(lisp
)/[a-zA-Z
]*/[a-zA-Z
]*.el
24 ETAGS
= ..
/lib-src
/etags
26 # Files which should not be compiled.
27 # - emacs-lisp/cl-specs.el: only contains `def-edebug-spec's so there's
28 # no point compiling it, although it doesn't hurt.
33 $(lisp
)/cus-start.el \
34 $(lisp
)/emacs-lisp
/cl-specs.el \
35 $(lisp
)/finder-inf.el \
37 $(lisp
)/forms-pass.el \
38 $(lisp
)/generic-x.el \
39 $(lisp
)/international
/latin-1.el \
40 $(lisp
)/international
/latin-2.el \
41 $(lisp
)/international
/latin-3.el \
42 $(lisp
)/international
/latin-4.el \
43 $(lisp
)/international
/latin-5.el \
44 $(lisp
)/international
/latin-8.el \
45 $(lisp
)/international
/latin-9.el \
46 $(lisp
)/international
/mule-conf.el \
49 $(lisp
)/mail
/blessmail.el \
53 $(lisp
)/play
/bruce.el \
55 $(lisp
)/term
/internal.el \
58 # Files to compile before others during a bootstrap. This is done
59 # to speed up the bootstrap process.
62 $(lisp
)/emacs-lisp
/byte-opt.el \
63 $(lisp
)/emacs-lisp
/bytecomp.el \
66 # The actual Emacs command run in the targets below.
68 emacs
= $(EMACS
) $(EMACSOPT
)
70 # Common command to find subdirectories
72 setwins
=subdirs
=`find $$wd -type d -print`; \
73 for file in
$$subdirs; do \
74 case
$$file in
*/Old |
*/RCS |
*/CVS |
*/CVS
/* |
*/=* ) ;; \
75 *) wins
="$$wins $$file" ;; \
83 custom-deps
: cus-load.el doit
84 wd
=$(lisp
); $(setwins
); \
85 echo Directories
: $$wins; \
86 $(emacs
) -l cus-dep
-f custom-make-dependencies
$$wins
89 echo
"(provide 'finder-inf)" >> $@
90 finder-data
: finder-inf.el doit
91 wd
=$(lisp
); $(setwins
); \
92 echo Directories
: $$wins; \
93 $(emacs
) -l finder
-f finder-compile-keywords-make-dist
$$wins
96 echo
";;; loaddefs.el --- automatically extracted autoloads" >> $@
97 echo
";;" >> $@
; echo
";;; Code:" >> $@
99 echo
";;; Local Variables:" >> $@
100 echo
";;; version-control: never" >> $@
101 echo
";;; no-byte-compile: t" >> $@
102 echo
";;; no-update-autoloads: t" >> $@
103 echo
";;; End:" >> $@
104 echo
";;; loaddefs.el ends here" >> $@
105 autoloads
: loaddefs.el doit
106 wd
=$(lisp
); $(setwins
); \
107 echo Directories
: $$wins; \
108 $(emacs
) -l autoload
--eval
'(setq generated-autoload-file "$(lisp)/loaddefs.el")' -f batch-update-autoloads
$$wins
111 $(MAKE
) $(MFLAGS
) update-subdirs
113 wd
=$(lisp
); $(setwins
); \
114 for file in
$$wins; do \
115 $(srcdir)/update-subdirs
$$file; \
118 updates
: update-subdirs autoloads finder-data custom-deps
120 TAGS
: $(lisptagsfiles1
) $(lisptagsfiles2
)
121 ${ETAGS} $(lisptagsfiles1
) $(lisptagsfiles2
)
123 TAGS-LISP
: $(lispsource
)$(lisptagsfiles1
) $(lispsource
)$(lisptagsfiles2
)
124 ${ETAGS} -o TAGS-LISP \
125 $(lispsource
)$(lisptagsfiles1
) $(lispsource
)$(lisptagsfiles2
)
128 -EMACSLOADPATH
=$(lisp
) $(emacs
) -f batch-byte-compile
$<
130 $(DONTCOMPILE
:.el
=.elc
):
133 # Compile all Lisp files, except those from DONTCOMPILE. This
134 # compiles files unconditionally. All .elc files are made writable
135 # before compilation in case we checked out read-only (CVS option -r).
136 # Files MUST be compiled one by one. If we compile several files in a
137 # row we can't make sure that the compilation environment is clean.
138 # We also set the load-path of the Emacs used for compilation to the
139 # current directory and its subdirectories, to make sure require's and
140 # load's in the files being compiled find the right files.
142 compile-files
: subdirs.el doit
143 find
$(lisp
) -name
"*.elc" -print | xargs chmod
+w
; \
144 wd
=$(lisp
); $(setwins
); \
145 elpat
=`echo $$wins | tr ' ' '\012\012' | \
146 sed -e 's|\(.\)$$|\1/|' -e 's|^\./||' -e 's|$$|*.el|'`; \
147 els
=`echo $$elpat $(DONTCOMPILE) $(COMPILE_FIRST) | \
148 tr ' ' '\012\012' | sort | uniq -u`; \
149 for el in
$(COMPILE_FIRST
) $$els; do \
150 echo Compiling
$$el; \
151 EMACSLOADPATH
=$(lisp
) $(emacs
) -f batch-byte-compile
$$el; \
154 # Backup compiled Lisp files in elc.tar.gz. If that file already
155 # exists, make a backup of it.
157 backup-compiled-files
:
158 -mv
$(lisp
)/elc.
tar.gz
$(lisp
)/elc.
tar.gz~
159 -tar czf
$(lisp
)/elc.
tar.gz
$(lisp
)/*.elc
$(lisp
)/*/*.elc
161 # Compile Lisp files, but save old compiled files first.
163 compile
: backup-compiled-files compile-files
165 # Recompile all Lisp files which are newer than their .elc files.
166 # Note that this doesn't create .elc files. It only recompiles if an
170 $(emacs
) -f batch-byte-recompile-directory
$(lisp
)
172 # Prepare a bootstrap in the lisp subdirectory. Build loaddefs.el,
173 # because it's not sure it's up-to-date, and if it's not, that might
174 # lead to errors during the bootstrap because something fails to
175 # autoload as expected. Remove compiled Lisp files so that
176 # bootstrap-emacs will be built from sources only.
179 if
test -f
$(EMACS
); then
$(MAKE
) $(MFLAGS
) autoloads
; fi
180 -rm -f
$(lisp
)/*.elc
$(lisp
)/*/*.elc
182 # Generate/update files for the bootstrap process.
184 bootstrap
: autoloads compile-files custom-deps
187 -rm -f
$(lisp
)/Makefile
189 # Makefile ends here.