Commit | Line | Data |
---|---|---|
46947372 JB |
1 | # DIST: This is the distribution Makefile for Emacs. configure can |
2 | # DIST: make most of the changes to this file you might want, so try | |
3 | # DIST: that first. | |
86a5659e | 4 | |
46947372 JB |
5 | # make all to compile and build Emacs. |
6 | # make install to install it. | |
78008d14 | 7 | # make TAGS to update tags tables. |
86a5659e | 8 | # |
78008d14 JB |
9 | # make clean or make mostlyclean |
10 | # Delete all files from the current directory that are normally | |
868e080d | 11 | # created by building the program. Don't delete the files that |
78008d14 JB |
12 | # record the configuration. Also preserve files that could be made |
13 | # by building, but normally aren't because the distribution comes | |
14 | # with them. | |
15 | # | |
16 | # Delete `.dvi' files here if they are not part of the distribution. | |
17 | # | |
18 | # make distclean | |
19 | # Delete all files from the current directory that are created by | |
20 | # configuring or building the program. If you have unpacked the | |
21 | # source and built the program without creating any other files, | |
22 | # `make distclean' should leave only the files that were in the | |
23 | # distribution. | |
24 | # | |
26873b72 | 25 | # make maintainer-clean |
78008d14 JB |
26 | # Delete everything from the current directory that can be |
27 | # reconstructed with this Makefile. This typically includes | |
28 | # everything deleted by distclean, plus more: C source files | |
29 | # produced by Bison, tags tables, info files, and so on. | |
30 | # | |
31 | # make extraclean | |
32 | # Still more severe - delete backup and autosave files, too. | |
86a5659e JB |
33 | |
34 | SHELL = /bin/sh | |
2dc44cb5 RS |
35 | |
36 | # If Make doesn't predefine MAKE, set it here. | |
37 | @SET_MAKE@ | |
86a5659e | 38 | |
78008d14 | 39 | # ==================== Things `configure' Might Edit ==================== |
86a5659e | 40 | |
c75ff9db | 41 | CC=@CC@ |
d4acf74f | 42 | CPP=@CPP@ |
c75ff9db | 43 | C_SWITCH_SYSTEM=@c_switch_system@ |
d3245f70 | 44 | ALLOCA=@ALLOCA@ |
b6472fc1 JB |
45 | LN_S=@LN_S@ |
46 | CFLAGS=@CFLAGS@ | |
46af2ed8 | 47 | C_SWITCH_X_SITE=@C_SWITCH_X_SITE@ |
09b89128 | 48 | LD_SWITCH_X_SITE=@LD_SWITCH_X_SITE@ |
4b5a51c1 | 49 | YACC=@YACC@ |
78008d14 JB |
50 | |
51 | ### These help us choose version- and architecture-specific directories | |
52 | ### to install files in. | |
53 | ||
54 | ### This should be the number of the Emacs version we're building, | |
55 | ### like `18.59' or `19.0'. | |
c75ff9db | 56 | version=@version@ |
78008d14 JB |
57 | |
58 | ### This should be the name of the configuration we're building Emacs | |
59 | ### for, like `mips-dec-ultrix' or `sparc-sun-sunos'. | |
c75ff9db JB |
60 | configuration=@configuration@ |
61 | ||
78008d14 JB |
62 | # ==================== Where To Install Things ==================== |
63 | ||
46947372 | 64 | # The default location for installation. Everything is placed in |
78008d14 JB |
65 | # subdirectories of this directory. The default values for many of |
66 | # the variables below are expressed in terms of this one, so you may | |
8d467c70 JB |
67 | # not need to change them. This defaults to /usr/local. |
68 | prefix=@prefix@ | |
86a5659e | 69 | |
78008d14 | 70 | # Like `prefix', but used for architecture-specific files. |
86ddcc58 | 71 | exec_prefix=@exec_prefix@ |
78008d14 | 72 | |
46947372 JB |
73 | # Where to install Emacs and other binaries that people will want to |
74 | # run directly (like etags). | |
0e265b72 | 75 | bindir=@bindir@ |
86a5659e | 76 | |
868e080d | 77 | # Where to install architecture-independent data files. ${lispdir} |
78008d14 | 78 | # and ${etcdir} are subdirectories of this. |
0e265b72 | 79 | datadir=@datadir@ |
0c22fbca JB |
80 | |
81 | # Where to install and expect the files that Emacs modifies as it | |
868e080d | 82 | # runs. These files are all architecture-independent. Right now, the |
78008d14 JB |
83 | # only such data is the locking directory; ${lockdir} is a |
84 | # subdirectory of this. | |
3e74e344 | 85 | sharedstatedir=@sharedstatedir@ |
0c22fbca JB |
86 | |
87 | # Where to install and expect executable files to be run by Emacs | |
88 | # rather than directly by users, and other architecture-dependent | |
868e080d | 89 | # data. ${archlibdir} is a subdirectory of this. |
2fd54e64 | 90 | libexecdir=@libexecdir@ |
0c22fbca JB |
91 | |
92 | # Where to install Emacs's man pages, and what extension they should have. | |
0e265b72 | 93 | mandir=@mandir@ |
0c22fbca JB |
94 | manext=.1 |
95 | ||
96 | # Where to install and expect the info files describing Emacs. In the | |
97 | # past, this defaulted to a subdirectory of ${prefix}/lib/emacs, but | |
98 | # since there are now many packages documented with the texinfo | |
99 | # system, it is inappropriate to imply that it is part of Emacs. | |
0e265b72 | 100 | infodir=@infodir@ |
86a5659e | 101 | |
b2f3c6b2 RS |
102 | # Where to look for bitmap files. |
103 | bitmapdir=@bitmapdir@ | |
104 | ||
00c29909 | 105 | # Where to find the source code. The source code for Emacs's C kernel is |
78008d14 JB |
106 | # expected to be in ${srcdir}/src, and the source code for Emacs's |
107 | # utility programs is expected to be in ${srcdir}/lib-src. This is | |
108 | # set by the configure script's `--srcdir' option. | |
d3245f70 | 109 | srcdir=@srcdir@ |
86a5659e | 110 | |
f854bb66 RM |
111 | # Tell make where to find source files; this is needed for the makefiles. |
112 | VPATH=@srcdir@ | |
113 | ||
0c22fbca JB |
114 | # ==================== Emacs-specific directories ==================== |
115 | ||
78008d14 JB |
116 | # These variables hold the values Emacs will actually use. They are |
117 | # based on the values of the standard Make variables above. | |
118 | ||
0e265b72 BF |
119 | # Where to install the lisp files distributed with |
120 | # Emacs. This includes the Emacs version, so that the | |
121 | # lisp files for different versions of Emacs will install | |
122 | # themselves in separate directories. | |
123 | lispdir=@lispdir@ | |
d3245f70 | 124 | |
0e265b72 BF |
125 | # Directories Emacs should search for lisp files specific |
126 | # to this site (i.e. customizations), before consulting | |
127 | # ${lispdir}. This should be a colon-separated list of | |
128 | # directories. | |
129 | locallisppath=@locallisppath@ | |
d3245f70 JB |
130 | |
131 | # Where Emacs will search to find its lisp files. Before | |
132 | # changing this, check to see if your purpose wouldn't | |
133 | # better be served by changing locallisppath. This | |
46947372 | 134 | # should be a colon-separated list of directories. |
0e265b72 | 135 | lisppath=@lisppath@ |
86a5659e | 136 | |
d3245f70 JB |
137 | # Where Emacs will search for its lisp files while |
138 | # building. This is only used during the process of | |
139 | # compiling Emacs, to help Emacs find its lisp files | |
140 | # before they've been installed in their final location. | |
90ac71dc RS |
141 | # It's usually identical to lisppath, except that |
142 | # it does not include locallisppath, and the | |
d3245f70 JB |
143 | # entry for the directory containing the installed lisp |
144 | # files has been replaced with ../lisp. This should be a | |
145 | # colon-separated list of directories. | |
3dbc7e32 | 146 | buildlisppath=${srcdir}/lisp |
86a5659e | 147 | |
0e265b72 BF |
148 | # Where to install the other architecture-independent |
149 | # data files distributed with Emacs (like the tutorial, | |
150 | # the cookie recipes and the Zippy database). This path | |
151 | # usually contains the Emacs version number, so the data | |
152 | # files for multiple versions of Emacs may be installed | |
153 | # at once. | |
154 | etcdir=@etcdir@ | |
155 | ||
156 | # Where to create and expect the locking directory, where | |
157 | # the Emacs locking code keeps track of which files are | |
158 | # currently being edited. | |
159 | lockdir=@lockdir@ | |
160 | ||
161 | # Where to put executables to be run by Emacs rather than | |
162 | # the user. This path usually includes the Emacs version | |
163 | # and configuration name, so that multiple configurations | |
164 | # for multiple versions of Emacs may be installed at | |
165 | # once. | |
166 | archlibdir=@archlibdir@ | |
a34902ab | 167 | |
e408046f KH |
168 | # Where to put the docstring file. |
169 | docdir=@docdir@ | |
170 | ||
46947372 JB |
171 | # ==================== Utility Programs for the Build ==================== |
172 | ||
173 | # Allow the user to specify the install program. | |
19697295 | 174 | INSTALL = @INSTALL@ |
86ddcc58 JB |
175 | INSTALL_PROGRAM = @INSTALL_PROGRAM@ |
176 | INSTALL_DATA = @INSTALL_DATA@ | |
46947372 | 177 | |
46947372 | 178 | # ============================= Targets ============================== |
86a5659e | 179 | |
9ef7f9f0 KH |
180 | # What emacs should be called when installed. |
181 | EMACS = emacs | |
182 | ||
86a5659e JB |
183 | # Subdirectories to make recursively. `lisp' is not included |
184 | # because the compiled lisp files are part of the distribution | |
185 | # and you cannot remake them without installing Emacs first. | |
46947372 | 186 | SUBDIR = lib-src src |
86a5659e | 187 | |
78008d14 | 188 | # The makefiles of the directories in $SUBDIR. |
dffd6dac | 189 | SUBDIR_MAKEFILES = lib-src/Makefile man/Makefile src/Makefile oldXMenu/Makefile lwlib/Makefile |
78008d14 | 190 | |
83f6a565 JB |
191 | # Subdirectories to install, and where they'll go. |
192 | # lib-src's makefile knows how to install it, so we don't do that here. | |
193 | # When installing the info files, we need to do special things to | |
194 | # avoid nuking an existing dir file, so we don't do that here; | |
195 | # instead, we have written out explicit code in the `install' targets. | |
78c7997f RS |
196 | COPYDIR = ${srcdir}/etc ${srcdir}/lisp |
197 | COPYDESTS = ${etcdir} ${lispdir} | |
86a5659e | 198 | |
8672a560 | 199 | all: paths-force ${SUBDIR} |
86a5659e | 200 | |
309848ba | 201 | removenullpaths=sed -e 's/^://g' -e 's/:$$//g' -e 's/::/:/g' |
46947372 | 202 | |
8672a560 | 203 | # Note that sed is not in /bin on 386bsd. |
d58c5947 RS |
204 | src/paths.h: Makefile ${srcdir}/src/paths.in |
205 | @echo "Producing \`src/paths.h' from \`src/paths.in'." | |
8672a560 RS |
206 | @(lisppath=`echo ${lisppath} | ${removenullpaths}` ; \ |
207 | buildlisppath=`echo ${buildlisppath} | ${removenullpaths}` ; \ | |
8d61b1e0 | 208 | sed < ${srcdir}/src/paths.in > paths.h.$$$$ \ |
8672a560 RS |
209 | -e 's;\(#.*PATH_LOADSEARCH\).*$$;\1 "'$${lisppath}'";' \ |
210 | -e 's;\(#.*PATH_DUMPLOADSEARCH\).*$$;\1 "'$${buildlisppath}'";' \ | |
211 | -e 's;\(#.*PATH_EXEC\).*$$;\1 "${archlibdir}";' \ | |
212 | -e 's;\(#.*PATH_INFO\).*$$;\1 "${infodir}";' \ | |
213 | -e 's;\(#.*PATH_DATA\).*$$;\1 "${etcdir}";' \ | |
b2f3c6b2 | 214 | -e 's;\(#.*PATH_BITMAPS\).*$$;\1 "${bitmapdir}";' \ |
8672a560 | 215 | -e 's;\(#.*PATH_DOC\).*$$;\1 "${docdir}";' \ |
270cc80e | 216 | -e 's;\(#.*PATH_LOCK\).*$$;\1 "${lockdir}/";') && \ |
8d61b1e0 | 217 | ${srcdir}/move-if-change paths.h.$$$$ src/paths.h |
8672a560 RS |
218 | |
219 | # For `make all', | |
220 | # we force the rebuilding of src/paths.h because the user might give | |
78008d14 JB |
221 | # make different values for the various directories. Since we use |
222 | # move-if-change, src/paths.h only actually changes if the user did | |
223 | # something notable, so the only unnecessary work we do is in building | |
8d61b1e0 | 224 | # paths.h.$$, which isn't much. |
692f9ac6 | 225 | # Note that sed is not in /bin on 386bsd. |
0bdd1e86 RS |
226 | # We depend on src/paths.h here to prevent simultaneous execution of |
227 | # that rule and this one, in a parallel make. | |
228 | # It is possible for paths.h to be updated twice--but that would happen anyway. | |
229 | paths-force: FRC src/paths.h | |
d58c5947 | 230 | @echo "Producing \`src/paths.h' from \`src/paths.in'." |
7987a169 JB |
231 | @(lisppath=`echo ${lisppath} | ${removenullpaths}` ; \ |
232 | buildlisppath=`echo ${buildlisppath} | ${removenullpaths}` ; \ | |
8d61b1e0 | 233 | sed < ${srcdir}/src/paths.in > paths.h.$$$$ \ |
7987a169 JB |
234 | -e 's;\(#.*PATH_LOADSEARCH\).*$$;\1 "'$${lisppath}'";' \ |
235 | -e 's;\(#.*PATH_DUMPLOADSEARCH\).*$$;\1 "'$${buildlisppath}'";' \ | |
236 | -e 's;\(#.*PATH_EXEC\).*$$;\1 "${archlibdir}";' \ | |
8b14d296 | 237 | -e 's;\(#.*PATH_INFO\).*$$;\1 "${infodir}";' \ |
7987a169 | 238 | -e 's;\(#.*PATH_DATA\).*$$;\1 "${etcdir}";' \ |
b2f3c6b2 | 239 | -e 's;\(#.*PATH_BITMAPS\).*$$;\1 "${bitmapdir}";' \ |
e408046f | 240 | -e 's;\(#.*PATH_DOC\).*$$;\1 "${docdir}";' \ |
270cc80e | 241 | -e 's;\(#.*PATH_LOCK\).*$$;\1 "${lockdir}/";') && \ |
8d61b1e0 | 242 | ${srcdir}/move-if-change paths.h.$$$$ src/paths.h |
86a5659e | 243 | |
05ed817f | 244 | src: lib-src FRC src/paths.h |
a874c104 | 245 | |
485c9046 RS |
246 | # This ought to depend on src/paths.h, so that in parallel make |
247 | # src/paths.h will be available for the compilations in lib-src. | |
248 | # But that causes trouble in `make install' if a different prefix | |
249 | # is specified at that time. | |
05ed817f | 250 | lib-src: FRC src/paths.h |
86a5659e JB |
251 | |
252 | .RECURSIVE: ${SUBDIR} | |
253 | ||
78008d14 | 254 | ${SUBDIR}: ${SUBDIR_MAKEFILES} FRC |
0e265b72 | 255 | cd $@; $(MAKE) all $(MFLAGS) \ |
7c811eec RS |
256 | CC='${CC}' CFLAGS='${CFLAGS}' CPPFLAGS='${CPPFLAGS}' \ |
257 | LDFLAGS='${LDFLAGS}' MAKE='${MAKE}' | |
0e265b72 | 258 | |
8672a560 | 259 | blessmail: ${SUBDIR_MAKEFILES} src FRC |
df8bde8b RS |
260 | cd lib-src; $(MAKE) maybe-blessmail $(MFLAGS) \ |
261 | MAKE='${MAKE}' archlibdir='$(archlibdir)' | |
d541babe | 262 | |
0e265b72 BF |
263 | Makefile: Makefile.in config.status |
264 | ./config.status | |
265 | ||
d58c5947 | 266 | src/Makefile: src/Makefile.in config.status |
0e265b72 BF |
267 | ./config.status |
268 | ||
269 | lib-src/Makefile: lib-src/Makefile.in config.status | |
270 | ./config.status | |
271 | ||
272 | oldXMenu/Makefile: oldXMenu/Makefile.in config.status | |
78008d14 JB |
273 | ./config.status |
274 | ||
98dfba1b RS |
275 | lwlib/Makefile: lwlib/Makefile.in config.status |
276 | ./config.status | |
277 | ||
78008d14 JB |
278 | # ==================== Installation ==================== |
279 | ||
dbc4e1c1 JB |
280 | ## If we let lib-src do its own installation, that means we |
281 | ## don't have to duplicate the list of utilities to install in | |
282 | ## this Makefile as well. | |
d3245f70 | 283 | |
3dbc7e32 JB |
284 | ## On AIX, use tar xBf. |
285 | ## On Xenix, use tar xpf. | |
286 | ||
9ef7f9f0 | 287 | .PHONY: install mkdir |
98dfba1b | 288 | |
d3245f70 JB |
289 | ## We delete each directory in ${COPYDESTS} before we copy into it; |
290 | ## that way, we can reinstall over directories that have been put in | |
291 | ## place with their files read-only (perhaps because they are checked | |
292 | ## into RCS). In order to make this safe, we make sure that the | |
293 | ## source exists and is distinct from the destination. | |
653ddcc3 RS |
294 | ## We don't depend on `all', but rather on ${SUBDIR}, so that we won't |
295 | ## ever modify src/paths.h. | |
a5038ae5 RS |
296 | install: ${SUBDIR} install-arch-dep install-arch-indep blessmail |
297 | @true | |
8b14d296 | 298 | |
af1d3b64 RS |
299 | ### Note that we copy the DOC-* files from the build etc directory |
300 | ### as well as lots of things from ${srcdir}/etc. | |
3be1f08e | 301 | install-arch-dep: mkdir |
8b14d296 | 302 | (cd lib-src; \ |
0e265b72 | 303 | $(MAKE) install $(MFLAGS) prefix=${prefix} \ |
2fd54e64 RS |
304 | exec_prefix=${exec_prefix} bindir=${bindir} \ |
305 | libexecdir=${libexecdir} archlibdir=${archlibdir}) | |
08068cb6 RS |
306 | ${INSTALL_PROGRAM} src/emacs ${bindir}/emacs-${version} |
307 | -chmod 1755 ${bindir}/emacs-${version} | |
9ef7f9f0 KH |
308 | rm -f ${bindir}/$(EMACS) |
309 | -ln ${bindir}/emacs-${version} ${bindir}/$(EMACS) | |
08068cb6 | 310 | |
3be1f08e RS |
311 | ### Note that we copy the DOC-* files from the build etc directory |
312 | ### as well as lots of things from ${srcdir}/etc. | |
1eb9aca7 RS |
313 | ### Note that we copy DOC* and then delete DOC |
314 | ### as a workaround for a bug in tar on Ultrix 4.2. | |
0cf61204 | 315 | |
08068cb6 | 316 | install-arch-indep: mkdir |
46947372 | 317 | -set ${COPYDESTS} ; \ |
005775ce | 318 | for dir in ${COPYDIR} ; do \ |
8672a560 | 319 | if [ `(cd $$1 && /bin/pwd)` != `(cd $${dir} && /bin/pwd)` ] ; then \ |
88190b54 | 320 | rm -rf $$1 ; \ |
005775ce | 321 | fi ; \ |
335bb18d | 322 | shift ; \ |
005775ce JB |
323 | done |
324 | -set ${COPYDESTS} ; \ | |
a5038ae5 RS |
325 | mkdir ${COPYDESTS} ; \ |
326 | chmod ugo+rx ${COPYDESTS} ; \ | |
46947372 JB |
327 | for dir in ${COPYDIR} ; do \ |
328 | dest=$$1 ; shift ; \ | |
d3245f70 | 329 | [ -d $${dir} ] \ |
8fd812d1 | 330 | && [ `(cd $${dir} && /bin/pwd)` != `(cd $${dest} && /bin/pwd)` ] \ |
3dbc7e32 | 331 | && (echo "Copying $${dir}..." ; \ |
5d9e58e8 | 332 | (cd $${dir}; tar -cf - . )|(cd $${dest};umask 022; tar -xvf - ); \ |
d3245f70 JB |
333 | for subdir in `find $${dest} -type d ! -name RCS -print` ; do \ |
334 | rm -rf $${subdir}/RCS ; \ | |
335 | rm -rf $${subdir}/CVS ; \ | |
336 | rm -f $${subdir}/\#* ; \ | |
3d4be9d6 | 337 | rm -f $${subdir}/.\#* ; \ |
d3245f70 | 338 | rm -f $${subdir}/*~ ; \ |
0ff7e78f | 339 | rm -f $${subdir}/*.orig ; \ |
d3245f70 | 340 | done) ; \ |
46947372 | 341 | done |
b2f3c6b2 | 342 | -rm -f ${lispdir}/subdirs.el |
b4594994 | 343 | $(srcdir)/update-subdirs ${lispdir} |
3be1f08e RS |
344 | if [ `(cd ./etc; /bin/pwd)` != `(cd ${docdir}; /bin/pwd)` ]; \ |
345 | then \ | |
969f1735 | 346 | echo "Copying etc/DOC-* ..." ; \ |
1eb9aca7 RS |
347 | (cd etc; tar -cf - DOC*)|(cd ${docdir}; umask 0; tar -xvf - ); \ |
348 | (cd $(docdir); rm DOC) \ | |
3be1f08e | 349 | else true; fi |
8672a560 | 350 | thisdir=`/bin/pwd`; \ |
21e8e1db | 351 | if [ `(cd ${srcdir}/info && /bin/pwd)` != `(cd ${infodir} && /bin/pwd)` ]; \ |
5e9e88fd | 352 | then \ |
469dd2ef RS |
353 | (cd ${infodir}; \ |
354 | if [ ! -f dir.old ]; then mv -f dir dir.old; \ | |
355 | else mv -f dir dir.bak; fi; \ | |
356 | cd ${srcdir}/info ; \ | |
357 | (cd $${thisdir}; ${INSTALL_DATA} ${srcdir}/info/dir ${infodir}/dir); \ | |
1eb9aca7 | 358 | for f in cl* dired-x* ediff* emacs* forms* gnus* info* mh-e* sc* vip*; do \ |
d59d49d3 | 359 | (cd $${thisdir}; ${INSTALL_DATA} ${srcdir}/info/$$f ${infodir}/$$f); \ |
ce0b6622 | 360 | done); \ |
21e8e1db | 361 | else true; fi |
8672a560 | 362 | thisdir=`/bin/pwd`; cd ${srcdir}/etc; for page in emacs etags ctags ; do \ |
d59d49d3 | 363 | (cd $${thisdir}; ${INSTALL_DATA} ${srcdir}/etc/$${page}.1 ${mandir}/$${page}${manext}); \ |
868e080d | 364 | done |
badb0a97 | 365 | |
868e080d | 366 | ### Build all the directories we're going to install Emacs in. Since |
78008d14 | 367 | ### we may be creating several layers of directories (for example, |
614b45a7 | 368 | ### /usr/local/lib/emacs/19.0/mips-dec-ultrix4.2), we use mkinstalldirs |
6784fb67 | 369 | ### instead of mkdir. Not all systems' mkdir programs have the `-p' flag. |
05ed817f | 370 | mkdir: FRC |
614b45a7 | 371 | $(srcdir)/mkinstalldirs ${COPYDESTS} ${lockdir} ${infodir} ${mandir} \ |
2fd54e64 | 372 | ${bindir} ${datadir} ${docdir} ${libexecdir} \ |
309848ba | 373 | `echo ${locallisppath} | sed 's/:/ /g'` |
dffd6dac | 374 | -chmod a+rwx ${lockdir} |
86a5659e | 375 | |
d4acf74f JB |
376 | ### Delete all the installed files that the `install' target would |
377 | ### create (but not the noninstalled files such as `make all' would | |
378 | ### create). | |
44257b1a JB |
379 | ### |
380 | ### Don't delete the lisp and etc directories if they're in the source tree. | |
d4acf74f | 381 | uninstall: |
44257b1a | 382 | (cd lib-src; \ |
0e265b72 | 383 | $(MAKE) $(MFLAGS) uninstall \ |
44257b1a | 384 | prefix=${prefix} exec_prefix=${exec_prefix} \ |
2fd54e64 | 385 | bindir=${bindir} libexecdir=${libexecdir} archlibdir=${archlibdir}) |
44257b1a | 386 | for dir in ${lispdir} ${etcdir} ; do \ |
726d0798 | 387 | if [ -d $${dir} ]; then \ |
8672a560 RS |
388 | case `(cd $${dir} ; /bin/pwd)` in \ |
389 | `(cd ${srcdir} ; /bin/pwd)`* ) ;; \ | |
726d0798 RS |
390 | * ) rm -rf $${dir} ;; \ |
391 | esac ; \ | |
392 | case $${dir} in \ | |
393 | ${datadir}/emacs/${version}/* ) \ | |
394 | rm -rf ${datadir}/emacs/${version} \ | |
395 | ;; \ | |
396 | esac ; \ | |
397 | fi ; \ | |
44257b1a | 398 | done |
1eb9aca7 | 399 | (cd ${infodir} && rm -f cl* dired-x* ediff* emacs* forms* gnus* info* mh-e* sc* vip*) |
6b356ee8 KH |
400 | (cd ${mandir} && rm -f emacs.1 etags.1 ctags.1) |
401 | (cd ${bindir} && rm -f emacs-${version} $(EMACS)) | |
d4acf74f JB |
402 | |
403 | ||
05ed817f | 404 | FRC: |
78008d14 JB |
405 | |
406 | # ==================== Cleaning up and miscellanea ==================== | |
407 | ||
26873b72 | 408 | .PHONY: mostlyclean clean distclean maintainer-clean extraclean |
98dfba1b | 409 | |
78008d14 | 410 | ### `mostlyclean' |
d4acf74f JB |
411 | ### Like `clean', but may refrain from deleting a few files that people |
412 | ### normally don't want to recompile. For example, the `mostlyclean' | |
413 | ### target for GCC does not delete `libgcc.a', because recompiling it | |
414 | ### is rarely necessary and takes a lot of time. | |
05ed817f | 415 | mostlyclean: FRC |
0e265b72 BF |
416 | (cd src; $(MAKE) $(MFLAGS) mostlyclean) |
417 | (cd oldXMenu; $(MAKE) $(MFLAGS) mostlyclean) | |
98dfba1b | 418 | (cd lwlib; $(MAKE) $(MFLAGS) mostlyclean) |
0e265b72 | 419 | (cd lib-src; $(MAKE) $(MFLAGS) mostlyclean) |
e6124e9d | 420 | -(cd man && $(MAKE) $(MFLAGS) mostlyclean) |
d4acf74f JB |
421 | |
422 | ### `clean' | |
423 | ### Delete all files from the current directory that are normally | |
424 | ### created by building the program. Don't delete the files that | |
425 | ### record the configuration. Also preserve files that could be made | |
426 | ### by building, but normally aren't because the distribution comes | |
427 | ### with them. | |
78008d14 | 428 | ### |
d4acf74f | 429 | ### Delete `.dvi' files here if they are not part of the distribution. |
05ed817f | 430 | clean: FRC |
0e265b72 BF |
431 | (cd src; $(MAKE) $(MFLAGS) clean) |
432 | (cd oldXMenu; $(MAKE) $(MFLAGS) clean) | |
98dfba1b | 433 | (cd lwlib; $(MAKE) $(MFLAGS) clean) |
0e265b72 | 434 | (cd lib-src; $(MAKE) $(MFLAGS) clean) |
e6124e9d | 435 | -(cd man && $(MAKE) $(MFLAGS) clean) |
46947372 | 436 | |
78008d14 | 437 | ### `distclean' |
d4acf74f JB |
438 | ### Delete all files from the current directory that are created by |
439 | ### configuring or building the program. If you have unpacked the | |
440 | ### source and built the program without creating any other files, | |
441 | ### `make distclean' should leave only the files that were in the | |
442 | ### distribution. | |
443 | top_distclean=\ | |
dffd6dac | 444 | rm -f config.status config.cache config.log ; \ |
d4acf74f | 445 | rm -f Makefile ${SUBDIR_MAKEFILES} ; \ |
6b356ee8 | 446 | (cd lock && rm -f *) |
05ed817f | 447 | distclean: FRC |
0e265b72 BF |
448 | (cd src; $(MAKE) $(MFLAGS) distclean) |
449 | (cd oldXMenu; $(MAKE) $(MFLAGS) distclean) | |
98dfba1b | 450 | (cd lwlib; $(MAKE) $(MFLAGS) distclean) |
0e265b72 | 451 | (cd lib-src; $(MAKE) $(MFLAGS) distclean) |
e6124e9d | 452 | (cd man && $(MAKE) $(MFLAGS) distclean) |
d4acf74f | 453 | ${top_distclean} |
46947372 | 454 | |
26873b72 | 455 | ### `maintainer-clean' |
d4acf74f JB |
456 | ### Delete everything from the current directory that can be |
457 | ### reconstructed with this Makefile. This typically includes | |
458 | ### everything deleted by distclean, plus more: C source files | |
459 | ### produced by Bison, tags tables, info files, and so on. | |
460 | ### | |
26873b72 | 461 | ### One exception, however: `make maintainer-clean' should not delete |
d4acf74f | 462 | ### `configure' even if `configure' can be remade using a rule in the |
26873b72 | 463 | ### Makefile. More generally, `make maintainer-clean' should not delete |
d4acf74f JB |
464 | ### anything that needs to exist in order to run `configure' and then |
465 | ### begin to build the program. | |
26873b72 RS |
466 | maintainer-clean: FRC |
467 | (cd src; $(MAKE) $(MFLAGS) maintainer-clean) | |
468 | (cd oldXMenu; $(MAKE) $(MFLAGS) maintainer-clean) | |
469 | (cd lwlib; $(MAKE) $(MFLAGS) maintainer-clean) | |
470 | (cd lib-src; $(MAKE) $(MFLAGS) maintainer-clean) | |
471 | -(cd man && $(MAKE) $(MFLAGS) maintainer-clean) | |
d4acf74f | 472 | ${top_distclean} |
46947372 | 473 | |
78008d14 JB |
474 | ### This doesn't actually appear in the coding standards, but Karl |
475 | ### says GCC supports it, and that's where the configuration part of | |
476 | ### the coding standards seem to come from. It's like distclean, but | |
477 | ### it deletes backup and autosave files too. | |
478 | extraclean: | |
0e265b72 | 479 | for i in ${SUBDIR}; do (cd $$i; $(MAKE) $(MFLAGS) extraclean); done |
6b356ee8 | 480 | -(cd lock && rm *) |
78008d14 JB |
481 | -rm config.status config-tmp-* |
482 | -rm -f *~ \#* | |
483 | ||
29c0047b ER |
484 | ### Unlocking and relocking. The idea of these productions is to reduce |
485 | ### hassles when installing an incremental tar of Emacs. Do `make unlock' | |
486 | ### before unlocking the file to take the write locks off all sources so | |
487 | ### that tar xvof will overwrite them without fuss. Then do `make relock' | |
488 | ### afterward so that VC mode will know which files should be checked in | |
489 | ### if you want to mung them. | |
490 | ### | |
491 | ### Note: it's no disaster if these productions miss a file or two; tar | |
492 | ### and VC will swiftly let you know if this happens, and it is easily | |
493 | ### corrected. | |
494 | SOURCES = ChangeLog GETTING.GNU.SOFTWARE INSTALL Makefile.in PROBLEMS \ | |
24470d72 | 495 | README configure make-dist move-if-change |
29c0047b | 496 | |
98dfba1b RS |
497 | .PHONY: unlock relock |
498 | ||
29c0047b ER |
499 | unlock: |
500 | chmod u+w $(SOURCES) cpp/* | |
501 | -(cd elisp; chmod u+w Makefile README *.texi) | |
0e265b72 BF |
502 | (cd etc; $(MAKE) $(MFLAGS) unlock) |
503 | (cd lib-src; $(MAKE) $(MFLAGS) unlock) | |
504 | (cd lisp; $(MAKE) $(MFLAGS) unlock) | |
29c0047b ER |
505 | (cd lisp/term; chmod u+w README *.el) |
506 | (cd man; chmod u+w *texi* ChangeLog split-man) | |
507 | (cd oldXMenu; chmod u+w *.[ch] Makefile README) | |
98dfba1b | 508 | (cd lwlib; chmod u+w *.[ch] Makefile README) |
0e265b72 | 509 | (cd src; $(MAKE) $(MFLAGS) unlock) |
29c0047b ER |
510 | |
511 | relock: | |
512 | chmod u-w $(SOURCES) cpp/* | |
513 | -(cd elisp; chmod u-w Makefile README *.texi) | |
0e265b72 BF |
514 | (cd etc; $(MAKE) $(MFLAGS) relock) |
515 | (cd lib-src; $(MAKE) $(MFLAGS) relock) | |
516 | (cd lisp; $(MAKE) $(MFLAGS) relock) | |
29c0047b ER |
517 | (cd lisp/term; chmod u+w README *.el) |
518 | (cd man; chmod u+w *texi* ChangeLog split-man) | |
519 | (cd oldXMenu; chmod u+w *.[ch] Makefile README) | |
98dfba1b | 520 | (cd lwlib; chmod u+w *.[ch] Makefile README) |
0e265b72 | 521 | (cd src; $(MAKE) $(MFLAGS) relock) |
78008d14 | 522 | |
46947372 | 523 | TAGS tags: lib-src |
928cf895 | 524 | cd ${srcdir}/src; $(MAKE) tags |
46947372 JB |
525 | |
526 | check: | |
527 | @echo "We don't have any tests for GNU Emacs yet." | |
4746118a JB |
528 | |
529 | dist: | |
b4594994 | 530 | $(srcdir)/update-subdirs ${srcdir}/lisp |
78008d14 | 531 | cd ${srcdir}; make-dist |
d4acf74f | 532 | |
653ddcc3 RS |
533 | .PHONY: info dvi dist check |
534 | force-info: | |
535 | info: force-info | |
0e265b72 | 536 | (cd ${srcdir}/man; $(MAKE) $(MFLAGS) info) |
d4acf74f | 537 | dvi: |
6784fb67 | 538 | (cd man; $(MAKE) $(MFLAGS) dvi) |