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
5 # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
6 # 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
8 # This file is part of GNU Emacs.
10 # GNU Emacs is free software; you can redistribute it and/or modify
11 # it under the terms of the GNU General Public License as published by
12 # the Free Software Foundation; either version 3, or (at your option)
15 # GNU Emacs is distributed in the hope that it will be useful,
16 # but WITHOUT ANY WARRANTY; without even the implied warranty of
17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 # GNU General Public License for more details.
20 # You should have received a copy of the GNU General Public License
21 # along with GNU Emacs; see the file COPYING. If not, write to
22 # the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
23 # Boston, MA 02110-1301, USA.
25 # make all to compile and build Emacs.
26 # make install to install it.
27 # make TAGS to update tags tables.
29 # make clean or make mostlyclean
30 # Delete all files from the current directory that are normally
31 # created by building the program. Don't delete the files that
32 # record the configuration. Also preserve files that could be made
33 # by building, but normally aren't because the distribution comes
36 # Delete `.dvi' files here if they are not part of the distribution.
39 # Delete all files from the current directory that are created by
40 # configuring or building the program. If you have unpacked the
41 # source and built the program without creating any other files,
42 # `make distclean' should leave only the files that were in the
45 # make maintainer-clean
46 # Delete everything from the current directory that can be
47 # reconstructed with this Makefile. This typically includes
48 # everything deleted by distclean, plus more: .elc files,
49 # C source files produced by Bison, tags tables, info files,
53 # Still more severe - delete backup and autosave files, too.
56 # Recompiles all the Emacs Lisp files using the latest source,
57 # then rebuilds Emacs.
60 # Recompiles changed Emacs Lisp files using the latest C source,
61 # then rebuilds Emacs. This is faster than `make bootstrap'
62 # but once in a while an old .elc file can cause trouble.
66 # This may not work with certain non-GNU make's. It only matters when
67 # inheriting a CDPATH not starting with the current directory.
70 # If Make doesn't predefine MAKE, set it here.
73 # ==================== Things `configure' Might Edit ====================
77 C_SWITCH_SYSTEM
=@c_switch_system@
83 C_SWITCH_X_SITE
=@C_SWITCH_X_SITE@
84 LD_SWITCH_X_SITE
=@LD_SWITCH_X_SITE@
87 ### These help us choose version- and architecture-specific directories
88 ### to install files in.
90 ### This should be the number of the Emacs version we're building,
91 ### like `18.59' or `19.0'.
94 ### This should be the name of the configuration we're building Emacs
95 ### for, like `mips-dec-ultrix' or `sparc-sun-sunos'.
96 configuration
=@configuration@
98 # ==================== Where To Install Things ====================
100 # The default location for installation. Everything is placed in
101 # subdirectories of this directory. The default values for many of
102 # the variables below are expressed in terms of this one, so you may
103 # not need to change them. This defaults to /usr/local.
106 # Like `prefix', but used for architecture-specific files.
107 exec_prefix=@
exec_prefix@
109 # Where to install Emacs and other binaries that people will want to
110 # run directly (like etags).
113 # The root of the directory tree for read-only architecture-independent
114 # data files. ${datadir}, ${infodir} and ${mandir} are based on this.
115 datarootdir
=@datarootdir@
117 # Where to install architecture-independent data files. ${lispdir}
118 # and ${etcdir} are subdirectories of this.
121 # Where to install and expect the files that Emacs modifies as it
122 # runs. These files are all architecture-independent.
123 # Right now, this is not used.
124 sharedstatedir
=@sharedstatedir@
126 # Where to install and expect executable files to be run by Emacs
127 # rather than directly by users, and other architecture-dependent
128 # data. ${archlibdir} is a subdirectory of this.
129 libexecdir
=@libexecdir@
131 # Where to install Emacs's man pages, and what extension they should have.
134 man1dir=$(mandir)/man1
136 # Where to install and expect the info files describing Emacs. In the
137 # past, this defaulted to a subdirectory of ${prefix}/lib/emacs, but
138 # since there are now many packages documented with the texinfo
139 # system, it is inappropriate to imply that it is part of Emacs.
141 INFO_FILES
=ada-mode autotype calc ccmode cl dbus dired-x ebrowse ediff \
142 efaq eintr elisp emacs emacs-mime erc eshell eudc flymake \
143 forms gnus idlwave
info message mh-e newsticker nxml-mode \
144 org pcl-cvs pgg rcirc reftex remember sc ses sieve speedbar \
145 tramp vip viper widget woman smtpmail url
147 # Directory for local state files for all programs.
148 localstatedir
=@localstatedir@
150 # Where to look for bitmap files.
151 bitmapdir
=@bitmapdir@
153 # Where to find the source code. The source code for Emacs's C kernel is
154 # expected to be in ${srcdir}/src, and the source code for Emacs's
155 # utility programs is expected to be in ${srcdir}/lib-src. This is
156 # set by the configure script's `--srcdir' option.
158 # We use $(srcdir) explicitly in dependencies so as not to depend on VPATH.
161 # Where the manpage source files are kept.
162 mansrcdir
=$(srcdir)/doc
/man
164 # Tell make where to find source files; this is needed for the makefiles.
167 # Where to find the application default.
168 x_default_search_path
=@x_default_search_path@
170 # Location to install Emacs.app on Mac OS X
171 carbon_appdir
=@carbon_appdir@
173 # Where the etc/emacs.desktop file is to be installed.
174 desktopdir
=$(datarootdir
)/applications
176 # Where the etc/images/icons/hicolor directory is to be installed.
177 icondir
=$(datarootdir
)/icons
179 # ==================== Emacs-specific directories ====================
181 # These variables hold the values Emacs will actually use. They are
182 # based on the values of the standard Make variables above.
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.
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
194 locallisppath
=@locallisppath@
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
199 # should be a colon-separated list of directories.
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.
206 # It's usually identical to lisppath, except that
207 # it does not include locallisppath, and the
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.
211 buildlisppath
=${srcdir}/lisp
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
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
226 archlibdir
=@archlibdir@
228 # Where to put the docstring file.
231 # Where to install Emacs game score files.
234 # ==================== Utility Programs for the Build ====================
236 # Allow the user to specify the install program.
238 INSTALL_PROGRAM
= @INSTALL_PROGRAM@
239 INSTALL_DATA
= @INSTALL_DATA@
240 INSTALL_INFO
= @INSTALL_INFO@
241 # By default, we uphold the dignity of our programs.
244 # We use gzip to compress installed .el files.
245 GZIP_PROG
= @GZIP_PROG@
247 # ============================= Targets ==============================
249 # Program name transformation.
250 TRANSFORM
= @program_transform_name@
252 # What emacs should be called when installed.
253 EMACS
= `echo emacs${EXEEXT} | sed '$(TRANSFORM)'`
254 EMACSFULL
= `echo emacs-${version}${EXEEXT} | sed '$(TRANSFORM)'`
256 # Subdirectories to make recursively. `lisp' is not included
257 # because the compiled lisp files are part of the distribution.
258 # leim is not included because it needs special handling.
261 # The makefiles of the directories in $SUBDIR.
262 SUBDIR_MAKEFILES
= lib-src
/Makefile doc
/emacs
/Makefile doc
/misc
/Makefile doc
/lispref
/Makefile doc
/lispintro
/Makefile src
/Makefile oldXMenu
/Makefile lwlib
/Makefile leim
/Makefile
264 # Subdirectories to install, and where they'll go.
265 # lib-src's makefile knows how to install it, so we don't do that here.
266 # leim's makefile also knows how to install it, so we don't do that here.
267 # When installing the info files, we need to do special things to
268 # avoid nuking an existing dir file, so we don't do that here;
269 # instead, we have written out explicit code in the `install' targets.
270 COPYDIR
= ${srcdir}/etc
${srcdir}/lisp
271 COPYDESTS
= $(DESTDIR
)${etcdir} $(DESTDIR
)${lispdir}
275 removenullpaths
=sed
-e
's/^://g' -e
's/:$$//g' -e
's/::/:/g'
277 # Generate epaths.h from epaths.in. This target is invoked by `configure'.
279 @
(lisppath
=`echo ${lisppath} | ${removenullpaths}` ; \
280 buildlisppath
=`echo ${buildlisppath} | ${removenullpaths}` ; \
281 x_default_search_path
=`echo ${x_default_search_path}`; \
282 gamedir
=`echo ${gamedir}`; \
283 sed
< ${srcdir}/src
/epaths.in
> epaths.h.
$$$$ \
284 -e
's;\(#.*PATH_LOADSEARCH\).*$$;\1 "'"$${lisppath}"'";' \
285 -e
's;\(#.*PATH_DUMPLOADSEARCH\).*$$;\1 "'"$${buildlisppath}"'";' \
286 -e
's;\(#.*PATH_EXEC\).*$$;\1 "${archlibdir}";' \
287 -e
's;\(#.*PATH_INFO\).*$$;\1 "${infodir}";' \
288 -e
's;\(#.*PATH_DATA\).*$$;\1 "${etcdir}";' \
289 -e
's;\(#.*PATH_BITMAPS\).*$$;\1 "${bitmapdir}";' \
290 -e
's;\(#.*PATH_X_DEFAULTS\).*$$;\1 "${x_default_search_path}";' \
291 -e
's;\(#.*PATH_GAME\).*$$;\1 "${gamedir}";' \
292 -e
's;\(#.*PATH_DOC\).*$$;\1 "${docdir}";' \
293 -e
's;/[*] *arch-tag:.*;/*;') && \
294 ${srcdir}/move-if-change epaths.h.
$$$$ src
/epaths.h
296 # For parallel make, src should be built before leim.
297 # "export PARALLEL=0" is for SGI's Make, to prevent it from
298 # running more than 1 process in the leim directory, especially for
299 # the $TIT files there.
300 leim
: src
${SUBDIR_MAKEFILES} FRC
301 (export PARALLEL
; PARALLEL
=0; cd
$@
; $(MAKE
) all $(MFLAGS
) \
302 CC
='${CC}' CFLAGS
='${CFLAGS}' CPPFLAGS
='${CPPFLAGS}' \
303 LDFLAGS
='${LDFLAGS}' MAKE
='${MAKE}')
307 lib-src
: FRC src
/config.stamp
309 .RECURSIVE
: ${SUBDIR} leim
311 ${SUBDIR}: maybe_bootstrap
${SUBDIR_MAKEFILES} FRC
312 cd
$@
; $(MAKE
) all $(MFLAGS
) \
313 CC
='${CC}' CFLAGS
='${CFLAGS}' CPPFLAGS
='${CPPFLAGS}' \
314 LDFLAGS
='${LDFLAGS}' MAKE
='${MAKE}'
316 blessmail
: ${SUBDIR_MAKEFILES} src FRC
317 cd lib-src
; $(MAKE
) maybe-blessmail
$(MFLAGS
) \
318 MAKE
='${MAKE}' archlibdir
='$(archlibdir)'
320 Makefile
: $(srcdir)/Makefile.in config.status
323 config.status
: ${srcdir}/configure
${srcdir}/lisp
/version.el
324 .
/config.status
--recheck
326 AUTOCONF_INPUTS
= @MAINT@
$(srcdir)/configure.in
$(srcdir)/m4
/getopt.m4
328 $(srcdir)/configure
: $(AUTOCONF_INPUTS
)
329 cd
${srcdir} && autoconf
331 $(srcdir)/src
/config.in
: $(srcdir)/src
/stamp-h.in
333 $(srcdir)/src
/stamp-h.in
: $(AUTOCONF_INPUTS
)
334 cd
${srcdir} && autoheader
335 rm -f
$(srcdir)/src
/stamp-h.in
336 echo timestamp
> $(srcdir)/src
/stamp-h.in
338 src
/Makefile
: $(srcdir)/src
/Makefile.in config.status
341 src
/config.stamp
: $(srcdir)/src
/config.in config.status
343 touch src
/config.stamp
345 lib-src
/Makefile
: $(srcdir)/lib-src
/Makefile.in config.status
348 doc
/emacs
/Makefile
: $(srcdir)/doc
/emacs
/Makefile.in config.status
351 doc
/misc
/Makefile
: $(srcdir)/doc
/misc
/Makefile.in config.status
354 doc
/lispref
/Makefile
: $(srcdir)/doc
/lispref
/Makefile.in config.status
357 doc
/lispintro
/Makefile
: $(srcdir)/doc
/lispintro
/Makefile.in config.status
360 oldXMenu
/Makefile
: $(srcdir)/oldXMenu
/Makefile.in config.status
363 lwlib
/Makefile
: $(srcdir)/lwlib
/Makefile.in config.status
366 leim
/Makefile
: $(srcdir)/leim
/Makefile.in config.status
369 # ==================== Installation ====================
371 ## If we let lib-src do its own installation, that means we
372 ## don't have to duplicate the list of utilities to install in
373 ## this Makefile as well.
375 ## On AIX, use tar xBf.
376 ## On Xenix, use tar xpf.
378 .PHONY
: install mkdir
380 ## We delete each directory in ${COPYDESTS} before we copy into it;
381 ## that way, we can reinstall over directories that have been put in
382 ## place with their files read-only (perhaps because they are checked
383 ## into RCS). In order to make this safe, we make sure that the
384 ## source exists and is distinct from the destination.
385 ### We do install-arch-indep first because
386 ### the executable needs the Lisp files and DOC file to work properly.
387 install: all install-arch-indep install-arch-dep install-leim blessmail
390 ### Install the executables that were compiled specifically for this machine.
391 ### It would be nice to do something for a parallel make
392 ### to ensure that install-arch-indep finishes before this starts.
393 install-arch-dep
: mkdir
395 $(MAKE
) install $(MFLAGS
) prefix=${prefix} \
396 exec_prefix=${exec_prefix} bindir=${bindir} \
397 libexecdir
=${libexecdir} archlibdir
=${archlibdir} \
398 INSTALL_STRIP
=${INSTALL_STRIP})
399 ${INSTALL_PROGRAM} $(INSTALL_STRIP
) src
/emacs
${EXEEXT} $(DESTDIR
)${bindir}/$(EMACSFULL
)
400 -chmod
1755 $(DESTDIR
)${bindir}/$(EMACSFULL
)
401 rm -f
$(DESTDIR
)${bindir}/$(EMACS
)
402 -ln
$(DESTDIR
)${bindir}/$(EMACSFULL
) $(DESTDIR
)${bindir}/$(EMACS
)
404 for f in
`cd lib-src && echo fns-*.el`; do \
405 if
test -r lib-src
/$$f ; then \
406 ${INSTALL_DATA} lib-src
/$$f $(DESTDIR
)${archlibdir}/$$f; \
409 if
test "${carbon_appdir}" != ""; then \
410 umask
022; mkdir
-p
$(DESTDIR
)${carbon_appdir}/Emacs.app
; \
411 (cd mac
/Emacs.app
; (tar -chf
- . | \
412 (cd
$(DESTDIR
)${carbon_appdir}/Emacs.app
; umask
022; tar -xvf
- \
413 && cat
> /dev
/null
))) || exit
1; \
416 ### Install the files that are machine-independent.
417 ### Most of them come straight from the distribution;
418 ### the exception is the DOC-* files, which are copied
419 ### from the build directory.
421 ## Note that we copy DOC* and then delete DOC
422 ## as a workaround for a bug in tar on Ultrix 4.2.
424 ## We install only the relevant DOC file if possible
425 ## (ie DOC-${version}.buildnumber), otherwise DOC-${version}*.
427 ## If people complain about the h flag in tar command, take that out.
428 ## That flag is also used in leim/Makefile.in
430 ## Note that the Makefiles in the etc directory are potentially useful
431 ## in an installed Emacs, so should not be excluded.
434 ## http://lists.gnu.org/archive/html/emacs-devel/2007-10/msg01672.html
435 ## Nuisance because i) it needs to be the user running install, so
436 ## configure can't set it; ii) can't (?) use the result of rule
437 ## commands to set make variables.
438 install-arch-indep
: mkdir
info install-etc
439 -set
${COPYDESTS} ; \
441 for
dir in
${COPYDIR} ; do \
442 if
[ `(cd $$1 && /bin/pwd)` != `(cd $${dir} && /bin/pwd)` ] ; then \
447 -set
${COPYDESTS} ; \
448 mkdir
${COPYDESTS} ; \
449 chmod ugo
+rx
${COPYDESTS} ; \
451 for installuser in
$${LOGNAME} $${USERNAME} $${USER} \
452 `id -un 2> /dev/null`; do \
453 [ -n
"$${installuser}" ] && break
; \
455 for
dir in
${COPYDIR} ; do \
458 && [ `(cd $${dir} && /bin/pwd)` != `(cd $${dest} && /bin/pwd)` ] \
459 && (echo
"Copying $${dir} to $${dest}..." ; \
460 (cd
$${dir}; tar -chf
- .
) \
461 |
(cd
$${dest}; umask
022; \
462 tar -xvf
- && cat
> /dev
/null
) || exit
1; \
463 find
$${dest} -exec chown
$${installuser} {} ';' ;\
464 for subdir in
`find $${dest} -type d ! -name RCS ! -name CVS -print` ; do \
465 chmod a
+rx
$${subdir} ; \
466 rm -rf
$${subdir}/RCS
; \
467 rm -rf
$${subdir}/CVS
; \
468 rm -f
$${subdir}/.cvsignore
; \
469 rm -f
$${subdir}/.arch-inventory
; \
470 rm -f
$${subdir}/\
#* ; \
471 rm -f
$${subdir}/.\
#* ; \
472 rm -f
$${subdir}/*~
; \
473 rm -f
$${subdir}/*.orig
; \
474 [ "$${dir}" != "${srcdir}/etc" ] && \
475 rm -f
$${subdir}/[mM
]akefile
* ; \
476 rm -f
$${subdir}/ChangeLog
* ; \
477 rm -f
$${subdir}/dired.todo
; \
480 -rm -f
$(DESTDIR
)${lispdir}/subdirs.el
481 $(srcdir)/update-subdirs
$(DESTDIR
)${lispdir}
482 if
[ -f
$(DESTDIR
)${datadir}/emacs
/${version}/site-lisp
/subdirs.el
]; \
485 (echo
"(if (fboundp 'normal-top-level-add-subdirs-to-load-path)"; \
486 echo
" (normal-top-level-add-subdirs-to-load-path))") \
487 > $(DESTDIR
)${datadir}/emacs
/${version}/site-lisp
/subdirs.el
; \
489 chmod a
+r
$(DESTDIR
)${datadir}/emacs
/${version}/site-lisp
/subdirs.el
490 -if
[ -f
$(DESTDIR
)${datadir}/emacs
/site-lisp
/subdirs.el
]; \
493 (echo
"(if (fboundp 'normal-top-level-add-subdirs-to-load-path)"; \
494 echo
" (normal-top-level-add-subdirs-to-load-path))") \
495 > $(DESTDIR
)${datadir}/emacs
/site-lisp
/subdirs.el
; \
497 -chmod a
+r
$(DESTDIR
)${datadir}/emacs
/site-lisp
/subdirs.el
499 if
[ `(cd ./etc; /bin/pwd)` != `(cd $(DESTDIR)${docdir}; /bin/pwd)` ]; \
501 fullversion
=`./src/emacs --version | sed -n '1 s/GNU Emacs *//p'`; \
502 if
[ -f
"./etc/DOC-$${fullversion}" ]; \
504 docfile
="DOC-$${fullversion}"; \
506 docfile
="DOC-${version}*"; \
508 echo
"Copying etc/$${docfile} to $(DESTDIR)${docdir} ..." ; \
509 (cd .
/etc
; tar -chf
- $${docfile}) \
510 |
(cd
$(DESTDIR
)${docdir}; umask
022; tar -xvf
- && cat
> /dev
/null
) || exit
1; \
511 (cd
$(DESTDIR
)$(docdir
); \
512 for installuser in
$${LOGNAME} $${USERNAME} $${USER} \
513 `id -un 2> /dev/null`; do \
514 [ -n
"$${installuser}" ] && break
; \
516 chown
$${installuser} DOC
*; chmod a
+r DOC
*; \
517 if
test "`echo DOC-*`" != "DOC-*"; then
rm -f DOC
; fi
); \
521 && [ -r .
/lisp
/simple.el
] \
522 && [ x
`(cd ./lisp; /bin/pwd)` != x
`(cd $(DESTDIR)${lispdir}; /bin/pwd)` ] \
523 && [ x
`(cd ${srcdir}/lisp; /bin/pwd)` != x
`(cd ./lisp; /bin/pwd)` ]; \
525 echo
"Copying lisp/*.el and lisp/*.elc to $(DESTDIR)${lispdir} ..." ; \
526 (cd lisp
; tar -chf
- *.el
*.elc
) \
527 |
(cd
$(DESTDIR
)${lispdir}; umask
022; tar -xvf
- && cat
> /dev
/null
) || exit
1; \
528 (cd
$(DESTDIR
)${lispdir}; \
529 for installuser in
$${LOGNAME} $${USERNAME} $${USER} \
530 `id -un 2> /dev/null`; do \
531 [ -n
"$${installuser}" ] && break
; \
533 find .
-exec chown
$${installuser} {} ';') ; \
536 if
[ -n
"${GZIP_PROG}" ]; \
538 echo
"Compressing *.el ..." ; \
539 (cd
$(DESTDIR
)${lispdir}; for f in
`find . -name "*.elc" -print`; do \
540 ${GZIP_PROG} -9n
`echo $$f|sed 's/.elc$$/.el/'` ; \
544 thisdir
=`/bin/pwd`; \
545 if
[ `(cd ${srcdir}/info && /bin/pwd)` != `(cd $(DESTDIR)${infodir} && /bin/pwd)` ]; \
547 (cd
$(DESTDIR
)${infodir}; \
548 if
[ -f
dir ]; then true
; \
551 ${INSTALL_DATA} ${srcdir}/info/dir $(DESTDIR
)${infodir}/dir; \
552 chmod a
+r
$(DESTDIR
)${infodir}/dir); \
554 cd
${srcdir}/info ; \
555 for elt in
$(INFO_FILES
); do \
556 for f in
`ls $$elt $$elt-[1-9] $$elt-[1-9][0-9] 2>/dev/null`; do \
557 ${INSTALL_DATA} $$f $(DESTDIR
)${infodir}/$$f; \
558 chmod a
+r
$(DESTDIR
)${infodir}/$$f; \
563 thisdir
=`/bin/pwd`; \
564 if
[ `(cd ${srcdir}/info && /bin/pwd)` != `(cd $(DESTDIR)${infodir} && /bin/pwd)` ]; \
566 for elt in
$(INFO_FILES
); do \
568 ${INSTALL_INFO} --info-dir
=$(DESTDIR
)${infodir} $(DESTDIR
)${infodir}/$$elt); \
571 -chmod
-R a
+r
$(DESTDIR
)${datadir}/emacs
/${version} $(DESTDIR
)${datadir}/emacs
/site-lisp
${COPYDESTS} $(DESTDIR
)${infodir}
572 thisdir
=`/bin/pwd`; \
574 for page in emacs emacsclient etags ctags
; do \
576 ${INSTALL_DATA} ${mansrcdir}/$${page}.1 $(DESTDIR
)${man1dir}/$${page}${manext}; \
577 chmod a
+r
$(DESTDIR
)${man1dir}/$${page}${manext}); \
580 ## Install those items from etc/ that need to end up elsewhere.
582 ${INSTALL_DATA} ${srcdir}/etc
/emacs.desktop \
583 $(DESTDIR
)${desktopdir}/emacs.desktop
584 for icon in
$(srcdir)/etc
/images
/icons
/*/*x
*/apps
/*.
*; do \
585 if
[ -r
$${icon} ]; then \
586 iicon
=`echo "$${icon}" | sed 's,$(srcdir)/etc/images/icons,$(DESTDIR)${icondir},'` ; \
587 ${INSTALL_DATA} $${icon} $${iicon} ; \
591 ### Install LEIM files. Although they are machine-independent, we
592 ### have separate target here instead of including it in
593 ### `install-arch-indep'. People who extracted LEIM files after they
594 ### insalled Emacs itself can install only LEIM files by this target.
595 install-leim
: leim
/Makefile mkdir
596 cd leim
; $(MAKE
) install
598 ### Build Emacs and install it, stripping binaries while installing them.
600 $(MAKE
) INSTALL_STRIP
=-s
install
602 ### Build all the directories we're going to install Emacs in. Since
603 ### we may be creating several layers of directories (for example,
604 ### /usr/local/lib/emacs/19.0/mips-dec-ultrix4.2), we use mkinstalldirs
605 ### instead of mkdir. Not all systems' mkdir programs have the `-p' flag.
607 if
[ -d
$(DESTDIR
)${datadir} ]; then true
; else \
608 $(srcdir)/mkinstalldirs
$(DESTDIR
)${datadir}; \
609 chmod a
+r
$(DESTDIR
)${datadir};\
612 for
dir in
$(srcdir)/etc
/images
/icons
/*/*x
*/apps
; do \
613 if
[ -d
$${dir} ]; then \
614 icondirs
="$${icondirs} $${dir}" ; \
617 icondirs
=`echo "$${icondirs}" | sed 's,$(srcdir)/etc/images/icons,$(DESTDIR)${icondir},g'` ; \
618 $(srcdir)/mkinstalldirs
${COPYDESTS} $(DESTDIR
)${infodir} $(DESTDIR
)${man1dir} \
619 $(DESTDIR
)${bindir} $(DESTDIR
)${docdir} $(DESTDIR
)${libexecdir} \
620 $(DESTDIR
)${datadir}/emacs
/site-lisp \
621 $(DESTDIR
)${datadir}/emacs
/${version}/site-lisp \
622 $(DESTDIR
)`echo ${locallisppath} | sed 's,:, $(DESTDIR),g'` \
623 $(DESTDIR
)${desktopdir} $${icondirs}
625 ### Delete all the installed files that the `install' target would
626 ### create (but not the noninstalled files such as `make all' would
629 ### Don't delete the lisp and etc directories if they're in the source tree.
632 $(MAKE
) $(MFLAGS
) uninstall \
633 prefix=${prefix} exec_prefix=${exec_prefix} \
634 bindir=${bindir} libexecdir
=${libexecdir} archlibdir
=${archlibdir})
636 for
dir in
$(DESTDIR
)${lispdir} $(DESTDIR
)${etcdir} ; do \
637 if
[ -d
$${dir} ]; then \
638 case
`(cd $${dir} ; /bin/pwd)` in \
639 `(cd ${srcdir} ; /bin/pwd)`* ) ;; \
640 * ) rm -rf
$${dir} ;; \
643 $(DESTDIR
)${datadir}/emacs
/${version}/* ) \
644 rm -rf
$(DESTDIR
)${datadir}/emacs
/${version} \
649 (cd
$(DESTDIR
)${archlibdir} && rm -f fns-
*)
650 -rm -rf
$(DESTDIR
)${libexecdir}/emacs
/${version}
651 (cd
$(DESTDIR
)${infodir} && \
652 for elt in
$(INFO_FILES
); do \
653 $(INSTALL_INFO
) --remove
--info-dir
=.
$$elt; \
654 for f in
`ls $$elt $$elt-[1-9] $$elt-[1-9][0-9] 2>/dev/null`; do \
658 (cd
$(DESTDIR
)${man1dir} && rm -f emacs
${manext} emacsclient
${manext} etags
${manext} ctags
${manext})
659 (cd
$(DESTDIR
)${bindir} && rm -f
$(EMACSFULL
) $(EMACS
))
664 # ==================== Cleaning up and miscellanea ====================
666 .PHONY
: mostlyclean clean distclean maintainer-clean extraclean
669 ### Like `clean', but may refrain from deleting a few files that people
670 ### normally don't want to recompile. For example, the `mostlyclean'
671 ### target for GCC does not delete `libgcc.a', because recompiling it
672 ### is rarely necessary and takes a lot of time.
674 (cd src
; $(MAKE
) $(MFLAGS
) mostlyclean)
675 (cd oldXMenu
; $(MAKE
) $(MFLAGS
) mostlyclean)
676 (cd lwlib
; $(MAKE
) $(MFLAGS
) mostlyclean)
677 (cd lib-src
; $(MAKE
) $(MFLAGS
) mostlyclean)
678 -(cd doc
/emacs
&& $(MAKE
) $(MFLAGS
) mostlyclean)
679 -(cd doc
/misc
&& $(MAKE
) $(MFLAGS
) mostlyclean)
680 -(cd doc
/lispref
&& $(MAKE
) $(MFLAGS
) mostlyclean)
681 -(cd doc
/lispintro
&& $(MAKE
) $(MFLAGS
) mostlyclean)
682 (cd leim
; $(MAKE
) $(MFLAGS
) mostlyclean)
685 ### Delete all files from the current directory that are normally
686 ### created by building the program. Don't delete the files that
687 ### record the configuration. Also preserve files that could be made
688 ### by building, but normally aren't because the distribution comes
691 ### Delete `.dvi' files here if they are not part of the distribution.
693 (cd src
; $(MAKE
) $(MFLAGS
) clean)
694 (cd oldXMenu
; $(MAKE
) $(MFLAGS
) clean)
695 (cd lwlib
; $(MAKE
) $(MFLAGS
) clean)
696 (cd lib-src
; $(MAKE
) $(MFLAGS
) clean)
697 -(cd doc
/emacs
&& $(MAKE
) $(MFLAGS
) clean)
698 -(cd doc
/misc
&& $(MAKE
) $(MFLAGS
) clean)
699 -(cd doc
/lispref
&& $(MAKE
) $(MFLAGS
) clean)
700 -(cd doc
/lispintro
&& $(MAKE
) $(MFLAGS
) clean)
701 (cd leim
; $(MAKE
) $(MFLAGS
) clean)
704 ### Delete all files from the current directory that are created by
705 ### configuring or building the program. If you have unpacked the
706 ### source and built the program without creating any other files,
707 ### `make distclean' should leave only the files that were in the
710 rm -f config.status config.cache config.log
; \
711 rm -f Makefile
${SUBDIR_MAKEFILES} ; \
712 if
[ -d lock
] ; then
(cd lock
&& (rm -f
* || true
)); else true
; fi
714 (cd src
; $(MAKE
) $(MFLAGS
) distclean)
715 (cd oldXMenu
; $(MAKE
) $(MFLAGS
) distclean)
716 (cd lwlib
; $(MAKE
) $(MFLAGS
) distclean)
717 (cd lib-src
; $(MAKE
) $(MFLAGS
) distclean)
718 (cd doc
/emacs
&& $(MAKE
) $(MFLAGS
) distclean)
719 (cd doc
/misc
&& $(MAKE
) $(MFLAGS
) distclean)
720 (cd doc
/lispref
&& $(MAKE
) $(MFLAGS
) distclean)
721 (cd doc
/lispintro
&& $(MAKE
) $(MFLAGS
) distclean)
722 (cd leim
; $(MAKE
) $(MFLAGS
) distclean)
723 (cd lisp
; $(MAKE
) $(MFLAGS
) distclean)
726 ### `maintainer-clean'
727 ### Delete everything from the current directory that can be
728 ### reconstructed with this Makefile. This typically includes
729 ### everything deleted by distclean, plus more: C source files
730 ### produced by Bison, tags tables, info files, and so on.
732 ### One exception, however: `make maintainer-clean' should not delete
733 ### `configure' even if `configure' can be remade using a rule in the
734 ### Makefile. More generally, `make maintainer-clean' should not delete
735 ### anything that needs to exist in order to run `configure' and then
736 ### begin to build the program.
737 maintainer-clean
: FRC
738 (cd src
; $(MAKE
) $(MFLAGS
) maintainer-clean
)
739 (cd oldXMenu
; $(MAKE
) $(MFLAGS
) maintainer-clean
)
740 (cd lwlib
; $(MAKE
) $(MFLAGS
) maintainer-clean
)
741 (cd lib-src
; $(MAKE
) $(MFLAGS
) maintainer-clean
)
742 -(cd doc
/emacs
&& $(MAKE
) $(MFLAGS
) maintainer-clean
)
743 -(cd doc
/misc
&& $(MAKE
) $(MFLAGS
) maintainer-clean
)
744 -(cd doc
/lispref
&& $(MAKE
) $(MFLAGS
) maintainer-clean
)
745 -(cd doc
/lispintro
&& $(MAKE
) $(MFLAGS
) maintainer-clean
)
746 (cd leim
; $(MAKE
) $(MFLAGS
) maintainer-clean
)
747 (cd lisp
; $(MAKE
) $(MFLAGS
) maintainer-clean
)
750 ### This doesn't actually appear in the coding standards, but Karl
751 ### says GCC supports it, and that's where the configuration part of
752 ### the coding standards seem to come from. It's like distclean, but
753 ### it deletes backup and autosave files too.
755 for i in
${SUBDIR} leim
; do
(cd
$$i; $(MAKE
) $(MFLAGS
) extraclean
); done
760 # The src subdir knows how to do the right thing
761 # even when the build directory and source dir are different.
762 TAGS
tags: lib-src src
766 @echo
"We don't have any tests for GNU Emacs yet."
769 cd
${srcdir}; .
/make-dist
771 .PHONY
: info dvi dist check html
773 # Note that man/Makefile knows how to
774 # put the info files in $(srcdir),
775 # so we can do ok running make in the build dir.
777 -(cd doc
/emacs
; $(MAKE
) $(MFLAGS
) info)
778 -(cd doc
/misc
; $(MAKE
) $(MFLAGS
) info)
779 -(cd doc
/lispref
; $(MAKE
) $(MFLAGS
) info)
780 -(cd doc
/lispintro
; $(MAKE
) $(MFLAGS
) info)
782 (cd doc
/emacs
; $(MAKE
) $(MFLAGS
) dvi)
783 (cd doc
/misc
; $(MAKE
) $(MFLAGS
) dvi)
784 (cd doc
/lispref
; $(MAKE
) $(MFLAGS
) elisp.
dvi)
785 (cd doc
/lispintro
; $(MAKE
) $(MFLAGS
) emacs-lisp-intro.
dvi)
789 ### This is meant for Emacs maintainers only. It first cleans the
790 ### lisp subdirectory, removing all compiled Lisp files. Then a
791 ### special emacs executable is built from Lisp sources, which is then
792 ### used to compile Lisp files. The last step is a "normal" make.
795 .PHONY
: bootstrap-build
797 .PHONY
: maybe_bootstrap
800 @bar
="`echo $(srcdir)/lisp/*.elc`"; \
801 if
[ \
( "$$bar" = '$(srcdir)/lisp/*.elc' \
) -o \
( "$$bar" = '' \
) ]; then \
802 echo
"Your tree does not include the compiled Lisp files."; \
803 echo
"You need to do \`make bootstrap' to build Emacs."; \
804 echo
"Emacs now requires Texinfo version 4.2."; \
808 bootstrap
: bootstrap-clean-before FRC
809 $(MAKE
) $(MFLAGS
) info bootstrap-build
811 bootfast
: bootstrap-clean-before-fast FRC
812 $(MAKE
) $(MFLAGS
) info bootstrap-build
815 (cd lisp
; $(MAKE
) $(MFLAGS
) bootstrap-prepare
)
816 (cd src
; $(MAKE
) $(MFLAGS
) bootstrap
)
817 (cd lisp
; $(MAKE
) $(MFLAGS
) bootstrap EMACS
=..
/src
/bootstrap-emacs
${EXEEXT})
818 (cd src
; $(MAKE
) $(MFLAGS
) mostlyclean)
819 $(MAKE
) $(MFLAGS
) all
820 (cd lisp
; $(MAKE
) $(MFLAGS
) bootstrap-after
)
822 ### Used for `bootstrap' to avoid deleting existing dumped Emacs executables.
823 bootstrap-clean-before
: bootstrap-clean-before-fast FRC
824 (cd lisp
; $(MAKE
) $(MFLAGS
) bootstrap-clean
)
825 (cd leim
; $(MAKE
) $(MFLAGS
) bootstrap-clean
)
827 ### Used for `bootfast' to avoid deleting existing dumped Emacs executables
828 ### and compiled .elc files.
829 bootstrap-clean-before-fast
: FRC
830 (cd src
; $(MAKE
) $(MFLAGS
) mostlyclean)
831 (cd oldXMenu
; $(MAKE
) $(MFLAGS
) clean)
832 (cd lwlib
; $(MAKE
) $(MFLAGS
) clean)
833 (cd lib-src
; $(MAKE
) $(MFLAGS
) clean)
834 -(cd doc
/emacs
&& $(MAKE
) $(MFLAGS
) clean)
835 -(cd doc
/misc
&& $(MAKE
) $(MFLAGS
) clean)
836 -(cd doc
/lispref
&& $(MAKE
) $(MFLAGS
) clean)
837 -(cd doc
/lispintro
&& $(MAKE
) $(MFLAGS
) clean)
838 (cd leim
; $(MAKE
) $(MFLAGS
) clean)
840 .PHONY
: check-declare
843 @if
[ ! -e
$(srcdir)/src
/emacs
]; then \
844 echo
"You must build Emacs to use this command"; \
847 (cd leim
; $(MAKE
) $(MFLAGS
) $@
)
848 (cd lisp
; $(MAKE
) $(MFLAGS
) $@
)