(Info-on-current-buffer): new entry point.
[emacs.git] / lisp / Makefile
blob8c56ff3a5097ff76a1929377333fb100ce178e5a
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 = 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 # Leave this in. I don't know if some utility depends on it.
22 dontcompilefiles: bindings.el blessmail.el bruce.el cus-load.el cus-start.el
23 dontcompilefiles: forms-d2.el forms-pass.el
24 dontcompilefiles: latin-1.el latin-2.el latin-3.el latin-4.el latin-5.el
25 dontcompilefiles: loaddefs.el loadup.el mule-conf.el patcomp.el
26 dontcompilefiles: paths.el sc.el subdirs.el term-nasty.el version.el
27 dontcompilefiles: generic-x.el latin-8.el latin-9.el
29 # Files which should not be compiled. All file names must be relative
30 # to the `lisp' directory.
32 DONTCOMPILE = bindings.el mail/blessmail.el play/bruce.el cus-load.el \
33 cus-start.el forms-d2.el forms-pass.el \
34 international/latin-1.el international/latin-2.el \
35 international/latin-3.el international/latin-4.el \
36 international/latin-5.el \
37 loaddefs.el loadup.el international/mule-conf.el patcomp.el \
38 paths.el mail/sc.el subdirs.el term-nasty.el version.el \
39 generic-x.el international/latin-8.el international/latin-9.el
41 # All Lisp source files in the current directory.
43 EL = $(lisptagsfiles1) $(lisptagsfiles2)
45 # The actual Emacs command run in the targets below.
47 emacs = $(EMACS) $(EMACSOPT)
49 # The Emacs used to compile Lisp files from scratch.
51 temacs=../src/temacs -batch -l ./loadup.el
53 # Common command to find subdirectories
55 setwins=subdirs=`find $$wd -type d -print`; \
56 for file in $$subdirs; do \
57 case $$file in */Old | */RCS | */CVS | */CVS/* | */=* ) ;; \
58 *) wins="$$wins $$file" ;; \
59 esac; \
60 done
62 doit:
64 custom-deps: doit
65 wd=.; $(setwins); \
66 echo Directories: $$wins; \
67 $(emacs) -l cus-dep -f custom-make-dependencies $$wins
69 finder-data: doit
70 wd=.; $(setwins); \
71 echo Directories: $$wins; \
72 $(emacs) -l finder -f finder-compile-keywords-make-dist $$wins
74 autoloads: doit
75 wd=.; $(setwins); \
76 echo Directories: $$wins; \
77 $(emacs) -f batch-update-autoloads $$wins
79 update-subdirs: doit
80 wd=.; $(setwins); \
81 for file in $$wins; do \
82 ../update-subdirs $$file; \
83 done;
85 updates: doit
86 wd=.; $(setwins); \
87 for file in $$wins; do \
88 ../update-subdirs $$file; \
89 done; \
90 echo Directories: $$wins; \
91 $(emacs) -l cus-dep -f custom-make-dependencies $$wins; \
92 $(emacs) -l finder -f finder-compile-keywords-make-dist $$wins; \
93 $(emacs) -f batch-update-autoloads $$wins
95 TAGS: $(lisptagsfiles1) $(lisptagsfiles2)
96 ${ETAGS} $(lisptagsfiles1) $(lisptagsfiles2)
98 TAGS-LISP: $(lispsource)$(lisptagsfiles1) $(lispsource)$(lisptagsfiles2)
99 ${ETAGS} -o TAGS-LISP \
100 $(lispsource)$(lisptagsfiles1) $(lispsource)$(lisptagsfiles2)
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, otherwise apparently
106 # eval-when-compile's in some Lisp files make problems in files being
107 # compiled later. We also set the load-path of the Emacs used for
108 # compilation to the current directory and its subdirectories, to
109 # make sure require's and load's in the files being compiled find
110 # the right files.
112 compile: doit
113 wd=`pwd`; \
114 find $$wd -name "*.elc" -print | xargs chmod +w; \
115 subdirs=`find $$wd -type d -print`; \
116 for dir in $$subdirs; do \
117 case $$dir in \
118 */Old | */RCS | */CVS | */=* ) ;; \
119 *) loadpath="$$loadpath \"$$dir\"" ;; \
120 esac; \
121 done; \
122 loadpath="(setq load-path '($$loadpath))"; \
123 dont_compile=`echo $(DONTCOMPILE)`; \
124 for el in $(EL); do \
125 compile_it=y; \
126 for dont in $$dont_compile; do \
127 if test $$el = $$dont; then \
128 compile_it=n; \
129 fi; \
130 done; \
131 if test $$compile_it = y; then \
132 $(emacs) --eval "$$loadpath" -f batch-byte-compile $$el; \
133 else \
134 echo "Don't compile $$el"; \
135 fi; \
136 done
138 # Compile Lisp files when all we have is the temacs in ../src. All
139 # .elc files under the current directory are deleted first to make
140 # sure we start from a clean basis.
142 bootstrap-compile: doit
143 wd=`pwd`; \
144 find $$wd -name "*.elc" -print | xargs rm -f \
145 subdirs=`find $$wd -type d -print`; \
146 for dir in $$subdirs; do \
147 case $$dir in \
148 */Old | */RCS | */CVS | */=* ) ;; \
149 *) loadpath="$$loadpath \"$$dir\"" ;; \
150 esac; \
151 done; \
152 loadpath="(setq load-path '($$loadpath))"; \
153 dont_compile=`echo $(DONTCOMPILE)`; \
154 for el in $(EL); do \
155 compile_it=y; \
156 for dont in $$dont_compile; do \
157 if test $$el = $$dont; then \
158 compile_it=n; \
159 fi; \
160 done; \
161 if test $$compile_it = y; then \
162 $(temacs) --eval "$$loadpath" -f batch-byte-compile $$el; \
163 else \
164 echo "Don't compile $$el"; \
165 fi; \
166 done
169 # Recompile all Lisp files which are newer than their .elc files.
170 # Note that this doesn't create .elc files. It only recompiles if an
171 # .elc is present.
173 recompile: doit
174 $(emacs) -f batch-byte-recompile-directory .
176 # Build loaddefs.el but with an Emacs executable which was not built
177 # in the current directory tree. The problem in this case is that
178 # autoload.el reads and writes loaddefs.el in its `source-directory'.
179 # If that's different from the current directory tree, we can't build
180 # loaddefs.el.
181 # Can't this rule be used in place of `autoload'? -sm
183 autoloads-with-other-emacs: doit
184 wd=.; $(setwins); \
185 echo Directories: $$wins; \
186 $(emacs) --eval '(setq source-directory ".")' \
187 -f batch-update-autoloads $$wins
189 # Makefile ends here.