Improve responsiveness while in 'replace-buffer-contents'
[emacs.git] / Makefile.in
blob238df40ded898b18c2360d41df3cbf02097534d3
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 -un 2> /dev/null`; do \
520 [ -n "$${installuser}" ] && break ; \
521 done
523 ### Install the files that are machine-independent.
524 ### Most of them come straight from the distribution; the exception is
525 ### the DOC file, which is copied from the build directory.
527 ## We delete each directory in ${COPYDESTS} before we copy into it;
528 ## that way, we can reinstall over directories that have been put in
529 ## place with their files read-only (perhaps because they are checked
530 ## into RCS). In order to make this safe, we make sure that the
531 ## source exists and is distinct from the destination.
533 ## We delete etc/DOC* because there may be irrelevant DOC files from
534 ## other builds in the source directory. This is ok because we just
535 ## deleted the entire installed etc/ directory and recreated it.
536 ## install-etcdoc installs the relevant DOC.
538 ## Note that we install etc/refcards/*.ps if present.
539 ## TODO we should compress these if GZIP_PROG is set.
540 ## It would be simpler to have a separate install rule for etc/refcards
541 ## (maybe move it to doc/refcards?).
543 ## Note that the Makefiles in the etc directory are potentially useful
544 ## in an installed Emacs, so should not be excluded.
546 ## We always create the _default_ locallisppath directories, and
547 ## ensure that they contain a subdirs.el file (via write_subdir).
548 ## This is true even if locallisppath has a non-default value.
549 ## In case of non-default value, we used to create the specified directories,
550 ## but not add subdirs.el to them. This was a strange halfway house.
551 ## Nowadays we do not create non-default directories.
553 ## Note that we use tar instead of plain old cp -R/-r because the latter
554 ## is apparently not portable (even in 2012!).
555 ## https://lists.gnu.org/r/emacs-devel/2012-05/msg00278.html
556 ## I have no idea which platforms Emacs supports where cp -R does not
557 ## work correctly, and therefore no idea when tar can be replaced.
558 ## See also these comments from 2004 about cp -r working fine:
559 ## https://lists.gnu.org/r/autoconf-patches/2004-11/msg00005.html
560 install-arch-indep: lisp install-info install-man ${INSTALL_ARCH_INDEP_EXTRA}
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.
641 ## FIXME:
642 ## If HAVE_MAKEINFO = no and there are no info files, do not install info/dir.
643 install-info: info
644 umask 022; ${MKDIR_P} "$(DESTDIR)${infodir}"
645 -unset CDPATH; \
646 thisdir=`/bin/pwd`; \
647 exp_infodir=`cd "$(DESTDIR)${infodir}" && /bin/pwd`; \
648 if [ "`cd ${srcdir}/info && /bin/pwd`" = "$$exp_infodir" ]; then \
649 true; \
650 else \
651 [ -f "$(DESTDIR)${infodir}/dir" ] || \
652 [ ! -f ${srcdir}/info/dir ] || \
653 ${INSTALL_DATA} ${srcdir}/info/dir "$(DESTDIR)${infodir}/dir"; \
654 info_misc=`$(MAKE) --no-print-directory -s -C doc/misc echo-info`; \
655 cd ${srcdir}/info ; \
656 for elt in ${INFO_NONMISC} $${info_misc}; do \
657 test "$(HAVE_MAKEINFO)" = "no" && test ! -f $$elt && continue; \
658 for f in `ls $$elt $$elt-[1-9] $$elt-[1-9][0-9] 2>/dev/null`; do \
659 (cd "$${thisdir}"; \
660 ${INSTALL_DATA} ${srcdir}/info/$$f "$(DESTDIR)${infodir}/$$f"); \
661 [ -n "${GZIP_PROG}" ] || continue ; \
662 rm -f "$(DESTDIR)${infodir}/$$f.gz"; \
663 ${GZIP_PROG} -9n "$(DESTDIR)${infodir}/$$f"; \
664 done; \
665 (cd "$${thisdir}"; \
666 ${INSTALL_INFO} --info-dir="$(DESTDIR)${infodir}" "$(DESTDIR)${infodir}/$$elt"); \
667 done; \
670 ## "gzip || true" is because some gzips exit with non-zero status
671 ## if compression would not reduce the file size. Eg, the gzip in
672 ## OpenBSD 4.9 seems to do this (2013/03). In Emacs, this can
673 ## only happen with the tiny ctags.1 manpage. We don't really care if
674 ## ctags.1 is compressed or not. "gzip -f" is another option here,
675 ## but not sure if portable.
676 install-man:
677 umask 022; ${MKDIR_P} "$(DESTDIR)${man1dir}"
678 thisdir=`/bin/pwd`; \
679 cd ${mansrcdir}; \
680 for page in *.1; do \
681 test "$$page" = ChangeLog.1 && continue; \
682 dest=`echo "$${page}" | sed -e 's/\.1$$//' -e '$(TRANSFORM)'`.1; \
683 (cd "$${thisdir}"; \
684 ${INSTALL_DATA} ${mansrcdir}/$${page} "$(DESTDIR)${man1dir}/$${dest}"); \
685 [ -n "${GZIP_PROG}" ] || continue ; \
686 rm -f "$(DESTDIR)${man1dir}/$${dest}.gz"; \
687 ${GZIP_PROG} -9n "$(DESTDIR)${man1dir}/$${dest}" || true; \
688 done
690 ## Install those items from etc/ that need to end up elsewhere.
692 ## If you prefer, choose "emacs22" at installation time.
693 ## Note: emacs22 does not have all the resolutions.
694 EMACS_ICON=emacs
696 install-etc:
697 umask 022; ${MKDIR_P} "$(DESTDIR)${desktopdir}"
698 tmp=etc/emacs.tmpdesktop; rm -f $${tmp}; \
699 sed -e "/^Exec=emacs/ s/emacs/${EMACS_NAME}/" \
700 -e "/^Icon=emacs/ s/emacs/${EMACS_NAME}/" \
701 ${srcdir}/etc/emacs.desktop > $${tmp}; \
702 ${INSTALL_DATA} $${tmp} "$(DESTDIR)${desktopdir}/${EMACS_NAME}.desktop"; \
703 rm -f $${tmp}
704 umask 022; ${MKDIR_P} "$(DESTDIR)${appdatadir}"
705 tmp=etc/emacs.tmpappdata; rm -f $${tmp}; \
706 sed -e "s/emacs\.desktop/${EMACS_NAME}.desktop/" \
707 ${srcdir}/etc/emacs.appdata.xml > $${tmp}; \
708 ${INSTALL_DATA} $${tmp} "$(DESTDIR)${appdatadir}/${EMACS_NAME}.appdata.xml"; \
709 rm -f $${tmp}
710 umask 022; $(MKDIR_P) "$(DESTDIR)$(systemdunitdir)"
711 tmp=etc/emacs.tmpservice; rm -f $${tmp}; \
712 client_name=`echo emacsclient | sed '$(TRANSFORM)'`${EXEEXT}; \
713 sed -e '/^##/d' \
714 -e "/^Documentation/ s/emacs(1)/${EMACS_NAME}(1)/" \
715 -e "/^ExecStart/ s|emacs|${bindir}/${EMACS}|" \
716 -e "/^ExecStop/ s|emacsclient|${bindir}/$${client_name}|" \
717 ${srcdir}/etc/emacs.service > $${tmp}; \
718 $(INSTALL_DATA) $${tmp} "$(DESTDIR)$(systemdunitdir)/${EMACS_NAME}.service"; \
719 rm -f $${tmp}
720 thisdir=`/bin/pwd`; \
721 cd ${iconsrcdir} || exit 1; umask 022 ; \
722 for dir in */*/apps */*/mimetypes; do \
723 [ -d $${dir} ] || continue ; \
724 ( cd "$${thisdir}"; ${MKDIR_P} "$(DESTDIR)${icondir}/$${dir}" ) ; \
725 for icon in $${dir}/${EMACS_ICON}[.-]*; do \
726 [ -r $${icon} ] || continue ; \
727 ext=`echo "$${icon}" | sed -e 's|.*\.||'`; \
728 dest=`echo "$${icon}" | sed -e 's|.*/||' -e "s|\\.$${ext}\$$||" -e 's/$(EMACS_ICON)/emacs/' -e '$(TRANSFORM)'`.$${ext} ; \
729 ( cd "$${thisdir}"; \
730 ${INSTALL_DATA} ${iconsrcdir}/$${icon} "$(DESTDIR)${icondir}/$${dir}/$${dest}" ) \
731 || exit 1; \
732 done ; \
733 done
735 ### Build Emacs and install it, stripping binaries while installing them.
736 install-strip:
737 $(MAKE) INSTALL_STRIP=-s install
739 ### Delete all the installed files that the 'install' target would
740 ### create (but not the noninstalled files such as 'make all' would create).
742 ### Don't delete the lisp and etc directories if they're in the source tree.
743 uninstall: uninstall-$(NTDIR) uninstall-doc
744 $(MAKE) -C lib-src uninstall
745 -unset CDPATH; \
746 for dir in "$(DESTDIR)${lispdir}" "$(DESTDIR)${etcdir}" ; do \
747 if [ -d "$${dir}" ]; then \
748 case `cd "$${dir}" ; /bin/pwd` in \
749 "`cd ${srcdir} ; /bin/pwd`"* ) ;; \
750 * ) rm -rf "$${dir}" ;; \
751 esac ; \
752 case "$${dir}" in \
753 "$(DESTDIR)${datadir}/emacs/${version}"/* ) \
754 rm -rf "$(DESTDIR)${datadir}/emacs/${version}" \
755 ;; \
756 esac ; \
757 fi ; \
758 done
759 -rm -rf "$(DESTDIR)${libexecdir}/emacs/${version}"
760 thisdir=`/bin/pwd`; \
761 (info_misc=`$(MAKE) --no-print-directory -s -C doc/misc echo-info`; \
762 if cd "$(DESTDIR)${infodir}"; then \
763 for elt in ${INFO_NONMISC} $${info_misc}; do \
764 (cd "$${thisdir}"; \
765 $(INSTALL_INFO) --remove --info-dir="$(DESTDIR)${infodir}" "$(DESTDIR)${infodir}/$$elt"); \
766 if [ -n "${GZIP_PROG}" ]; then \
767 ext=.gz; else ext=; fi; \
768 rm -f $$elt$$ext $$elt-[1-9]$$ext $$elt-[1-9][0-9]$$ext; \
769 done; \
771 (if [ -n "${GZIP_PROG}" ]; then \
772 ext=.gz; else ext=; fi; \
773 if cd ${mansrcdir}; then \
774 for page in *.1; do \
775 rm -f "$(DESTDIR)${man1dir}"/`echo "$${page}" | sed -e 's/\.1$$//' -e '$(TRANSFORM)'`.1$$ext; done; \
777 rm -f "$(DESTDIR)${bindir}/$(EMACS)" "$(DESTDIR)${bindir}/$(EMACSFULL)"
778 (if cd "$(DESTDIR)${icondir}"; then \
779 rm -f hicolor/*x*/apps/"${EMACS_NAME}.png" \
780 "hicolor/scalable/apps/${EMACS_NAME}.svg" \
781 hicolor/scalable/mimetypes/`echo emacs-document | sed '$(TRANSFORM)'`.svg; \
783 -rm -f "$(DESTDIR)${desktopdir}/${EMACS_NAME}.desktop"
784 -rm -f "$(DESTDIR)${appdatadir}/${EMACS_NAME}.appdata.xml"
785 -rm -f "$(DESTDIR)$(systemdunitdir)/${EMACS_NAME}.service"
786 ifneq (,$(use_gamedir))
787 for file in snake-scores tetris-scores; do \
788 file="$(DESTDIR)${gamedir}/$${file}"; \
789 [ -s "$${file}" ] || rm -f "$$file"; \
790 done
791 endif
793 ### Windows-specific uninstall target for removing programs produced
794 ### in nt/, and its Posix do-nothing shadow.
795 uninstall-:
796 uninstall-nt:
797 $(MAKE) -C $(NTDIR) uninstall
799 # ==================== Cleaning up and miscellanea ====================
801 .PHONY: mostlyclean clean distclean bootstrap-clean maintainer-clean extraclean
803 ## Eg:
804 ## src_clean:
805 ## make -C src clean
806 define submake_template
807 .PHONY: $(1)_$(2)
808 $(1)_$(2):
809 $$(MAKE) -C $(1) $(2)
810 endef
812 ### 'mostlyclean'
813 ### Like 'clean', but may refrain from deleting a few files that people
814 ### normally don't want to recompile. For example, the 'mostlyclean'
815 ### target for GCC does not delete 'libgcc.a', because recompiling it
816 ### is rarely necessary and takes a lot of time.
817 mostlyclean_dirs = src oldXMenu lwlib lib lib-src nt doc/emacs doc/misc \
818 doc/lispref doc/lispintro
820 $(foreach dir,$(mostlyclean_dirs),$(eval $(call submake_template,$(dir),mostlyclean)))
822 mostlyclean: $(mostlyclean_dirs:=_mostlyclean)
823 [ ! -d test ] || $(MAKE) -C test $@
825 ### 'clean'
826 ### Delete all files from the current directory that are normally
827 ### created by building the program. Don't delete the files that
828 ### record the configuration. Also preserve files that could be made
829 ### by building, but normally aren't because the distribution comes
830 ### with them.
832 ### Delete '.dvi' files here if they are not part of the distribution.
833 clean_dirs = $(mostlyclean_dirs) nextstep
835 $(foreach dir,$(clean_dirs),$(eval $(call submake_template,$(dir),clean)))
837 clean: $(clean_dirs:=_clean)
838 $(MAKE) -C admin/charsets $@
839 [ ! -d test ] || $(MAKE) -C test $@
840 -rm -f *.tmp etc/*.tmp*
841 -rm -rf info-dir.*
843 ### 'bootclean'
844 ### Delete all files that need to be remade for a clean bootstrap.
845 top_bootclean=\
846 rm -f config.cache config.log ${srcdir}/doc/man/emacs.1
848 ### 'distclean'
849 ### Delete all files from the current directory that are created by
850 ### configuring or building the program. If you have unpacked the
851 ### source and built the program without creating any other files,
852 ### 'make distclean' should leave only the files that were in the
853 ### distribution.
854 top_distclean=\
855 ${top_bootclean}; \
856 rm -f config.status config.log~ \
857 Makefile lib/gnulib.mk ${SUBDIR_MAKEFILES}
859 distclean_dirs = $(clean_dirs) leim lisp
861 $(foreach dir,$(distclean_dirs),$(eval $(call submake_template,$(dir),distclean)))
863 maybeclean_dirs = test admin/grammars admin/unidata admin/charsets
865 distclean: $(distclean_dirs:=_distclean)
866 for dir in $(filter-out test,$(maybeclean_dirs)); do \
867 $(MAKE) -C $$dir $@ || exit; \
868 done
869 [ ! -d test ] || $(MAKE) -C test $@
870 ${top_distclean}
872 ### 'bootstrap-clean'
873 ### Delete everything that can be reconstructed by 'make' and that
874 ### needs to be deleted in order to force a bootstrap from a clean state.
875 $(foreach dir,$(distclean_dirs),$(eval $(call submake_template,$(dir),bootstrap-clean)))
877 bootstrap-clean: $(distclean_dirs:=_bootstrap-clean)
878 for dir in $(filter-out test,$(maybeclean_dirs)); do \
879 $(MAKE) -C $$dir $@ || exit; \
880 done
881 [ ! -d test ] || $(MAKE) -C test $@
882 [ ! -f config.log ] || mv -f config.log config.log~
883 rm -rf ${srcdir}/info
884 rm -f ${srcdir}/etc/refcards/emacsver.tex
885 ${top_bootclean}
887 ### 'maintainer-clean'
888 ### Delete everything from the current directory that can be
889 ### reconstructed with this Makefile. This typically includes
890 ### everything deleted by distclean, plus more: C source files
891 ### produced by Bison, tags tables, info files, and so on.
893 ### One exception, however: 'make maintainer-clean' should not delete
894 ### 'configure' even if 'configure' can be remade using a rule in the
895 ### Makefile. More generally, 'make maintainer-clean' should not delete
896 ### anything that needs to exist in order to run 'configure' and then
897 ### begin to build the program.
898 top_maintainer_clean=\
899 ${top_distclean}; \
900 rm -fr autom4te.cache
902 maintainer_clean_dirs = src leim lisp
904 $(foreach dir,$(maintainer_clean_dirs),$(eval $(call submake_template,$(dir),maintainer-clean)))
906 maintainer-clean: bootstrap-clean $(maintainer_clean_dirs:=_maintainer-clean)
907 for dir in $(filter-out test,$(maybeclean_dirs)); do \
908 $(MAKE) -C $$dir $@ || exit; \
909 done
910 [ ! -d test ] || $(MAKE) -C test $@
911 ${top_maintainer_clean}
913 ### This doesn't actually appear in the coding standards, but Karl
914 ### says GCC supports it, and that's where the configuration part of
915 ### the coding standards seem to come from. It's like distclean, but
916 ### it deletes backup and autosave files too.
917 ### Note that we abuse this in some subdirectories (eg leim),
918 ### to delete some generated files that are slow to rebuild.
919 extraclean_dirs = ${NTDIR} lib-src src leim \
920 admin/charsets admin/grammars admin/unidata
922 $(foreach dir,$(extraclean_dirs),$(eval $(call submake_template,$(dir),extraclean)))
924 extraclean: $(extraclean_dirs:=_extraclean)
925 ${top_maintainer_clean}
926 -rm -f config-tmp-*
927 -rm -f *~ \#*
929 # The src subdir knows how to do the right thing
930 # even when the build directory and source dir are different.
931 .PHONY: TAGS tags
932 TAGS tags: lib lib-src src
933 $(MAKE) -C src tags
935 .PHONY: have-tests
936 have-tests:
937 @if test ! -d test; then \
938 echo "You do not seem to have the test/ directory."; \
939 echo "Maybe you are using a release tarfile, rather than a repository checkout."; \
940 exit 1; \
943 .PHONY: check check-maybe check-expensive check-all
944 check check-maybe check-expensive check-all: have-tests all
945 $(MAKE) -C test $@
947 dist:
948 cd ${srcdir}; ./make-dist
950 DVIS = lispref-dvi lispintro-dvi emacs-dvi misc-dvi
951 HTMLS = lispref-html lispintro-html emacs-html misc-html
952 INFOS = lispref-info lispintro-info emacs-info misc-info
953 PDFS = lispref-pdf lispintro-pdf emacs-pdf misc-pdf
954 PSS = lispref-ps lispintro-ps emacs-ps misc-ps
956 DOCS = $(DVIS) $(HTMLS) $(INFOS) $(PDFS) $(PSS)
957 $(DOCS):
958 $(MAKE) -C doc/$(subst -, ,$@)
960 .PHONY: $(DOCS) docs pdf ps
961 .PHONY: info dvi dist html info-real info-dir check-info
963 ## TODO add etc/refcards.
964 docs: $(DOCS)
965 dvi: $(DVIS)
966 html: $(HTMLS)
967 info-real: $(INFOS)
968 pdf: $(PDFS)
969 ps: $(PSS)
971 info-dir: ${srcdir}/info/dir
973 ## Hopefully doc/misc/*.texi is not too long for some systems?
974 srcdir_doc_info_dir_inputs = \
975 ${srcdir}/doc/emacs/emacs.texi \
976 ${srcdir}/doc/lispintro/emacs-lisp-intro.texi \
977 ${srcdir}/doc/lispref/elisp.texi \
978 $(sort $(wildcard ${srcdir}/doc/misc/*.texi))
979 info_dir_inputs = \
980 ../build-aux/dir_top \
981 $(subst ${srcdir}/doc/,,${srcdir_doc_info_dir_inputs})
982 info_dir_deps = \
983 ${srcdir}/build-aux/make-info-dir \
984 ${srcdir}/build-aux/dir_top \
985 ${srcdir_doc_info_dir_inputs}
987 ## It would be much simpler if info/dir was only created in the
988 ## installation location by the install-info rule, but we also
989 ## need one in the source directory for people running uninstalled.
990 ## FIXME it would be faster to use the install-info program if we have it,
991 ## but then we would need to depend on info-real, which would
992 ## slow down parallelization.
993 ${srcdir}/info/dir: ${info_dir_deps}
994 $(AM_V_at)${MKDIR_P} ${srcdir}/info
995 $(AM_V_GEN)(cd ${srcdir}/doc && \
996 AWK='${AWK}' ../build-aux/make-info-dir ${info_dir_inputs} \
997 ) >$@.tmp && mv $@.tmp $@
999 INSTALL_DVI = install-emacs-dvi install-lispref-dvi \
1000 install-lispintro-dvi install-misc-dvi
1001 INSTALL_HTML = install-emacs-html install-lispref-html \
1002 install-lispintro-html install-misc-html
1003 INSTALL_PDF = install-emacs-pdf install-lispref-pdf \
1004 install-lispintro-pdf install-misc-pdf
1005 INSTALL_PS = install-emacs-ps install-lispref-ps \
1006 install-lispintro-ps install-misc-ps
1007 INSTALL_DOC = $(INSTALL_DVI) $(INSTALL_HTML) $(INSTALL_PDF) $(INSTALL_PS)
1009 ## Install non .info forms of the documentation.
1010 ## TODO add etc/refcards.
1011 $(INSTALL_DOC):
1012 $(MAKE) -C doc/$(subst -, install-,$(subst install-,,$@))
1014 .PHONY: $(INSTALL_DOC) install-doc
1015 .PHONY: install-dvi install-html install-pdf install-ps
1017 install-doc: $(INSTALL_DOC)
1018 install-dvi: $(INSTALL_DVI)
1019 install-html: $(INSTALL_HTML)
1020 install-pdf: $(INSTALL_PDF)
1021 install-ps: $(INSTALL_PS)
1024 UNINSTALL_DVI = uninstall-emacs-dvi uninstall-lispref-dvi \
1025 uninstall-lispintro-dvi uninstall-misc-dvi
1026 UNINSTALL_HTML = uninstall-emacs-html uninstall-lispref-html \
1027 uninstall-lispintro-html uninstall-misc-html
1028 UNINSTALL_PDF = uninstall-emacs-pdf uninstall-lispref-pdf \
1029 uninstall-lispintro-pdf uninstall-misc-pdf
1030 UNINSTALL_PS = uninstall-emacs-ps uninstall-lispref-ps \
1031 uninstall-lispintro-ps uninstall-misc-ps
1032 UNINSTALL_DOC = $(UNINSTALL_DVI) $(UNINSTALL_HTML) $(UNINSTALL_PDF) $(UNINSTALL_PS)
1034 $(UNINSTALL_DOC):
1035 $(MAKE) -C doc/$(subst -, uninstall-,$(subst uninstall-,,$@))
1037 .PHONY: $(UNINSTALL_DOC) uninstall-doc
1038 .PHONY: uninstall-dvi uninstall-html uninstall-pdf uninstall-ps
1040 uninstall-doc: $(UNINSTALL_DOC)
1041 uninstall-dvi: $(UNINSTALL_DVI)
1042 uninstall-html: $(UNINSTALL_HTML)
1043 uninstall-pdf: $(UNINSTALL_PDF)
1044 uninstall-ps: $(UNINSTALL_PS)
1047 # Note that man/Makefile knows how to put the info files in $(srcdir),
1048 # so we can do ok running make in the build dir.
1049 # This used to have a clause that exited with an error if MAKEINFO = no.
1050 # But it is inappropriate to do so without checking if makeinfo is
1051 # actually needed - it is not if the info files are up-to-date. (Bug#3982)
1052 # Only the doc/*/Makefiles can decide that, so we let those rules run
1053 # and give a standard error if makeinfo is needed but missing.
1054 # While it would be nice to give a more detailed error message, that
1055 # would require changing every rule in doc/ that builds an info file,
1056 # and it's not worth it. This case is only relevant if you download a
1057 # release, then change the .texi files.
1058 info:
1059 ifneq ($(HAVE_MAKEINFO),no)
1060 $(MAKE) info-real info-dir
1061 endif
1063 ## build-aux/make-info-dir expects only certain dircategories.
1064 check-info: info
1065 cd info ; \
1066 bad= ; \
1067 for file in *; do \
1068 test -f "$${file}" || continue ; \
1069 case $${file} in \
1070 *-[0-9]*|COPYING|dir) continue ;; \
1071 esac ; \
1072 cat=`sed -n 's/^INFO-DIR-SECTION //p' $${file}`; \
1073 case $${cat} in \
1074 "Texinfo documentation system" | "Emacs"| "Emacs lisp" | \
1075 "Emacs editing modes" | "Emacs network features" | \
1076 "Emacs misc features" | "Emacs lisp libraries" ) : ;; \
1077 *) bad="$${bad} $${file}" ;; \
1078 esac; \
1079 done ; \
1080 if test -n "$${bad}"; then \
1081 echo "Unexpected dircategory in: $${bad}" ; \
1082 exit 1 ; \
1083 fi ; \
1084 echo "info files are OK"
1086 #### Bootstrapping.
1088 ### This first cleans the lisp subdirectory, removing all compiled
1089 ### Lisp files. Then re-run make to build all the files anew.
1091 .PHONY: bootstrap
1093 # Bootstrapping does the following:
1094 # * Remove files to start from a bootstrap-clean slate.
1095 # * Run autogen.sh.
1096 # * Rebuild Makefile, to update the build procedure itself.
1097 # * Do the actual build.
1098 bootstrap: bootstrap-clean
1099 cd $(srcdir) && ./autogen.sh autoconf
1100 $(MAKE) MAKEFILE_NAME=force-Makefile force-Makefile
1101 $(MAKE) all
1103 .PHONY: ChangeLog change-history change-history-commit change-history-nocommit
1104 .PHONY: preferred-branch-is-current unchanged-history-files
1106 CHANGELOG = ChangeLog
1107 emacslog = build-aux/gitlog-to-emacslog
1108 # The ChangeLog history files are called ChangeLog.1, ChangeLog.2, ...,
1109 # ChangeLog.$(CHANGELOG_HISTORY_INDEX_MAX). $(CHANGELOG_N) stands for
1110 # the newest (highest-numbered) ChangeLog history file.
1111 CHANGELOG_HISTORY_INDEX_MAX = 3
1112 CHANGELOG_N = ChangeLog.$(CHANGELOG_HISTORY_INDEX_MAX)
1114 # Convert git commit log to ChangeLog file. make-dist uses this.
1115 # I guess this is PHONY so it always updates?
1116 ChangeLog:
1117 $(AM_V_GEN)cd $(srcdir) && \
1118 ./$(emacslog) -o $(CHANGELOG) -n $(CHANGELOG_HISTORY_INDEX_MAX)
1120 # Check that we are in a good state for changing history.
1121 PREFERRED_BRANCH = emacs-26
1122 preferred-branch-is-current:
1123 git branch | grep -q '^\* $(PREFERRED_BRANCH)$$'
1124 unchanged-history-files:
1125 x=$$(git diff-files --name-only $(CHANGELOG_N) $(emacslog)) && \
1126 test -z "$$x"
1128 # Regular expression that matches the newest commit covered by a ChangeLog.
1129 new_commit_regexp = ^commit [0123456789abcdef]* (inclusive)
1131 # Copy newer commit messages to the start of the ChangeLog history file,
1132 # and consider them to be older.
1133 change-history-nocommit: preferred-branch-is-current unchanged-history-files
1134 -rm -f ChangeLog.tmp
1135 $(MAKE) ChangeLog CHANGELOG=ChangeLog.tmp
1136 sed '/^This file records repository revisions/,$$d' \
1137 ChangeLog.tmp >$(CHANGELOG_N).tmp
1138 new_commit_line=`grep '$(new_commit_regexp)' ChangeLog.tmp` && \
1139 sed 's/$(new_commit_regexp).*/'"$$new_commit_line/" \
1140 $(CHANGELOG_N) >>$(CHANGELOG_N).tmp
1141 rm ChangeLog.tmp
1142 mv $(CHANGELOG_N).tmp $(CHANGELOG_N)
1144 change-history: change-history-nocommit
1145 $(MAKE) $@-commit
1147 # If 'make change-history' fails because the newest ChangeLog history
1148 # file contains invalid text, fix the file by hand and then run
1149 # 'make change-history-commit'.
1150 change-history-commit:
1151 git commit -m'; make $@' $(CHANGELOG_N) $(emacslog)
1153 .PHONY: check-declare
1155 check-declare:
1156 @if [ ! -f $(srcdir)/src/emacs ]; then \
1157 echo "You must build Emacs to use this command"; \
1158 exit 1; \
1160 $(MAKE) -C lisp $@