]> code.delx.au - gnu-emacs/blob - lisp/Makefile
(make-autoload): Other typo. I'm getting tired.
[gnu-emacs] / lisp / Makefile
1 #
2 # Maintenance productions for the Lisp directory
3 #
4
5 # You can specify a different executable on the make command line,
6 # e.g. "make EMACS=../src/emacs ...".
7
8 EMACS = ../src/emacs
9
10 # Command line flags for Emacs. This must include --multibyte,
11 # otherwise some files will not compile.
12
13 EMACSOPT = --no-init-file --no-site-file --multibyte -batch
14
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
19
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.
24
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
34
35 # Files to compile before others during a bootstrap. This is done
36 # to speed up the bootstrap process.
37
38 COMPILE_FIRST = emacs-lisp/bytecomp.el emacs-lisp/byte-opt.el subr.el
39
40 # The actual Emacs command run in the targets below.
41
42 emacs = $(EMACS) $(EMACSOPT)
43
44 # Common command to find subdirectories
45
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" ;; \
50 esac; \
51 done
52
53 doit:
54
55 cus-load.el:
56 touch $@
57 custom-deps: cus-load.el doit
58 wd=.; $(setwins); \
59 echo Directories: $$wins; \
60 $(emacs) -l cus-dep -f custom-make-dependencies $$wins
61
62 finder-inf.el:
63 echo "(provide 'finder-inf)" >> $@
64 finder-data: finder-inf.el doit
65 wd=.; $(setwins); \
66 echo Directories: $$wins; \
67 $(emacs) -l finder -f finder-compile-keywords-make-dist $$wins
68
69 loaddefs.el:
70 echo ";;; loaddefs.el --- automatically extracted autoloads" >> $@
71 echo ";;" >> $@; echo ";;; Code:" >> $@
72 echo "\f" >> $@
73 echo ";;; Local Variables:" >> $@
74 echo ";;; version-control: never" >> $@
75 echo ";;; no-byte-compile: t" >> $@
76 echo ";;; no-update-autoloads: t" >> $@
77 echo ";;; End:" >> $@
78 echo ";;; loaddefs.el ends here" >> $@
79 autoloads: loaddefs.el doit
80 wd=.; $(setwins); \
81 echo Directories: $$wins; \
82 $(emacs) --eval '(setq generated-autoload-file "'`pwd`'/loaddefs.el")' -f batch-update-autoloads $$wins
83
84 subdirs.el:
85 $(MAKE) $(MFLAGS) update-subdirs
86 update-subdirs: doit
87 wd=.; $(setwins); \
88 for file in $$wins; do \
89 ../update-subdirs $$file; \
90 done;
91
92 updates: update-subdirs autoloads finder-data custom-deps
93
94 TAGS: $(lisptagsfiles1) $(lisptagsfiles2)
95 ${ETAGS} $(lisptagsfiles1) $(lisptagsfiles2)
96
97 TAGS-LISP: $(lispsource)$(lisptagsfiles1) $(lispsource)$(lisptagsfiles2)
98 ${ETAGS} -o TAGS-LISP \
99 $(lispsource)$(lisptagsfiles1) $(lispsource)$(lisptagsfiles2)
100
101 .el.elc: subdirs.el
102 -EMACSLOADPATH=`pwd` $(emacs) -f batch-byte-compile $<
103
104 $(DONTCOMPILE:.el=.elc):
105 -rm -f $@
106
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.
115
116 compile-files: subdirs.el doit
117 find . -name "*.elc" -print | xargs chmod +w; \
118 wd=.; $(setwins); \
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 ;\
126 done
127
128 # Backup compiled Lisp files in elc.tar.gz. If that file already
129 # exists, make a backup of it.
130
131 backup-compiled-files:
132 -mv elc.tar.gz elc.tar.gz~
133 tar czf elc.tar.gz *.elc */*.elc
134
135 # Compile Lisp files, but save old compiled files first.
136
137 compile: backup-compiled-files compile-files
138
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
141 # .elc is present.
142
143 recompile: doit
144 $(emacs) -f batch-byte-recompile-directory .
145
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.
151
152 bootstrap-clean:
153 if test -f $(emacs); then $(MAKE) $(MFLAGS) autoloads; fi
154 -rm -f *.elc */*.elc
155
156 # Generate/update files for the bootstrap process.
157
158 bootstrap: compile-files autoloads custom-deps
159
160 # Makefile ends here.