Update copyright notice.
[bpt/emacs.git] / Makefile.in
CommitLineData
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
34SHELL = /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 41CC=@CC@
d4acf74f 42CPP=@CPP@
c75ff9db 43C_SWITCH_SYSTEM=@c_switch_system@
d3245f70 44ALLOCA=@ALLOCA@
b6472fc1
JB
45LN_S=@LN_S@
46CFLAGS=@CFLAGS@
bb5f88cc 47LDFLAGS=@LDFLAGS@
e17d7117 48CPPFLAGS=@CPPFLAGS@
46af2ed8 49C_SWITCH_X_SITE=@C_SWITCH_X_SITE@
09b89128 50LD_SWITCH_X_SITE=@LD_SWITCH_X_SITE@
4b5a51c1 51YACC=@YACC@
78008d14
JB
52
53### These help us choose version- and architecture-specific directories
54### to install files in.
55
56### This should be the number of the Emacs version we're building,
57### like `18.59' or `19.0'.
c75ff9db 58version=@version@
78008d14
JB
59
60### This should be the name of the configuration we're building Emacs
61### for, like `mips-dec-ultrix' or `sparc-sun-sunos'.
c75ff9db
JB
62configuration=@configuration@
63
78008d14
JB
64# ==================== Where To Install Things ====================
65
46947372 66# The default location for installation. Everything is placed in
78008d14
JB
67# subdirectories of this directory. The default values for many of
68# the variables below are expressed in terms of this one, so you may
8d467c70
JB
69# not need to change them. This defaults to /usr/local.
70prefix=@prefix@
86a5659e 71
78008d14 72# Like `prefix', but used for architecture-specific files.
86ddcc58 73exec_prefix=@exec_prefix@
78008d14 74
46947372
JB
75# Where to install Emacs and other binaries that people will want to
76# run directly (like etags).
0e265b72 77bindir=@bindir@
86a5659e 78
868e080d 79# Where to install architecture-independent data files. ${lispdir}
78008d14 80# and ${etcdir} are subdirectories of this.
0e265b72 81datadir=@datadir@
0c22fbca
JB
82
83# Where to install and expect the files that Emacs modifies as it
c5bfadd6
RS
84# runs. These files are all architecture-independent.
85# Right now, this is not used.
3e74e344 86sharedstatedir=@sharedstatedir@
0c22fbca
JB
87
88# Where to install and expect executable files to be run by Emacs
89# rather than directly by users, and other architecture-dependent
868e080d 90# data. ${archlibdir} is a subdirectory of this.
2fd54e64 91libexecdir=@libexecdir@
0c22fbca
JB
92
93# Where to install Emacs's man pages, and what extension they should have.
0e265b72 94mandir=@mandir@
0c22fbca 95manext=.1
88e7bbf1 96man1dir=$(mandir)/man1
0c22fbca
JB
97
98# Where to install and expect the info files describing Emacs. In the
99# past, this defaulted to a subdirectory of ${prefix}/lib/emacs, but
100# since there are now many packages documented with the texinfo
101# system, it is inappropriate to imply that it is part of Emacs.
0e265b72 102infodir=@infodir@
86a5659e 103
b2f3c6b2
RS
104# Where to look for bitmap files.
105bitmapdir=@bitmapdir@
106
00c29909 107# Where to find the source code. The source code for Emacs's C kernel is
78008d14
JB
108# expected to be in ${srcdir}/src, and the source code for Emacs's
109# utility programs is expected to be in ${srcdir}/lib-src. This is
110# set by the configure script's `--srcdir' option.
0d60d4ef
RS
111
112# We use $(srcdir) explicitly in dependencies so as not to depend on VPATH.
d3245f70 113srcdir=@srcdir@
86a5659e 114
f854bb66
RM
115# Tell make where to find source files; this is needed for the makefiles.
116VPATH=@srcdir@
117
3163d9cf
RS
118# Where to find the application default.
119x_default_search_path=@x_default_search_path@
120
0c22fbca
JB
121# ==================== Emacs-specific directories ====================
122
78008d14
JB
123# These variables hold the values Emacs will actually use. They are
124# based on the values of the standard Make variables above.
125
0e265b72
BF
126# Where to install the lisp files distributed with
127# Emacs. This includes the Emacs version, so that the
128# lisp files for different versions of Emacs will install
129# themselves in separate directories.
130lispdir=@lispdir@
d3245f70 131
0e265b72
BF
132# Directories Emacs should search for lisp files specific
133# to this site (i.e. customizations), before consulting
134# ${lispdir}. This should be a colon-separated list of
135# directories.
136locallisppath=@locallisppath@
d3245f70
JB
137
138# Where Emacs will search to find its lisp files. Before
139# changing this, check to see if your purpose wouldn't
140# better be served by changing locallisppath. This
46947372 141# should be a colon-separated list of directories.
0e265b72 142lisppath=@lisppath@
86a5659e 143
d3245f70
JB
144# Where Emacs will search for its lisp files while
145# building. This is only used during the process of
146# compiling Emacs, to help Emacs find its lisp files
147# before they've been installed in their final location.
90ac71dc
RS
148# It's usually identical to lisppath, except that
149# it does not include locallisppath, and the
d3245f70
JB
150# entry for the directory containing the installed lisp
151# files has been replaced with ../lisp. This should be a
152# colon-separated list of directories.
3dbc7e32 153buildlisppath=${srcdir}/lisp
86a5659e 154
0e265b72
BF
155# Where to install the other architecture-independent
156# data files distributed with Emacs (like the tutorial,
157# the cookie recipes and the Zippy database). This path
158# usually contains the Emacs version number, so the data
159# files for multiple versions of Emacs may be installed
160# at once.
161etcdir=@etcdir@
162
0e265b72
BF
163# Where to put executables to be run by Emacs rather than
164# the user. This path usually includes the Emacs version
165# and configuration name, so that multiple configurations
166# for multiple versions of Emacs may be installed at
167# once.
168archlibdir=@archlibdir@
a34902ab 169
e408046f
KH
170# Where to put the docstring file.
171docdir=@docdir@
172
46947372
JB
173# ==================== Utility Programs for the Build ====================
174
175# Allow the user to specify the install program.
19697295 176INSTALL = @INSTALL@
86ddcc58
JB
177INSTALL_PROGRAM = @INSTALL_PROGRAM@
178INSTALL_DATA = @INSTALL_DATA@
23f1af23 179INSTALL_INFO = install-info
c1b8c545
RS
180# By default, we uphold the dignity of our programs.
181INSTALL_STRIP =
46947372 182
46947372 183# ============================= Targets ==============================
86a5659e 184
9ef7f9f0
KH
185# What emacs should be called when installed.
186EMACS = emacs
187
86a5659e
JB
188# Subdirectories to make recursively. `lisp' is not included
189# because the compiled lisp files are part of the distribution
190# and you cannot remake them without installing Emacs first.
c55db078 191SUBDIR = lib-src src leim
86a5659e 192
78008d14 193# The makefiles of the directories in $SUBDIR.
c55db078 194SUBDIR_MAKEFILES = lib-src/Makefile man/Makefile src/Makefile oldXMenu/Makefile lwlib/Makefile leim/Makefile
78008d14 195
83f6a565
JB
196# Subdirectories to install, and where they'll go.
197# lib-src's makefile knows how to install it, so we don't do that here.
c55db078 198# leim's makefile also knows how to install it, so we don't do that here.
83f6a565
JB
199# When installing the info files, we need to do special things to
200# avoid nuking an existing dir file, so we don't do that here;
201# instead, we have written out explicit code in the `install' targets.
78c7997f
RS
202COPYDIR = ${srcdir}/etc ${srcdir}/lisp
203COPYDESTS = ${etcdir} ${lispdir}
86a5659e 204
0a0dca73 205all: ${SUBDIR}
86a5659e 206
309848ba 207removenullpaths=sed -e 's/^://g' -e 's/:$$//g' -e 's/::/:/g'
46947372 208
c138b63b
RS
209# Generate epaths.h from epaths.in. This target is invoked by `configure'.
210epaths-force: FRC
8672a560
RS
211 @(lisppath=`echo ${lisppath} | ${removenullpaths}` ; \
212 buildlisppath=`echo ${buildlisppath} | ${removenullpaths}` ; \
3163d9cf 213 x_default_search_path=`echo ${x_default_search_path}`; \
c138b63b 214 sed < ${srcdir}/src/epaths.in > epaths.h.$$$$ \
8672a560
RS
215 -e 's;\(#.*PATH_LOADSEARCH\).*$$;\1 "'$${lisppath}'";' \
216 -e 's;\(#.*PATH_DUMPLOADSEARCH\).*$$;\1 "'$${buildlisppath}'";' \
217 -e 's;\(#.*PATH_EXEC\).*$$;\1 "${archlibdir}";' \
218 -e 's;\(#.*PATH_INFO\).*$$;\1 "${infodir}";' \
219 -e 's;\(#.*PATH_DATA\).*$$;\1 "${etcdir}";' \
b2f3c6b2 220 -e 's;\(#.*PATH_BITMAPS\).*$$;\1 "${bitmapdir}";' \
3163d9cf 221 -e 's;\(#.*PATH_X_DEFAULTS\).*$$;\1 "${x_default_search_path}";' \
3f16db29 222 -e 's;\(#.*PATH_DOC\).*$$;\1 "${docdir}";') && \
c138b63b 223 ${srcdir}/move-if-change epaths.h.$$$$ src/epaths.h
8672a560 224
bea3ec88
RS
225# For parallel make, src should be build before leim.
226leim: src
227
0a0dca73 228src: lib-src FRC
a874c104 229
f2f4aae9 230lib-src: FRC src/config.stamp
86a5659e
JB
231
232.RECURSIVE: ${SUBDIR}
233
78008d14 234${SUBDIR}: ${SUBDIR_MAKEFILES} FRC
0e265b72 235 cd $@; $(MAKE) all $(MFLAGS) \
7c811eec
RS
236 CC='${CC}' CFLAGS='${CFLAGS}' CPPFLAGS='${CPPFLAGS}' \
237 LDFLAGS='${LDFLAGS}' MAKE='${MAKE}'
0e265b72 238
8672a560 239blessmail: ${SUBDIR_MAKEFILES} src FRC
df8bde8b
RS
240 cd lib-src; $(MAKE) maybe-blessmail $(MFLAGS) \
241 MAKE='${MAKE}' archlibdir='$(archlibdir)'
d541babe 242
bd5f5333 243Makefile: $(srcdir)/Makefile.in config.status
0e265b72
BF
244 ./config.status
245
ade0bb57 246config.status: ${srcdir}/configure
7763df25
DL
247 ./config.status --recheck
248
3dd2781e 249${srcdir}/configure: configure.in aclocal.m4
7763df25
DL
250 cd ${srcdir} && autoconf
251
bd5f5333 252src/Makefile: $(srcdir)/src/Makefile.in config.status
0e265b72
BF
253 ./config.status
254
bd5f5333 255src/config.stamp: $(srcdir)/src/config.in config.status
a5f32ce4 256 ./config.status
f2f4aae9 257 touch src/config.stamp
a5f32ce4 258
bd5f5333 259lib-src/Makefile: $(srcdir)/lib-src/Makefile.in config.status
0e265b72
BF
260 ./config.status
261
bd5f5333 262man/Makefile: $(srcdir)/man/Makefile.in config.status
fdeed418
RS
263 ./config.status
264
bd5f5333 265oldXMenu/Makefile: $(srcdir)/oldXMenu/Makefile.in config.status
78008d14
JB
266 ./config.status
267
bd5f5333 268lwlib/Makefile: $(srcdir)/lwlib/Makefile.in config.status
98dfba1b
RS
269 ./config.status
270
bd5f5333 271leim/Makefile: $(srcdir)/leim/Makefile.in config.status
c55db078
KH
272 ./config.status
273
78008d14
JB
274# ==================== Installation ====================
275
dbc4e1c1
JB
276## If we let lib-src do its own installation, that means we
277## don't have to duplicate the list of utilities to install in
278## this Makefile as well.
d3245f70 279
3dbc7e32
JB
280## On AIX, use tar xBf.
281## On Xenix, use tar xpf.
282
9ef7f9f0 283.PHONY: install mkdir
98dfba1b 284
d3245f70
JB
285## We delete each directory in ${COPYDESTS} before we copy into it;
286## that way, we can reinstall over directories that have been put in
287## place with their files read-only (perhaps because they are checked
288## into RCS). In order to make this safe, we make sure that the
289## source exists and is distinct from the destination.
d7ce568f
RS
290### We do install-arch-indep first because
291### the executable needs the Lisp files and DOC file to work properly.
cff455ae 292install: all install-arch-indep install-arch-dep install-leim blessmail
a5038ae5 293 @true
8b14d296 294
d7e2eff6 295### Install the executables that were compiled specifically for this machine.
d7ce568f
RS
296### It would be nice to do something for a parallel make
297### to ensure that install-arch-indep finishes before this starts.
298install-arch-dep: mkdir
8b14d296 299 (cd lib-src; \
0e265b72 300 $(MAKE) install $(MFLAGS) prefix=${prefix} \
2fd54e64 301 exec_prefix=${exec_prefix} bindir=${bindir} \
c1b8c545
RS
302 libexecdir=${libexecdir} archlibdir=${archlibdir} \
303 INSTALL_STRIP=${INSTALL_STRIP})
304 ${INSTALL_PROGRAM} $(INSTALL_STRIP) src/emacs ${bindir}/emacs-${version}
08068cb6 305 -chmod 1755 ${bindir}/emacs-${version}
9ef7f9f0
KH
306 rm -f ${bindir}/$(EMACS)
307 -ln ${bindir}/emacs-${version} ${bindir}/$(EMACS)
10db7fc5 308 -unset CDPATH; \
764b077c 309 for f in `cd lib-src && echo fns-*.el`; do \
50d7ce09
KR
310 if test -r lib-src/$$f ; then \
311 ${INSTALL_DATA} lib-src/$$f ${archlibdir}/$$f; \
312 else true; fi ; \
cec762da 313 done
08068cb6 314
d7e2eff6
RS
315### Install the files that are machine-independent.
316### Most of them come straight from the distribution;
317### the exception is the DOC-* files, which are copied
24127cf7 318## from the build directory.
d7e2eff6 319
24127cf7
KH
320## Note that we copy DOC* and then delete DOC
321## as a workaround for a bug in tar on Ultrix 4.2.
97f4fff8 322install-arch-indep: mkdir info
46947372 323 -set ${COPYDESTS} ; \
97aa9c1d 324 unset CDPATH; \
d7e2eff6
RS
325 for dir in ${COPYDIR} ; do \
326 if [ `(cd $$1 && /bin/pwd)` != `(cd $${dir} && /bin/pwd)` ] ; then \
327 rm -rf $$1 ; \
328 fi ; \
329 shift ; \
330 done
005775ce 331 -set ${COPYDESTS} ; \
d7e2eff6
RS
332 mkdir ${COPYDESTS} ; \
333 chmod ugo+rx ${COPYDESTS} ; \
97aa9c1d 334 unset CDPATH; \
d7e2eff6
RS
335 for dir in ${COPYDIR} ; do \
336 dest=$$1 ; shift ; \
337 [ -d $${dir} ] \
338 && [ `(cd $${dir} && /bin/pwd)` != `(cd $${dest} && /bin/pwd)` ] \
339 && (echo "Copying $${dir} to $${dest}..." ; \
98cd1034 340 (cd $${dir}; tar -cf - . ) \
0d44146b
GM
341 | (cd $${dest}; umask 022; \
342 tar -xvf - && cat > /dev/null) || exit 1; \
b992884d 343 for subdir in `find $${dest} -type d ! -name RCS ! -name CVS -print` ; do \
5fab7212 344 chmod a+rx $${subdir} ; \
d7e2eff6
RS
345 rm -rf $${subdir}/RCS ; \
346 rm -rf $${subdir}/CVS ; \
347 rm -f $${subdir}/\#* ; \
348 rm -f $${subdir}/.\#* ; \
349 rm -f $${subdir}/*~ ; \
350 rm -f $${subdir}/*.orig ; \
351 rm -f $${subdir}/[mM]akefile* ; \
352 rm -f $${subdir}/ChangeLog* ; \
353 rm -f $${subdir}/dired.todo ; \
354 done) ; \
355 done
b2f3c6b2 356 -rm -f ${lispdir}/subdirs.el
b4594994 357 $(srcdir)/update-subdirs ${lispdir}
9f059d3c
RS
358 if [ -f ${datadir}/emacs/${version}/site-lisp/subdirs.el ]; \
359 then true; \
360 else \
361 (echo "(if (fboundp 'normal-top-level-add-subdirs-to-load-path)"; \
362 echo " (normal-top-level-add-subdirs-to-load-path))") \
d56a1167 363 > ${datadir}/emacs/${version}/site-lisp/subdirs.el; \
9f059d3c 364 fi
23f1af23 365 chmod a+r ${datadir}/emacs/${version}/site-lisp/subdirs.el
ad8cf30f 366 -if [ -f ${datadir}/emacs/site-lisp/subdirs.el ]; \
9f059d3c
RS
367 then true; \
368 else \
369 (echo "(if (fboundp 'normal-top-level-add-subdirs-to-load-path)"; \
370 echo " (normal-top-level-add-subdirs-to-load-path))") \
d56a1167 371 > ${datadir}/emacs/site-lisp/subdirs.el; \
9f059d3c 372 fi
ad8cf30f 373 -chmod a+r ${datadir}/emacs/site-lisp/subdirs.el
10db7fc5 374 -unset CDPATH; \
3be1f08e
RS
375 if [ `(cd ./etc; /bin/pwd)` != `(cd ${docdir}; /bin/pwd)` ]; \
376 then \
99d7a69d 377 echo "Copying etc/DOC-* to ${docdir} ..." ; \
98cd1034 378 (cd ./etc; tar -cf - DOC*) \
0d44146b 379 |(cd ${docdir}; umask 0; tar -xvf - && cat > /dev/null) || exit 1; \
ec28575a 380 (cd $(docdir); chmod a+r DOC*; rm DOC); \
3be1f08e 381 else true; fi
10db7fc5 382 -unset CDPATH; \
7d2cdc3c 383 if [ -r ./lisp ] \
bc63f59a 384 && [ -r ./lisp/simple.el ] \
7d2cdc3c 385 && [ x`(cd ./lisp; /bin/pwd)` != x`(cd ${lispdir}; /bin/pwd)` ] \
9ca335ed
RS
386 && [ x`(cd ${srcdir}/lisp; /bin/pwd)` != x`(cd ./lisp; /bin/pwd)` ]; \
387 then \
388 echo "Copying lisp/*.el and lisp/*.elc to ${lispdir} ..." ; \
98cd1034 389 (cd lisp; tar -cf - *.el *.elc) \
0d44146b 390 |(cd ${lispdir}; umask 0; tar -xvf - && cat > /dev/null) || exit 1; \
9ca335ed 391 else true; fi
10db7fc5 392 -unset CDPATH; \
8672a560 393 thisdir=`/bin/pwd`; \
21e8e1db 394 if [ `(cd ${srcdir}/info && /bin/pwd)` != `(cd ${infodir} && /bin/pwd)` ]; \
5e9e88fd 395 then \
469dd2ef 396 (cd ${infodir}; \
23f1af23
RS
397 if [ -f dir ]; then true; \
398 else \
399 (cd $${thisdir}; \
400 ${INSTALL_DATA} ${srcdir}/info/dir ${infodir}/dir; \
401 chmod a+r ${infodir}/dir); \
efe7425c 402 fi; \
469dd2ef 403 cd ${srcdir}/info ; \
e77e5691 404 for f in ada-mode* autotype* ccmode* cl* dired-x* ebrowse* ediff* efaq* emacs* eshell* eudc* forms* gnus* idlwave* info* message* mh-e* pcl-cvs* reftex* sc* speedbar* vip* widget* woman*; do \
d7e2eff6
RS
405 (cd $${thisdir}; \
406 ${INSTALL_DATA} ${srcdir}/info/$$f ${infodir}/$$f; \
dedd2c6d 407 chmod a+r ${infodir}/$$f); \
ce0b6622 408 done); \
21e8e1db 409 else true; fi
700fa9d1
RS
410 -unset CDPATH; \
411 thisdir=`/bin/pwd`; \
dedd2c6d
RS
412 if [ `(cd ${srcdir}/info && /bin/pwd)` != `(cd ${infodir} && /bin/pwd)` ]; \
413 then \
9bbd1465 414 for f in ada-mode autotype ccmode cl dired-x ebrowse ediff efaq emacs emacs-mime eshell eudc forms gnus idlwave info message mh-e pcl-cvs reftex sc speedbar vip viper widget woman; do \
dedd2c6d 415 (cd $${thisdir}; \
1da437e9 416 ${INSTALL_INFO} --info-dir=${infodir} ${infodir}/$$f); \
dedd2c6d
RS
417 done; \
418 else true; fi
b1b77d62 419 -chmod -R a+r ${datadir}/emacs ${COPYDESTS} ${infodir}
d7e2eff6
RS
420 thisdir=`/bin/pwd`; \
421 cd ${srcdir}/etc; \
422 for page in emacs etags ctags ; do \
423 (cd $${thisdir}; \
424 ${INSTALL_DATA} ${srcdir}/etc/$${page}.1 ${man1dir}/$${page}${manext}; \
425 chmod a+r ${man1dir}/$${page}${manext}); \
868e080d 426 done
badb0a97 427
24127cf7
KH
428### Install LEIM files. Although they are machine-independent, we
429### have separate target here instead of including it in
430### `install-arch-indep'. People who extracted LEIM files after they
431### insalled Emacs itself can install only LEIM files by this target.
bea3ec88 432install-leim: leim/Makefile mkdir
c10f84fb 433 cd leim; $(MAKE) install
24127cf7 434
8df9abae
RS
435### Build Emacs and install it, stripping binaries while installing them.
436install-strip:
97f4fff8 437 $(MAKE) INSTALL_STRIP=-s install
8df9abae 438
868e080d 439### Build all the directories we're going to install Emacs in. Since
78008d14 440### we may be creating several layers of directories (for example,
614b45a7 441### /usr/local/lib/emacs/19.0/mips-dec-ultrix4.2), we use mkinstalldirs
6784fb67 442### instead of mkdir. Not all systems' mkdir programs have the `-p' flag.
05ed817f 443mkdir: FRC
b1b77d62
RS
444 if [ -d ${datadir} ]; then true; else \
445 $(srcdir)/mkinstalldirs ${datadir}; \
446 chmod a+r ${datadir};\
447 fi
c5bfadd6 448 $(srcdir)/mkinstalldirs ${COPYDESTS} ${infodir} ${man1dir} \
b1b77d62 449 ${bindir} ${docdir} ${libexecdir} \
23f1af23
RS
450 ${datadir}/emacs/site-lisp \
451 ${datadir}/emacs/${version}/site-lisp \
309848ba 452 `echo ${locallisppath} | sed 's/:/ /g'`
86a5659e 453
d4acf74f
JB
454### Delete all the installed files that the `install' target would
455### create (but not the noninstalled files such as `make all' would
456### create).
44257b1a
JB
457###
458### Don't delete the lisp and etc directories if they're in the source tree.
d4acf74f 459uninstall:
44257b1a 460 (cd lib-src; \
0e265b72 461 $(MAKE) $(MFLAGS) uninstall \
44257b1a 462 prefix=${prefix} exec_prefix=${exec_prefix} \
2fd54e64 463 bindir=${bindir} libexecdir=${libexecdir} archlibdir=${archlibdir})
10db7fc5 464 -unset CDPATH; \
44257b1a 465 for dir in ${lispdir} ${etcdir} ; do \
726d0798 466 if [ -d $${dir} ]; then \
8672a560
RS
467 case `(cd $${dir} ; /bin/pwd)` in \
468 `(cd ${srcdir} ; /bin/pwd)`* ) ;; \
726d0798
RS
469 * ) rm -rf $${dir} ;; \
470 esac ; \
471 case $${dir} in \
472 ${datadir}/emacs/${version}/* ) \
473 rm -rf ${datadir}/emacs/${version} \
474 ;; \
475 esac ; \
476 fi ; \
44257b1a 477 done
41613c15 478 (cd ${archlibdir} && rm -f fns-*)
5db37a2e 479 -rm -rf ${libexecdir}/emacs/${version}
41613c15 480 (cd ${infodir} && rm -f cl* ada-mode* autotype* ccmode* ebrowse* efaq* eshell* eudc* idlwave* message* pcl-cvs* reftex* speedbar* widget* woman* dired-x* ediff* emacs* forms* gnus* info* mh-e* sc* vip*)
88e7bbf1 481 (cd ${man1dir} && rm -f emacs.1 etags.1 ctags.1)
6b356ee8 482 (cd ${bindir} && rm -f emacs-${version} $(EMACS))
d4acf74f
JB
483
484
05ed817f 485FRC:
78008d14
JB
486
487# ==================== Cleaning up and miscellanea ====================
488
26873b72 489.PHONY: mostlyclean clean distclean maintainer-clean extraclean
98dfba1b 490
78008d14 491### `mostlyclean'
d4acf74f
JB
492### Like `clean', but may refrain from deleting a few files that people
493### normally don't want to recompile. For example, the `mostlyclean'
494### target for GCC does not delete `libgcc.a', because recompiling it
495### is rarely necessary and takes a lot of time.
05ed817f 496mostlyclean: FRC
0e265b72
BF
497 (cd src; $(MAKE) $(MFLAGS) mostlyclean)
498 (cd oldXMenu; $(MAKE) $(MFLAGS) mostlyclean)
98dfba1b 499 (cd lwlib; $(MAKE) $(MFLAGS) mostlyclean)
0e265b72 500 (cd lib-src; $(MAKE) $(MFLAGS) mostlyclean)
e6124e9d 501 -(cd man && $(MAKE) $(MFLAGS) mostlyclean)
fa2ea19a 502 (cd leim; $(MAKE) $(MFLAGS) mostlyclean)
d4acf74f
JB
503
504### `clean'
505### Delete all files from the current directory that are normally
506### created by building the program. Don't delete the files that
507### record the configuration. Also preserve files that could be made
508### by building, but normally aren't because the distribution comes
509### with them.
78008d14 510###
d4acf74f 511### Delete `.dvi' files here if they are not part of the distribution.
05ed817f 512clean: FRC
0e265b72
BF
513 (cd src; $(MAKE) $(MFLAGS) clean)
514 (cd oldXMenu; $(MAKE) $(MFLAGS) clean)
98dfba1b 515 (cd lwlib; $(MAKE) $(MFLAGS) clean)
0e265b72 516 (cd lib-src; $(MAKE) $(MFLAGS) clean)
e6124e9d 517 -(cd man && $(MAKE) $(MFLAGS) clean)
fa2ea19a 518 (cd leim; $(MAKE) $(MFLAGS) clean)
46947372 519
78008d14 520### `distclean'
d4acf74f
JB
521### Delete all files from the current directory that are created by
522### configuring or building the program. If you have unpacked the
523### source and built the program without creating any other files,
524### `make distclean' should leave only the files that were in the
525### distribution.
526top_distclean=\
dffd6dac 527 rm -f config.status config.cache config.log ; \
d4acf74f 528 rm -f Makefile ${SUBDIR_MAKEFILES} ; \
80e79e3e 529 if [ -d lock ] ; then (cd lock && (rm -f * || true)); else true; fi
05ed817f 530distclean: FRC
0e265b72
BF
531 (cd src; $(MAKE) $(MFLAGS) distclean)
532 (cd oldXMenu; $(MAKE) $(MFLAGS) distclean)
98dfba1b 533 (cd lwlib; $(MAKE) $(MFLAGS) distclean)
0e265b72 534 (cd lib-src; $(MAKE) $(MFLAGS) distclean)
e6124e9d 535 (cd man && $(MAKE) $(MFLAGS) distclean)
fa2ea19a 536 (cd leim; $(MAKE) $(MFLAGS) distclean)
8c47a252 537 (cd lisp; $(MAKE) $(MFLAGS) distclean)
d4acf74f 538 ${top_distclean}
46947372 539
26873b72 540### `maintainer-clean'
d4acf74f
JB
541### Delete everything from the current directory that can be
542### reconstructed with this Makefile. This typically includes
543### everything deleted by distclean, plus more: C source files
544### produced by Bison, tags tables, info files, and so on.
545###
26873b72 546### One exception, however: `make maintainer-clean' should not delete
d4acf74f 547### `configure' even if `configure' can be remade using a rule in the
26873b72 548### Makefile. More generally, `make maintainer-clean' should not delete
d4acf74f
JB
549### anything that needs to exist in order to run `configure' and then
550### begin to build the program.
26873b72
RS
551maintainer-clean: FRC
552 (cd src; $(MAKE) $(MFLAGS) maintainer-clean)
553 (cd oldXMenu; $(MAKE) $(MFLAGS) maintainer-clean)
554 (cd lwlib; $(MAKE) $(MFLAGS) maintainer-clean)
555 (cd lib-src; $(MAKE) $(MFLAGS) maintainer-clean)
556 -(cd man && $(MAKE) $(MFLAGS) maintainer-clean)
fa2ea19a 557 (cd leim; $(MAKE) $(MFLAGS) maintainer-clean)
d4acf74f 558 ${top_distclean}
46947372 559
78008d14
JB
560### This doesn't actually appear in the coding standards, but Karl
561### says GCC supports it, and that's where the configuration part of
562### the coding standards seem to come from. It's like distclean, but
563### it deletes backup and autosave files too.
564extraclean:
0e265b72 565 for i in ${SUBDIR}; do (cd $$i; $(MAKE) $(MFLAGS) extraclean); done
9e8886a8 566 ${top_distclean}
2f417e39 567 -rm -f config-tmp-*
78008d14
JB
568 -rm -f *~ \#*
569
29c0047b
ER
570### Unlocking and relocking. The idea of these productions is to reduce
571### hassles when installing an incremental tar of Emacs. Do `make unlock'
572### before unlocking the file to take the write locks off all sources so
573### that tar xvof will overwrite them without fuss. Then do `make relock'
574### afterward so that VC mode will know which files should be checked in
575### if you want to mung them.
576###
577### Note: it's no disaster if these productions miss a file or two; tar
578### and VC will swiftly let you know if this happens, and it is easily
579### corrected.
e5f83e23 580SOURCES = ChangeLog GETTING.GNU.SOFTWARE INSTALL Makefile.in \
24470d72 581 README configure make-dist move-if-change
29c0047b 582
98dfba1b
RS
583.PHONY: unlock relock
584
29c0047b 585unlock:
0c19c8b3 586 chmod u+w $(SOURCES)
29c0047b 587 -(cd elisp; chmod u+w Makefile README *.texi)
0e265b72
BF
588 (cd etc; $(MAKE) $(MFLAGS) unlock)
589 (cd lib-src; $(MAKE) $(MFLAGS) unlock)
590 (cd lisp; $(MAKE) $(MFLAGS) unlock)
29c0047b
ER
591 (cd lisp/term; chmod u+w README *.el)
592 (cd man; chmod u+w *texi* ChangeLog split-man)
593 (cd oldXMenu; chmod u+w *.[ch] Makefile README)
98dfba1b 594 (cd lwlib; chmod u+w *.[ch] Makefile README)
0e265b72 595 (cd src; $(MAKE) $(MFLAGS) unlock)
29c0047b
ER
596
597relock:
0c19c8b3 598 chmod u-w $(SOURCES)
29c0047b 599 -(cd elisp; chmod u-w Makefile README *.texi)
0e265b72
BF
600 (cd etc; $(MAKE) $(MFLAGS) relock)
601 (cd lib-src; $(MAKE) $(MFLAGS) relock)
602 (cd lisp; $(MAKE) $(MFLAGS) relock)
29c0047b
ER
603 (cd lisp/term; chmod u+w README *.el)
604 (cd man; chmod u+w *texi* ChangeLog split-man)
605 (cd oldXMenu; chmod u+w *.[ch] Makefile README)
98dfba1b 606 (cd lwlib; chmod u+w *.[ch] Makefile README)
0e265b72 607 (cd src; $(MAKE) $(MFLAGS) relock)
78008d14 608
5c62b2e9
DL
609# The src subdir knows how to do the right thing
610# even when the build directory and source dir are different.
8e60a253 611TAGS tags: lib-src src
a383fece 612 cd src; $(MAKE) tags
46947372
JB
613
614check:
615 @echo "We don't have any tests for GNU Emacs yet."
4746118a
JB
616
617dist:
c6035ee6 618 cd ${srcdir}; ./make-dist
d4acf74f 619
b992884d 620.PHONY: info dvi dist check html
653ddcc3 621force-info:
5c62b2e9
DL
622# Note that man/Makefile knows how to
623# put the info files in $(srcdir),
624# so we can do ok running make in the build dir.
653ddcc3 625info: force-info
5c5f75f1 626 (cd man; $(MAKE) $(MFLAGS) info)
d4acf74f 627dvi:
6784fb67 628 (cd man; $(MAKE) $(MFLAGS) dvi)
3b691429
GM
629
630#### Bootstrapping.
631
632### This is meant for Emacs maintainers only. It first cleans the
633### lisp subdirectory, removing all compiled Lisp files. Then a
634### special emacs executable is built from Lisp sources, which is then
635### used to compile Lisp files. The last step is a "normal" make.
636
3aca9e8c
GM
637bootstrap: clean bootstrap-lisp-1 bootstrap-src bootstrap-lisp clean all info
638
639bootstrap-lisp-1:
3b691429 640 (cd lisp; $(MAKE) $(MFLAGS) bootstrap-clean)
3aca9e8c
GM
641
642bootstrap-lisp:
3b691429 643 -(cd lisp; $(MAKE) $(MFLAGS) bootstrap EMACS=../src/bootstrap-emacs)
3b691429 644
3aca9e8c
GM
645bootstrap-src:
646 (cd src; $(MAKE) $(MFLAGS) bootstrap)