* emacsclient.c (main): Return EXIT_FAILURE if Emacs sends us an error string
[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
92ab3834 5# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
114f9c96 6# 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
57ebf0be 7# Free Software Foundation, Inc.
b3ae7a0a
GM
8
9# This file is part of GNU Emacs.
10
b33ba812 11# GNU Emacs is free software: you can redistribute it and/or modify
b3ae7a0a 12# it under the terms of the GNU General Public License as published by
b33ba812
GM
13# the Free Software Foundation, either version 3 of the License, or
14# (at your option) any later version.
b3ae7a0a
GM
15
16# GNU Emacs is distributed in the hope that it will be useful,
17# but WITHOUT ANY WARRANTY; without even the implied warranty of
18# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19# GNU General Public License for more details.
20
21# You should have received a copy of the GNU General Public License
b33ba812
GM
22# along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
23
24### Commentary:
b3ae7a0a 25
46947372
JB
26# make all to compile and build Emacs.
27# make install to install it.
78008d14 28# make TAGS to update tags tables.
86a5659e 29#
78008d14
JB
30# make clean or make mostlyclean
31# Delete all files from the current directory that are normally
868e080d 32# created by building the program. Don't delete the files that
78008d14
JB
33# record the configuration. Also preserve files that could be made
34# by building, but normally aren't because the distribution comes
35# with them.
36#
37# Delete `.dvi' files here if they are not part of the distribution.
177c0ea7 38#
78008d14
JB
39# make distclean
40# Delete all files from the current directory that are created by
41# configuring or building the program. If you have unpacked the
42# source and built the program without creating any other files,
43# `make distclean' should leave only the files that were in the
44# distribution.
177c0ea7 45#
26873b72 46# make maintainer-clean
78008d14
JB
47# Delete everything from the current directory that can be
48# reconstructed with this Makefile. This typically includes
8aa2d05f
LT
49# everything deleted by distclean, plus more: .elc files,
50# C source files produced by Bison, tags tables, info files,
51# and so on.
78008d14
JB
52#
53# make extraclean
54# Still more severe - delete backup and autosave files, too.
51769fcc 55#
cd9ebbbb 56# make bootstrap
fc46d219
SM
57# Removes all the compiled files to force a new bootstrap from a
58# clean slate, and then build in the normal way.
86a5659e
JB
59
60SHELL = /bin/sh
2dc44cb5 61
68e4cc57
LT
62# This may not work with certain non-GNU make's. It only matters when
63# inheriting a CDPATH not starting with the current directory.
64CDPATH=
65
2dc44cb5
RS
66# If Make doesn't predefine MAKE, set it here.
67@SET_MAKE@
86a5659e 68
78008d14 69# ==================== Things `configure' Might Edit ====================
86a5659e 70
c75ff9db 71CC=@CC@
b6472fc1 72CFLAGS=@CFLAGS@
bb5f88cc 73LDFLAGS=@LDFLAGS@
e17d7117 74CPPFLAGS=@CPPFLAGS@
108c7c97 75EXEEXT=@EXEEXT@
79bc8bbb 76MAKEINFO=@MAKEINFO@
78008d14
JB
77
78### These help us choose version- and architecture-specific directories
79### to install files in.
80
81### This should be the number of the Emacs version we're building,
82### like `18.59' or `19.0'.
c75ff9db 83version=@version@
78008d14
JB
84
85### This should be the name of the configuration we're building Emacs
86### for, like `mips-dec-ultrix' or `sparc-sun-sunos'.
c75ff9db
JB
87configuration=@configuration@
88
78008d14
JB
89# ==================== Where To Install Things ====================
90
46947372 91# The default location for installation. Everything is placed in
78008d14
JB
92# subdirectories of this directory. The default values for many of
93# the variables below are expressed in terms of this one, so you may
8d467c70
JB
94# not need to change them. This defaults to /usr/local.
95prefix=@prefix@
86a5659e 96
78008d14 97# Like `prefix', but used for architecture-specific files.
86ddcc58 98exec_prefix=@exec_prefix@
78008d14 99
46947372
JB
100# Where to install Emacs and other binaries that people will want to
101# run directly (like etags).
0e265b72 102bindir=@bindir@
86a5659e 103
ca1cd89c
AS
104# The root of the directory tree for read-only architecture-independent
105# data files. ${datadir}, ${infodir} and ${mandir} are based on this.
106datarootdir=@datarootdir@
107
868e080d 108# Where to install architecture-independent data files. ${lispdir}
78008d14 109# and ${etcdir} are subdirectories of this.
0e265b72 110datadir=@datadir@
0c22fbca
JB
111
112# Where to install and expect the files that Emacs modifies as it
c5bfadd6
RS
113# runs. These files are all architecture-independent.
114# Right now, this is not used.
3e74e344 115sharedstatedir=@sharedstatedir@
0c22fbca
JB
116
117# Where to install and expect executable files to be run by Emacs
118# rather than directly by users, and other architecture-dependent
868e080d 119# data. ${archlibdir} is a subdirectory of this.
2fd54e64 120libexecdir=@libexecdir@
0c22fbca 121
8e7aa5de
GM
122# Where to install Emacs's man pages.
123# This used to allow choice of the numeric extension, but this made
124# little sense since the files were always installed in man1/
125# (and they contain cross-references that expect them to be there).
0e265b72 126mandir=@mandir@
88e7bbf1 127man1dir=$(mandir)/man1
8e7aa5de
GM
128MAN_PAGES=b2m.1 ctags.1 ebrowse.1 emacs.1 emacsclient.1 etags.1 \
129 grep-changelog.1 rcs-checkin.1
0c22fbca
JB
130
131# Where to install and expect the info files describing Emacs. In the
132# past, this defaulted to a subdirectory of ${prefix}/lib/emacs, but
133# since there are now many packages documented with the texinfo
134# system, it is inappropriate to imply that it is part of Emacs.
0e265b72 135infodir=@infodir@
389b99fd 136INFO_FILES=ada-mode auth autotype calc ccmode cl dbus dired-x ebrowse \
3bdb7e3e 137 ede ediff edt eieio efaq eintr elisp emacs emacs-mime epa erc \
b6c0fa71
JB
138 eshell eudc flymake forms gnus idlwave info mairix-el \
139 message mh-e newsticker nxml-mode org pcl-cvs pgg rcirc \
371b0117
GM
140 reftex remember sasl sc semantic ses sieve smtpmail speedbar \
141 tramp url vip viper widget woman
86a5659e 142
97f1ce35
RS
143# Directory for local state files for all programs.
144localstatedir=@localstatedir@
145
b2f3c6b2
RS
146# Where to look for bitmap files.
147bitmapdir=@bitmapdir@
148
00c29909 149# Where to find the source code. The source code for Emacs's C kernel is
78008d14
JB
150# expected to be in ${srcdir}/src, and the source code for Emacs's
151# utility programs is expected to be in ${srcdir}/lib-src. This is
152# set by the configure script's `--srcdir' option.
0d60d4ef
RS
153
154# We use $(srcdir) explicitly in dependencies so as not to depend on VPATH.
d3245f70 155srcdir=@srcdir@
86a5659e 156
e7426ea4
GM
157# Where the manpage source files are kept.
158mansrcdir=$(srcdir)/doc/man
159
f854bb66
RM
160# Tell make where to find source files; this is needed for the makefiles.
161VPATH=@srcdir@
162
3163d9cf
RS
163# Where to find the application default.
164x_default_search_path=@x_default_search_path@
165
edfda783 166# Location to install Emacs.app under NeXT/Open/GNUstep / Cocoa
06b62770
AR
167ns_appbindir=@ns_appbindir@
168ns_appresdir=@ns_appresdir@
edfda783 169
b26cd843
GM
170# Where the etc/emacs.desktop file is to be installed.
171desktopdir=$(datarootdir)/applications
172
173# Where the etc/images/icons/hicolor directory is to be installed.
174icondir=$(datarootdir)/icons
175
4cba674a
GM
176# The source directory for the icon files.
177iconsrcdir=$(srcdir)/etc/images/icons
178
0c22fbca
JB
179# ==================== Emacs-specific directories ====================
180
78008d14
JB
181# These variables hold the values Emacs will actually use. They are
182# based on the values of the standard Make variables above.
183
0e265b72
BF
184# Where to install the lisp files distributed with
185# Emacs. This includes the Emacs version, so that the
186# lisp files for different versions of Emacs will install
187# themselves in separate directories.
188lispdir=@lispdir@
d3245f70 189
0e265b72
BF
190# Directories Emacs should search for lisp files specific
191# to this site (i.e. customizations), before consulting
192# ${lispdir}. This should be a colon-separated list of
193# directories.
194locallisppath=@locallisppath@
d3245f70
JB
195
196# Where Emacs will search to find its lisp files. Before
197# changing this, check to see if your purpose wouldn't
198# better be served by changing locallisppath. This
46947372 199# should be a colon-separated list of directories.
0e265b72 200lisppath=@lisppath@
86a5659e 201
d3245f70
JB
202# Where Emacs will search for its lisp files while
203# building. This is only used during the process of
204# compiling Emacs, to help Emacs find its lisp files
205# before they've been installed in their final location.
177c0ea7 206# It's usually identical to lisppath, except that
90ac71dc 207# it does not include locallisppath, and the
d3245f70
JB
208# entry for the directory containing the installed lisp
209# files has been replaced with ../lisp. This should be a
210# colon-separated list of directories.
3dbc7e32 211buildlisppath=${srcdir}/lisp
86a5659e 212
0e265b72
BF
213# Where to install the other architecture-independent
214# data files distributed with Emacs (like the tutorial,
215# the cookie recipes and the Zippy database). This path
216# usually contains the Emacs version number, so the data
217# files for multiple versions of Emacs may be installed
218# at once.
219etcdir=@etcdir@
220
0e265b72
BF
221# Where to put executables to be run by Emacs rather than
222# the user. This path usually includes the Emacs version
223# and configuration name, so that multiple configurations
224# for multiple versions of Emacs may be installed at
225# once.
226archlibdir=@archlibdir@
a34902ab 227
e408046f
KH
228# Where to put the docstring file.
229docdir=@docdir@
230
97f1ce35
RS
231# Where to install Emacs game score files.
232gamedir=@gamedir@
233
46947372
JB
234# ==================== Utility Programs for the Build ====================
235
236# Allow the user to specify the install program.
19697295 237INSTALL = @INSTALL@
86ddcc58
JB
238INSTALL_PROGRAM = @INSTALL_PROGRAM@
239INSTALL_DATA = @INSTALL_DATA@
82b96f95 240INSTALL_INFO = @INSTALL_INFO@
c1b8c545
RS
241# By default, we uphold the dignity of our programs.
242INSTALL_STRIP =
46947372 243
e8439d34 244# We use gzip to compress installed .el files.
a220d97b 245GZIP_PROG = @GZIP_PROG@
338648ad
GM
246# If non-nil, gzip the installed Info and man pages.
247GZIP_INFO = @GZIP_INFO@
e8439d34 248
46947372 249# ============================= Targets ==============================
86a5659e 250
a4663fed
PJ
251# Program name transformation.
252TRANSFORM = @program_transform_name@
253
9ef7f9f0 254# What emacs should be called when installed.
108c7c97
AS
255EMACS = `echo emacs${EXEEXT} | sed '$(TRANSFORM)'`
256EMACSFULL = `echo emacs-${version}${EXEEXT} | sed '$(TRANSFORM)'`
9ef7f9f0 257
86a5659e 258# Subdirectories to make recursively. `lisp' is not included
42c615ae 259# because the compiled lisp files are part of the distribution.
4ce7f03e 260# leim is not included because it needs special handling.
49f6eb95
SM
261#
262# Actually, we now include `lisp' as well, since the compiled files
263# are not included any more in case of bootstrap or in case Emacs was
264# checked out from a VCS.
265SUBDIR = lib-src src lisp
86a5659e 266
d0b7952a
AS
267# The subdir makefiles created by config.status.
268SUBDIR_MAKEFILES = lib-src/Makefile doc/emacs/Makefile doc/misc/Makefile doc/lispref/Makefile doc/lispintro/Makefile src/Makefile oldXMenu/Makefile lwlib/Makefile leim/Makefile lisp/Makefile
78008d14 269
83f6a565
JB
270# Subdirectories to install, and where they'll go.
271# lib-src's makefile knows how to install it, so we don't do that here.
c55db078 272# leim's makefile also knows how to install it, so we don't do that here.
83f6a565
JB
273# When installing the info files, we need to do special things to
274# avoid nuking an existing dir file, so we don't do that here;
275# instead, we have written out explicit code in the `install' targets.
78c7997f 276COPYDIR = ${srcdir}/etc ${srcdir}/lisp
81af9060 277COPYDESTS = $(DESTDIR)${etcdir} $(DESTDIR)${lispdir}
86a5659e 278
0635d9fa 279all: ${SUBDIR} leim
86a5659e 280
309848ba 281removenullpaths=sed -e 's/^://g' -e 's/:$$//g' -e 's/::/:/g'
46947372 282
c138b63b 283# Generate epaths.h from epaths.in. This target is invoked by `configure'.
8cce271e
GM
284# See comments in configure.in for why it is done this way, as opposed
285# to just letting configure generate epaths.h from epaths.in in a
286# similar way to how Makefile is made from Makefile.in.
c138b63b 287epaths-force: FRC
8672a560
RS
288 @(lisppath=`echo ${lisppath} | ${removenullpaths}` ; \
289 buildlisppath=`echo ${buildlisppath} | ${removenullpaths}` ; \
3163d9cf 290 x_default_search_path=`echo ${x_default_search_path}`; \
97f1ce35 291 gamedir=`echo ${gamedir}`; \
c138b63b 292 sed < ${srcdir}/src/epaths.in > epaths.h.$$$$ \
eb7c6f20
LK
293 -e 's;\(#.*PATH_LOADSEARCH\).*$$;\1 "'"$${lisppath}"'";' \
294 -e 's;\(#.*PATH_DUMPLOADSEARCH\).*$$;\1 "'"$${buildlisppath}"'";' \
8672a560
RS
295 -e 's;\(#.*PATH_EXEC\).*$$;\1 "${archlibdir}";' \
296 -e 's;\(#.*PATH_INFO\).*$$;\1 "${infodir}";' \
297 -e 's;\(#.*PATH_DATA\).*$$;\1 "${etcdir}";' \
b2f3c6b2 298 -e 's;\(#.*PATH_BITMAPS\).*$$;\1 "${bitmapdir}";' \
3163d9cf 299 -e 's;\(#.*PATH_X_DEFAULTS\).*$$;\1 "${x_default_search_path}";' \
97f1ce35 300 -e 's;\(#.*PATH_GAME\).*$$;\1 "${gamedir}";' \
48d67035
MB
301 -e 's;\(#.*PATH_DOC\).*$$;\1 "${docdir}";' \
302 -e 's;/[*] *arch-tag:.*;/*;') && \
c138b63b 303 ${srcdir}/move-if-change epaths.h.$$$$ src/epaths.h
8672a560 304
9a698d2e 305# For parallel make, src should be built before leim.
4ce7f03e
GM
306# "export PARALLEL=0" is for SGI's Make, to prevent it from
307# running more than 1 process in the leim directory, especially for
308# the $TIT files there.
ac935997 309leim: src Makefile FRC
4ce7f03e
GM
310 (export PARALLEL; PARALLEL=0; cd $@; $(MAKE) all $(MFLAGS) \
311 CC='${CC}' CFLAGS='${CFLAGS}' CPPFLAGS='${CPPFLAGS}' \
312 LDFLAGS='${LDFLAGS}' MAKE='${MAKE}')
bea3ec88 313
0a0dca73 314src: lib-src FRC
a874c104 315
4ce7f03e 316.RECURSIVE: ${SUBDIR} leim
86a5659e 317
49f6eb95
SM
318# We need to build `emacs' in `src' to compile the *.elc files in `lisp'.
319lisp: src
320
b4b7bab7
SM
321# These targets should be "${SUBDIR} without `src'".
322lib-src lisp: Makefile FRC
323 cd $@; $(MAKE) all $(MFLAGS) \
324 CC='${CC}' CFLAGS='${CFLAGS}' CPPFLAGS='${CPPFLAGS}' \
325 LDFLAGS='${LDFLAGS}' MAKE='${MAKE}'
326
b4945b95
SM
327# Pass to src/Makefile.in an additional BOOTSTRAPEMACS variable which
328# is either set to bootstrap-emacs (in case bootstrap-emacs has not been
329# constructed yet) or the empty string (otherwise).
330# src/Makefile.in uses it to implement conditional dependencies, so that
331# files that need bootstrap-emacs to be built do not additionally need
332# to be kept fresher than bootstrap-emacs. Otherwise changing a single
333# file src/foo.c forces dumping a new bootstrap-emacs, then re-byte-compiling
334# all preloaded elisp files, and only then dump the actual src/emacs, which
335# is not wrong, but is overkill in 99.99% of the cases.
b4b7bab7 336src: Makefile FRC
b4945b95 337 boot=bootstrap-emacs$(EXEEXT); \
b4b7bab7
SM
338 if [ ! -x "src/$$boot" ]; then \
339 cd $@; $(MAKE) all $(MFLAGS) \
340 CC='${CC}' CFLAGS='${CFLAGS}' CPPFLAGS='${CPPFLAGS}' \
341 LDFLAGS='${LDFLAGS}' MAKE='${MAKE}' BOOTSTRAPEMACS="$$boot"; \
2ae83832 342 fi;
5b5262f4
SM
343 if [ -r .bzr/checkout/dirstate ]; then \
344 vcswitness="$$(pwd)/.bzr/checkout/dirstate"; \
345 fi; \
b4945b95 346 cd $@; $(MAKE) all $(MFLAGS) \
7c811eec 347 CC='${CC}' CFLAGS='${CFLAGS}' CPPFLAGS='${CPPFLAGS}' \
5b5262f4
SM
348 LDFLAGS='${LDFLAGS}' MAKE='${MAKE}' BOOTSTRAPEMACS="" \
349 VCSWITNESS="$$vcswitness"
0e265b72 350
ac935997 351blessmail: Makefile src FRC
df8bde8b
RS
352 cd lib-src; $(MAKE) maybe-blessmail $(MFLAGS) \
353 MAKE='${MAKE}' archlibdir='$(archlibdir)'
d541babe 354
ac935997
SM
355# We used to have one rule per */Makefile.in, but that leads to race
356# conditions with parallel makes, so let's assume that the time stamp on
357# ./Makefile is representative of the time stamp on all the other Makefiles.
358Makefile: config.status $(srcdir)/src/config.in \
359 $(srcdir)/Makefile.in \
360 $(srcdir)/src/Makefile.in \
361 $(srcdir)/lib-src/Makefile.in \
362 $(srcdir)/doc/emacs/Makefile.in \
363 $(srcdir)/doc/misc/Makefile.in \
364 $(srcdir)/doc/lispref/Makefile.in \
365 $(srcdir)/doc/lispintro/Makefile.in \
366 $(srcdir)/oldXMenu/Makefile.in \
367 $(srcdir)/lwlib/Makefile.in \
368 $(srcdir)/leim/Makefile.in \
369 $(srcdir)/lisp/Makefile.in
0e265b72
BF
370 ./config.status
371
c97adfa5 372config.status: ${srcdir}/configure ${srcdir}/lisp/version.el
7763df25
DL
373 ./config.status --recheck
374
9eff9fe3
PE
375AUTOCONF_INPUTS = @MAINT@ $(srcdir)/configure.in $(srcdir)/m4/getopt.m4
376
377$(srcdir)/configure: $(AUTOCONF_INPUTS)
7763df25
DL
378 cd ${srcdir} && autoconf
379
9dfcf5a5 380$(srcdir)/src/config.in: $(srcdir)/src/stamp-h.in
5b5262f4
SM
381 @ # Usually, there's no need to rebuild src/config.in just
382 @ # because stamp-h.in has changed (since building stamp-h.in
383 @ # refreshes config.in as well), but if config.in is missing
384 @ # then we really need to do something more.
385 [ -r "$@" ] || ( cd ${srcdir} && autoheader )
9eff9fe3 386$(srcdir)/src/stamp-h.in: $(AUTOCONF_INPUTS)
9dfcf5a5
AS
387 cd ${srcdir} && autoheader
388 rm -f $(srcdir)/src/stamp-h.in
389 echo timestamp > $(srcdir)/src/stamp-h.in
390
78008d14
JB
391# ==================== Installation ====================
392
dbc4e1c1
JB
393## If we let lib-src do its own installation, that means we
394## don't have to duplicate the list of utilities to install in
395## this Makefile as well.
d3245f70 396
3dbc7e32
JB
397## On AIX, use tar xBf.
398## On Xenix, use tar xpf.
399
9ef7f9f0 400.PHONY: install mkdir
98dfba1b 401
d3245f70
JB
402## We delete each directory in ${COPYDESTS} before we copy into it;
403## that way, we can reinstall over directories that have been put in
404## place with their files read-only (perhaps because they are checked
405## into RCS). In order to make this safe, we make sure that the
406## source exists and is distinct from the destination.
d7ce568f
RS
407### We do install-arch-indep first because
408### the executable needs the Lisp files and DOC file to work properly.
cff455ae 409install: all install-arch-indep install-arch-dep install-leim blessmail
a5038ae5 410 @true
8b14d296 411
734dabe0 412MV_DIRS = for i in $$dir; do rm -fr `basename "$$i"` ; mv "$$i" . ; done
9c222401 413
d7e2eff6 414### Install the executables that were compiled specifically for this machine.
d7ce568f
RS
415### It would be nice to do something for a parallel make
416### to ensure that install-arch-indep finishes before this starts.
417install-arch-dep: mkdir
8b14d296 418 (cd lib-src; \
0e265b72 419 $(MAKE) install $(MFLAGS) prefix=${prefix} \
2fd54e64 420 exec_prefix=${exec_prefix} bindir=${bindir} \
c1b8c545
RS
421 libexecdir=${libexecdir} archlibdir=${archlibdir} \
422 INSTALL_STRIP=${INSTALL_STRIP})
81af9060
EZ
423 ${INSTALL_PROGRAM} $(INSTALL_STRIP) src/emacs${EXEEXT} $(DESTDIR)${bindir}/$(EMACSFULL)
424 -chmod 1755 $(DESTDIR)${bindir}/$(EMACSFULL)
425 rm -f $(DESTDIR)${bindir}/$(EMACS)
426 -ln $(DESTDIR)${bindir}/$(EMACSFULL) $(DESTDIR)${bindir}/$(EMACS)
10db7fc5 427 -unset CDPATH; \
764b077c 428 for f in `cd lib-src && echo fns-*.el`; do \
50d7ce09 429 if test -r lib-src/$$f ; then \
81af9060 430 ${INSTALL_DATA} lib-src/$$f $(DESTDIR)${archlibdir}/$$f; \
50d7ce09 431 else true; fi ; \
cec762da 432 done
58dfab18 433 if test "${ns_appresdir}" != ""; then \
06b62770 434 ( cd ${ns_appresdir} ; \
9c222401
JD
435 if test -d share/emacs ; then dir=share/emacs/*/*; $(MV_DIRS); fi;\
436 if test -d share/info ; then dir=share/info; $(MV_DIRS) ; fi ; \
06b62770 437 rm -fr share ) ; \
da53fab9 438 ( cd ${ns_appbindir}libexec ; dir=emacs/*/*/* ; $(MV_DIRS); \
9c222401 439 rm -fr emacs ) ; \
da53fab9 440 ( cd ${ns_appbindir}bin ; rm -f emacs emacs-24* ; \
06b62770
AR
441 ln -sf ../libexec/* .) ; \
442 else true ; fi
08068cb6 443
2b5f541b
GM
444## FIXME is the emacs-24* bit above really necessary and correct?
445## What if I have 24.1 and 24.2 installed at the same time?
446## In any case, it should use something like echo $version | sed 's/\..*//'
447## instead of hard-coding a version.
448
7864e4ee
GM
449## http://lists.gnu.org/archive/html/emacs-devel/2007-10/msg01672.html
450## Needs to be the user running install, so configure can't set it.
451set_installuser=for installuser in $${LOGNAME} $${USERNAME} $${USER} \
452 `id -un 2> /dev/null`; do \
453 [ -n "$${installuser}" ] && break ; \
454 done
455
d7e2eff6
RS
456### Install the files that are machine-independent.
457### Most of them come straight from the distribution;
458### the exception is the DOC-* files, which are copied
e61dd7f9 459### from the build directory.
d7e2eff6 460
24127cf7
KH
461## Note that we copy DOC* and then delete DOC
462## as a workaround for a bug in tar on Ultrix 4.2.
8422aeb7 463
244ccd62
GM
464## We install only the relevant DOC file if possible
465## (ie DOC-${version}.buildnumber), otherwise DOC-${version}*.
466
8422aeb7
EZ
467## If people complain about the h flag in tar command, take that out.
468## That flag is also used in leim/Makefile.in
5a6a83f2
GM
469
470## Note that the Makefiles in the etc directory are potentially useful
471## in an installed Emacs, so should not be excluded.
9a56b440 472
b26cd843 473install-arch-indep: mkdir info install-etc
46947372 474 -set ${COPYDESTS} ; \
97aa9c1d 475 unset CDPATH; \
d7e2eff6
RS
476 for dir in ${COPYDIR} ; do \
477 if [ `(cd $$1 && /bin/pwd)` != `(cd $${dir} && /bin/pwd)` ] ; then \
478 rm -rf $$1 ; \
479 fi ; \
480 shift ; \
481 done
005775ce 482 -set ${COPYDESTS} ; \
d7e2eff6
RS
483 mkdir ${COPYDESTS} ; \
484 chmod ugo+rx ${COPYDESTS} ; \
97aa9c1d 485 unset CDPATH; \
7864e4ee 486 $(set_installuser); \
d7e2eff6
RS
487 for dir in ${COPYDIR} ; do \
488 dest=$$1 ; shift ; \
489 [ -d $${dir} ] \
490 && [ `(cd $${dir} && /bin/pwd)` != `(cd $${dest} && /bin/pwd)` ] \
491 && (echo "Copying $${dir} to $${dest}..." ; \
bc171472 492 (cd $${dir}; tar -chf - . ) \
0d44146b
GM
493 | (cd $${dest}; umask 022; \
494 tar -xvf - && cat > /dev/null) || exit 1; \
9a56b440 495 find $${dest} -exec chown $${installuser} {} ';' ;\
02be533b 496 for subdir in `find $${dest} -type d -print` ; do \
5fab7212 497 chmod a+rx $${subdir} ; \
cea426d3 498 rm -f $${subdir}/.gitignore ; \
52b9b5cc 499 rm -f $${subdir}/.arch-inventory ; \
2ec536de 500 rm -f $${subdir}/.DS_Store ; \
d7e2eff6
RS
501 rm -f $${subdir}/\#* ; \
502 rm -f $${subdir}/.\#* ; \
503 rm -f $${subdir}/*~ ; \
504 rm -f $${subdir}/*.orig ; \
5a6a83f2 505 [ "$${dir}" != "${srcdir}/etc" ] && \
92424f95
GM
506 rm -f $${subdir}/[mM]akefile*.c $${subdir}/[mM]akefile*[.-]in \
507 $${subdir}/[mM]akefile ; \
d7e2eff6 508 rm -f $${subdir}/ChangeLog* ; \
d7e2eff6
RS
509 done) ; \
510 done
81af9060
EZ
511 -rm -f $(DESTDIR)${lispdir}/subdirs.el
512 $(srcdir)/update-subdirs $(DESTDIR)${lispdir}
513 if [ -f $(DESTDIR)${datadir}/emacs/${version}/site-lisp/subdirs.el ]; \
9f059d3c
RS
514 then true; \
515 else \
516 (echo "(if (fboundp 'normal-top-level-add-subdirs-to-load-path)"; \
517 echo " (normal-top-level-add-subdirs-to-load-path))") \
81af9060 518 > $(DESTDIR)${datadir}/emacs/${version}/site-lisp/subdirs.el; \
9f059d3c 519 fi
81af9060
EZ
520 chmod a+r $(DESTDIR)${datadir}/emacs/${version}/site-lisp/subdirs.el
521 -if [ -f $(DESTDIR)${datadir}/emacs/site-lisp/subdirs.el ]; \
9f059d3c
RS
522 then true; \
523 else \
524 (echo "(if (fboundp 'normal-top-level-add-subdirs-to-load-path)"; \
525 echo " (normal-top-level-add-subdirs-to-load-path))") \
81af9060 526 > $(DESTDIR)${datadir}/emacs/site-lisp/subdirs.el; \
9f059d3c 527 fi
81af9060 528 -chmod a+r $(DESTDIR)${datadir}/emacs/site-lisp/subdirs.el
10db7fc5 529 -unset CDPATH; \
81af9060 530 if [ `(cd ./etc; /bin/pwd)` != `(cd $(DESTDIR)${docdir}; /bin/pwd)` ]; \
3be1f08e 531 then \
244ccd62
GM
532 fullversion=`./src/emacs --version | sed -n '1 s/GNU Emacs *//p'`; \
533 if [ -f "./etc/DOC-$${fullversion}" ]; \
534 then \
535 docfile="DOC-$${fullversion}"; \
536 else \
201a4073 537 docfile="DOC"; \
244ccd62
GM
538 fi; \
539 echo "Copying etc/$${docfile} to $(DESTDIR)${docdir} ..." ; \
540 (cd ./etc; tar -chf - $${docfile}) \
81af9060 541 |(cd $(DESTDIR)${docdir}; umask 022; tar -xvf - && cat > /dev/null) || exit 1; \
9a56b440 542 (cd $(DESTDIR)$(docdir); \
7864e4ee 543 $(set_installuser); \
9a56b440 544 chown $${installuser} DOC*; chmod a+r DOC*; \
664a406f 545 if test "`echo DOC-*`" != "DOC-*"; then rm -f DOC; fi); \
3be1f08e 546 else true; fi
10db7fc5 547 -unset CDPATH; \
2c4396c4
AS
548 if [ -r ./lisp ] \
549 && [ -r ./lisp/simple.el ] \
81af9060 550 && [ x`(cd ./lisp; /bin/pwd)` != x`(cd $(DESTDIR)${lispdir}; /bin/pwd)` ] \
56ab7fbb 551 && [ x`(cd ${srcdir}/lisp; /bin/pwd)` != x`(cd ./lisp; /bin/pwd)` ]; \
9ca335ed 552 then \
81af9060 553 echo "Copying lisp/*.el and lisp/*.elc to $(DESTDIR)${lispdir} ..." ; \
2c4396c4 554 (cd lisp; tar -chf - *.el *.elc) \
81af9060 555 |(cd $(DESTDIR)${lispdir}; umask 022; tar -xvf - && cat > /dev/null) || exit 1; \
9a56b440 556 (cd $(DESTDIR)${lispdir}; \
7864e4ee 557 $(set_installuser); \
9a56b440 558 find . -exec chown $${installuser} {} ';') ; \
9ca335ed 559 else true; fi
10db7fc5 560 -unset CDPATH; \
a220d97b 561 if [ -n "${GZIP_PROG}" ]; \
e8439d34
RF
562 then \
563 echo "Compressing *.el ..." ; \
81af9060 564 (cd $(DESTDIR)${lispdir}; for f in `find . -name "*.elc" -print`; do \
a220d97b 565 ${GZIP_PROG} -9n `echo $$f|sed 's/.elc$$/.el/'` ; \
e8439d34
RF
566 done) \
567 else true; fi
568 -unset CDPATH; \
8672a560 569 thisdir=`/bin/pwd`; \
81af9060 570 if [ `(cd ${srcdir}/info && /bin/pwd)` != `(cd $(DESTDIR)${infodir} && /bin/pwd)` ]; \
5e9e88fd 571 then \
81af9060 572 (cd $(DESTDIR)${infodir}; \
23f1af23
RS
573 if [ -f dir ]; then true; \
574 else \
575 (cd $${thisdir}; \
81af9060
EZ
576 ${INSTALL_DATA} ${srcdir}/info/dir $(DESTDIR)${infodir}/dir; \
577 chmod a+r $(DESTDIR)${infodir}/dir); \
efe7425c 578 fi; \
469dd2ef 579 cd ${srcdir}/info ; \
84d3272c 580 for elt in $(INFO_FILES); do \
1c73f195 581 test "$(MAKEINFO)" = "off" && ! test -e $$elt && continue; \
84d3272c
EZ
582 for f in `ls $$elt $$elt-[1-9] $$elt-[1-9][0-9] 2>/dev/null`; do \
583 ${INSTALL_DATA} $$f $(DESTDIR)${infodir}/$$f; \
584 chmod a+r $(DESTDIR)${infodir}/$$f; \
338648ad 585 if [ -n "${GZIP_INFO}" ] && [ -n "${GZIP_PROG}" ]; then \
5877cf48 586 rm -f $(DESTDIR)${infodir}/$$f.gz; \
d772827c 587 ${GZIP_PROG} -9n $(DESTDIR)${infodir}/$$f; \
338648ad 588 else true; fi; \
84d3272c 589 done; \
ce0b6622 590 done); \
21e8e1db 591 else true; fi
700fa9d1
RS
592 -unset CDPATH; \
593 thisdir=`/bin/pwd`; \
81af9060 594 if [ `(cd ${srcdir}/info && /bin/pwd)` != `(cd $(DESTDIR)${infodir} && /bin/pwd)` ]; \
dedd2c6d 595 then \
84d3272c 596 for elt in $(INFO_FILES); do \
1c73f195 597 test "$(MAKEINFO)" = "off" && ! test -e $$elt && continue; \
dedd2c6d 598 (cd $${thisdir}; \
84d3272c 599 ${INSTALL_INFO} --info-dir=$(DESTDIR)${infodir} $(DESTDIR)${infodir}/$$elt); \
dedd2c6d
RS
600 done; \
601 else true; fi
07cd4153 602 -chmod -R a+r $(DESTDIR)${datadir}/emacs/${version} ${COPYDESTS}
d7e2eff6 603 thisdir=`/bin/pwd`; \
e7426ea4 604 cd ${mansrcdir}; \
8e7aa5de 605 for page in ${MAN_PAGES}; do \
d7e2eff6 606 (cd $${thisdir}; \
8e7aa5de 607 ${INSTALL_DATA} ${mansrcdir}/$${page} $(DESTDIR)${man1dir}/$${page}; \
338648ad
GM
608 chmod a+r $(DESTDIR)${man1dir}/$${page}; \
609 if [ -n "${GZIP_INFO}" ] && [ -n "${GZIP_PROG}" ]; then \
5877cf48 610 rm -f $(DESTDIR)${man1dir}/$${page}.gz; \
338648ad
GM
611 ${GZIP_PROG} -9n $(DESTDIR)${man1dir}/$${page}; \
612 else true; fi ); \
868e080d 613 done
badb0a97 614
b26cd843
GM
615## Install those items from etc/ that need to end up elsewhere.
616install-etc: mkdir
617 ${INSTALL_DATA} ${srcdir}/etc/emacs.desktop \
618 $(DESTDIR)${desktopdir}/emacs.desktop
69c7cf1b
GM
619 for icon in $(iconsrcdir)/*/*/apps/*.* \
620 $(iconsrcdir)/*/*/mimetypes/*.*; do \
b26cd843
GM
621 if [ -r $${icon} ]; then \
622 iicon=`echo "$${icon}" | sed 's,$(srcdir)/etc/images/icons,$(DESTDIR)${icondir},'` ; \
623 ${INSTALL_DATA} $${icon} $${iicon} ; \
624 fi ; \
625 done
626
24127cf7
KH
627### Install LEIM files. Although they are machine-independent, we
628### have separate target here instead of including it in
629### `install-arch-indep'. People who extracted LEIM files after they
630### insalled Emacs itself can install only LEIM files by this target.
bea3ec88 631install-leim: leim/Makefile mkdir
c10f84fb 632 cd leim; $(MAKE) install
24127cf7 633
8df9abae
RS
634### Build Emacs and install it, stripping binaries while installing them.
635install-strip:
97f4fff8 636 $(MAKE) INSTALL_STRIP=-s install
8df9abae 637
868e080d 638### Build all the directories we're going to install Emacs in. Since
78008d14 639### we may be creating several layers of directories (for example,
614b45a7 640### /usr/local/lib/emacs/19.0/mips-dec-ultrix4.2), we use mkinstalldirs
6784fb67 641### instead of mkdir. Not all systems' mkdir programs have the `-p' flag.
07cd4153
GM
642### We set the umask so that any created directories are world-readable.
643### FIXME it would be good to warn about non-standard permissions of
644### pre-existing directories, but that does not seem easy.
05ed817f 645mkdir: FRC
b26cd843 646 icondirs= ; \
69c7cf1b 647 for dir in $(iconsrcdir)/*/*/apps $(iconsrcdir)/*/*/mimetypes; do \
b26cd843
GM
648 if [ -d $${dir} ]; then \
649 icondirs="$${icondirs} $${dir}" ; \
650 fi ; \
651 done ; \
652 icondirs=`echo "$${icondirs}" | sed 's,$(srcdir)/etc/images/icons,$(DESTDIR)${icondir},g'` ; \
07cd4153
GM
653 umask 022 ; \
654 $(srcdir)/mkinstalldirs $(DESTDIR)${datadir} ${COPYDESTS} \
655 $(DESTDIR)${infodir} $(DESTDIR)${man1dir} \
81af9060
EZ
656 $(DESTDIR)${bindir} $(DESTDIR)${docdir} $(DESTDIR)${libexecdir} \
657 $(DESTDIR)${datadir}/emacs/site-lisp \
658 $(DESTDIR)${datadir}/emacs/${version}/site-lisp \
b26cd843
GM
659 $(DESTDIR)`echo ${locallisppath} | sed 's,:, $(DESTDIR),g'` \
660 $(DESTDIR)${desktopdir} $${icondirs}
86a5659e 661
d4acf74f 662### Delete all the installed files that the `install' target would
07cd4153 663### create (but not the noninstalled files such as `make all' would create).
44257b1a
JB
664###
665### Don't delete the lisp and etc directories if they're in the source tree.
d4acf74f 666uninstall:
44257b1a 667 (cd lib-src; \
0e265b72 668 $(MAKE) $(MFLAGS) uninstall \
44257b1a 669 prefix=${prefix} exec_prefix=${exec_prefix} \
2fd54e64 670 bindir=${bindir} libexecdir=${libexecdir} archlibdir=${archlibdir})
10db7fc5 671 -unset CDPATH; \
81af9060 672 for dir in $(DESTDIR)${lispdir} $(DESTDIR)${etcdir} ; do \
726d0798 673 if [ -d $${dir} ]; then \
8672a560
RS
674 case `(cd $${dir} ; /bin/pwd)` in \
675 `(cd ${srcdir} ; /bin/pwd)`* ) ;; \
726d0798
RS
676 * ) rm -rf $${dir} ;; \
677 esac ; \
678 case $${dir} in \
81af9060
EZ
679 $(DESTDIR)${datadir}/emacs/${version}/* ) \
680 rm -rf $(DESTDIR)${datadir}/emacs/${version} \
726d0798
RS
681 ;; \
682 esac ; \
683 fi ; \
44257b1a 684 done
f8388570
TO
685 if [ -d $(DESTDIR)${archlibdir} ]; then \
686 (cd $(DESTDIR)${archlibdir} && rm -f fns-*) \
687 fi
81af9060 688 -rm -rf $(DESTDIR)${libexecdir}/emacs/${version}
84d3272c
EZ
689 (cd $(DESTDIR)${infodir} && \
690 for elt in $(INFO_FILES); do \
691 $(INSTALL_INFO) --remove --info-dir=. $$elt; \
692 for f in `ls $$elt $$elt-[1-9] $$elt-[1-9][0-9] 2>/dev/null`; do \
693 rm -f $$f; \
694 done; \
695 done;)
8e7aa5de 696 (cd $(DESTDIR)${man1dir} && rm -f $(MAN_PAGES))
81af9060 697 (cd $(DESTDIR)${bindir} && rm -f $(EMACSFULL) $(EMACS))
b1fc99ed 698 (cd $(DESTDIR)${icondir} && rm -f hicolor/*x*/apps/emacs.png hicolor/*x*/apps/emacs22.png hicolor/scalable/apps/emacs.svg hicolor/scalable/mimetypes/emacs-document.svg )
8bfbbb97
GM
699 -rm -f $(DESTDIR)${desktopdir}/emacs.desktop
700 for file in snake-scores tetris-scores; do \
701 file=$(DESTDIR)${gamedir}/$${file}; \
702 [ -s $${file} ] || rm -f $$file; \
703 done
d4acf74f 704
05ed817f 705FRC:
78008d14
JB
706
707# ==================== Cleaning up and miscellanea ====================
708
26873b72 709.PHONY: mostlyclean clean distclean maintainer-clean extraclean
98dfba1b 710
78008d14 711### `mostlyclean'
d4acf74f
JB
712### Like `clean', but may refrain from deleting a few files that people
713### normally don't want to recompile. For example, the `mostlyclean'
714### target for GCC does not delete `libgcc.a', because recompiling it
715### is rarely necessary and takes a lot of time.
05ed817f 716mostlyclean: FRC
0e265b72
BF
717 (cd src; $(MAKE) $(MFLAGS) mostlyclean)
718 (cd oldXMenu; $(MAKE) $(MFLAGS) mostlyclean)
98dfba1b 719 (cd lwlib; $(MAKE) $(MFLAGS) mostlyclean)
0e265b72 720 (cd lib-src; $(MAKE) $(MFLAGS) mostlyclean)
e7426ea4
GM
721 -(cd doc/emacs && $(MAKE) $(MFLAGS) mostlyclean)
722 -(cd doc/misc && $(MAKE) $(MFLAGS) mostlyclean)
723 -(cd doc/lispref && $(MAKE) $(MFLAGS) mostlyclean)
724 -(cd doc/lispintro && $(MAKE) $(MFLAGS) mostlyclean)
fa2ea19a 725 (cd leim; $(MAKE) $(MFLAGS) mostlyclean)
d4acf74f
JB
726
727### `clean'
728### Delete all files from the current directory that are normally
729### created by building the program. Don't delete the files that
730### record the configuration. Also preserve files that could be made
731### by building, but normally aren't because the distribution comes
732### with them.
177c0ea7 733###
d4acf74f 734### Delete `.dvi' files here if they are not part of the distribution.
05ed817f 735clean: FRC
0e265b72
BF
736 (cd src; $(MAKE) $(MFLAGS) clean)
737 (cd oldXMenu; $(MAKE) $(MFLAGS) clean)
98dfba1b 738 (cd lwlib; $(MAKE) $(MFLAGS) clean)
0e265b72 739 (cd lib-src; $(MAKE) $(MFLAGS) clean)
e7426ea4
GM
740 -(cd doc/emacs && $(MAKE) $(MFLAGS) clean)
741 -(cd doc/misc && $(MAKE) $(MFLAGS) clean)
742 -(cd doc/lispref && $(MAKE) $(MFLAGS) clean)
743 -(cd doc/lispintro && $(MAKE) $(MFLAGS) clean)
fa2ea19a 744 (cd leim; $(MAKE) $(MFLAGS) clean)
46947372 745
fc46d219
SM
746### `bootclean'
747### Delete all files that need to be remade for a clean bootstrap.
748top_bootclean=\
8a6a5642 749 rm -f config.cache config.log
78008d14 750### `distclean'
d4acf74f
JB
751### Delete all files from the current directory that are created by
752### configuring or building the program. If you have unpacked the
753### source and built the program without creating any other files,
754### `make distclean' should leave only the files that were in the
755### distribution.
756top_distclean=\
fc46d219
SM
757 ${top_bootclean}; \
758 rm -f config.status Makefile ${SUBDIR_MAKEFILES}
05ed817f 759distclean: FRC
0e265b72
BF
760 (cd src; $(MAKE) $(MFLAGS) distclean)
761 (cd oldXMenu; $(MAKE) $(MFLAGS) distclean)
98dfba1b 762 (cd lwlib; $(MAKE) $(MFLAGS) distclean)
0e265b72 763 (cd lib-src; $(MAKE) $(MFLAGS) distclean)
e7426ea4
GM
764 (cd doc/emacs && $(MAKE) $(MFLAGS) distclean)
765 (cd doc/misc && $(MAKE) $(MFLAGS) distclean)
766 (cd doc/lispref && $(MAKE) $(MFLAGS) distclean)
767 (cd doc/lispintro && $(MAKE) $(MFLAGS) distclean)
fa2ea19a 768 (cd leim; $(MAKE) $(MFLAGS) distclean)
8c47a252 769 (cd lisp; $(MAKE) $(MFLAGS) distclean)
d4acf74f 770 ${top_distclean}
46947372 771
49f6eb95
SM
772### `bootstrap-clean'
773### Delete everything that can be reconstructed by `make' and that
774### needs to be deleted in order to force a bootstrap from a clean state.
775bootstrap-clean: FRC
776 (cd src; $(MAKE) $(MFLAGS) bootstrap-clean)
777 (cd oldXMenu; $(MAKE) $(MFLAGS) maintainer-clean)
778 (cd lwlib; $(MAKE) $(MFLAGS) maintainer-clean)
779 (cd lib-src; $(MAKE) $(MFLAGS) maintainer-clean)
780 -(cd doc/emacs && $(MAKE) $(MFLAGS) maintainer-clean)
781 -(cd doc/misc && $(MAKE) $(MFLAGS) maintainer-clean)
782 -(cd doc/lispref && $(MAKE) $(MFLAGS) maintainer-clean)
783 -(cd doc/lispintro && $(MAKE) $(MFLAGS) maintainer-clean)
784 (cd leim; $(MAKE) $(MFLAGS) maintainer-clean)
fc46d219
SM
785 (cd lisp; $(MAKE) $(MFLAGS) bootstrap-clean)
786 ${top_bootclean}
49f6eb95 787
26873b72 788### `maintainer-clean'
d4acf74f
JB
789### Delete everything from the current directory that can be
790### reconstructed with this Makefile. This typically includes
791### everything deleted by distclean, plus more: C source files
792### produced by Bison, tags tables, info files, and so on.
177c0ea7 793###
26873b72 794### One exception, however: `make maintainer-clean' should not delete
d4acf74f 795### `configure' even if `configure' can be remade using a rule in the
26873b72 796### Makefile. More generally, `make maintainer-clean' should not delete
d4acf74f
JB
797### anything that needs to exist in order to run `configure' and then
798### begin to build the program.
fc46d219 799maintainer-clean: bootstrap-clean FRC
26873b72 800 (cd src; $(MAKE) $(MFLAGS) maintainer-clean)
fc46d219
SM
801 (cd lisp; $(MAKE) $(MFLAGS) maintainer-clean)
802 ${top_distclean}
46947372 803
78008d14
JB
804### This doesn't actually appear in the coding standards, but Karl
805### says GCC supports it, and that's where the configuration part of
806### the coding standards seem to come from. It's like distclean, but
807### it deletes backup and autosave files too.
808extraclean:
4ce7f03e 809 for i in ${SUBDIR} leim; do (cd $$i; $(MAKE) $(MFLAGS) extraclean); done
9e8886a8 810 ${top_distclean}
2f417e39 811 -rm -f config-tmp-*
78008d14
JB
812 -rm -f *~ \#*
813
5c62b2e9
DL
814# The src subdir knows how to do the right thing
815# even when the build directory and source dir are different.
8e60a253 816TAGS tags: lib-src src
a383fece 817 cd src; $(MAKE) tags
46947372
JB
818
819check:
820 @echo "We don't have any tests for GNU Emacs yet."
4746118a
JB
821
822dist:
c6035ee6 823 cd ${srcdir}; ./make-dist
d4acf74f 824
b992884d 825.PHONY: info dvi dist check html
79bc8bbb
GM
826
827info-real:
ffd8aba9
GM
828 (cd doc/emacs; $(MAKE) $(MFLAGS) info)
829 (cd doc/misc; $(MAKE) $(MFLAGS) info)
830 (cd doc/lispref; $(MAKE) $(MFLAGS) info)
831 (cd doc/lispintro; $(MAKE) $(MFLAGS) info)
79bc8bbb 832
653ddcc3 833force-info:
ffd8aba9 834# Note that man/Makefile knows how to put the info files in $(srcdir),
5c62b2e9 835# so we can do ok running make in the build dir.
ffd8aba9
GM
836# This used to have a clause that exited with an error if MAKEINFO = no.
837# But it is inappropriate to do so without checking if makeinfo is
838# actually needed - it is not if the info files are up-to-date. (Bug#3982)
839# Only the doc/*/Makefiles can decide that, so we let those rules run
840# and give a standard error if makeinfo is needed but missing.
841# While it would be nice to give a more detailed error message, that
842# would require changing every rule in doc/ that builds an info file,
278b354f 843# and it's not worth it. This case is only relevant if you download a
ffd8aba9 844# release, then change the .texi files.
653ddcc3 845info: force-info
1c73f195
GM
846 @if test "$(MAKEINFO)" = "off"; then \
847 echo "Configured --without-makeinfo, not building manuals" ; \
79bc8bbb
GM
848 else \
849 $(MAKE) $(MFLAGS) info-real ; \
850 fi
737e2b96
GM
851
852# The info/dir file must be updated by hand when new manuals are added.
853check-info-dir: info
854 cd info ; \
855 missing= ; \
856 for file in *; do \
857 test -f "$${file}" || continue ; \
858 case $${file} in \
859 *-[0-9]*|COPYING|dir) continue ;; \
860 esac ; \
861 grep -q -F ": ($${file})." dir || missing="$${missing} $${file}" ; \
862 done ; \
863 if test -n "$${missing}"; then \
864 echo "Missing info/dir entries: $${missing}" ; \
865 exit 1 ; \
866 fi ; \
867 echo "info/dir is OK"
868
d4acf74f 869dvi:
e7426ea4
GM
870 (cd doc/emacs; $(MAKE) $(MFLAGS) dvi)
871 (cd doc/misc; $(MAKE) $(MFLAGS) dvi)
872 (cd doc/lispref; $(MAKE) $(MFLAGS) elisp.dvi)
873 (cd doc/lispintro; $(MAKE) $(MFLAGS) emacs-lisp-intro.dvi)
3b691429
GM
874
875#### Bootstrapping.
876
f6c9e04f 877### This first cleans the lisp subdirectory, removing all compiled
fc46d219 878### Lisp files. Then re-run make to build all the files anew.
3b691429 879
ffb0b9d7 880.PHONY: bootstrap
6e6f3adb 881
49f6eb95
SM
882bootstrap: bootstrap-clean FRC
883 if [ -x ./config.status ]; then \
49f6eb95
SM
884 ./config.status; \
885 else \
886 ./configure --enable-maintainer-mode; \
887 fi
fc46d219 888 $(MAKE) $(MFLAGS) info all
6e6f3adb 889
4f73d1e1
GM
890.PHONY: check-declare
891
892check-declare:
893 @if [ ! -e $(srcdir)/src/emacs ]; then \
894 echo "You must build Emacs to use this command"; \
895 exit 1; \
896 fi
897 (cd leim; $(MAKE) $(MFLAGS) $@)
898 (cd lisp; $(MAKE) $(MFLAGS) $@)