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 | ||
49 | ||
c48c3772 PA |
50 | doit: |
51 | ||
ff45a04d | 52 | custom-deps: doit |
f83a4f35 RS |
53 | subdirs=`find . -type d -print`; \ |
54 | for file in $$subdirs; do \ | |
d39c8850 | 55 | case $$file in */Old | */RCS | */CVS | */=* ) ;; \ |
f83a4f35 RS |
56 | *) wins="$$wins $$file" ;; \ |
57 | esac; \ | |
58 | done; \ | |
4746aeeb | 59 | echo Directories: $$wins; \ |
7ec641b8 | 60 | $(emacs) -l cus-dep -f custom-make-dependencies $$wins |
009368b9 | 61 | |
ff45a04d | 62 | finder-data: doit |
f83a4f35 RS |
63 | subdirs=`find . -type d -print`; \ |
64 | for file in $$subdirs; do \ | |
d39c8850 | 65 | case $$file in */Old | */RCS | */CVS | */=* ) ;; \ |
f83a4f35 RS |
66 | *) wins="$$wins $$file" ;; \ |
67 | esac; \ | |
68 | done; \ | |
4746aeeb | 69 | echo Directories: $$wins; \ |
7ec641b8 | 70 | $(emacs) -l finder -f finder-compile-keywords-make-dist $$wins |
009368b9 RS |
71 | |
72 | autoloads: doit | |
f83a4f35 RS |
73 | subdirs=`find . -type d -print`; \ |
74 | for file in $$subdirs; do \ | |
d39c8850 | 75 | case $$file in */Old | */RCS | */CVS | */=* ) ;; \ |
f83a4f35 RS |
76 | *) wins="$$wins $$file" ;; \ |
77 | esac; \ | |
78 | done; \ | |
4746aeeb | 79 | echo Directories: $$wins; \ |
7ec641b8 | 80 | $(emacs) -f batch-update-autoloads $$wins |
f83a4f35 | 81 | |
98b918b6 RS |
82 | update-subdirs: doit |
83 | subdirs=`find . -type d -print`; \ | |
84 | for file in $$subdirs; do \ | |
d39c8850 | 85 | case $$file in */Old | */RCS | */CVS | */=* ) ;; \ |
98b918b6 RS |
86 | *) wins="$$wins $$file" ;; \ |
87 | esac; \ | |
88 | done; \ | |
89 | for file in $$wins; do \ | |
90 | ../update-subdirs $$file; \ | |
91 | done; | |
92 | ||
f83a4f35 RS |
93 | updates: doit |
94 | subdirs=`find . -type d -print`; \ | |
95 | for file in $$subdirs; do \ | |
d39c8850 | 96 | case $$file in */Old | */RCS | */CVS | */=* ) ;; \ |
f83a4f35 RS |
97 | *) wins="$$wins $$file" ;; \ |
98 | esac; \ | |
99 | done; \ | |
98b918b6 RS |
100 | for file in $$wins; do \ |
101 | ../update-subdirs $$file; \ | |
102 | done; \ | |
4746aeeb | 103 | echo Directories: $$wins; \ |
7ec641b8 GM |
104 | $(emacs) -l cus-dep -f custom-make-dependencies $$wins; \ |
105 | $(emacs) -l finder -f finder-compile-keywords-make-dist $$wins; \ | |
106 | $(emacs) -f batch-update-autoloads $$wins | |
c48c3772 | 107 | |
7ab2c289 RS |
108 | TAGS: $(lisptagsfiles1) $(lisptagsfiles2) |
109 | ${ETAGS} $(lisptagsfiles1) $(lisptagsfiles2) | |
110 | ||
111 | TAGS-LISP: $(lispsource)$(lisptagsfiles1) $(lispsource)$(lisptagsfiles2) | |
112 | ${ETAGS} -o TAGS-LISP \ | |
113 | $(lispsource)$(lisptagsfiles1) $(lispsource)$(lisptagsfiles2) | |
7ec641b8 GM |
114 | |
115 | # Compile all Lisp files, except those from DONTCOMPILE. This | |
116 | # compiles files unconditionally. All .elc files are made writable | |
117 | # before compilation in case we checked out read-only (CVS option -r). | |
57f707e7 GM |
118 | # Files must be compiled one by one, otherwise apparently |
119 | # eval-when-compile's in some Lisp files make problems in files being | |
120 | # compiled later. We also set the load-path of the Emacs used for | |
121 | # compilation to the current directory and its subdirectories, to | |
122 | # make sure require's and load's in the files being compiled find | |
123 | # the right files. | |
7ec641b8 GM |
124 | |
125 | compile: doit | |
57f707e7 GM |
126 | wd=`pwd`; \ |
127 | find $$wd -name "*.elc" | xargs chmod +w; \ | |
128 | subdirs=`find $$wd -type d -print`; \ | |
129 | for dir in $$subdirs; do \ | |
130 | case $$dir in \ | |
131 | */Old | */RCS | */CVS | */=* ) ;; \ | |
132 | *) loadpath="$$loadpath \"$$dir\"" ;; \ | |
133 | esac; \ | |
134 | done; \ | |
135 | loadpath="(setq load-path '($$loadpath))"; \ | |
7ec641b8 GM |
136 | dont_compile=`echo $(DONTCOMPILE)`; \ |
137 | for el in $(EL); do \ | |
138 | compile_it=y; \ | |
139 | for dont in $$dont_compile; do \ | |
140 | if test $$el = $$dont; then \ | |
141 | compile_it=n; \ | |
142 | fi; \ | |
143 | done; \ | |
144 | if test $$compile_it = y; then \ | |
57f707e7 | 145 | $(emacs) --eval "$$loadpath" -f batch-byte-compile $$el; \ |
7ec641b8 GM |
146 | else \ |
147 | echo "Don't compile $$el"; \ | |
148 | fi; \ | |
57f707e7 | 149 | done |
7ec641b8 GM |
150 | |
151 | # Recompile all Lisp files which are newer than their .elc files. | |
152 | # Note that this doesn't create .elc files. It only recompiles if an | |
153 | # .elc is present. | |
154 | ||
155 | recompile: doit | |
156 | $(emacs) -f batch-byte-recompile-directory . | |
157 | ||
158 | # Build loaddefs.el but with an Emacs executable which was not built | |
159 | # in the current directory tree. The problem in this case is that | |
160 | # autoload.el reads and writes loaddefs.el in its `source-directory'. | |
161 | # If that's different from the current directory tree, we can't build | |
162 | # loaddefs.el. | |
163 | ||
164 | autoloads-with-other-emacs: doit | |
165 | subdirs=`find . -type d -print`; \ | |
166 | for file in $$subdirs; do \ | |
167 | case $$file in */Old | */RCS | */CVS | */=* ) ;; \ | |
168 | *) wins="$$wins $$file" ;; \ | |
169 | esac; \ | |
170 | done; \ | |
171 | echo Directories: $$wins; \ | |
172 | $(emacs) --eval '(setq source-directory ".")' \ | |
173 | -f batch-update-autoloads $$wins | |
174 | ||
175 | # Makefile ends here. |