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
)/eshell
/esh-maint.el \
36 $(lisp
)/finder-inf.el \
38 $(lisp
)/forms-pass.el \
39 $(lisp
)/generic-x.el \
40 $(lisp
)/international
/latin-1.el \
41 $(lisp
)/international
/latin-2.el \
42 $(lisp
)/international
/latin-3.el \
43 $(lisp
)/international
/latin-4.el \
44 $(lisp
)/international
/latin-5.el \
45 $(lisp
)/international
/latin-8.el \
46 $(lisp
)/international
/latin-9.el \
47 $(lisp
)/international
/mule-conf.el \
50 $(lisp
)/mail
/blessmail.el \
54 $(lisp
)/play
/bruce.el \
56 $(lisp
)/term
/internal.el \
59 # Files to compile before others during a bootstrap. This is done
60 # to speed up the bootstrap process.
63 $(lisp
)/emacs-lisp
/byte-opt.el \
64 $(lisp
)/emacs-lisp
/bytecomp.el \
67 # The actual Emacs command run in the targets below.
69 emacs
= $(EMACS
) $(EMACSOPT
)
71 # Common command to find subdirectories
73 setwins
=subdirs
=`find $$wd -type d -print`; \
74 for file in
$$subdirs; do \
75 case
$$file in
*/Old |
*/RCS |
*/CVS |
*/CVS
/* |
*/=* ) ;; \
76 *) wins
="$$wins $$file" ;; \
84 custom-deps
: cus-load.el doit
85 wd
=$(lisp
); $(setwins
); \
86 echo Directories
: $$wins; \
87 $(emacs
) -l cus-dep
-f custom-make-dependencies
$$wins
90 echo
"(provide 'finder-inf)" >> $@
91 finder-data
: finder-inf.el doit
92 wd
=$(lisp
); $(setwins
); \
93 echo Directories
: $$wins; \
94 $(emacs
) -l finder
-f finder-compile-keywords-make-dist
$$wins
97 echo
";;; loaddefs.el --- automatically extracted autoloads" >> $@
98 echo
";;" >> $@
; echo
";;; Code:" >> $@
100 echo
";;; Local Variables:" >> $@
101 echo
";;; version-control: never" >> $@
102 echo
";;; no-byte-compile: t" >> $@
103 echo
";;; no-update-autoloads: t" >> $@
104 echo
";;; End:" >> $@
105 echo
";;; loaddefs.el ends here" >> $@
106 autoloads
: loaddefs.el doit
107 wd
=$(lisp
); $(setwins
); \
108 echo Directories
: $$wins; \
109 $(emacs
) -l autoload
--eval
'(setq generated-autoload-file "$(lisp)/loaddefs.el")' -f batch-update-autoloads
$$wins
112 $(MAKE
) $(MFLAGS
) update-subdirs
114 wd
=$(lisp
); $(setwins
); \
115 for file in
$$wins; do \
116 $(srcdir)/update-subdirs
$$file; \
119 updates
: update-subdirs autoloads finder-data custom-deps
121 TAGS
: $(lisptagsfiles1
) $(lisptagsfiles2
)
122 ${ETAGS} $(lisptagsfiles1
) $(lisptagsfiles2
)
124 TAGS-LISP
: $(lispsource
)$(lisptagsfiles1
) $(lispsource
)$(lisptagsfiles2
)
125 ${ETAGS} -o TAGS-LISP \
126 $(lispsource
)$(lisptagsfiles1
) $(lispsource
)$(lisptagsfiles2
)
129 -EMACSLOADPATH
=$(lisp
) $(emacs
) -f batch-byte-compile
$<
131 $(DONTCOMPILE
:.el
=.elc
):
134 # Compile all Lisp files, except those from DONTCOMPILE. This
135 # compiles files unconditionally. All .elc files are made writable
136 # before compilation in case we checked out read-only (CVS option -r).
137 # Files MUST be compiled one by one. If we compile several files in a
138 # row we can't make sure that the compilation environment is clean.
139 # We also set the load-path of the Emacs used for compilation to the
140 # current directory and its subdirectories, to make sure require's and
141 # load's in the files being compiled find the right files.
143 compile-files
: subdirs.el doit
144 find
$(lisp
) -name
"*.elc" -print | xargs chmod
+w
; \
145 wd
=$(lisp
); $(setwins
); \
146 elpat
=`echo $$wins | tr ' ' '\012\012' | \
147 sed -e 's|\(.\)$$|\1/|' -e 's|^\./||' -e 's|$$|*.el|'`; \
148 els
=`echo $$elpat $(DONTCOMPILE) $(COMPILE_FIRST) | \
149 tr ' ' '\012\012' | sort | uniq -u`; \
150 for el in
$(COMPILE_FIRST
) $$els; do \
151 echo Compiling
$$el; \
152 EMACSLOADPATH
=$(lisp
) $(emacs
) -f batch-byte-compile
$$el; \
155 # Backup compiled Lisp files in elc.tar.gz. If that file already
156 # exists, make a backup of it.
158 backup-compiled-files
:
159 -mv
$(lisp
)/elc.
tar.gz
$(lisp
)/elc.
tar.gz~
160 -tar czf
$(lisp
)/elc.
tar.gz
$(lisp
)/*.elc
$(lisp
)/*/*.elc
162 # Compile Lisp files, but save old compiled files first.
164 compile
: backup-compiled-files compile-files
166 # Recompile all Lisp files which are newer than their .elc files.
167 # Note that this doesn't create .elc files. It only recompiles if an
171 $(emacs
) -f batch-byte-recompile-directory
$(lisp
)
173 # Prepare a bootstrap in the lisp subdirectory. Build loaddefs.el,
174 # because it's not sure it's up-to-date, and if it's not, that might
175 # lead to errors during the bootstrap because something fails to
176 # autoload as expected. Remove compiled Lisp files so that
177 # bootstrap-emacs will be built from sources only.
180 if
test -f
$(EMACS
); then
$(MAKE
) $(MFLAGS
) autoloads
; fi
181 -rm -f
$(lisp
)/*.elc
$(lisp
)/*/*.elc
183 # Generate/update files for the bootstrap process.
185 bootstrap
: autoloads compile-files custom-deps
188 -rm -f
$(lisp
)/Makefile
190 # Makefile ends here.