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