Doc fixes.
[emacs.git] / lisp / Makefile
blob650099956d7499cbc321e0db7d3ef7e59d369240
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 ...".
8 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 # The actual Emacs command run in the targets below.
37 emacs = $(EMACS) $(EMACSOPT)
39 # Common command to find subdirectories
41 setwins=subdirs=`find $$wd -type d -print`; \
42 for file in $$subdirs; do \
43 case $$file in */Old | */RCS | */CVS | */CVS/* | */=* ) ;; \
44 *) wins="$$wins $$file" ;; \
45 esac; \
46 done
48 doit:
50 cus-load.el:
51 touch $@
52 custom-deps: cus-load.el doit
53 wd=.; $(setwins); \
54 echo Directories: $$wins; \
55 $(emacs) -l cus-dep -f custom-make-dependencies $$wins
57 finder-inf.el:
58 echo "(provide 'finder-inf)" >> $@
59 finder-data: finder-inf.el doit
60 wd=.; $(setwins); \
61 echo Directories: $$wins; \
62 $(emacs) -l finder -f finder-compile-keywords-make-dist $$wins
64 loaddefs.el:
65 echo ";;; loaddefs.el --- automatically extracted autoloads" >> $@
66 echo ";;" >> $@; echo ";;; Code:" >> $@
67 echo "\f" >> $@
68 echo ";;; Local Variables:" >> $@
69 echo ";;; version-control: never" >> $@
70 echo ";;; no-byte-compile: t" >> $@
71 echo ";;; no-update-autoloads: t" >> $@
72 echo ";;; End:" >> $@
73 echo ";;; loaddefs.el ends here" >> $@
74 autoloads: loaddefs.el doit
75 wd=.; $(setwins); \
76 echo Directories: $$wins; \
77 $(emacs) --eval '(setq generated-autoload-file "'`pwd`'/loaddefs.el")' -f batch-update-autoloads $$wins
79 subdirs.el:
80 $(MAKE) $(MFLAGS) update-subdirs
81 update-subdirs: doit
82 wd=.; $(setwins); \
83 for file in $$wins; do \
84 ../update-subdirs $$file; \
85 done;
87 updates: update-subdirs autoloads finder-data custom-deps
89 TAGS: $(lisptagsfiles1) $(lisptagsfiles2)
90 ${ETAGS} $(lisptagsfiles1) $(lisptagsfiles2)
92 TAGS-LISP: $(lispsource)$(lisptagsfiles1) $(lispsource)$(lisptagsfiles2)
93 ${ETAGS} -o TAGS-LISP \
94 $(lispsource)$(lisptagsfiles1) $(lispsource)$(lisptagsfiles2)
96 .el.elc: subdirs.el
97 -EMACSLOADPATH=`pwd` $(emacs) -f batch-byte-compile $<
99 $(DONTCOMPILE:.el=.elc):
100 -rm -f $@
102 # Compile all Lisp files, except those from DONTCOMPILE. This
103 # compiles files unconditionally. All .elc files are made writable
104 # before compilation in case we checked out read-only (CVS option -r).
105 # Files MUST be compiled one by one. If we compile several files in a
106 # row we can't make sure that the compilation environment is clean.
107 # We also set the load-path of the Emacs used for compilation to the
108 # current directory and its subdirectories, to make sure require's and
109 # load's in the files being compiled find the right files.
111 compile-files: subdirs.el doit
112 find . -name "*.elc" -print | xargs chmod +w; \
113 wd=.; $(setwins); \
114 elpat=`echo $$wins | tr ' ' '\012\012' | \
115 sed -e 's|\(.\)$$|\1/|' -e 's|^\./||' -e 's|$$|*.el|'`; \
116 els=`echo $$elpat $(DONTCOMPILE) | tr ' ' '\012\012' | sort | uniq -u`; \
117 for el in $$els; do \
118 echo Compiling $$el; \
119 EMACSLOADPATH=`pwd` $(emacs) -f batch-byte-compile $$el ;\
120 done
122 # Backup compiled Lisp files in elc.tar.gz. If that file already
123 # exists, make a backup of it.
125 backup-compiled-files:
126 -mv elc.tar.gz elc.tar.gz~
127 tar czf elc.tar.gz *.elc */*.elc
129 # Compile Lisp files, but save old compiled files first.
131 compile: backup-compiled-files compile-files
133 # Recompile all Lisp files which are newer than their .elc files.
134 # Note that this doesn't create .elc files. It only recompiles if an
135 # .elc is present.
137 recompile: doit
138 $(emacs) -f batch-byte-recompile-directory .
140 # Remove files for a bootstrap. Compiled Lisp files must be removed
141 # because otherwise `bootstrap-emacs' would not be built from sources.
143 bootstrap-clean:
144 -rm -f *.elc */*.elc
146 # Generate/update files for the bootstrap process.
148 bootstrap: compile-files autoloads custom-deps
150 # Makefile ends here.