Fix package.el handling of local variables on first line.
[emacs.git] / Makefile.in
blob9a9be4f0a4340a89e2bf392109a735e19b824879
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.
5 # Copyright (C) 1992-2012 Free Software Foundation, Inc.
7 # This file is part of GNU Emacs.
9 # GNU Emacs is free software: you can redistribute it and/or modify
10 # it under the terms of the GNU General Public License as published by
11 # the Free Software Foundation, either version 3 of the License, or
12 # (at your option) any later version.
14 # GNU Emacs is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 # GNU General Public License for more details.
19 # You should have received a copy of the GNU General Public License
20 # along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
22 ### Commentary:
24 # make all to compile and build Emacs.
25 # make install to install it.
26 # make TAGS to update tags tables.
28 # make clean or make mostlyclean
29 # Delete all files from the current directory that are normally
30 # created by building the program. Don't delete the files that
31 # record the configuration. Also preserve files that could be made
32 # by building, but normally aren't because the distribution comes
33 # with them.
35 # Delete `.dvi' files here if they are not part of the distribution.
37 # make distclean
38 # Delete all files from the current directory that are created by
39 # configuring or building the program. If you have unpacked the
40 # source and built the program without creating any other files,
41 # `make distclean' should leave only the files that were in the
42 # distribution.
44 # make maintainer-clean
45 # Delete everything from the current directory that can be
46 # reconstructed with this Makefile. This typically includes
47 # everything deleted by distclean, plus more: .elc files,
48 # C source files produced by Bison, tags tables, info files,
49 # and so on.
51 # make extraclean
52 # Still more severe - delete backup and autosave files, too.
54 # make bootstrap
55 # Removes all the compiled files to force a new bootstrap from a
56 # clean slate, and then build in the normal way.
58 SHELL = /bin/sh
60 # This may not work with certain non-GNU make's. It only matters when
61 # inheriting a CDPATH not starting with the current directory.
62 CDPATH=
64 # If Make doesn't predefine MAKE, set it here.
65 @SET_MAKE@
67 # ==================== Things `configure' Might Edit ====================
69 MAINTAINER_MODE_FLAG = --disable-maintainer-mode
70 @MAINT@MAINTAINER_MODE_FLAG = --enable-maintainer-mode
71 cache_file = @cache_file@
72 CONFIGURE_FLAGS = --cache-file=$(cache_file) $(MAINTAINER_MODE_FLAG)
74 CC=@CC@
75 CFLAGS=@CFLAGS@
76 LDFLAGS=@LDFLAGS@
77 CPPFLAGS=@CPPFLAGS@
78 EXEEXT=@EXEEXT@
80 ### These help us choose version- and architecture-specific directories
81 ### to install files in.
83 ### This should be the number of the Emacs version we're building,
84 ### like `18.59' or `19.0'.
85 version=@version@
87 ### This should be the name of the configuration we're building Emacs
88 ### for, like `mips-dec-ultrix' or `sparc-sun-sunos'.
89 configuration=@configuration@
91 # ==================== Where To Install Things ====================
93 # The default location for installation. Everything is placed in
94 # subdirectories of this directory. The default values for many of
95 # the variables below are expressed in terms of this one, so you may
96 # not need to change them. This defaults to /usr/local.
97 prefix=@prefix@
99 # Like `prefix', but used for architecture-specific files.
100 exec_prefix=@exec_prefix@
102 # Where to install Emacs and other binaries that people will want to
103 # run directly (like etags).
104 bindir=@bindir@
106 # The root of the directory tree for read-only architecture-independent
107 # data files. ${datadir}, ${infodir} and ${mandir} are based on this.
108 datarootdir=@datarootdir@
110 # Where to install architecture-independent data files. ${lispdir}
111 # and ${etcdir} are subdirectories of this.
112 datadir=@datadir@
114 # Where to install and expect the files that Emacs modifies as it
115 # runs. These files are all architecture-independent.
116 # Right now, this is not used.
117 sharedstatedir=@sharedstatedir@
119 # Where to install and expect executable files to be run by Emacs
120 # rather than directly by users, and other architecture-dependent
121 # data. ${archlibdir} is a subdirectory of this.
122 libexecdir=@libexecdir@
124 # Where to install Emacs's man pages.
125 # This used to allow choice of the numeric extension, but this made
126 # little sense since the files were always installed in man1/
127 # (and they contain cross-references that expect them to be there).
128 mandir=@mandir@
129 man1dir=$(mandir)/man1
130 MAN_PAGES=ctags.1 ebrowse.1 emacs.1 emacsclient.1 etags.1 \
131 grep-changelog.1 rcs-checkin.1
133 # Where to install and expect the info files describing Emacs. In the
134 # past, this defaulted to a subdirectory of ${prefix}/lib/emacs, but
135 # since there are now many packages documented with the texinfo
136 # system, it is inappropriate to imply that it is part of Emacs.
137 infodir=@infodir@
138 INFO_FILES=ada-mode auth autotype calc ccmode cl dbus dired-x ebrowse \
139 ede ediff edt eieio efaq eintr elisp emacs emacs-gnutls emacs-mime epa erc \
140 ert eshell eudc flymake forms gnus idlwave info mairix-el \
141 message mh-e newsticker nxml-mode org pcl-cvs pgg rcirc \
142 reftex remember sasl sc semantic ses sieve smtpmail speedbar \
143 tramp url vip viper widget woman
145 # If no makeinfo was found and configured --without-makeinfo, "no"; else "yes".
146 HAVE_MAKEINFO=@HAVE_MAKEINFO@
148 # Directory for local state files for all programs.
149 localstatedir=@localstatedir@
151 # Where to look for bitmap files.
152 bitmapdir=@bitmapdir@
154 # Where to find the source code. The source code for Emacs's C kernel is
155 # expected to be in ${srcdir}/src, and the source code for Emacs's
156 # utility programs is expected to be in ${srcdir}/lib-src. This is
157 # set by the configure script's `--srcdir' option.
159 # We use $(srcdir) explicitly in dependencies so as not to depend on VPATH.
160 srcdir=@srcdir@
162 # Where the manpage source files are kept.
163 mansrcdir=$(srcdir)/doc/man
165 # Tell make where to find source files; this is needed for the makefiles.
166 VPATH=@srcdir@
168 # Where to find the application default.
169 x_default_search_path=@x_default_search_path@
171 # Location to install Emacs.app under NeXT/Open/GNUstep / Cocoa
172 ns_appbindir=@ns_appbindir@
173 ns_appresdir=@ns_appresdir@
175 # Where the etc/emacs.desktop file is to be installed.
176 desktopdir=$(datarootdir)/applications
178 # Where the etc/images/icons/hicolor directory is to be installed.
179 icondir=$(datarootdir)/icons
181 # The source directory for the icon files.
182 iconsrcdir=$(srcdir)/etc/images/icons
184 # ==================== Emacs-specific directories ====================
186 # These variables hold the values Emacs will actually use. They are
187 # based on the values of the standard Make variables above.
189 # Where to install the lisp files distributed with
190 # Emacs. This includes the Emacs version, so that the
191 # lisp files for different versions of Emacs will install
192 # themselves in separate directories.
193 lispdir=@lispdir@
195 # Directories Emacs should search for lisp files specific
196 # to this site (i.e. customizations), before consulting
197 # ${lispdir}. This should be a colon-separated list of
198 # directories.
199 locallisppath=@locallisppath@
201 # Where Emacs will search to find its lisp files. Before
202 # changing this, check to see if your purpose wouldn't
203 # better be served by changing locallisppath. This
204 # should be a colon-separated list of directories.
205 lisppath=@lisppath@
207 # Where Emacs will search for its lisp files while
208 # building. This is only used during the process of
209 # compiling Emacs, to help Emacs find its lisp files
210 # before they've been installed in their final location.
211 # This should be a colon-separated list of directories.
212 # Normally it points to the lisp/ directory in the sources.
213 buildlisppath=${srcdir}/lisp
215 # Where to install the other architecture-independent
216 # data files distributed with Emacs (like the tutorial,
217 # the cookie recipes and the Zippy database). This path
218 # usually contains the Emacs version number, so the data
219 # files for multiple versions of Emacs may be installed
220 # at once.
221 etcdir=@etcdir@
223 # Where to put executables to be run by Emacs rather than
224 # the user. This path usually includes the Emacs version
225 # and configuration name, so that multiple configurations
226 # for multiple versions of Emacs may be installed at
227 # once.
228 archlibdir=@archlibdir@
230 # Where to put the docstring file.
231 docdir=@docdir@
233 # Where to install Emacs game score files.
234 gamedir=@gamedir@
236 # ==================== Utility Programs for the Build ====================
238 # Allow the user to specify the install program.
239 # Note that if the system does not provide a suitable install,
240 # configure will use build-aux/install-sh. Annoyingly, it does
241 # not use an absolute path. So we must take care to always run
242 # INSTALL-type commands from the top-level directory.
243 # This explains (I think) the cd thisdir seen in several install rules.
244 INSTALL = @INSTALL@
245 INSTALL_PROGRAM = @INSTALL_PROGRAM@
246 INSTALL_DATA = @INSTALL_DATA@
247 INSTALL_INFO = @INSTALL_INFO@
248 # By default, we uphold the dignity of our programs.
249 INSTALL_STRIP =
251 # We use gzip to compress installed .el files.
252 GZIP_PROG = @GZIP_PROG@
253 # If non-nil, gzip the installed Info and man pages.
254 GZIP_INFO = @GZIP_INFO@
256 # ============================= Targets ==============================
258 # Program name transformation.
259 TRANSFORM = @program_transform_name@
261 # What emacs should be called when installed.
262 EMACS = `echo emacs${EXEEXT} | sed '$(TRANSFORM)'`
263 EMACSFULL = `echo emacs-${version}${EXEEXT} | sed '$(TRANSFORM)'`
265 # Subdirectories to make recursively. `lisp' is not included
266 # because the compiled lisp files are part of the distribution.
267 # leim is not included because it needs special handling.
269 # Actually, we now include `lisp' as well, since the compiled files
270 # are not included any more in case of bootstrap or in case Emacs was
271 # checked out from a VCS.
272 SUBDIR = lib lib-src src lisp
274 # The subdir makefiles created by config.status.
275 SUBDIR_MAKEFILES_IN = @SUBDIR_MAKEFILES_IN@
276 SUBDIR_MAKEFILES = `echo $(SUBDIR_MAKEFILES_IN:.in=) | sed 's|$(srcdir)/||g'`
278 # Subdirectories to install, and where they'll go.
279 # lib-src's makefile knows how to install it, so we don't do that here.
280 # leim's makefile also knows how to install it, so we don't do that here.
281 # When installing the info files, we need to do special things to
282 # avoid nuking an existing dir file, so we don't do that here;
283 # instead, we have written out explicit code in the `install' targets.
284 COPYDIR = ${srcdir}/etc ${srcdir}/lisp
285 COPYDESTS = $(DESTDIR)${etcdir} $(DESTDIR)${lispdir}
287 all: ${SUBDIR} leim
289 removenullpaths=sed -e 's/^://g' -e 's/:$$//g' -e 's/::/:/g'
291 # Generate epaths.h from epaths.in. This target is invoked by `configure'.
292 # See comments in configure.in for why it is done this way, as opposed
293 # to just letting configure generate epaths.h from epaths.in in a
294 # similar way to how Makefile is made from Makefile.in.
295 epaths-force: FRC
296 @(lisppath=`echo ${lisppath} | ${removenullpaths}` ; \
297 buildlisppath=`echo ${buildlisppath} | ${removenullpaths}` ; \
298 x_default_search_path=`echo ${x_default_search_path}`; \
299 gamedir=`echo ${gamedir}`; \
300 sed < ${srcdir}/src/epaths.in > epaths.h.$$$$ \
301 -e 's;\(#.*PATH_LOADSEARCH\).*$$;\1 "'"$${lisppath}"'";' \
302 -e 's;\(#.*PATH_DUMPLOADSEARCH\).*$$;\1 "'"$${buildlisppath}"'";' \
303 -e 's;\(#.*PATH_EXEC\).*$$;\1 "${archlibdir}";' \
304 -e 's;\(#.*PATH_INFO\).*$$;\1 "${infodir}";' \
305 -e 's;\(#.*PATH_DATA\).*$$;\1 "${etcdir}";' \
306 -e 's;\(#.*PATH_BITMAPS\).*$$;\1 "${bitmapdir}";' \
307 -e 's;\(#.*PATH_X_DEFAULTS\).*$$;\1 "${x_default_search_path}";' \
308 -e 's;\(#.*PATH_GAME\).*$$;\1 "${gamedir}";' \
309 -e 's;\(#.*PATH_DOC\).*$$;\1 "${docdir}";') && \
310 ${srcdir}/build-aux/move-if-change epaths.h.$$$$ src/epaths.h
312 # For parallel make, src should be built before leim.
313 # "export PARALLEL=0" is for SGI's Make, to prevent it from
314 # running more than 1 process in the leim directory, especially for
315 # the $TIT files there.
316 leim: src Makefile FRC
317 (export PARALLEL; PARALLEL=0; cd $@; $(MAKE) all $(MFLAGS) \
318 CC='${CC}' CFLAGS='${CFLAGS}' CPPFLAGS='${CPPFLAGS}' \
319 LDFLAGS='${LDFLAGS}' MAKE='${MAKE}')
321 lib-src src: lib
323 src: lib-src FRC
325 .RECURSIVE: ${SUBDIR} leim
327 # We need to build `emacs' in `src' to compile the *.elc files in `lisp'.
328 lisp: src
330 # Maintainers can put a copy of gnulib into $(gnulib_srcdir).
331 gnulib_srcdir = ../gnulib
332 $(gnulib_srcdir):
333 git clone git://git.savannah.gnu.org/gnulib.git $@
335 # A shorter name that satisfies MS-DOS 8+3 constraints.
336 DOS_gnulib_comp.m4 = gl-comp.m4
338 # Update modules from gnulib, for maintainers, who should have it in
339 # $(gnulib_srcdir) (relative to $(srcdir) and should have build tools
340 # as per $(gnulib_srcdir)/DEPENDENCIES.
341 GNULIB_MODULES = \
342 alloca-opt \
343 careadlinkat crypto/md5 crypto/sha1 crypto/sha256 crypto/sha512 dtoastr \
344 dup2 \
345 filemode getloadavg getopt-gnu ignore-value intprops lstat \
346 mktime pthread_sigmask readlink \
347 socklen stdarg stdio strftime strtoimax strtoumax symlink sys_stat
348 GNULIB_TOOL_FLAGS = \
349 --avoid=msvc-inval --avoid=msvc-nothrow \
350 --avoid=raise --avoid=threadlib \
351 --conditional-dependencies --import --no-changelog --no-vc-files \
352 --makefile-name=gnulib.mk
353 sync-from-gnulib: $(gnulib_srcdir)
354 -cd $(srcdir)/m4 && cp $(DOS_gnulib_comp.m4) gnulib-comp.m4
355 cd $(srcdir) && \
356 $(gnulib_srcdir)/gnulib-tool $(GNULIB_TOOL_FLAGS) $(GNULIB_MODULES)
357 cd $(srcdir)/m4 && rm gnulib-cache.m4 warn-on-use.m4
358 cd $(srcdir)/m4 && mv gnulib-comp.m4 $(DOS_gnulib_comp.m4)
359 cp $(gnulib_srcdir)/build-aux/texinfo.tex $(srcdir)/doc/misc
360 cp \
361 $(gnulib_srcdir)/build-aux/move-if-change \
362 $(srcdir)/build-aux
363 cd $(srcdir) && autoreconf -i -I m4
364 .PHONY: sync-from-gnulib
366 # These targets should be "${SUBDIR} without `src'".
367 lib lib-src lisp: Makefile FRC
368 cd $@; $(MAKE) all $(MFLAGS) \
369 CC='${CC}' CFLAGS='${CFLAGS}' CPPFLAGS='${CPPFLAGS}' \
370 LDFLAGS='${LDFLAGS}' MAKE='${MAKE}'
372 # Pass to src/Makefile.in an additional BOOTSTRAPEMACS variable which
373 # is either set to bootstrap-emacs (in case bootstrap-emacs has not been
374 # constructed yet) or the empty string (otherwise).
375 # src/Makefile.in uses it to implement conditional dependencies, so that
376 # files that need bootstrap-emacs to be built do not additionally need
377 # to be kept fresher than bootstrap-emacs. Otherwise changing a single
378 # file src/foo.c forces dumping a new bootstrap-emacs, then re-byte-compiling
379 # all preloaded elisp files, and only then dump the actual src/emacs, which
380 # is not wrong, but is overkill in 99.99% of the cases.
381 src: Makefile FRC
382 boot=bootstrap-emacs$(EXEEXT); \
383 if [ ! -x "src/$$boot" ]; then \
384 cd $@; $(MAKE) all $(MFLAGS) \
385 CC='${CC}' CFLAGS='${CFLAGS}' CPPFLAGS='${CPPFLAGS}' \
386 LDFLAGS='${LDFLAGS}' MAKE='${MAKE}' BOOTSTRAPEMACS="$$boot"; \
388 if [ -r .bzr/checkout/dirstate ]; then \
389 vcswitness="`pwd`/.bzr/checkout/dirstate"; \
390 fi; \
391 cd $@; $(MAKE) all $(MFLAGS) \
392 CC='${CC}' CFLAGS='${CFLAGS}' CPPFLAGS='${CPPFLAGS}' \
393 LDFLAGS='${LDFLAGS}' MAKE='${MAKE}' BOOTSTRAPEMACS="" \
394 VCSWITNESS="$$vcswitness"
396 blessmail: Makefile src FRC
397 cd lib-src; $(MAKE) maybe-blessmail $(MFLAGS) \
398 MAKE='${MAKE}' archlibdir='$(archlibdir)'
400 # We used to have one rule per */Makefile.in, but that leads to race
401 # conditions with parallel makes, so let's assume that the time stamp on
402 # ./Makefile is representative of the time stamp on all the other Makefiles.
403 Makefile: config.status $(srcdir)/src/config.in \
404 $(srcdir)/Makefile.in $(SUBDIR_MAKEFILES_IN)
405 ./config.status
407 # Don't erase config.status if make is interrupted while refreshing it.
408 .PRECIOUS: config.status
410 config.status: ${srcdir}/configure ${srcdir}/lisp/version.el
411 if [ -x ./config.status ]; then \
412 ./config.status --recheck; \
413 else \
414 ./configure $(CONFIGURE_FLAGS); \
417 AUTOCONF_INPUTS = @MAINT@ $(srcdir)/configure.in $(srcdir)/aclocal.m4
419 $(srcdir)/configure: $(AUTOCONF_INPUTS)
420 cd ${srcdir} && autoconf
422 ACLOCAL_INPUTS = @MAINT@ $(srcdir)/m4/$(DOS_gnulib_comp.m4)
423 $(srcdir)/aclocal.m4: $(ACLOCAL_INPUTS)
424 cd $(srcdir) && aclocal -I m4
426 AUTOMAKE_INPUTS = @MAINT@ $(srcdir)/aclocal.m4 $(srcdir)/lib/Makefile.am $(srcdir)/lib/gnulib.mk
427 $(srcdir)/lib/Makefile.in: $(AUTOMAKE_INPUTS)
428 cd $(srcdir) && automake --gnu -a -c lib/Makefile
429 am--refresh: $(srcdir)/aclocal.m4 $(srcdir)/configure $(srcdir)/src/config.in
430 .PHONY: am--refresh
432 $(srcdir)/src/config.in: $(srcdir)/src/stamp-h.in
433 @ # Usually, there's no need to rebuild src/config.in just
434 @ # because stamp-h.in has changed (since building stamp-h.in
435 @ # refreshes config.in as well), but if config.in is missing
436 @ # then we really need to do something more.
437 [ -r "$@" ] || ( cd ${srcdir} && autoheader )
438 $(srcdir)/src/stamp-h.in: $(AUTOCONF_INPUTS)
439 cd ${srcdir} && autoheader
440 rm -f $(srcdir)/src/stamp-h.in
441 echo timestamp > $(srcdir)/src/stamp-h.in
443 # ==================== Installation ====================
445 ## If we let lib-src do its own installation, that means we
446 ## don't have to duplicate the list of utilities to install in
447 ## this Makefile as well.
449 ## On AIX, use tar xBf.
450 ## On Xenix, use tar xpf.
452 .PHONY: install mkdir
454 ## We delete each directory in ${COPYDESTS} before we copy into it;
455 ## that way, we can reinstall over directories that have been put in
456 ## place with their files read-only (perhaps because they are checked
457 ## into RCS). In order to make this safe, we make sure that the
458 ## source exists and is distinct from the destination.
459 ### We do install-arch-indep first because
460 ### the executable needs the Lisp files and DOC file to work properly.
461 install: all install-arch-indep install-arch-dep install-leim blessmail
462 @true
464 MV_DIRS = for i in $$dir; do rm -fr `basename "$$i"` ; mv "$$i" . ; done
466 ### Install the executables that were compiled specifically for this machine.
467 ### It would be nice to do something for a parallel make
468 ### to ensure that install-arch-indep finishes before this starts.
469 install-arch-dep: mkdir
470 (cd lib-src; \
471 $(MAKE) install $(MFLAGS) prefix=${prefix} \
472 exec_prefix=${exec_prefix} bindir=${bindir} \
473 libexecdir=${libexecdir} archlibdir=${archlibdir} \
474 INSTALL_STRIP=${INSTALL_STRIP})
475 ${INSTALL_PROGRAM} $(INSTALL_STRIP) src/emacs${EXEEXT} $(DESTDIR)${bindir}/$(EMACSFULL)
476 -chmod 1755 $(DESTDIR)${bindir}/$(EMACSFULL)
477 rm -f $(DESTDIR)${bindir}/$(EMACS)
478 -ln $(DESTDIR)${bindir}/$(EMACSFULL) $(DESTDIR)${bindir}/$(EMACS)
479 if test "${ns_appresdir}" != ""; then \
480 ( cd ${ns_appresdir} ; \
481 if test -d share/emacs ; then dir=share/emacs/*/*; $(MV_DIRS); fi;\
482 if test -d share/info ; then dir=share/info; $(MV_DIRS) ; fi ; \
483 rm -fr share ) ; \
484 ( cd ${ns_appbindir} ; \
485 if cd libexec ; then dir=emacs/*/*/* ; $(MV_DIRS); \
486 rm -fr emacs; if cd ../bin; then rm -f emacs emacs-24*; \
487 ln -sf ../libexec/* . ; fi ; fi ) ; \
488 else true ; fi
490 ## FIXME is the emacs-24* bit above really necessary and correct?
491 ## What if I have 24.1 and 24.2 installed at the same time?
492 ## In any case, it should use something like echo $version | sed 's/\..*//'
493 ## instead of hard-coding a version.
495 ## http://lists.gnu.org/archive/html/emacs-devel/2007-10/msg01672.html
496 ## Needs to be the user running install, so configure can't set it.
497 set_installuser=for installuser in $${LOGNAME} $${USERNAME} $${USER} \
498 `id -un 2> /dev/null`; do \
499 [ -n "$${installuser}" ] && break ; \
500 done
502 ### Install the files that are machine-independent.
503 ### Most of them come straight from the distribution;
504 ### the exception is the DOC-* files, which are copied
505 ### from the build directory.
507 ## Note that we copy DOC* and then delete DOC
508 ## as a workaround for a bug in tar on Ultrix 4.2.
510 ## We install only the relevant DOC file if possible
511 ## (ie DOC-${version}.buildnumber), otherwise DOC-${version}*.
513 ## If people complain about the h flag in tar command, take that out.
514 ## That flag is also used in leim/Makefile.in
516 ## Note that the Makefiles in the etc directory are potentially useful
517 ## in an installed Emacs, so should not be excluded.
519 install-arch-indep: mkdir info install-etc
520 -set ${COPYDESTS} ; \
521 unset CDPATH; \
522 for dir in ${COPYDIR} ; do \
523 if [ `(cd $$1 && /bin/pwd)` != `(cd $${dir} && /bin/pwd)` ] ; then \
524 rm -rf $$1 ; \
525 fi ; \
526 shift ; \
527 done
528 -set ${COPYDESTS} ; \
529 mkdir ${COPYDESTS} ; \
530 chmod ugo+rx ${COPYDESTS} ; \
531 unset CDPATH; \
532 $(set_installuser); \
533 for dir in ${COPYDIR} ; do \
534 dest=$$1 ; shift ; \
535 [ -d $${dir} ] \
536 && [ `(cd $${dir} && /bin/pwd)` != `(cd $${dest} && /bin/pwd)` ] \
537 && (echo "Copying $${dir} to $${dest}..." ; \
538 (cd $${dir}; tar -chf - . ) \
539 | (cd $${dest}; umask 022; \
540 tar -xvf - && cat > /dev/null) || exit 1; \
541 find $${dest} -exec chown $${installuser} {} ';' ;\
542 for subdir in `find $${dest} -type d -print` ; do \
543 chmod a+rx $${subdir} ; \
544 rm -f $${subdir}/.gitignore ; \
545 rm -f $${subdir}/.arch-inventory ; \
546 rm -f $${subdir}/.DS_Store ; \
547 rm -f $${subdir}/\#* ; \
548 rm -f $${subdir}/.\#* ; \
549 rm -f $${subdir}/*~ ; \
550 rm -f $${subdir}/*.orig ; \
551 [ "$${dir}" != "${srcdir}/etc" ] && \
552 rm -f $${subdir}/[mM]akefile*.c $${subdir}/[mM]akefile*[.-]in \
553 $${subdir}/[mM]akefile ; \
554 rm -f $${subdir}/ChangeLog* ; \
555 done) ; \
556 done
557 -rm -f $(DESTDIR)${lispdir}/subdirs.el
558 $(srcdir)/update-subdirs $(DESTDIR)${lispdir}
559 if [ -f $(DESTDIR)${datadir}/emacs/${version}/site-lisp/subdirs.el ]; \
560 then true; \
561 else \
562 (echo "(if (fboundp 'normal-top-level-add-subdirs-to-load-path)"; \
563 echo " (normal-top-level-add-subdirs-to-load-path))") \
564 > $(DESTDIR)${datadir}/emacs/${version}/site-lisp/subdirs.el; \
566 chmod a+r $(DESTDIR)${datadir}/emacs/${version}/site-lisp/subdirs.el
567 -if [ -f $(DESTDIR)${datadir}/emacs/site-lisp/subdirs.el ]; \
568 then true; \
569 else \
570 (echo "(if (fboundp 'normal-top-level-add-subdirs-to-load-path)"; \
571 echo " (normal-top-level-add-subdirs-to-load-path))") \
572 > $(DESTDIR)${datadir}/emacs/site-lisp/subdirs.el; \
574 -chmod a+r $(DESTDIR)${datadir}/emacs/site-lisp/subdirs.el
575 -unset CDPATH; \
576 if [ `(cd ./etc; /bin/pwd)` != `(cd $(DESTDIR)${docdir}; /bin/pwd)` ]; \
577 then \
578 fullversion=`./src/emacs --version | sed -n '1 s/GNU Emacs *//p'`; \
579 if [ -f "./etc/DOC-$${fullversion}" ]; \
580 then \
581 docfile="DOC-$${fullversion}"; \
582 else \
583 docfile="DOC"; \
584 fi; \
585 echo "Copying etc/$${docfile} to $(DESTDIR)${docdir} ..." ; \
586 (cd ./etc; tar -chf - $${docfile}) \
587 |(cd $(DESTDIR)${docdir}; umask 022; tar -xvf - && cat > /dev/null) || exit 1; \
588 (cd $(DESTDIR)$(docdir); \
589 $(set_installuser); \
590 chown $${installuser} DOC*; chmod a+r DOC*; \
591 if test "`echo DOC-*`" != "DOC-*"; then rm -f DOC; fi); \
592 else true; fi
593 -unset CDPATH; \
594 if [ -r ./lisp ] \
595 && [ -r ./lisp/simple.el ] \
596 && [ x`(cd ./lisp; /bin/pwd)` != x`(cd $(DESTDIR)${lispdir}; /bin/pwd)` ] \
597 && [ x`(cd ${srcdir}/lisp; /bin/pwd)` != x`(cd ./lisp; /bin/pwd)` ]; \
598 then \
599 echo "Copying lisp/*.el and lisp/*.elc to $(DESTDIR)${lispdir} ..." ; \
600 (cd lisp; tar -chf - *.el *.elc) \
601 |(cd $(DESTDIR)${lispdir}; umask 022; tar -xvf - && cat > /dev/null) || exit 1; \
602 (cd $(DESTDIR)${lispdir}; \
603 $(set_installuser); \
604 find . -exec chown $${installuser} {} ';') ; \
605 else true; fi
606 -unset CDPATH; \
607 if [ -n "${GZIP_PROG}" ]; \
608 then \
609 echo "Compressing *.el ..." ; \
610 (cd $(DESTDIR)${lispdir}; for f in `find . -name "*.elc" -print`; do \
611 ${GZIP_PROG} -9n `echo $$f|sed 's/.elc$$/.el/'` ; \
612 done) \
613 else true; fi
614 -unset CDPATH; \
615 thisdir=`/bin/pwd`; \
616 if [ `(cd ${srcdir}/info && /bin/pwd)` != `(cd $(DESTDIR)${infodir} && /bin/pwd)` ]; \
617 then \
618 (cd $(DESTDIR)${infodir}; \
619 if [ -f dir ]; then true; \
620 else \
621 (cd $${thisdir}; \
622 ${INSTALL_DATA} ${srcdir}/info/dir $(DESTDIR)${infodir}/dir; \
623 chmod a+r $(DESTDIR)${infodir}/dir); \
624 fi; \
625 cd ${srcdir}/info ; \
626 for elt in $(INFO_FILES); do \
627 test "$(HAVE_MAKEINFO)" = "no" && test ! -f $$elt && continue; \
628 for f in `ls $$elt $$elt-[1-9] $$elt-[1-9][0-9] 2>/dev/null`; do \
629 (cd $${thisdir}; \
630 ${INSTALL_DATA} ${srcdir}/info/$$f $(DESTDIR)${infodir}/$$f); \
631 chmod a+r $(DESTDIR)${infodir}/$$f; \
632 if [ -n "${GZIP_INFO}" ] && [ -n "${GZIP_PROG}" ]; then \
633 rm -f $(DESTDIR)${infodir}/$$f.gz; \
634 ${GZIP_PROG} -9n $(DESTDIR)${infodir}/$$f; \
635 else true; fi; \
636 done; \
637 done); \
638 else true; fi
639 -unset CDPATH; \
640 thisdir=`/bin/pwd`; \
641 if [ `(cd ${srcdir}/info && /bin/pwd)` != `(cd $(DESTDIR)${infodir} && /bin/pwd)` ]; \
642 then \
643 for elt in $(INFO_FILES); do \
644 test "$(HAVE_MAKEINFO)" = "no" && test ! -f $$elt && continue; \
645 (cd $${thisdir}; \
646 ${INSTALL_INFO} --info-dir=$(DESTDIR)${infodir} $(DESTDIR)${infodir}/$$elt); \
647 done; \
648 else true; fi
649 -chmod -R a+r $(DESTDIR)${datadir}/emacs/${version} ${COPYDESTS}
650 thisdir=`/bin/pwd`; \
651 cd ${mansrcdir}; \
652 for page in ${MAN_PAGES}; do \
653 (cd $${thisdir}; \
654 ${INSTALL_DATA} ${mansrcdir}/$${page} $(DESTDIR)${man1dir}/$${page}; \
655 chmod a+r $(DESTDIR)${man1dir}/$${page}; \
656 if [ -n "${GZIP_INFO}" ] && [ -n "${GZIP_PROG}" ]; then \
657 rm -f $(DESTDIR)${man1dir}/$${page}.gz; \
658 ${GZIP_PROG} -9n $(DESTDIR)${man1dir}/$${page}; \
659 else true; fi ); \
660 done
662 ## Install those items from etc/ that need to end up elsewhere.
663 install-etc: mkdir
664 ${INSTALL_DATA} ${srcdir}/etc/emacs.desktop \
665 $(DESTDIR)${desktopdir}/emacs.desktop
666 for icon in $(iconsrcdir)/*/*/apps/*.* \
667 $(iconsrcdir)/*/*/mimetypes/*.*; do \
668 if [ -r $${icon} ]; then \
669 iicon=`echo "$${icon}" | sed 's,$(srcdir)/etc/images/icons,$(DESTDIR)${icondir},'` ; \
670 ${INSTALL_DATA} $${icon} $${iicon} ; \
671 fi ; \
672 done
674 ### Install LEIM files. Although they are machine-independent, we
675 ### have separate target here instead of including it in
676 ### `install-arch-indep'. People who extracted LEIM files after they
677 ### installed Emacs itself can install only LEIM files by this target.
678 install-leim: leim/Makefile mkdir
679 cd leim; $(MAKE) install
681 ### Build Emacs and install it, stripping binaries while installing them.
682 install-strip:
683 $(MAKE) INSTALL_STRIP=-s install
685 ### Build all the directories we're going to install Emacs in. Since
686 ### we may be creating several layers of directories (for example,
687 ### /usr/local/lib/emacs/19.0/mips-dec-ultrix4.2), we use install-sh -d
688 ### instead of mkdir. Not all systems' mkdir programs have the `-p' flag.
689 ### We set the umask so that any created directories are world-readable.
690 ### FIXME it would be good to warn about non-standard permissions of
691 ### pre-existing directories, but that does not seem easy.
692 mkdir: FRC
693 icondirs= ; \
694 for dir in $(iconsrcdir)/*/*/apps $(iconsrcdir)/*/*/mimetypes; do \
695 if [ -d $${dir} ]; then \
696 icondirs="$${icondirs} $${dir}" ; \
697 fi ; \
698 done ; \
699 icondirs=`echo "$${icondirs}" | sed 's,$(srcdir)/etc/images/icons,$(DESTDIR)${icondir},g'` ; \
700 umask 022 ; \
701 $(srcdir)/build-aux/install-sh -d $(DESTDIR)${datadir} ${COPYDESTS} \
702 $(DESTDIR)${infodir} $(DESTDIR)${man1dir} \
703 $(DESTDIR)${bindir} $(DESTDIR)${docdir} $(DESTDIR)${libexecdir} \
704 $(DESTDIR)${datadir}/emacs/site-lisp \
705 $(DESTDIR)${datadir}/emacs/${version}/site-lisp \
706 $(DESTDIR)`echo ${locallisppath} | sed 's,:, $(DESTDIR),g'` \
707 $(DESTDIR)${desktopdir} $${icondirs}
709 ### Delete all the installed files that the `install' target would
710 ### create (but not the noninstalled files such as `make all' would create).
712 ### Don't delete the lisp and etc directories if they're in the source tree.
713 uninstall:
714 (cd lib-src; \
715 $(MAKE) $(MFLAGS) uninstall \
716 prefix=${prefix} exec_prefix=${exec_prefix} \
717 bindir=${bindir} libexecdir=${libexecdir} archlibdir=${archlibdir})
718 -unset CDPATH; \
719 for dir in $(DESTDIR)${lispdir} $(DESTDIR)${etcdir} ; do \
720 if [ -d $${dir} ]; then \
721 case `(cd $${dir} ; /bin/pwd)` in \
722 `(cd ${srcdir} ; /bin/pwd)`* ) ;; \
723 * ) rm -rf $${dir} ;; \
724 esac ; \
725 case $${dir} in \
726 $(DESTDIR)${datadir}/emacs/${version}/* ) \
727 rm -rf $(DESTDIR)${datadir}/emacs/${version} \
728 ;; \
729 esac ; \
730 fi ; \
731 done
732 -rm -rf $(DESTDIR)${libexecdir}/emacs/${version}
733 thisdir=`/bin/pwd`; \
734 (cd $(DESTDIR)${infodir} && \
735 for elt in $(INFO_FILES); do \
736 (cd $${thisdir}; \
737 $(INSTALL_INFO) --remove --info-dir=$(DESTDIR)${infodir} $(DESTDIR)${infodir}/$$elt); \
738 if [ -n "${GZIP_INFO}" ] && [ -n "${GZIP_PROG}" ]; then \
739 ext=.gz; else ext=; fi; \
740 rm -f $$elt$$ext $$elt-[1-9]$$ext $$elt-[1-9][0-9]$$ext; \
741 done;)
742 (if [ -n "${GZIP_INFO}" ] && [ -n "${GZIP_PROG}" ]; then \
743 ext=.gz; else ext=; fi; \
744 cd $(DESTDIR)${man1dir} && for page in ${MAN_PAGES}; do \
745 rm -f $$page$$ext; done )
746 (cd $(DESTDIR)${bindir} && rm -f $(EMACSFULL) $(EMACS))
747 (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 )
748 -rm -f $(DESTDIR)${desktopdir}/emacs.desktop
749 for file in snake-scores tetris-scores; do \
750 file=$(DESTDIR)${gamedir}/$${file}; \
751 [ -s $${file} ] || rm -f $$file; \
752 done
754 FRC:
756 # ==================== Cleaning up and miscellanea ====================
758 .PHONY: mostlyclean clean distclean maintainer-clean extraclean
760 ### `mostlyclean'
761 ### Like `clean', but may refrain from deleting a few files that people
762 ### normally don't want to recompile. For example, the `mostlyclean'
763 ### target for GCC does not delete `libgcc.a', because recompiling it
764 ### is rarely necessary and takes a lot of time.
765 mostlyclean: FRC
766 (cd src; $(MAKE) $(MFLAGS) mostlyclean)
767 (cd oldXMenu; $(MAKE) $(MFLAGS) mostlyclean)
768 (cd lwlib; $(MAKE) $(MFLAGS) mostlyclean)
769 (cd lib; $(MAKE) $(MFLAGS) mostlyclean)
770 (cd lib-src; $(MAKE) $(MFLAGS) mostlyclean)
771 -(cd doc/emacs && $(MAKE) $(MFLAGS) mostlyclean)
772 -(cd doc/misc && $(MAKE) $(MFLAGS) mostlyclean)
773 -(cd doc/lispref && $(MAKE) $(MFLAGS) mostlyclean)
774 -(cd doc/lispintro && $(MAKE) $(MFLAGS) mostlyclean)
775 (cd leim; $(MAKE) $(MFLAGS) mostlyclean)
777 ### `clean'
778 ### Delete all files from the current directory that are normally
779 ### created by building the program. Don't delete the files that
780 ### record the configuration. Also preserve files that could be made
781 ### by building, but normally aren't because the distribution comes
782 ### with them.
784 ### Delete `.dvi' files here if they are not part of the distribution.
785 clean: FRC
786 (cd src; $(MAKE) $(MFLAGS) clean)
787 (cd oldXMenu; $(MAKE) $(MFLAGS) clean)
788 (cd lwlib; $(MAKE) $(MFLAGS) clean)
789 (cd lib; $(MAKE) $(MFLAGS) clean)
790 (cd lib-src; $(MAKE) $(MFLAGS) clean)
791 -(cd doc/emacs && $(MAKE) $(MFLAGS) clean)
792 -(cd doc/misc && $(MAKE) $(MFLAGS) clean)
793 -(cd doc/lispref && $(MAKE) $(MFLAGS) clean)
794 -(cd doc/lispintro && $(MAKE) $(MFLAGS) clean)
795 (cd leim; $(MAKE) $(MFLAGS) clean)
797 ### `bootclean'
798 ### Delete all files that need to be remade for a clean bootstrap.
799 top_bootclean=\
800 rm -f config.cache config.log
801 ### `distclean'
802 ### Delete all files from the current directory that are created by
803 ### configuring or building the program. If you have unpacked the
804 ### source and built the program without creating any other files,
805 ### `make distclean' should leave only the files that were in the
806 ### distribution.
807 top_distclean=\
808 ${top_bootclean}; \
809 rm -f config.status config.log~ Makefile stamp-h1 ${SUBDIR_MAKEFILES}
810 distclean: FRC
811 (cd src; $(MAKE) $(MFLAGS) distclean)
812 (cd oldXMenu; $(MAKE) $(MFLAGS) distclean)
813 (cd lwlib; $(MAKE) $(MFLAGS) distclean)
814 (cd lib; $(MAKE) $(MFLAGS) distclean)
815 (cd lib-src; $(MAKE) $(MFLAGS) distclean)
816 (cd doc/emacs && $(MAKE) $(MFLAGS) distclean)
817 (cd doc/misc && $(MAKE) $(MFLAGS) distclean)
818 (cd doc/lispref && $(MAKE) $(MFLAGS) distclean)
819 (cd doc/lispintro && $(MAKE) $(MFLAGS) distclean)
820 (cd leim; $(MAKE) $(MFLAGS) distclean)
821 (cd lisp; $(MAKE) $(MFLAGS) distclean)
822 ${top_distclean}
824 ### `bootstrap-clean'
825 ### Delete everything that can be reconstructed by `make' and that
826 ### needs to be deleted in order to force a bootstrap from a clean state.
827 bootstrap-clean: FRC
828 (cd src; $(MAKE) $(MFLAGS) bootstrap-clean)
829 (cd oldXMenu; $(MAKE) $(MFLAGS) maintainer-clean)
830 (cd lwlib; $(MAKE) $(MFLAGS) maintainer-clean)
831 (cd lib; $(MAKE) $(MFLAGS) maintainer-clean)
832 (cd lib-src; $(MAKE) $(MFLAGS) maintainer-clean)
833 -(cd doc/emacs && $(MAKE) $(MFLAGS) maintainer-clean)
834 -(cd doc/misc && $(MAKE) $(MFLAGS) maintainer-clean)
835 -(cd doc/lispref && $(MAKE) $(MFLAGS) maintainer-clean)
836 -(cd doc/lispintro && $(MAKE) $(MFLAGS) maintainer-clean)
837 (cd leim; $(MAKE) $(MFLAGS) maintainer-clean)
838 (cd lisp; $(MAKE) $(MFLAGS) bootstrap-clean)
839 [ ! -f config.log ] || mv -f config.log config.log~
840 ${top_bootclean}
841 ## configure; make bootstrap replaces the real config.log from configure
842 ## with the truncated one from config.status. The former is more useful.
844 ### `maintainer-clean'
845 ### Delete everything from the current directory that can be
846 ### reconstructed with this Makefile. This typically includes
847 ### everything deleted by distclean, plus more: C source files
848 ### produced by Bison, tags tables, info files, and so on.
850 ### One exception, however: `make maintainer-clean' should not delete
851 ### `configure' even if `configure' can be remade using a rule in the
852 ### Makefile. More generally, `make maintainer-clean' should not delete
853 ### anything that needs to exist in order to run `configure' and then
854 ### begin to build the program.
855 top_maintainer_clean=\
856 ${top_distclean}; \
857 rm -fr autom4te.cache
858 maintainer-clean: bootstrap-clean FRC
859 (cd src; $(MAKE) $(MFLAGS) maintainer-clean)
860 (cd lisp; $(MAKE) $(MFLAGS) maintainer-clean)
861 ${top_maintainer_clean}
863 ### This doesn't actually appear in the coding standards, but Karl
864 ### says GCC supports it, and that's where the configuration part of
865 ### the coding standards seem to come from. It's like distclean, but
866 ### it deletes backup and autosave files too.
867 extraclean:
868 for i in ${SUBDIR} leim; do (cd $$i; $(MAKE) $(MFLAGS) extraclean); done
869 ${top_maintainer_clean}
870 -rm -f config-tmp-*
871 -rm -f *~ \#*
873 # The src subdir knows how to do the right thing
874 # even when the build directory and source dir are different.
875 TAGS tags: lib lib-src src
876 cd src; $(MAKE) $(MFLAGS) tags
878 check:
879 @if test ! -d test/automated; then \
880 echo "You do not seem to have the test/ directory."; \
881 echo "Maybe you are using a release tarfile, rather than a repository checkout."; \
882 else \
883 cd test/automated && $(MAKE) $(MFLAGS) check; \
886 dist:
887 cd ${srcdir}; ./make-dist
889 .PHONY: info dvi dist check html
891 info-real:
892 (cd doc/emacs; $(MAKE) $(MFLAGS) info)
893 (cd doc/misc; $(MAKE) $(MFLAGS) info)
894 (cd doc/lispref; $(MAKE) $(MFLAGS) info)
895 (cd doc/lispintro; $(MAKE) $(MFLAGS) info)
897 force-info:
898 # Note that man/Makefile knows how to put the info files in $(srcdir),
899 # so we can do ok running make in the build dir.
900 # This used to have a clause that exited with an error if MAKEINFO = no.
901 # But it is inappropriate to do so without checking if makeinfo is
902 # actually needed - it is not if the info files are up-to-date. (Bug#3982)
903 # Only the doc/*/Makefiles can decide that, so we let those rules run
904 # and give a standard error if makeinfo is needed but missing.
905 # While it would be nice to give a more detailed error message, that
906 # would require changing every rule in doc/ that builds an info file,
907 # and it's not worth it. This case is only relevant if you download a
908 # release, then change the .texi files.
909 info: force-info
910 @if test "$(HAVE_MAKEINFO)" = "no"; then \
911 echo "Configured --without-makeinfo, not building manuals" ; \
912 else \
913 $(MAKE) $(MFLAGS) info-real ; \
916 # The info/dir file must be updated by hand when new manuals are added.
917 check-info-dir: info
918 cd info ; \
919 missing= ; \
920 for file in *; do \
921 test -f "$${file}" || continue ; \
922 case $${file} in \
923 *-[0-9]*|COPYING|dir) continue ;; \
924 esac ; \
925 grep -q -F ": ($${file})." dir || missing="$${missing} $${file}" ; \
926 done ; \
927 if test -n "$${missing}"; then \
928 echo "Missing info/dir entries: $${missing}" ; \
929 exit 1 ; \
930 fi ; \
931 echo "info/dir is OK"
933 dvi:
934 (cd doc/emacs; $(MAKE) $(MFLAGS) dvi)
935 (cd doc/misc; $(MAKE) $(MFLAGS) dvi)
936 (cd doc/lispref; $(MAKE) $(MFLAGS) elisp.dvi)
937 (cd doc/lispintro; $(MAKE) $(MFLAGS) emacs-lisp-intro.dvi)
939 #### Bootstrapping.
941 ### This first cleans the lisp subdirectory, removing all compiled
942 ### Lisp files. Then re-run make to build all the files anew.
944 .PHONY: bootstrap
946 ## configure; make bootstrap replaces the real config.log from configure
947 ## with the truncated one from config.status. The former is more useful.
948 bootstrap: bootstrap-clean FRC
949 if [ -x ./config.status ]; then \
950 ./config.status; \
951 else \
952 ./configure $(CONFIGURE_FLAGS); \
954 $(MAKE) $(MFLAGS) info all
956 .PHONY: check-declare
958 check-declare:
959 @if [ ! -f $(srcdir)/src/emacs ]; then \
960 echo "You must build Emacs to use this command"; \
961 exit 1; \
963 (cd leim; $(MAKE) $(MFLAGS) $@)
964 (cd lisp; $(MAKE) $(MFLAGS) $@)