Clarify dired-do-shell-command doc string
[emacs.git] / Makefile.in
blob4fa7c9ed5f1a3a09117c8e1924ada48ce3debb55
1 ### @configure_input@
3 # Copyright (C) 1992-2021 Free Software Foundation, Inc.
5 # This file is part of GNU Emacs.
7 # GNU Emacs is free software: you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation, either version 3 of the License, or
10 # (at your option) any later version.
12 # GNU Emacs is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
20 ### Commentary:
22 # make all to compile and build Emacs.
23 # make install to install it.
24 # make TAGS to update tags tables.
26 # make clean or make mostlyclean
27 # Delete all files from the current directory that are normally
28 # created by building the program. Don't delete the files that
29 # record the configuration. Also preserve files that could be made
30 # by building, but normally aren't because the distribution comes
31 # with them.
33 # Delete '.dvi' files here if they are not part of the distribution.
35 # make distclean
36 # Delete all files from the current directory that are created by
37 # configuring or building the program. If you have unpacked the
38 # source and built the program without creating any other files,
39 # 'make distclean' should leave only the files that were in the
40 # distribution.
42 # make maintainer-clean
43 # Delete everything from the current directory that can be
44 # reconstructed with this Makefile. This typically includes
45 # everything deleted by distclean, plus more: .elc files,
46 # C source files produced by Bison, tags tables, info files,
47 # and so on.
49 # make extraclean
50 # Still more severe - delete backup and autosave files, too.
51 # Also generated files that do not normally change and can be slow
52 # to rebuild (eg leim/ja-dic).
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 # make docs
59 # Make Emacs documentation files from their sources; requires makeinfo.
61 # make check (or check-expensive or check-all)
62 # Run the Emacs test suite.
63 # check-expensive includes additional tests that can be slow.
64 # check-all runs all tests, including ones that can be slow, or
65 # fail unpredictably
67 SHELL = @SHELL@
69 DUMPING=@DUMPING@
71 # This only matters when inheriting a CDPATH not starting with the
72 # current directory.
73 CDPATH=
75 # ==================== Things 'configure' Might Edit ====================
77 cache_file = @cache_file@
78 CONFIGURE_FLAGS = --cache-file=$(cache_file)
80 AWK = @AWK@
82 EXEEXT=@EXEEXT@
84 ### These help us choose version- and architecture-specific directories
85 ### to install files in.
87 ### This should be the number of the Emacs version we're building,
88 ### like '24.5' or '25.0.50'.
89 version=@version@
91 ### This should be the name of the configuration we're building Emacs
92 ### for, like 'x86_64-unknown-linux-gnu' or 'powerpc-ibm-aix7.1.2.0'.
93 configuration=@configuration@
95 ### The nt/ subdirectory gets built only for MinGW
96 NTDIR=@NTDIR@
98 top_builddir = @top_builddir@
99 -include ${top_builddir}/src/verbose.mk
101 # ==================== Where To Install Things ====================
103 # Location to install Emacs.app under GNUstep / macOS.
104 # Later values may use these.
105 ns_appbindir=@ns_appbindir@
106 ns_appresdir=@ns_appresdir@
107 # Either yes or no depending on whether this is a relocatable Emacs.app.
108 ns_self_contained=@ns_self_contained@
110 # The default location for installation. Everything is placed in
111 # subdirectories of this directory. The default values for many of
112 # the variables below are expressed in terms of this one, so you may
113 # not need to change them. This defaults to /usr/local.
114 prefix=@prefix@
116 # Like 'prefix', but used for architecture-specific files.
117 exec_prefix=@exec_prefix@
119 # Where to install Emacs and other binaries that people will want to
120 # run directly (like etags).
121 bindir=@bindir@
123 # The root of the directory tree for read-only architecture-independent
124 # data files. ${datadir}, ${infodir} and ${mandir} are based on this.
125 datarootdir=@datarootdir@
127 # Where to install architecture-independent data files. ${lispdir}
128 # and ${etcdir} are subdirectories of this.
129 datadir=@datadir@
131 # Where to install and expect the files that Emacs modifies as it
132 # runs. These files are all architecture-independent.
133 # Right now, this is not used.
134 sharedstatedir=@sharedstatedir@
136 # Where to install and expect executable files to be run by Emacs
137 # rather than directly by users (and other architecture-dependent
138 # data, although Emacs does not have any). The executables
139 # are actually installed in ${archlibdir}, which is (normally)
140 # a subdirectory of this.
141 libexecdir=@libexecdir@
143 # Currently only used for the systemd service file.
144 libdir=@libdir@
146 # Where to install emacs-module.h.
147 includedir=@includedir@
149 # Where to install Emacs's man pages.
150 # Note they contain cross-references that expect them to be in section 1.
151 mandir=@mandir@
152 man1dir=$(mandir)/man1
154 # Where to install and expect the info files describing Emacs.
155 infodir=@infodir@
156 # Info files not in the doc/misc directory (we get those via make echo-info).
157 INFO_NONMISC=emacs.info eintr.info elisp.info
159 # Directory for local state files for all programs.
160 localstatedir=@localstatedir@
162 # Where to look for bitmap files.
163 bitmapdir=@bitmapdir@
165 # Where to find the source code. The source code for Emacs's C kernel is
166 # expected to be in ${srcdir}/src, and the source code for Emacs's
167 # utility programs is expected to be in ${srcdir}/lib-src. This is
168 # set by the configure script's '--srcdir' option.
170 # We use $(srcdir) explicitly in dependencies so as not to depend on VPATH.
171 srcdir=@srcdir@
172 abs_srcdir=@abs_srcdir@
174 # Where the manpage source files are kept.
175 mansrcdir=$(srcdir)/doc/man
177 # Tell make where to find source files; this is needed for the makefiles.
178 VPATH=@srcdir@
180 # Where to find the application default.
181 x_default_search_path=@x_default_search_path@
183 # Where the etc/emacs.desktop file is to be installed.
184 desktopdir=$(datarootdir)/applications
186 # Where the etc/emacs.appdata.xml file is to be installed.
187 appdatadir=$(datarootdir)/metainfo
189 # Where the etc/emacs.service file is to be installed.
190 # The system value (typically /usr/lib/systemd/user) can be
191 # obtained with: pkg-config --variable=systemduserunitdir systemd
192 # but that does not respect configure's prefix.
193 # It is not clear where we should install this file when
194 # prefix != /usr (or /usr/local?) (eg for non-root installs).
195 # Other options include ~/.config/systemd/user/,
196 # $XDG_RUNTIME_DIR/systemd/user/
197 # It seems the user may end up having to make a manual link...
198 systemdunitdir=$(libdir)/systemd/user
200 # Where the etc/images/icons/hicolor directory is to be installed.
201 icondir=$(datarootdir)/icons
203 # The source directory for the icon files.
204 iconsrcdir=$(srcdir)/etc/images/icons
206 # ==================== Emacs-specific directories ====================
208 # These variables hold the values Emacs will actually use. They are
209 # based on the values of the standard Make variables above.
211 # Where to install the lisp files distributed with Emacs.
212 # This includes the Emacs version, so that the lisp files for different
213 # versions of Emacs will install themselves in separate directories.
214 lispdir=@lispdir@
216 # Directories Emacs should search for standard lisp files.
217 # The default is ${lispdir}.
218 standardlisppath=@standardlisppath@
220 # Directories Emacs should search for lisp files specific to this
221 # site (i.e. customizations), before consulting ${standardlisppath}.
222 # This should be a colon-separated list of directories.
223 locallisppath=@locallisppath@
225 # Where Emacs will search to find its lisp files. Before
226 # changing this, check to see if your purpose wouldn't
227 # better be served by changing locallisppath. This
228 # should be a colon-separated list of directories.
229 # The default is ${locallisppath}:${standardlisppath}.
230 lisppath=@lisppath@
232 # Where Emacs will search for its lisp files while building.
233 # This is only used during the process of compiling Emacs,
234 # to help Emacs find its lisp files before they've been installed
235 # in their final location.
236 # This should be a colon-separated list of directories.
237 # Normally it points to the lisp/ directory in the sources.
238 # NB lread.c relies on lisp/ being first here.
239 buildlisppath=${abs_srcdir}/lisp
241 # Where to install the other architecture-independent
242 # data files distributed with Emacs (like the tutorial,
243 # the cookie recipes and the Zippy database). This path
244 # usually contains the Emacs version number, so the data
245 # files for multiple versions of Emacs may be installed
246 # at once.
247 etcdir=@etcdir@
249 # Where to put executables to be run by Emacs rather than
250 # the user. This path usually includes the Emacs version
251 # and configuration name, so that multiple configurations
252 # for multiple versions of Emacs may be installed at
253 # once.
254 archlibdir=@archlibdir@
256 # Where to put the etc/DOC file.
257 etcdocdir=@etcdocdir@
259 # User or group of the auxiliary program update-game-score, which is
260 # installed on platforms with a game directory shared by multiple users.
261 # On other platforms Emacs can update the score files itself.
262 gameuser=@gameuser@
263 gamegroup=@gamegroup@
264 # Where to install game score files, if gameuser or gamegroup is nonempty.
265 gamedir=@gamedir@
266 # Nonempty if and only if a shared gamedir is used.
267 use_gamedir=$(gameuser)$(gamegroup)
269 # ==================== Utility Programs for the Build ====================
271 # Allow the user to specify the install program.
272 # Note that if the system does not provide a suitable install,
273 # configure will use build-aux/install-sh. Annoyingly, it does
274 # not use an absolute path. So we must take care to always run
275 # INSTALL-type commands from the directory containing the Makefile.
276 # This explains (I think) the cd thisdir seen in several install rules.
277 INSTALL = @INSTALL@
278 INSTALL_PROGRAM = @INSTALL_PROGRAM@
279 INSTALL_DATA = @INSTALL_DATA@
280 INSTALL_INFO = @INSTALL_INFO@
281 # By default, we uphold the dignity of our programs.
282 INSTALL_STRIP =
283 MKDIR_P = @MKDIR_P@
284 # Create a link to a file in the same directory as the target.
285 LN_S_FILEONLY = @LN_S_FILEONLY@
287 # We use gzip to compress installed .el and some .txt files.
288 GZIP_PROG = @GZIP_PROG@
290 # ============================= Targets ==============================
292 # Program name transformation.
293 TRANSFORM = @program_transform_name@
295 # What emacs should be called when installed.
296 EMACS_NAME = `echo emacs | sed '$(TRANSFORM)'`
297 EMACS = ${EMACS_NAME}${EXEEXT}
298 EMACSFULL = `echo emacs-${version} | sed '$(TRANSFORM)'`${EXEEXT}
300 # Subdirectories to make recursively.
301 SUBDIR = $(NTDIR) lib lib-src src lisp
303 # The subdir makefiles created by config.status.
304 SUBDIR_MAKEFILES_IN = @SUBDIR_MAKEFILES_IN@
305 SUBDIR_MAKEFILES = $(patsubst ${srcdir}/%,%,${SUBDIR_MAKEFILES_IN:.in=})
307 # Non-makefile files created by config.status.
308 CONFIG_STATUS_FILES_IN = \
309 ${srcdir}/nt/emacs.rc.in ${srcdir}/nt/emacsclient.rc.in \
310 ${srcdir}/doc/man/emacs.1.in ${srcdir}/src/emacs-module.h.in \
311 ${srcdir}/src/module-env-*.h
313 # Subdirectories to install, and where they'll go. lib-src's and nt's
314 # makefiles know how to install them, so we don't do that here.
315 # Directories that cannot simply be copied, eg info, are treated
316 # separately.
317 COPYDIR = ${srcdir}/etc ${srcdir}/lisp
318 COPYDESTS = "$(DESTDIR)${etcdir}" "$(DESTDIR)${lispdir}"
320 all: ${SUBDIR} info
322 .PHONY: all ${SUBDIR} blessmail epaths-force epaths-force-w32 etc-emacsver
324 # If configure were to just generate emacsver.tex from emacsver.tex.in
325 # in the normal way, the timestamp of emacsver.tex would always be
326 # newer than that of the pdf files, which are prebuilt in release tarfiles.
327 # So we use this rule, and move-if-change, to avoid that.
328 etc-emacsver:
329 majorversion=`echo ${version} | sed 's/\..*//'`; \
330 sed "s/[@]majorversion@/$${majorversion}/" \
331 ${srcdir}/etc/refcards/emacsver.tex.in > emacsver.tex.$$$$ && \
332 ${srcdir}/build-aux/move-if-change emacsver.tex.$$$$ \
333 ${srcdir}/etc/refcards/emacsver.tex
335 # The shared gamedir name as a C string literal, or a null ptr if not in use.
336 PATH_GAME = $(if $(use_gamedir),"$(gamedir)",((char const *) 0))
338 # Generate epaths.h from epaths.in. This target is invoked by 'configure'.
339 # See comments in configure.ac for why it is done this way, as opposed
340 # to just letting configure generate epaths.h from epaths.in in a
341 # similar way to how Makefile is made from Makefile.in.
342 epaths-force:
343 @for dir in '$(abs_srcdir)' '$(lispdir)' '$(archlibdir)'; do \
344 case $$dir in \
345 *:*) \
346 printf >&2 "Build or installation directory '%s'\\n" "$$dir"; \
347 echo >&2 "cannot contain ':'."; \
348 exit 1;; \
349 esac; \
350 done
351 @(gamedir='${gamedir}'; \
352 sed < ${srcdir}/src/epaths.in > epaths.h.$$$$ \
353 -e 's;\(#.*PATH_LOADSEARCH\).*$$;\1 "${standardlisppath}";' \
354 -e 's;\(#.*PATH_SITELOADSEARCH\).*$$;\1 "${locallisppath}";' \
355 -e 's;\(#.*PATH_DUMPLOADSEARCH\).*$$;\1 "${buildlisppath}";' \
356 -e '/^#define PATH_[^ ]*SEARCH /s/\([":]\):*/\1/g' \
357 -e '/^#define PATH_[^ ]*SEARCH /s/:"/"/' \
358 -e 's;\(#.*PATH_EXEC\).*$$;\1 "${archlibdir}";' \
359 -e 's;\(#.*PATH_INFO\).*$$;\1 "${infodir}";' \
360 -e 's;\(#.*PATH_DATA\).*$$;\1 "${etcdir}";' \
361 -e 's;\(#.*PATH_BITMAPS\).*$$;\1 "${bitmapdir}";' \
362 -e 's;\(#.*PATH_X_DEFAULTS\).*$$;\1 "${x_default_search_path}";' \
363 -e 's;\(#.*PATH_GAME\).*$$;\1 $(PATH_GAME);' \
364 -e 's;\(#.*PATH_DOC\).*$$;\1 "${etcdocdir}";') && \
365 ${srcdir}/build-aux/move-if-change epaths.h.$$$$ src/epaths.h
367 # The w32 build needs a slightly different editing, and it uses
368 # nt/epaths.nt as the template.
370 # Use the value of ${locallisppath} supplied by 'configure',
371 # to support the --enable-locallisppath argument.
373 # In this case, the paths written to 'src/epaths.h' must be in native
374 # MS-Windows format (e.g. 'c:/foo/bar'), because temacs is a MinGW
375 # program that doesn't support MSYS-style paths (e.g. '/c/foo/bar' or
376 # '/foo/bar').
377 epaths-force-w32:
378 @(w32srcdir=`${srcdir}/build-aux/msys-to-w32 "${abs_srcdir}"`; \
379 w32prefix=`${srcdir}/build-aux/msys-to-w32 "${prefix}"`; \
380 w32locallisppath=`${srcdir}/build-aux/msys-to-w32 "${locallisppath}"` ; \
381 w32locallisppath=$${w32locallisppath//$${w32prefix}/"%emacs_dir%"} ; \
382 sed < ${srcdir}/nt/epaths.nt > epaths.h.$$$$ \
383 -e 's;\(#.*PATH_SITELOADSEARCH\).*$$;\1 "'"$${w32locallisppath//;/\\;}"'";' \
384 -e '/^.*#/s/@VER@/${version}/g' \
385 -e '/^.*#/s/@CFG@/${configuration}/g' \
386 -e "/^.*#/s|@SRC@|$${w32srcdir}|g") && \
387 ${srcdir}/build-aux/move-if-change epaths.h.$$$$ src/epaths.h
389 lib-src src: $(NTDIR) lib
391 src: lib-src
393 # We need to build 'emacs' in 'src' to compile the *.elc files in 'lisp'.
394 lisp: src
396 # These targets should be "${SUBDIR} without 'src'".
397 lib lib-src lisp nt: Makefile
398 $(MAKE) -C $@ all
400 # Ideally, VCSWITNESS should be a file that is modified whenever the
401 # repository registers a commit from either a local checkin or a
402 # repository pull. In git there is no single file that guarantees
403 # this, but the local log for the current head should be close enough.
405 # Pass an unexpanded $srcdir to src's Makefile, which then
406 # expands it using its own value of srcdir (which points to the
407 # source directory of src/).
408 dirstate = .git/logs/HEAD
409 VCSWITNESS = $(if $(wildcard $(srcdir)/$(dirstate)),$$(srcdir)/../$(dirstate))
410 src: Makefile
411 $(MAKE) -C $@ VCSWITNESS='$(VCSWITNESS)' all
413 blessmail: Makefile src
414 $(MAKE) -C lib-src maybe-blessmail
416 # We used to have one rule per */Makefile.in, but that leads to race
417 # conditions with parallel makes, so assume that the timestamp on
418 # ./Makefile represents the timestamp on all the other Makefiles.
419 # Similarly, assume the timestamp on ./configure represents the
420 # timestamp on src/config.in.
422 # config.status overrides MAKEFILE_NAME with a bogus name when creating
423 # src/epaths.h, so that 'make epaths-force' does not recursively invoke
424 # config.status and overwrite config.status while executing it (Bug#11214).
426 # 'make bootstrap' overrides MAKEFILE_NAME to a nonexistent file but
427 # then attempts to build that file. This forces 'Makefile', 'lib/Makefile',
428 # etc. to be built without running into similar recursion problems.
429 MAKEFILE_NAME = Makefile
430 $(MAKEFILE_NAME): config.status $(srcdir)/configure \
431 $(srcdir)/lib/gnulib.mk.in \
432 $(srcdir)/Makefile.in $(SUBDIR_MAKEFILES_IN) $(CONFIG_STATUS_FILES_IN)
433 MAKE='$(MAKE)' ./config.status
435 # Don't erase these files if make is interrupted while refreshing them.
436 .PRECIOUS: Makefile config.status
438 config.status: ${srcdir}/configure
439 if [ -x ./config.status ]; then \
440 $(CFG) ./config.status --recheck; \
441 else \
442 $(CFG) $(srcdir)/configure $(CONFIGURE_FLAGS); \
445 $(srcdir)/configure: $(srcdir)/configure.ac $(srcdir)/m4/*.m4
446 cd $(srcdir) && ./autogen.sh autoconf
448 # ==================== Installation ====================
450 .PHONY: install install-arch-dep install-arch-indep install-etcdoc install-info
451 .PHONY: install-man install-etc install-strip install-$(NTDIR)
452 .PHONY: uninstall uninstall-$(NTDIR)
454 ## If we let lib-src do its own installation, that means we
455 ## don't have to duplicate the list of utilities to install in
456 ## this Makefile as well.
458 install: all install-arch-indep install-etcdoc install-arch-dep install-$(NTDIR) blessmail
459 @true
461 ## Ensure that $subdir contains a subdirs.el file.
462 ## Here and elsewhere, we set the umask so that any created files are
463 ## world-readable.
464 ## TODO it might be good to warn about non-standard permissions of
465 ## pre-existing directories, but that does not seem easy.
466 write_subdir=if [ -f "$${subdir}/subdirs.el" ]; \
467 then true; \
468 else \
469 umask 022; \
470 ${MKDIR_P} "$${subdir}"; \
471 (echo "(if (fboundp 'normal-top-level-add-subdirs-to-load-path)"; \
472 echo " (normal-top-level-add-subdirs-to-load-path))") \
473 > "$${subdir}/subdirs.el"; \
476 ### Install the executables that were compiled specifically for this machine.
477 ### We do install-arch-indep first because the executable needs the
478 ### Lisp files and DOC file to work properly.
479 install-arch-dep: src install-arch-indep install-etcdoc install-$(NTDIR)
480 umask 022; ${MKDIR_P} "$(DESTDIR)${bindir}"
481 $(MAKE) -C lib-src install
482 ifeq (${ns_self_contained},no)
483 ${INSTALL_PROGRAM} $(INSTALL_STRIP) src/emacs${EXEEXT} "$(DESTDIR)${bindir}/$(EMACSFULL)"
484 ifeq (${DUMPING},pdumper)
485 ${INSTALL_DATA} src/emacs.pdmp "$(DESTDIR)${libexecdir}/emacs/${version}/${configuration}"/emacs.pdmp
486 endif
487 -chmod 755 "$(DESTDIR)${bindir}/$(EMACSFULL)"
488 ifndef NO_BIN_LINK
489 rm -f "$(DESTDIR)${bindir}/$(EMACS)"
490 cd "$(DESTDIR)${bindir}" && $(LN_S_FILEONLY) "$(EMACSFULL)" "$(EMACS)"
491 endif
492 else
493 subdir=${ns_appresdir}/site-lisp && ${write_subdir}
494 rm -rf ${ns_appresdir}/share
495 endif
497 ### Windows-specific install target for installing programs produced
498 ### in nt/, and its Posix do-nothing shadow.
499 install-:
500 install-nt:
501 $(MAKE) -C $(NTDIR) install
503 ## In the share directory, we are deleting:
504 ## applications (with emacs.desktop, also found in etc/)
505 ## emacs (basically empty except for unneeded site-lisp directories)
506 ## icons (duplicates etc/images/icons/hicolor)
508 ## This is install-etc for everything except self-contained-ns builds.
509 ## For them, it is empty.
510 INSTALL_ARCH_INDEP_EXTRA = @INSTALL_ARCH_INDEP_EXTRA@
512 ## https://lists.gnu.org/r/emacs-devel/2007-10/msg01672.html
513 ## Needs to be the user running install, so configure can't set it.
514 set_installuser=for installuser in $${LOGNAME} $${USERNAME} $${USER} \
515 `(id -u) 2> /dev/null`; do \
516 [ -n "$${installuser}" ] && break ; \
517 done; \
518 installgroup=`(id -g) 2>/dev/null` && [ -n "$$installgroup" ] && \
519 installuser=$$installuser:$$installgroup
521 ### Install the files that are machine-independent.
522 ### Most of them come straight from the distribution; the exception is
523 ### the DOC file, which is copied from the build directory.
525 ## We delete each directory in ${COPYDESTS} before we copy into it;
526 ## that way, we can reinstall over directories that have been put in
527 ## place with their files read-only (perhaps because they are checked
528 ## into RCS). In order to make this safe, we make sure that the
529 ## source exists and is distinct from the destination.
531 ## We delete etc/DOC* because there may be irrelevant DOC files from
532 ## other builds in the source directory. This is ok because we just
533 ## deleted the entire installed etc/ directory and recreated it.
534 ## install-etcdoc installs the relevant DOC.
536 ## Note that we install etc/refcards/*.ps if present.
537 ## TODO we should compress these if GZIP_PROG is set.
538 ## It would be simpler to have a separate install rule for etc/refcards
539 ## (maybe move it to doc/refcards?).
541 ## Note that the Makefiles in the etc directory are potentially useful
542 ## in an installed Emacs, so should not be excluded.
544 ## We always create the _default_ locallisppath directories, and
545 ## ensure that they contain a subdirs.el file (via write_subdir).
546 ## This is true even if locallisppath has a non-default value.
547 ## In case of non-default value, we used to create the specified directories,
548 ## but not add subdirs.el to them. This was a strange halfway house.
549 ## Nowadays we do not create non-default directories.
551 ## Note that we use tar instead of plain old cp -R/-r because the latter
552 ## is apparently not portable (even in 2012!).
553 ## https://lists.gnu.org/r/emacs-devel/2012-05/msg00278.html
554 ## I have no idea which platforms Emacs supports where cp -R does not
555 ## work correctly, and therefore no idea when tar can be replaced.
556 ## See also these comments from 2004 about cp -r working fine:
557 ## https://lists.gnu.org/r/autoconf-patches/2004-11/msg00005.html
558 install-arch-indep: lisp install-info install-man ${INSTALL_ARCH_INDEP_EXTRA}
559 umask 022 && $(MKDIR_P) "$(DESTDIR)$(includedir)"
560 $(INSTALL_DATA) src/emacs-module.h "$(DESTDIR)$(includedir)/emacs-module.h"
561 -set ${COPYDESTS} ; \
562 unset CDPATH; \
563 $(set_installuser); \
564 for dir in ${COPYDIR} ; do \
565 [ -d $${dir} ] || exit 1 ; \
566 dest="$$1" ; shift ; \
567 if [ -d "$${dest}" ]; then \
568 exp_dest=`cd "$${dest}" && /bin/pwd`; \
569 [ "$$exp_dest" = "`cd $${dir} && /bin/pwd`" ] && continue ; \
570 else true; \
571 fi; \
572 rm -rf "$${dest}" ; \
573 umask 022; ${MKDIR_P} "$${dest}" ; \
574 printf 'Copying %s to %s...\n' "$$dir" "$$dest" ; \
575 (cd $${dir}; tar -chf - . ) \
576 | (cd "$${dest}"; umask 022; \
577 tar -xvf - && cat > /dev/null) || exit 1; \
578 if [ "$${dir}" = "${srcdir}/etc" ]; then \
579 rm -f "$${dest}/DOC"* ; \
580 rm -f "$${dest}/refcards"/*.aux "$${dest}/refcards"/*.dvi; \
581 rm -f "$${dest}/refcards"/*.log "$${dest}/refcards"/*.in; \
582 else true; \
583 fi; \
584 (cd "$${dest}" || exit 1; \
585 for subdir in `find . -type d -print` ; do \
586 chmod a+rx $${subdir} ; \
587 rm -f $${subdir}/.gitignore ; \
588 rm -f $${subdir}/.arch-inventory ; \
589 rm -f $${subdir}/.DS_Store ; \
590 rm -f $${subdir}/#* ; \
591 rm -f $${subdir}/.#* ; \
592 rm -f $${subdir}/*~ ; \
593 rm -f $${subdir}/*.orig ; \
594 rm -f $${subdir}/ChangeLog* ; \
595 [ "$${dir}" != "${srcdir}/etc" ] && \
596 rm -f $${subdir}/[mM]akefile*[.-]in $${subdir}/[mM]akefile ; \
597 done ); \
598 find "$${dest}" -exec chown $${installuser} {} ';' ;\
599 done
600 -rm -f "$(DESTDIR)${lispdir}/subdirs.el"
601 umask 022; $(srcdir)/build-aux/update-subdirs "$(DESTDIR)${lispdir}"
602 subdir="$(DESTDIR)${datadir}/emacs/${version}/site-lisp" ; \
603 ${write_subdir}
604 subdir="$(DESTDIR)${datadir}/emacs/site-lisp" ; \
605 ${write_subdir} || true
606 [ -z "${GZIP_PROG}" ] || { \
607 echo "Compressing *.el etc. ..." && \
608 cd "$(DESTDIR)${lispdir}" && \
609 for f in `find . -name "*.elc" -print | sed 's/.elc$$/.el/'`; do \
610 ${GZIP_PROG} -9n "$$f"; \
611 done; \
612 ${GZIP_PROG} -9n "../etc/publicsuffix.txt"; \
614 -chmod -R a+r "$(DESTDIR)${datadir}/emacs/${version}" ${COPYDESTS}
616 ## The above chmods are needed because "umask 022; tar ..." is not
617 ## guaranteed to do the right thing; eg if we are root and tar is
618 ## preserving source permissions.
620 ## Note that install-arch-indep deletes and recreates the entire
621 ## installed etc/ directory, so we need it to run before this does.
622 install-etcdoc: src install-arch-indep
623 -unset CDPATH; \
624 umask 022; ${MKDIR_P} "$(DESTDIR)${etcdocdir}" ; \
625 exp_etcdocdir=`cd "$(DESTDIR)${etcdocdir}"; /bin/pwd`; \
626 if [ "`cd ./etc; /bin/pwd`" != "$$exp_etcdocdir" ]; \
627 then \
628 docfile="DOC"; \
629 printf 'Copying %s to %s ...\n' "etc/$$docfile" \
630 "$(DESTDIR)${etcdocdir}"; \
631 ${INSTALL_DATA} etc/$${docfile} "$(DESTDIR)${etcdocdir}/$${docfile}"; \
632 $(set_installuser); \
633 chown $${installuser} "$(DESTDIR)${etcdocdir}/$${docfile}" || true ; \
634 else true; fi
636 ## FIXME:
637 ## If info/dir is missing, but we have install-info, we should let
638 ## that handle it. If info/dir is present and we do not have install-info,
639 ## we should check for missing entries and add them by hand.
640 install-info: info
641 umask 022; ${MKDIR_P} "$(DESTDIR)${infodir}"
642 -unset CDPATH; \
643 thisdir=`/bin/pwd`; \
644 exp_infodir=`cd "$(DESTDIR)${infodir}" && /bin/pwd`; \
645 if [ "`cd ${srcdir}/info && /bin/pwd`" = "$$exp_infodir" ]; then \
646 true; \
647 else \
648 [ -f "$(DESTDIR)${infodir}/dir" ] || \
649 [ ! -f ${srcdir}/info/dir ] || \
650 ${INSTALL_DATA} ${srcdir}/info/dir "$(DESTDIR)${infodir}/dir"; \
651 info_misc=`MAKEFLAGS= $(MAKE) --no-print-directory -s -C doc/misc echo-info`; \
652 cd ${srcdir}/info ; \
653 for elt in ${INFO_NONMISC} $${info_misc}; do \
654 for f in `ls $$elt $$elt-[1-9] $$elt-[1-9][0-9] 2>/dev/null`; do \
655 (cd "$${thisdir}"; \
656 ${INSTALL_DATA} ${srcdir}/info/$$f "$(DESTDIR)${infodir}/$$f"); \
657 [ -n "${GZIP_PROG}" ] || continue ; \
658 rm -f "$(DESTDIR)${infodir}/$$f.gz"; \
659 ${GZIP_PROG} -9n "$(DESTDIR)${infodir}/$$f"; \
660 done; \
661 (cd "$${thisdir}"; \
662 ${INSTALL_INFO} --info-dir="$(DESTDIR)${infodir}" "$(DESTDIR)${infodir}/$$elt"); \
663 done; \
666 ## "gzip || true" is because some gzips exit with non-zero status
667 ## if compression would not reduce the file size. Eg, the gzip in
668 ## OpenBSD 4.9 seems to do this (2013/03). In Emacs, this can
669 ## only happen with the tiny ctags.1 manpage. We don't really care if
670 ## ctags.1 is compressed or not. "gzip -f" is another option here,
671 ## but not sure if portable.
672 install-man:
673 umask 022; ${MKDIR_P} "$(DESTDIR)${man1dir}"
674 thisdir=`/bin/pwd`; \
675 cd ${mansrcdir}; \
676 for page in *.1; do \
677 test "$$page" = ChangeLog.1 && continue; \
678 dest=`echo "$${page}" | sed -e 's/\.1$$//' -e '$(TRANSFORM)'`.1; \
679 (cd "$${thisdir}"; \
680 ${INSTALL_DATA} ${mansrcdir}/$${page} "$(DESTDIR)${man1dir}/$${dest}"); \
681 [ -n "${GZIP_PROG}" ] || continue ; \
682 rm -f "$(DESTDIR)${man1dir}/$${dest}.gz"; \
683 ${GZIP_PROG} -9n "$(DESTDIR)${man1dir}/$${dest}" || true; \
684 done
686 ## Install those items from etc/ that need to end up elsewhere.
688 ## If you prefer, choose "emacs22" at installation time.
689 ## Note: emacs22 does not have all the resolutions.
690 EMACS_ICON=emacs
692 install-etc:
693 umask 022; ${MKDIR_P} "$(DESTDIR)${desktopdir}"
694 tmp=etc/emacs.tmpdesktop; rm -f $${tmp}; \
695 sed -e "/^Exec=emacs/ s/emacs/${EMACS_NAME}/" \
696 -e "/^Icon=emacs/ s/emacs/${EMACS_NAME}/" \
697 ${srcdir}/etc/emacs.desktop > $${tmp}; \
698 ${INSTALL_DATA} $${tmp} "$(DESTDIR)${desktopdir}/${EMACS_NAME}.desktop"; \
699 rm -f $${tmp}
700 tmp=etc/emacsclient.tmpdesktop; rm -f $${tmp}; \
701 client_name=`echo emacsclient | sed '$(TRANSFORM)'`${EXEEXT}; \
702 sed -e "/^Exec=emacsclient/ s|emacsclient|${bindir}/$${client_name}|" \
703 -e "/^Icon=emacs/ s/emacs/${EMACS_NAME}/" \
704 ${srcdir}/etc/emacsclient.desktop > $${tmp}; \
705 ${INSTALL_DATA} $${tmp} "$(DESTDIR)${desktopdir}/$${client_name}.desktop"; \
706 rm -f $${tmp}
707 umask 022; ${MKDIR_P} "$(DESTDIR)${appdatadir}"
708 tmp=etc/emacs.tmpappdata; rm -f $${tmp}; \
709 sed -e "s/emacs\.desktop/${EMACS_NAME}.desktop/" \
710 ${srcdir}/etc/emacs.appdata.xml > $${tmp}; \
711 ${INSTALL_DATA} $${tmp} "$(DESTDIR)${appdatadir}/${EMACS_NAME}.appdata.xml"; \
712 rm -f $${tmp}
713 umask 022; $(MKDIR_P) "$(DESTDIR)$(systemdunitdir)"
714 tmp=etc/emacs.tmpservice; rm -f $${tmp}; \
715 client_name=`echo emacsclient | sed '$(TRANSFORM)'`${EXEEXT}; \
716 sed -e '/^##/d' \
717 -e "/^Documentation/ s/emacs(1)/${EMACS_NAME}(1)/" \
718 -e "/^ExecStart/ s|emacs|${bindir}/${EMACS}|" \
719 -e "/^ExecStop/ s|emacsclient|${bindir}/$${client_name}|" \
720 ${srcdir}/etc/emacs.service > $${tmp}; \
721 $(INSTALL_DATA) $${tmp} "$(DESTDIR)$(systemdunitdir)/${EMACS_NAME}.service"; \
722 rm -f $${tmp}
723 thisdir=`/bin/pwd`; \
724 cd ${iconsrcdir} || exit 1; umask 022 ; \
725 for dir in */*/apps */*/mimetypes; do \
726 [ -d $${dir} ] || continue ; \
727 ( cd "$${thisdir}"; ${MKDIR_P} "$(DESTDIR)${icondir}/$${dir}" ) ; \
728 for icon in $${dir}/${EMACS_ICON}[.-]*; do \
729 [ -r $${icon} ] || continue ; \
730 ext=`echo "$${icon}" | sed -e 's|.*\.||'`; \
731 dest=`echo "$${icon}" | sed -e 's|.*/||' -e "s|\\.$${ext}\$$||" -e 's/$(EMACS_ICON)/emacs/' -e '$(TRANSFORM)'`.$${ext} ; \
732 ( cd "$${thisdir}"; \
733 ${INSTALL_DATA} ${iconsrcdir}/$${icon} "$(DESTDIR)${icondir}/$${dir}/$${dest}" ) \
734 || exit 1; \
735 done ; \
736 done
738 ### Build Emacs and install it, stripping binaries while installing them.
739 install-strip:
740 $(MAKE) INSTALL_STRIP=-s install
742 ### Delete all the installed files that the 'install' target would
743 ### create (but not the noninstalled files such as 'make all' would create).
745 ### Don't delete the lisp and etc directories if they're in the source tree.
746 uninstall: uninstall-$(NTDIR) uninstall-doc
747 rm -f "$(DESTDIR)$(includedir)/emacs-module.h"
748 $(MAKE) -C lib-src uninstall
749 -unset CDPATH; \
750 for dir in "$(DESTDIR)${lispdir}" "$(DESTDIR)${etcdir}" ; do \
751 if [ -d "$${dir}" ]; then \
752 case `cd "$${dir}" ; /bin/pwd` in \
753 "`cd ${srcdir} ; /bin/pwd`"* ) ;; \
754 * ) rm -rf "$${dir}" ;; \
755 esac ; \
756 case "$${dir}" in \
757 "$(DESTDIR)${datadir}/emacs/${version}"/* ) \
758 rm -rf "$(DESTDIR)${datadir}/emacs/${version}" \
759 ;; \
760 esac ; \
761 fi ; \
762 done
763 -rm -rf "$(DESTDIR)${libexecdir}/emacs/${version}"
764 thisdir=`/bin/pwd`; \
765 (info_misc=`MAKEFLAGS= $(MAKE) --no-print-directory -s -C doc/misc echo-info`; \
766 if cd "$(DESTDIR)${infodir}"; then \
767 for elt in ${INFO_NONMISC} $${info_misc}; do \
768 (cd "$${thisdir}"; \
769 $(INSTALL_INFO) --remove --info-dir="$(DESTDIR)${infodir}" "$(DESTDIR)${infodir}/$$elt"); \
770 if [ -n "${GZIP_PROG}" ]; then \
771 ext=.gz; else ext=; fi; \
772 rm -f $$elt$$ext $$elt-[1-9]$$ext $$elt-[1-9][0-9]$$ext; \
773 done; \
775 (if [ -n "${GZIP_PROG}" ]; then \
776 ext=.gz; else ext=; fi; \
777 if cd ${mansrcdir}; then \
778 for page in *.1; do \
779 rm -f "$(DESTDIR)${man1dir}"/`echo "$${page}" | sed -e 's/\.1$$//' -e '$(TRANSFORM)'`.1$$ext; done; \
781 rm -f "$(DESTDIR)${bindir}/$(EMACS)" "$(DESTDIR)${bindir}/$(EMACSFULL)"
782 (if cd "$(DESTDIR)${icondir}"; then \
783 rm -f hicolor/*x*/apps/"${EMACS_NAME}.png" \
784 "hicolor/scalable/apps/${EMACS_NAME}.svg" \
785 "hicolor/scalable/apps/${EMACS_NAME}.ico" \
786 "hicolor/scalable/mimetypes/${EMACS_NAME}-document.svg" \
787 "hicolor/scalable/mimetypes/${EMACS_NAME}-document23.svg"; \
789 -rm -f "$(DESTDIR)${desktopdir}/${EMACS_NAME}.desktop"
790 -rm -f "$(DESTDIR)${appdatadir}/${EMACS_NAME}.appdata.xml"
791 -rm -f "$(DESTDIR)$(systemdunitdir)/${EMACS_NAME}.service"
792 ifneq (,$(use_gamedir))
793 for file in snake-scores tetris-scores; do \
794 file="$(DESTDIR)${gamedir}/$${file}"; \
795 [ -s "$${file}" ] || rm -f "$$file"; \
796 done
797 endif
799 ### Windows-specific uninstall target for removing programs produced
800 ### in nt/, and its Posix do-nothing shadow.
801 uninstall-:
802 uninstall-nt:
803 $(MAKE) -C $(NTDIR) uninstall
805 # ==================== Cleaning up and miscellanea ====================
807 .PHONY: mostlyclean clean distclean bootstrap-clean maintainer-clean extraclean
809 ## Eg:
810 ## src_clean:
811 ## make -C src clean
812 define submake_template
813 .PHONY: $(1)_$(2)
814 $(1)_$(2):
815 $$(MAKE) -C $(1) $(2)
816 endef
818 ### 'mostlyclean'
819 ### Like 'clean', but may refrain from deleting a few files that people
820 ### normally don't want to recompile. For example, the 'mostlyclean'
821 ### target for GCC does not delete 'libgcc.a', because recompiling it
822 ### is rarely necessary and takes a lot of time.
823 mostlyclean_dirs = src oldXMenu lwlib lib lib-src nt doc/emacs doc/misc \
824 doc/lispref doc/lispintro
826 $(foreach dir,$(mostlyclean_dirs),$(eval $(call submake_template,$(dir),mostlyclean)))
828 mostlyclean: $(mostlyclean_dirs:=_mostlyclean)
829 [ ! -d test ] || $(MAKE) -C test $@
831 ### 'clean'
832 ### Delete all files from the current directory that are normally
833 ### created by building the program. Don't delete the files that
834 ### record the configuration. Also preserve files that could be made
835 ### by building, but normally aren't because the distribution comes
836 ### with them.
838 ### Delete '.dvi' files here if they are not part of the distribution.
839 clean_dirs = $(mostlyclean_dirs) nextstep
841 $(foreach dir,$(clean_dirs),$(eval $(call submake_template,$(dir),clean)))
843 clean: $(clean_dirs:=_clean)
844 $(MAKE) -C admin/charsets $@
845 [ ! -d test ] || $(MAKE) -C test $@
846 -rm -f ./*.tmp etc/*.tmp*
847 -rm -rf info-dir.*
849 ### 'bootclean'
850 ### Delete all files that need to be remade for a clean bootstrap.
851 top_bootclean=\
852 rm -f config.cache config.log ${srcdir}/doc/man/emacs.1
854 ### 'distclean'
855 ### Delete all files from the current directory that are created by
856 ### configuring or building the program. If you have unpacked the
857 ### source and built the program without creating any other files,
858 ### 'make distclean' should leave only the files that were in the
859 ### distribution.
860 top_distclean=\
861 ${top_bootclean}; \
862 rm -f config.status config.log~ \
863 Makefile makefile lib/gnulib.mk ${SUBDIR_MAKEFILES}
865 distclean_dirs = $(clean_dirs) leim lisp
867 $(foreach dir,$(distclean_dirs),$(eval $(call submake_template,$(dir),distclean)))
869 maybeclean_dirs = test admin/grammars admin/unidata admin/charsets
871 distclean: $(distclean_dirs:=_distclean)
872 for dir in $(filter-out test,$(maybeclean_dirs)); do \
873 $(MAKE) -C $$dir $@ || exit; \
874 done
875 [ ! -d test ] || $(MAKE) -C test $@
876 ${top_distclean}
878 ### 'bootstrap-clean'
879 ### Delete everything that can be reconstructed by 'make' and that
880 ### needs to be deleted in order to force a bootstrap from a clean state.
881 $(foreach dir,$(distclean_dirs),$(eval $(call submake_template,$(dir),bootstrap-clean)))
883 bootstrap-clean: $(distclean_dirs:=_bootstrap-clean)
884 for dir in $(filter-out test,$(maybeclean_dirs)); do \
885 $(MAKE) -C $$dir $@ || exit; \
886 done
887 [ ! -d test ] || $(MAKE) -C test $@
888 [ ! -f config.log ] || mv -f config.log config.log~
889 rm -rf ${srcdir}/info
890 rm -f ${srcdir}/etc/refcards/emacsver.tex
891 ${top_bootclean}
893 ### 'maintainer-clean'
894 ### Delete everything from the current directory that can be
895 ### reconstructed with this Makefile. This typically includes
896 ### everything deleted by distclean, plus more: C source files
897 ### produced by Bison, tags tables, info files, and so on.
899 ### One exception, however: 'make maintainer-clean' should not delete
900 ### 'configure' even if 'configure' can be remade using a rule in the
901 ### Makefile. More generally, 'make maintainer-clean' should not delete
902 ### anything that needs to exist in order to run 'configure' and then
903 ### begin to build the program.
904 top_maintainer_clean=\
905 ${top_distclean}; \
906 rm -fr autom4te.cache
908 maintainer_clean_dirs = src leim lisp
910 $(foreach dir,$(maintainer_clean_dirs),$(eval $(call submake_template,$(dir),maintainer-clean)))
912 maintainer-clean: bootstrap-clean $(maintainer_clean_dirs:=_maintainer-clean)
913 for dir in $(filter-out test,$(maybeclean_dirs)); do \
914 $(MAKE) -C $$dir $@ || exit; \
915 done
916 [ ! -d test ] || $(MAKE) -C test $@
917 ${top_maintainer_clean}
919 ### This doesn't actually appear in the coding standards, but Karl
920 ### says GCC supports it, and that's where the configuration part of
921 ### the coding standards seem to come from. It's like distclean, but
922 ### it deletes backup and autosave files too.
923 ### Note that we abuse this in some subdirectories (eg leim),
924 ### to delete some generated files that are slow to rebuild.
925 extraclean_dirs = ${NTDIR} lib-src src leim \
926 admin/charsets admin/grammars admin/unidata lisp lib
928 $(foreach dir,$(extraclean_dirs),$(eval $(call submake_template,$(dir),extraclean)))
930 extraclean: $(extraclean_dirs:=_extraclean)
931 ${top_maintainer_clean}
932 -rm -f config-tmp-* aclocal.m4 configure
933 -rm -f ./*~ \#* etc/refcards/emacsver.tex doc/emacs/emacsver.texi
934 -rm -f info/*.info info/dir
935 -rmdir info 2>/dev/null
937 # The src subdir knows how to do the right thing
938 # even when the build directory and source dir are different.
939 .PHONY: TAGS tags
940 # FIXME: We used to include `src` in the dependencies, not sure why.
941 # I removed it because it causes `make tags` to build Emacs.
942 TAGS tags: lib lib-src # src
943 $(MAKE) -C src tags
944 $(MAKE) -C doc/emacs tags
945 $(MAKE) -C doc/lispintro tags
946 $(MAKE) -C doc/lispref tags
947 $(MAKE) -C doc/misc tags
949 CHECK_TARGETS = check check-maybe check-expensive check-all
950 .PHONY: $(CHECK_TARGETS)
951 $(CHECK_TARGETS): all
952 ifeq ($(wildcard test),test)
953 $(MAKE) -C test $@
954 else
955 @echo "You do not seem to have the test/ directory."
956 @echo "Maybe you used a release tarfile that lacks tests."
957 endif
959 test/%:
960 $(MAKE) -C test $*
963 dist:
964 cd ${srcdir}; ./make-dist
966 DVIS = lispref-dvi lispintro-dvi emacs-dvi misc-dvi
967 HTMLS = lispref-html lispintro-html emacs-html misc-html
968 INFOS = lispref-info lispintro-info emacs-info misc-info
969 PDFS = lispref-pdf lispintro-pdf emacs-pdf misc-pdf
970 PSS = lispref-ps lispintro-ps emacs-ps misc-ps
972 DOCS = $(DVIS) $(HTMLS) $(INFOS) $(PDFS) $(PSS)
973 $(DOCS):
974 $(MAKE) -C doc/$(subst -, ,$@)
976 .PHONY: $(DOCS) docs pdf ps
977 .PHONY: info dvi dist html info-dir check-info
979 ## TODO add etc/refcards.
980 docs: $(DOCS)
981 dvi: $(DVIS)
982 html: $(HTMLS)
983 info: $(INFOS) info-dir
984 pdf: $(PDFS)
985 ps: $(PSS)
987 # This dependency is due to those doc/misc/ manuals that use .org sources.
988 # Depending on src is sufficient, but ends up being slow, since the
989 # uncompiled lisp/org/*.el files are used to build the .texi files
990 # (which can be slow even with the elc files).
991 misc-info: lisp
992 # Using src rather than lisp because one is less likely to get unnecessary
993 # rebuilds of stuff that is not strictly necessary for generating manuals.
994 misc-dvi misc-html misc-pdf misc-ps: src
996 info-dir: ${srcdir}/info/dir
998 texi_misc = $(shell MAKEFLAGS= ${MAKE} --no-print-directory -s -C doc/misc echo-sources)
1000 srcdir_doc_info_dir_inputs = \
1001 ${srcdir}/doc/emacs/emacs.texi \
1002 ${srcdir}/doc/lispintro/emacs-lisp-intro.texi \
1003 ${srcdir}/doc/lispref/elisp.texi \
1004 $(addprefix ${srcdir}/doc/misc/,${texi_misc})
1005 info_dir_inputs = \
1006 ../build-aux/dir_top \
1007 $(subst ${srcdir}/doc/,,${srcdir_doc_info_dir_inputs})
1008 info_dir_deps = \
1009 ${srcdir}/build-aux/make-info-dir \
1010 ${srcdir}/build-aux/dir_top \
1011 ${srcdir_doc_info_dir_inputs}
1013 ## It would be much simpler if info/dir was only created in the
1014 ## installation location by the install-info rule, but we also
1015 ## need one in the source directory for people running uninstalled.
1016 ## FIXME it would be faster to use the install-info program if we have it,
1017 ## but then we would need to depend on ${INFOS}, which would
1018 ## slow down parallelization.
1019 ${srcdir}/info/dir: ${info_dir_deps}
1020 $(AM_V_at)${MKDIR_P} ${srcdir}/info
1021 $(AM_V_GEN)(cd ${srcdir}/doc && \
1022 AWK='${AWK}' ../build-aux/make-info-dir ${info_dir_inputs} \
1023 ) >$@.tmp && mv $@.tmp $@
1025 INSTALL_DVI = install-emacs-dvi install-lispref-dvi \
1026 install-lispintro-dvi install-misc-dvi
1027 INSTALL_HTML = install-emacs-html install-lispref-html \
1028 install-lispintro-html install-misc-html
1029 INSTALL_PDF = install-emacs-pdf install-lispref-pdf \
1030 install-lispintro-pdf install-misc-pdf
1031 INSTALL_PS = install-emacs-ps install-lispref-ps \
1032 install-lispintro-ps install-misc-ps
1033 INSTALL_DOC = $(INSTALL_DVI) $(INSTALL_HTML) $(INSTALL_PDF) $(INSTALL_PS)
1035 ## Install non .info forms of the documentation.
1036 ## TODO add etc/refcards.
1037 $(INSTALL_DOC):
1038 $(MAKE) -C doc/$(subst -, install-,$(subst install-,,$@))
1040 .PHONY: $(INSTALL_DOC) install-doc
1041 .PHONY: install-dvi install-html install-pdf install-ps
1043 install-doc: $(INSTALL_DOC)
1044 install-dvi: $(INSTALL_DVI)
1045 install-html: $(INSTALL_HTML)
1046 install-pdf: $(INSTALL_PDF)
1047 install-ps: $(INSTALL_PS)
1050 UNINSTALL_DVI = uninstall-emacs-dvi uninstall-lispref-dvi \
1051 uninstall-lispintro-dvi uninstall-misc-dvi
1052 UNINSTALL_HTML = uninstall-emacs-html uninstall-lispref-html \
1053 uninstall-lispintro-html uninstall-misc-html
1054 UNINSTALL_PDF = uninstall-emacs-pdf uninstall-lispref-pdf \
1055 uninstall-lispintro-pdf uninstall-misc-pdf
1056 UNINSTALL_PS = uninstall-emacs-ps uninstall-lispref-ps \
1057 uninstall-lispintro-ps uninstall-misc-ps
1058 UNINSTALL_DOC = $(UNINSTALL_DVI) $(UNINSTALL_HTML) $(UNINSTALL_PDF) $(UNINSTALL_PS)
1060 $(UNINSTALL_DOC):
1061 $(MAKE) -C doc/$(subst -, uninstall-,$(subst uninstall-,,$@))
1063 .PHONY: $(UNINSTALL_DOC) uninstall-doc
1064 .PHONY: uninstall-dvi uninstall-html uninstall-pdf uninstall-ps
1066 uninstall-doc: $(UNINSTALL_DOC)
1067 uninstall-dvi: $(UNINSTALL_DVI)
1068 uninstall-html: $(UNINSTALL_HTML)
1069 uninstall-pdf: $(UNINSTALL_PDF)
1070 uninstall-ps: $(UNINSTALL_PS)
1072 ## build-aux/make-info-dir expects only certain dircategories.
1073 check-info: info
1074 cd info ; \
1075 bad= ; \
1076 for file in *; do \
1077 test -f "$${file}" || continue ; \
1078 case $${file} in \
1079 *-[0-9]*|COPYING|dir) continue ;; \
1080 esac ; \
1081 cat=`sed -n 's/^INFO-DIR-SECTION //p' $${file}`; \
1082 case $${cat} in \
1083 "Texinfo documentation system" | "Emacs"| "Emacs lisp" | \
1084 "Emacs editing modes" | "Emacs network features" | \
1085 "Emacs misc features" | "Emacs lisp libraries" ) : ;; \
1086 *) bad="$${bad} $${file}" ;; \
1087 esac; \
1088 done ; \
1089 if test -n "$${bad}"; then \
1090 echo "Unexpected dircategory in: $${bad}" ; \
1091 exit 1 ; \
1092 fi ; \
1093 echo "info files are OK"
1095 #### Bootstrapping.
1097 ### This first cleans the lisp subdirectory, removing all compiled
1098 ### Lisp files. Then re-run make to build all the files anew.
1100 .PHONY: bootstrap
1102 # Bootstrapping does the following:
1103 # * Remove files to start from a bootstrap-clean slate.
1104 # * Run autogen.sh.
1105 # * Rebuild Makefile, to update the build procedure itself.
1106 # * Do the actual build.
1107 bootstrap: bootstrap-clean
1108 cd $(srcdir) && ./autogen.sh autoconf
1109 $(MAKE) MAKEFILE_NAME=force-Makefile force-Makefile
1110 $(MAKE) all
1112 .PHONY: ChangeLog change-history change-history-commit change-history-nocommit
1113 .PHONY: preferred-branch-is-current unchanged-history-files
1115 CHANGELOG = ChangeLog
1116 emacslog = build-aux/gitlog-to-emacslog
1117 # The ChangeLog history files are called ChangeLog.1, ChangeLog.2, ...,
1118 # ChangeLog.$(CHANGELOG_HISTORY_INDEX_MAX). $(CHANGELOG_N) stands for
1119 # the newest (highest-numbered) ChangeLog history file.
1120 CHANGELOG_HISTORY_INDEX_MAX = 3
1121 CHANGELOG_N = ChangeLog.$(CHANGELOG_HISTORY_INDEX_MAX)
1123 # Convert git commit log to ChangeLog file. make-dist uses this.
1124 # I guess this is PHONY so it always updates?
1125 ChangeLog:
1126 $(AM_V_GEN)cd $(srcdir) && \
1127 ./$(emacslog) -o $(CHANGELOG) -n $(CHANGELOG_HISTORY_INDEX_MAX)
1129 # Check that we are in a good state for changing history.
1130 PREFERRED_BRANCH = emacs-27
1131 preferred-branch-is-current:
1132 git branch | grep -q '^\* $(PREFERRED_BRANCH)$$'
1133 unchanged-history-files:
1134 x=$$(git diff-files --name-only $(CHANGELOG_N) $(emacslog)) && \
1135 test -z "$$x"
1137 # Regular expression that matches the newest commit covered by a ChangeLog.
1138 new_commit_regexp = ^commit [0123456789abcdef]* (inclusive)
1140 # Copy newer commit messages to the start of the ChangeLog history file,
1141 # and consider them to be older.
1142 change-history-nocommit: preferred-branch-is-current unchanged-history-files
1143 -rm -f ChangeLog.tmp
1144 $(MAKE) ChangeLog CHANGELOG=ChangeLog.tmp
1145 sed '/^This file records repository revisions/,$$d' \
1146 ChangeLog.tmp >$(CHANGELOG_N).tmp
1147 new_commit_line=`grep '$(new_commit_regexp)' ChangeLog.tmp` && \
1148 sed 's/$(new_commit_regexp).*/'"$$new_commit_line/" \
1149 $(CHANGELOG_N) >>$(CHANGELOG_N).tmp
1150 rm ChangeLog.tmp
1151 mv $(CHANGELOG_N).tmp $(CHANGELOG_N)
1153 change-history: change-history-nocommit
1154 $(MAKE) $@-commit
1156 # If 'make change-history' fails because the newest ChangeLog history
1157 # file contains invalid text, fix the file by hand and then run
1158 # 'make change-history-commit'.
1159 change-history-commit:
1160 git commit -m'; make $@' $(CHANGELOG_N) $(emacslog)
1162 .PHONY: check-declare
1164 check-declare:
1165 @if [ ! -f $(srcdir)/src/emacs ]; then \
1166 echo "You must build Emacs to use this command"; \
1167 exit 1; \
1169 $(MAKE) -C lisp $@
1170 $(MAKE) -C test $@
1172 .PHONY: gitmerge
1174 GITMERGE_EMACS = ./src/emacs${EXEEXT}
1175 GITMERGE_NMIN = 10
1177 gitmerge:
1178 ${GITMERGE_EMACS} -batch --no-site-file --no-site-lisp \
1179 -l ${srcdir}/admin/gitmerge.el \
1180 --eval '(setq gitmerge-minimum-missing ${GITMERGE_NMIN})' -f gitmerge