Commit | Line | Data |
---|---|---|
c7685c8d PA |
1 | # |
2 | # Maintenance productions for the Lisp directory | |
3 | # | |
7ec641b8 GM |
4 | |
5 | # You can specify a different executable on the make command line, | |
6 | # e.g. "make EMACS=../src/emacs ...". | |
7 | ||
8 | EMACS = 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 | ||
c7685c8d | 15 | SOURCES = *.el COPYING Makefile |
7ab2c289 RS |
16 | lisptagsfiles1 = [a-zA-Z]*.el |
17 | lisptagsfiles2 = [a-zA-Z]*/[a-zA-Z]*.el | |
3975988b | 18 | ETAGS = ../lib-src/etags |
c7685c8d | 19 | |
7ec641b8 GM |
20 | # Leave this in. I don't know if some utility depends on it. |
21 | ||
e51f50ef | 22 | dontcompilefiles: bindings.el blessmail.el bruce.el cus-load.el cus-start.el |
36d31689 | 23 | dontcompilefiles: forms-d2.el forms-pass.el |
65ef095e | 24 | dontcompilefiles: latin-1.el latin-2.el latin-3.el latin-4.el latin-5.el |
e51f50ef RS |
25 | dontcompilefiles: loaddefs.el loadup.el mule-conf.el patcomp.el |
26 | dontcompilefiles: paths.el sc.el subdirs.el term-nasty.el version.el | |
4dab794f | 27 | dontcompilefiles: generic-x.el latin-8.el latin-9.el |
e51f50ef | 28 | |
7ec641b8 GM |
29 | # Files which should not be compiled. All file names must be relative |
30 | # to the `lisp' directory. | |
31 | ||
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 | |
40 | ||
41 | # All Lisp source files in the current directory. | |
42 | ||
43 | EL = $(lisptagsfiles1) $(lisptagsfiles2) | |
44 | ||
45 | # The actual Emacs command run in the targets below. | |
46 | ||
47 | emacs = $(EMACS) $(EMACSOPT) | |
48 | ||
96ff0f09 GM |
49 | # The Emacs used to compile Lisp files from scratch. |
50 | ||
51 | temacs=../src/temacs -batch -l ./loadup.el | |
52 | ||
80c382e5 | 53 | # Common command to find subdirectories |
7ec641b8 | 54 | |
80c382e5 | 55 | setwins=subdirs=`find . -type d -print`; \ |
f83a4f35 | 56 | for file in $$subdirs; do \ |
80c382e5 | 57 | case $$file in */Old | */RCS | */CVS | */CVS/* | */=* ) ;; \ |
f83a4f35 RS |
58 | *) wins="$$wins $$file" ;; \ |
59 | esac; \ | |
80c382e5 SM |
60 | done |
61 | ||
62 | doit: | |
63 | ||
64 | custom-deps: doit | |
65 | $(setwins); \ | |
4746aeeb | 66 | echo Directories: $$wins; \ |
7ec641b8 | 67 | $(emacs) -l cus-dep -f custom-make-dependencies $$wins |
009368b9 | 68 | |
ff45a04d | 69 | finder-data: doit |
80c382e5 | 70 | $(setwins); \ |
4746aeeb | 71 | echo Directories: $$wins; \ |
7ec641b8 | 72 | $(emacs) -l finder -f finder-compile-keywords-make-dist $$wins |
009368b9 RS |
73 | |
74 | autoloads: doit | |
80c382e5 | 75 | $(setwins); \ |
4746aeeb | 76 | echo Directories: $$wins; \ |
7ec641b8 | 77 | $(emacs) -f batch-update-autoloads $$wins |
f83a4f35 | 78 | |
98b918b6 | 79 | update-subdirs: doit |
80c382e5 | 80 | $(setwins); \ |
98b918b6 RS |
81 | for file in $$wins; do \ |
82 | ../update-subdirs $$file; \ | |
83 | done; | |
84 | ||
f83a4f35 | 85 | updates: doit |
80c382e5 | 86 | $(setwins); \ |
98b918b6 RS |
87 | for file in $$wins; do \ |
88 | ../update-subdirs $$file; \ | |
89 | done; \ | |
4746aeeb | 90 | echo Directories: $$wins; \ |
7ec641b8 GM |
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 | |
c48c3772 | 94 | |
7ab2c289 RS |
95 | TAGS: $(lisptagsfiles1) $(lisptagsfiles2) |
96 | ${ETAGS} $(lisptagsfiles1) $(lisptagsfiles2) | |
97 | ||
98 | TAGS-LISP: $(lispsource)$(lisptagsfiles1) $(lispsource)$(lisptagsfiles2) | |
99 | ${ETAGS} -o TAGS-LISP \ | |
100 | $(lispsource)$(lisptagsfiles1) $(lispsource)$(lisptagsfiles2) | |
7ec641b8 GM |
101 | |
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). | |
57f707e7 GM |
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. | |
7ec641b8 GM |
111 | |
112 | compile: doit | |
57f707e7 | 113 | wd=`pwd`; \ |
96ff0f09 | 114 | find $$wd -name "*.elc" -print | xargs chmod +w; \ |
57f707e7 GM |
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))"; \ | |
7ec641b8 GM |
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 \ | |
57f707e7 | 132 | $(emacs) --eval "$$loadpath" -f batch-byte-compile $$el; \ |
7ec641b8 GM |
133 | else \ |
134 | echo "Don't compile $$el"; \ | |
135 | fi; \ | |
57f707e7 | 136 | done |
7ec641b8 | 137 | |
96ff0f09 GM |
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. | |
141 | ||
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 | |
167 | ||
168 | ||
7ec641b8 GM |
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. | |
172 | ||
173 | recompile: doit | |
174 | $(emacs) -f batch-byte-recompile-directory . | |
175 | ||
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 | ||
182 | autoloads-with-other-emacs: doit | |
183 | subdirs=`find . -type d -print`; \ | |
184 | for file in $$subdirs; do \ | |
185 | case $$file in */Old | */RCS | */CVS | */=* ) ;; \ | |
186 | *) wins="$$wins $$file" ;; \ | |
187 | esac; \ | |
188 | done; \ | |
189 | echo Directories: $$wins; \ | |
190 | $(emacs) --eval '(setq source-directory ".")' \ | |
191 | -f batch-update-autoloads $$wins | |
192 | ||
193 | # Makefile ends here. |