Attempt to make defclass documentation more legible
[emacs.git] / Makefile.in
blobb7502880230a85a5767dc30b59e12d995353bf45
1 ### @configure_input@
3 # Copyright (C) 1992-2021 Free Software Foundation, Inc.
5 # This file is part of GNU Emacs.
7 # GNU Emacs is free software: you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation, either version 3 of the License, or
10 # (at your option) any later version.
12 # GNU Emacs is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
20 ### Commentary:
22 # make all to compile and build Emacs.
23 # make install to install it.
24 # make TAGS to update tags tables.
26 # make clean or make mostlyclean
27 # Delete all files from the current directory that are normally
28 # created by building the program. Don't delete the files that
29 # record the configuration. Also preserve files that could be made
30 # by building, but normally aren't because the distribution comes
31 # with them.
33 # Delete '.dvi' files here if they are not part of the distribution.
35 # make distclean
36 # Delete all files from the current directory that are created by
37 # configuring or building the program. If you have unpacked the
38 # source and built the program without creating any other files,
39 # 'make distclean' should leave only the files that were in the
40 # distribution.
42 # make maintainer-clean
43 # Delete everything from the current directory that can be
44 # reconstructed with this Makefile. This typically includes
45 # everything deleted by distclean, plus more: .elc files,
46 # C source files produced by Bison, tags tables, info files,
47 # and so on.
49 # make extraclean
50 # Still more severe - delete backup and autosave files, too.
52 # make bootstrap
53 # Removes all the compiled files to force a new bootstrap from a
54 # clean slate, and then build in the normal way.
56 # make docs
57 # Make Emacs documentation files from their sources; requires makeinfo.
59 # make check (or check-expensive or check-all)
60 # Run the Emacs test suite.
61 # check-expensive includes additional tests that can be slow.
62 # check-all runs all tests, including ones that can be slow, or
63 # fail unpredictably
65 SHELL = @SHELL@
67 DUMPING=@DUMPING@
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 top_builddir = @top_builddir@
97 -include ${top_builddir}/src/verbose.mk
99 FIND_DELETE = @FIND_DELETE@
101 HAVE_NATIVE_COMP = @HAVE_NATIVE_COMP@
103 USE_STARTUP_NOTIFICATION = @USE_STARTUP_NOTIFICATION@
105 # ==================== Where To Install Things ====================
107 # Location to install Emacs.app under GNUstep / macOS.
108 # Later values may use these.
109 ns_appbindir=@ns_appbindir@
110 ns_appresdir=@ns_appresdir@
111 # Either yes or no depending on whether this is a relocatable Emacs.app.
112 ns_self_contained=@ns_self_contained@
114 # The default location for installation. Everything is placed in
115 # subdirectories of this directory. The default values for many of
116 # the variables below are expressed in terms of this one, so you may
117 # not need to change them. This defaults to /usr/local.
118 prefix=@prefix@
120 # Like 'prefix', but used for architecture-specific files.
121 exec_prefix=@exec_prefix@
123 # Where to install Emacs and other binaries that people will want to
124 # run directly (like etags).
125 bindir=@bindir@
127 # The root of the directory tree for read-only architecture-independent
128 # data files. ${datadir}, ${infodir} and ${mandir} are based on this.
129 datarootdir=@datarootdir@
131 # Where to install architecture-independent data files. ${lispdir}
132 # and ${etcdir} are subdirectories of this.
133 datadir=@datadir@
135 # Where to install and expect the files that Emacs modifies as it
136 # runs. These files are all architecture-independent.
137 # Right now, this is not used.
138 sharedstatedir=@sharedstatedir@
140 # Where to install and expect executable files to be run by Emacs
141 # rather than directly by users (and other architecture-dependent
142 # data, although Emacs does not have any). The executables
143 # are actually installed in ${archlibdir}, which is (normally)
144 # a subdirectory of this.
145 libexecdir=@libexecdir@
147 # Currently only used for the systemd service file.
148 libdir=@libdir@
150 # Where to install emacs-module.h.
151 includedir=@includedir@
153 # Where to install Emacs's man pages.
154 # Note they contain cross-references that expect them to be in section 1.
155 mandir=@mandir@
156 man1dir=$(mandir)/man1
158 # Where to install and expect the info files describing Emacs.
159 infodir=@infodir@
160 # Info files not in the doc/misc directory (we get those via make echo-info).
161 INFO_NONMISC=emacs.info eintr.info elisp.info
163 # Directory for local state files for all programs.
164 localstatedir=@localstatedir@
166 # Where to look for bitmap files.
167 bitmapdir=@bitmapdir@
169 # Where to find the source code. The source code for Emacs's C kernel is
170 # expected to be in ${srcdir}/src, and the source code for Emacs's
171 # utility programs is expected to be in ${srcdir}/lib-src. This is
172 # set by the configure script's '--srcdir' option.
174 # We use $(srcdir) explicitly in dependencies so as not to depend on VPATH.
175 srcdir=@srcdir@
176 abs_srcdir=@abs_srcdir@
178 # Where the manpage source files are kept.
179 mansrcdir=$(srcdir)/doc/man
181 # Tell make where to find source files; this is needed for the makefiles.
182 VPATH=@srcdir@
184 # Where to find the application default.
185 x_default_search_path=@x_default_search_path@
187 # Where the etc/emacs.desktop file is to be installed.
188 desktopdir=$(datarootdir)/applications
190 # Where the etc/emacs.metainfo.xml file is to be installed.
191 metainfodir=$(datarootdir)/metainfo
193 # Where the etc/emacs.service file is to be installed.
194 # The system value (typically /usr/lib/systemd/user) can be
195 # obtained with: pkg-config --variable=systemduserunitdir systemd
196 # but that does not respect configure's prefix.
197 # It is not clear where we should install this file when
198 # prefix != /usr (or /usr/local?) (eg for non-root installs).
199 # Other options include ~/.config/systemd/user/,
200 # $XDG_RUNTIME_DIR/systemd/user/
201 # It seems the user may end up having to make a manual link...
202 systemdunitdir=$(libdir)/systemd/user
204 # Where the etc/images/icons/hicolor directory is to be installed.
205 icondir=$(datarootdir)/icons
207 # The source directory for the icon files.
208 iconsrcdir=$(srcdir)/etc/images/icons
210 # ==================== Emacs-specific directories ====================
212 # These variables hold the values Emacs will actually use. They are
213 # based on the values of the standard Make variables above.
215 # Where lisp files are installed in a distributed with Emacs (relative
216 # path to the installation directory).
217 lispdirrel=@lispdirrel@
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 ${srcdir}/src/emacs-module.h.in \
319 ${srcdir}/src/module-env-*.h
321 # Subdirectories to install, and where they'll go. lib-src's and nt's
322 # makefiles know how to install them, so we don't do that here.
323 # Directories that cannot simply be copied, eg info, are treated
324 # separately.
325 COPYDIR = ${srcdir}/etc ${srcdir}/lisp
326 COPYDESTS = "$(DESTDIR)${etcdir}" "$(DESTDIR)${lispdir}"
328 ifeq (${ns_self_contained},no)
329 BIN_DESTDIR='$(DESTDIR)${bindir}/'
330 ELN_DESTDIR = $(DESTDIR)${libdir}/emacs/${version}/
331 else
332 BIN_DESTDIR='${ns_appbindir}/'
333 ELN_DESTDIR = ${ns_appresdir}/
334 endif
336 all: ${SUBDIR} info
338 .PHONY: all ${SUBDIR} blessmail epaths-force epaths-force-w32 etc-emacsver
340 # If configure were to just generate emacsver.tex from emacsver.tex.in
341 # in the normal way, the timestamp of emacsver.tex would always be
342 # newer than that of the pdf files, which are prebuilt in release tarfiles.
343 # So we use this rule, and move-if-change, to avoid that.
344 etc-emacsver:
345 majorversion=`echo ${version} | sed 's/\..*//'`; \
346 sed "s/[@]majorversion@/$${majorversion}/" \
347 ${srcdir}/etc/refcards/emacsver.tex.in > emacsver.tex.$$$$ && \
348 ${srcdir}/build-aux/move-if-change emacsver.tex.$$$$ \
349 ${srcdir}/etc/refcards/emacsver.tex
351 # The shared gamedir name as a C string literal, or a null ptr if not in use.
352 PATH_GAME = $(if $(use_gamedir),"$(gamedir)",((char const *) 0))
354 # Generate epaths.h from epaths.in. This target is invoked by 'configure'.
355 # See comments in configure.ac for why it is done this way, as opposed
356 # to just letting configure generate epaths.h from epaths.in in a
357 # similar way to how Makefile is made from Makefile.in.
358 epaths-force:
359 @for dir in '$(abs_srcdir)' '$(lispdir)' '$(archlibdir)'; do \
360 case $$dir in \
361 *:*) \
362 printf >&2 "Build or installation directory '%s'\\n" "$$dir"; \
363 echo >&2 "cannot contain ':'."; \
364 exit 1;; \
365 esac; \
366 done
367 @(gamedir='${gamedir}'; \
368 sed < ${srcdir}/src/epaths.in > epaths.h.$$$$ \
369 -e 's;\(#.*PATH_LOADSEARCH\).*$$;\1 "${standardlisppath}";' \
370 -e 's;\(#.*PATH_REL_LOADSEARCH\).*$$;\1 "${lispdirrel}";' \
371 -e 's;\(#.*PATH_SITELOADSEARCH\).*$$;\1 "${locallisppath}";' \
372 -e 's;\(#.*PATH_DUMPLOADSEARCH\).*$$;\1 "${buildlisppath}";' \
373 -e '/^#define PATH_[^ ]*SEARCH /s/\([":]\):*/\1/g' \
374 -e '/^#define PATH_[^ ]*SEARCH /s/:"/"/' \
375 -e 's;\(#.*PATH_EXEC\).*$$;\1 "${archlibdir}";' \
376 -e 's;\(#.*PATH_INFO\).*$$;\1 "${infodir}";' \
377 -e 's;\(#.*PATH_DATA\).*$$;\1 "${etcdir}";' \
378 -e 's;\(#.*PATH_BITMAPS\).*$$;\1 "${bitmapdir}";' \
379 -e 's;\(#.*PATH_X_DEFAULTS\).*$$;\1 "${x_default_search_path}";' \
380 -e 's;\(#.*PATH_GAME\).*$$;\1 $(PATH_GAME);' \
381 -e 's;\(#.*PATH_DOC\).*$$;\1 "${etcdocdir}";') && \
382 ${srcdir}/build-aux/move-if-change epaths.h.$$$$ src/epaths.h
384 # The w32 build needs a slightly different editing, and it uses
385 # nt/epaths.nt as the template.
387 # Use the value of ${locallisppath} supplied by 'configure',
388 # to support the --enable-locallisppath argument.
390 # In this case, the paths written to 'src/epaths.h' must be in native
391 # MS-Windows format (e.g. 'c:/foo/bar'), because temacs is a MinGW
392 # program that doesn't support MSYS-style paths (e.g. '/c/foo/bar' or
393 # '/foo/bar').
394 epaths-force-w32:
395 @(w32srcdir=`${srcdir}/build-aux/msys-to-w32 "${abs_srcdir}"`; \
396 w32prefix=`${srcdir}/build-aux/msys-to-w32 "${prefix}"`; \
397 w32locallisppath=`${srcdir}/build-aux/msys-to-w32 "${locallisppath}"` ; \
398 w32locallisppath=$${w32locallisppath//$${w32prefix}/"%emacs_dir%"} ; \
399 sed < ${srcdir}/nt/epaths.nt > epaths.h.$$$$ \
400 -e 's;\(#.*PATH_SITELOADSEARCH\).*$$;\1 "'"$${w32locallisppath//;/\\;}"'";' \
401 -e 's;\(#.*PATH_REL_LOADSEARCH\).*$$;\1 "${lispdirrel}";' \
402 -e '/^.*#/s/@VER@/${version}/g' \
403 -e '/^.*#/s/@CFG@/${configuration}/g' \
404 -e "/^.*#/s|@SRC@|$${w32srcdir}|g") && \
405 ${srcdir}/build-aux/move-if-change epaths.h.$$$$ src/epaths.h
407 lib-src src: $(NTDIR) lib
409 src: lib-src
411 # We need to build 'emacs' in 'src' to compile the *.elc files in 'lisp'.
412 lisp: src
414 # These targets should be "${SUBDIR} without 'src'".
415 lib lib-src lisp nt: Makefile
416 $(MAKE) -C $@ all
418 # Ideally, VCSWITNESS should be a file that is modified whenever the
419 # repository registers a commit from either a local checkin or a
420 # repository pull. In git there is no single file that guarantees
421 # this, but the local log for the current head should be close enough.
423 # Pass an unexpanded $srcdir to src's Makefile, which then
424 # expands it using its own value of srcdir (which points to the
425 # source directory of src/).
426 dirstate = .git/logs/HEAD
427 VCSWITNESS = $(if $(wildcard $(srcdir)/$(dirstate)),$$(srcdir)/../$(dirstate))
428 src: Makefile
429 $(MAKE) -C $@ VCSWITNESS='$(VCSWITNESS)' BIN_DESTDIR='$(BIN_DESTDIR)' \
430 ELN_DESTDIR='$(ELN_DESTDIR)' all
432 blessmail: Makefile src
433 $(MAKE) -C lib-src maybe-blessmail
435 # We used to have one rule per */Makefile.in, but that leads to race
436 # conditions with parallel makes, so assume that the timestamp on
437 # ./Makefile represents the timestamp on all the other Makefiles.
438 # Similarly, assume the timestamp on ./configure represents the
439 # timestamp on src/config.in.
441 # config.status overrides MAKEFILE_NAME with a bogus name when creating
442 # src/epaths.h, so that 'make epaths-force' does not recursively invoke
443 # config.status and overwrite config.status while executing it (Bug#11214).
445 # 'make bootstrap' overrides MAKEFILE_NAME to a nonexistent file but
446 # then attempts to build that file. This forces 'Makefile', 'lib/Makefile',
447 # etc. to be built without running into similar recursion problems.
448 MAKEFILE_NAME = Makefile
449 $(MAKEFILE_NAME): config.status $(srcdir)/configure \
450 $(srcdir)/lib/gnulib.mk.in \
451 $(srcdir)/Makefile.in $(SUBDIR_MAKEFILES_IN) $(CONFIG_STATUS_FILES_IN)
452 MAKE='$(MAKE)' ./config.status
454 # Don't erase these files if make is interrupted while refreshing them.
455 .PRECIOUS: Makefile config.status
457 config.status: ${srcdir}/configure
458 if [ -x ./config.status ]; then \
459 $(CFG) ./config.status --recheck; \
460 else \
461 $(CFG) $(srcdir)/configure $(CONFIGURE_FLAGS); \
464 $(srcdir)/configure: $(srcdir)/configure.ac $(srcdir)/m4/*.m4
465 cd $(srcdir) && ./autogen.sh autoconf
467 # ==================== Installation ====================
469 .PHONY: install install-arch-dep install-arch-indep install-etcdoc install-info
470 .PHONY: install-man install-etc install-strip install-$(NTDIR) install-eln
471 .PHONY: uninstall uninstall-$(NTDIR)
473 ## If we let lib-src do its own installation, that means we
474 ## don't have to duplicate the list of utilities to install in
475 ## this Makefile as well.
477 install: all install-arch-indep install-etcdoc install-arch-dep install-$(NTDIR) blessmail install-eln
478 @true
480 ## Ensure that $subdir contains a subdirs.el file.
481 ## Here and elsewhere, we set the umask so that any created files are
482 ## world-readable.
483 ## TODO it might be good to warn about non-standard permissions of
484 ## pre-existing directories, but that does not seem easy.
485 write_subdir=if [ -f "$${subdir}/subdirs.el" ]; \
486 then true; \
487 else \
488 umask 022; \
489 ${MKDIR_P} "$${subdir}"; \
490 (echo "(if (fboundp 'normal-top-level-add-subdirs-to-load-path)"; \
491 echo " (normal-top-level-add-subdirs-to-load-path))") \
492 > "$${subdir}/subdirs.el"; \
495 ### Install the executables that were compiled specifically for this machine.
496 ### We do install-arch-indep first because the executable needs the
497 ### Lisp files and DOC file to work properly.
498 install-arch-dep: src install-arch-indep install-etcdoc install-$(NTDIR)
499 umask 022; ${MKDIR_P} "$(DESTDIR)${bindir}"
500 $(MAKE) -C lib-src install
501 ifeq (${ns_self_contained},no)
502 ${INSTALL_PROGRAM} $(INSTALL_STRIP) src/emacs${EXEEXT} "$(DESTDIR)${bindir}/$(EMACSFULL)"
503 ifeq (${DUMPING},pdumper)
504 ${INSTALL_DATA} src/emacs.pdmp "$(DESTDIR)${libexecdir}/emacs/${version}/${configuration}"/emacs.pdmp
505 endif
506 -chmod 755 "$(DESTDIR)${bindir}/$(EMACSFULL)"
507 ifndef NO_BIN_LINK
508 rm -f "$(DESTDIR)${bindir}/$(EMACS)"
509 cd "$(DESTDIR)${bindir}" && $(LN_S_FILEONLY) "$(EMACSFULL)" "$(EMACS)"
510 endif
511 else
512 subdir=${ns_appresdir}/site-lisp && ${write_subdir}
513 rm -rf ${ns_appresdir}/share
514 endif
516 ### Windows-specific install target for installing programs produced
517 ### in nt/, and its Posix do-nothing shadow.
518 install-:
519 install-nt:
520 $(MAKE) -C $(NTDIR) install
522 ## In the share directory, we are deleting:
523 ## applications (with emacs.desktop, also found in etc/)
524 ## emacs (basically empty except for unneeded site-lisp directories)
525 ## icons (duplicates etc/images/icons/hicolor)
527 ## This is install-etc for everything except self-contained-ns builds.
528 ## For them, it is empty.
529 INSTALL_ARCH_INDEP_EXTRA = @INSTALL_ARCH_INDEP_EXTRA@
531 ## https://lists.gnu.org/r/emacs-devel/2007-10/msg01672.html
532 ## Needs to be the user running install, so configure can't set it.
533 set_installuser=for installuser in $${LOGNAME} $${USERNAME} $${USER} \
534 `(id -u) 2> /dev/null`; do \
535 [ -n "$${installuser}" ] && break ; \
536 done; \
537 installgroup=`(id -g) 2>/dev/null` && [ -n "$$installgroup" ] && \
538 installuser=$$installuser:$$installgroup
540 ### Install the files that are machine-independent.
541 ### Most of them come straight from the distribution; the exception is
542 ### the DOC file, which is copied from the build directory.
544 ## We delete each directory in ${COPYDESTS} before we copy into it;
545 ## that way, we can reinstall over directories that have been put in
546 ## place with their files read-only (perhaps because they are checked
547 ## into RCS). In order to make this safe, we make sure that the
548 ## source exists and is distinct from the destination.
550 ## We delete etc/DOC* because there may be irrelevant DOC files from
551 ## other builds in the source directory. This is ok because we just
552 ## deleted the entire installed etc/ directory and recreated it.
553 ## install-etcdoc installs the relevant DOC.
555 ## Note that we install etc/refcards/*.ps if present.
556 ## TODO we should compress these if GZIP_PROG is set.
557 ## It would be simpler to have a separate install rule for etc/refcards
558 ## (maybe move it to doc/refcards?).
560 ## Note that the Makefiles in the etc directory are potentially useful
561 ## in an installed Emacs, so should not be excluded.
563 ## We always create the _default_ locallisppath directories, and
564 ## ensure that they contain a subdirs.el file (via write_subdir).
565 ## This is true even if locallisppath has a non-default value.
566 ## In case of non-default value, we used to create the specified directories,
567 ## but not add subdirs.el to them. This was a strange halfway house.
568 ## Nowadays we do not create non-default directories.
570 ## Note that we use tar instead of plain old cp -R/-r because the latter
571 ## is apparently not portable (even in 2012!).
572 ## https://lists.gnu.org/r/emacs-devel/2012-05/msg00278.html
573 ## I have no idea which platforms Emacs supports where cp -R does not
574 ## work correctly, and therefore no idea when tar can be replaced.
575 ## See also these comments from 2004 about cp -r working fine:
576 ## https://lists.gnu.org/r/autoconf-patches/2004-11/msg00005.html
577 install-arch-indep: lisp install-info install-man ${INSTALL_ARCH_INDEP_EXTRA}
578 umask 022 && $(MKDIR_P) "$(DESTDIR)$(includedir)"
579 $(INSTALL_DATA) src/emacs-module.h "$(DESTDIR)$(includedir)/emacs-module.h"
580 -set ${COPYDESTS} ; \
581 unset CDPATH; \
582 $(set_installuser); \
583 for dir in ${COPYDIR} ; do \
584 [ -d $${dir} ] || exit 1 ; \
585 dest="$$1" ; shift ; \
586 if [ -d "$${dest}" ]; then \
587 exp_dest=`cd "$${dest}" && /bin/pwd`; \
588 [ "$$exp_dest" = "`cd $${dir} && /bin/pwd`" ] && continue ; \
589 else true; \
590 fi; \
591 rm -rf "$${dest}" ; \
592 umask 022; ${MKDIR_P} "$${dest}" ; \
593 printf 'Copying %s to %s...\n' "$$dir" "$$dest" ; \
594 (cd $${dir}; tar -chf - . ) \
595 | (cd "$${dest}"; umask 022; \
596 tar -xvf - && cat > /dev/null) || exit 1; \
597 if [ "$${dir}" = "${srcdir}/etc" ]; then \
598 rm -f "$${dest}/DOC"* ; \
599 rm -f "$${dest}/refcards"/*.aux "$${dest}/refcards"/*.dvi; \
600 rm -f "$${dest}/refcards"/*.log "$${dest}/refcards"/*.in; \
601 else true; \
602 fi; \
603 (cd "$${dest}" || exit 1; \
604 for subdir in `find . -type d -print` ; do \
605 chmod a+rx $${subdir} ; \
606 rm -f $${subdir}/.gitignore ; \
607 rm -f $${subdir}/.arch-inventory ; \
608 rm -f $${subdir}/.DS_Store ; \
609 rm -f $${subdir}/#* ; \
610 rm -f $${subdir}/.#* ; \
611 rm -f $${subdir}/*~ ; \
612 rm -f $${subdir}/*.orig ; \
613 rm -f $${subdir}/ChangeLog* ; \
614 [ "$${dir}" != "${srcdir}/etc" ] && \
615 rm -f $${subdir}/[mM]akefile*[.-]in $${subdir}/[mM]akefile ; \
616 done ); \
617 find "$${dest}" -exec chown $${installuser} {} ';' ;\
618 done
619 -rm -f "$(DESTDIR)${lispdir}/subdirs.el"
620 umask 022; $(srcdir)/build-aux/update-subdirs "$(DESTDIR)${lispdir}"
621 subdir="$(DESTDIR)${datadir}/emacs/${version}/site-lisp" ; \
622 ${write_subdir}
623 subdir="$(DESTDIR)${datadir}/emacs/site-lisp" ; \
624 ${write_subdir} || true
625 [ -z "${GZIP_PROG}" ] || { \
626 echo "Compressing *.el etc. ..." && \
627 cd "$(DESTDIR)${lispdir}" && \
628 for f in `find . -name "*.elc" -print | sed 's/.elc$$/.el/'`; do \
629 ${GZIP_PROG} -9n "$$f"; \
630 done; \
631 ${GZIP_PROG} -9n "../etc/publicsuffix.txt"; \
633 -chmod -R a+r "$(DESTDIR)${datadir}/emacs/${version}" ${COPYDESTS}
635 ## The above chmods are needed because "umask 022; tar ..." is not
636 ## guaranteed to do the right thing; eg if we are root and tar is
637 ## preserving source permissions.
639 ## Note that install-arch-indep deletes and recreates the entire
640 ## installed etc/ directory, so we need it to run before this does.
641 install-etcdoc: src install-arch-indep
642 -unset CDPATH; \
643 umask 022; ${MKDIR_P} "$(DESTDIR)${etcdocdir}" ; \
644 exp_etcdocdir=`cd "$(DESTDIR)${etcdocdir}"; /bin/pwd`; \
645 if [ "`cd ./etc; /bin/pwd`" != "$$exp_etcdocdir" ]; \
646 then \
647 docfile="DOC"; \
648 printf 'Copying %s to %s ...\n' "etc/$$docfile" \
649 "$(DESTDIR)${etcdocdir}"; \
650 ${INSTALL_DATA} etc/$${docfile} "$(DESTDIR)${etcdocdir}/$${docfile}"; \
651 $(set_installuser); \
652 chown $${installuser} "$(DESTDIR)${etcdocdir}/$${docfile}" || true ; \
653 else true; fi
655 ## FIXME:
656 ## If info/dir is missing, but we have install-info, we should let
657 ## that handle it. If info/dir is present and we do not have install-info,
658 ## we should check for missing entries and add them by hand.
659 install-info: info
660 umask 022; ${MKDIR_P} "$(DESTDIR)${infodir}"
661 -unset CDPATH; \
662 thisdir=`/bin/pwd`; \
663 exp_infodir=`cd "$(DESTDIR)${infodir}" && /bin/pwd`; \
664 if [ "`cd ${srcdir}/info && /bin/pwd`" = "$$exp_infodir" ]; then \
665 true; \
666 else \
667 [ -f "$(DESTDIR)${infodir}/dir" ] || \
668 [ ! -f ${srcdir}/info/dir ] || \
669 ${INSTALL_DATA} ${srcdir}/info/dir "$(DESTDIR)${infodir}/dir"; \
670 info_misc=`MAKEFLAGS= $(MAKE) --no-print-directory -s -C doc/misc echo-info`; \
671 cd ${srcdir}/info ; \
672 for elt in ${INFO_NONMISC} $${info_misc}; do \
673 for f in `ls $$elt $$elt-[1-9] $$elt-[1-9][0-9] 2>/dev/null`; do \
674 (cd "$${thisdir}"; \
675 ${INSTALL_DATA} ${srcdir}/info/$$f "$(DESTDIR)${infodir}/$$f"); \
676 [ -n "${GZIP_PROG}" ] || continue ; \
677 rm -f "$(DESTDIR)${infodir}/$$f.gz"; \
678 ${GZIP_PROG} -9n "$(DESTDIR)${infodir}/$$f"; \
679 done; \
680 (cd "$${thisdir}"; \
681 ${INSTALL_INFO} --info-dir="$(DESTDIR)${infodir}" "$(DESTDIR)${infodir}/$$elt"); \
682 done; \
685 ## "gzip || true" is because some gzips exit with non-zero status
686 ## if compression would not reduce the file size. Eg, the gzip in
687 ## OpenBSD 4.9 seems to do this (2013/03). In Emacs, this can
688 ## only happen with the tiny ctags.1 manpage. We don't really care if
689 ## ctags.1 is compressed or not. "gzip -f" is another option here,
690 ## but not sure if portable.
691 install-man:
692 umask 022; ${MKDIR_P} "$(DESTDIR)${man1dir}"
693 thisdir=`/bin/pwd`; \
694 cd ${mansrcdir}; \
695 for page in *.1; do \
696 test "$$page" = ChangeLog.1 && continue; \
697 dest=`echo "$${page}" | sed -e 's/\.1$$//' -e '$(TRANSFORM)'`.1; \
698 (cd "$${thisdir}"; \
699 ${INSTALL_DATA} ${mansrcdir}/$${page} "$(DESTDIR)${man1dir}/$${dest}"); \
700 [ -n "${GZIP_PROG}" ] || continue ; \
701 rm -f "$(DESTDIR)${man1dir}/$${dest}.gz"; \
702 ${GZIP_PROG} -9n "$(DESTDIR)${man1dir}/$${dest}" || true; \
703 done
705 ## Install those items from etc/ that need to end up elsewhere.
707 ## If you prefer, choose "emacs22" at installation time.
708 ## Note: emacs22 does not have all the resolutions.
709 EMACS_ICON=emacs
711 ifeq (${USE_STARTUP_NOTIFICATION},no)
712 USE_STARTUP_NOTIFICATION_SED_CMD=-e "/^StartupNotify=true$$/d"
713 endif
714 install-etc:
715 umask 022; ${MKDIR_P} "$(DESTDIR)${desktopdir}"
716 tmp=etc/emacs.tmpdesktop; rm -f $${tmp}; \
717 sed -e "/^Exec=emacs/ s/emacs/${EMACS_NAME}/" \
718 -e "/^Icon=emacs/ s/emacs/${EMACS_NAME}/" \
719 $(USE_STARTUP_NOTIFICATION_SED_CMD) \
720 ${srcdir}/etc/emacs.desktop > $${tmp}; \
721 ${INSTALL_DATA} $${tmp} "$(DESTDIR)${desktopdir}/${EMACS_NAME}.desktop"; \
722 rm -f $${tmp}
723 tmp=etc/emacsclient.tmpdesktop; rm -f $${tmp}; \
724 client_name=`echo emacsclient | sed '$(TRANSFORM)'`${EXEEXT}; \
725 sed -e "/^Exec=emacsclient/ s|emacsclient|${bindir}/$${client_name}|" \
726 -e "/^Icon=emacs/ s/emacs/${EMACS_NAME}/" \
727 $(USE_STARTUP_NOTIFICATION_SED_CMD) \
728 ${srcdir}/etc/emacsclient.desktop > $${tmp}; \
729 ${INSTALL_DATA} $${tmp} "$(DESTDIR)${desktopdir}/$${client_name}.desktop"; \
730 rm -f $${tmp}
731 umask 022; ${MKDIR_P} "$(DESTDIR)${metainfodir}"
732 tmp=etc/emacs.tmpmetainfo; rm -f $${tmp}; \
733 sed -e "s/emacs\.desktop/${EMACS_NAME}.desktop/" \
734 ${srcdir}/etc/emacs.metainfo.xml > $${tmp}; \
735 ${INSTALL_DATA} $${tmp} "$(DESTDIR)${metainfodir}/${EMACS_NAME}.metainfo.xml"; \
736 rm -f $${tmp}
737 umask 022; $(MKDIR_P) "$(DESTDIR)$(systemdunitdir)"
738 tmp=etc/emacs.tmpservice; rm -f $${tmp}; \
739 client_name=`echo emacsclient | sed '$(TRANSFORM)'`${EXEEXT}; \
740 sed -e '/^##/d' \
741 -e "/^Documentation/ s/emacs(1)/${EMACS_NAME}(1)/" \
742 -e "/^ExecStart/ s|emacs|${bindir}/${EMACS}|" \
743 -e "/^ExecStop/ s|emacsclient|${bindir}/$${client_name}|" \
744 ${srcdir}/etc/emacs.service > $${tmp}; \
745 $(INSTALL_DATA) $${tmp} "$(DESTDIR)$(systemdunitdir)/${EMACS_NAME}.service"; \
746 rm -f $${tmp}
747 thisdir=`/bin/pwd`; \
748 cd ${iconsrcdir} || exit 1; umask 022 ; \
749 for dir in */*/apps */*/mimetypes; do \
750 [ -d $${dir} ] || continue ; \
751 ( cd "$${thisdir}"; ${MKDIR_P} "$(DESTDIR)${icondir}/$${dir}" ) ; \
752 for icon in $${dir}/${EMACS_ICON}[.-]*; do \
753 [ -r $${icon} ] || continue ; \
754 ext=`echo "$${icon}" | sed -e 's|.*\.||'`; \
755 dest=`echo "$${icon}" | sed -e 's|.*/||' -e "s|\\.$${ext}\$$||" -e 's/$(EMACS_ICON)/emacs/' -e '$(TRANSFORM)'`.$${ext} ; \
756 ( cd "$${thisdir}"; \
757 ${INSTALL_DATA} ${iconsrcdir}/$${icon} "$(DESTDIR)${icondir}/$${dir}/$${dest}" ) \
758 || exit 1; \
759 done ; \
760 done
762 ### Install native compiled Lisp files.
763 install-eln: lisp
764 ifeq ($(HAVE_NATIVE_COMP),yes)
765 find native-lisp -type d -exec $(MKDIR_P) "$(ELN_DESTDIR){}" \; ; \
766 find native-lisp -type f -exec ${INSTALL_DATA} "{}" "$(ELN_DESTDIR){}" \;
767 endif
769 ### Build Emacs and install it, stripping binaries while installing them.
770 install-strip:
771 $(MAKE) INSTALL_STRIP=-s install
773 ### Delete all the installed files that the 'install' target would
774 ### create (but not the noninstalled files such as 'make all' would create).
776 ### Don't delete the lisp and etc directories if they're in the source tree.
777 uninstall: uninstall-$(NTDIR) uninstall-doc
778 rm -f "$(DESTDIR)$(includedir)/emacs-module.h"
779 $(MAKE) -C lib-src uninstall
780 -unset CDPATH; \
781 for dir in "$(DESTDIR)${lispdir}" "$(DESTDIR)${etcdir}" ; do \
782 if [ -d "$${dir}" ]; then \
783 case `cd "$${dir}" ; /bin/pwd` in \
784 "`cd ${srcdir} ; /bin/pwd`"* ) ;; \
785 * ) rm -rf "$${dir}" ;; \
786 esac ; \
787 case "$${dir}" in \
788 "$(DESTDIR)${datadir}/emacs/${version}"/* ) \
789 rm -rf "$(DESTDIR)${datadir}/emacs/${version}" \
790 ;; \
791 esac ; \
792 fi ; \
793 done
794 -rm -rf "$(DESTDIR)${libexecdir}/emacs/${version}"
795 thisdir=`/bin/pwd`; \
796 (info_misc=`MAKEFLAGS= $(MAKE) --no-print-directory -s -C doc/misc echo-info`; \
797 if cd "$(DESTDIR)${infodir}"; then \
798 for elt in ${INFO_NONMISC} $${info_misc}; do \
799 (cd "$${thisdir}"; \
800 $(INSTALL_INFO) --remove --info-dir="$(DESTDIR)${infodir}" "$(DESTDIR)${infodir}/$$elt"); \
801 if [ -n "${GZIP_PROG}" ]; then \
802 ext=.gz; else ext=; fi; \
803 rm -f $$elt$$ext $$elt-[1-9]$$ext $$elt-[1-9][0-9]$$ext; \
804 done; \
806 (if [ -n "${GZIP_PROG}" ]; then \
807 ext=.gz; else ext=; fi; \
808 if cd ${mansrcdir}; then \
809 for page in *.1; do \
810 rm -f "$(DESTDIR)${man1dir}"/`echo "$${page}" | sed -e 's/\.1$$//' -e '$(TRANSFORM)'`.1$$ext; done; \
812 rm -f "$(DESTDIR)${bindir}/$(EMACS)" "$(DESTDIR)${bindir}/$(EMACSFULL)"
813 (if cd "$(DESTDIR)${icondir}"; then \
814 rm -f hicolor/*x*/apps/"${EMACS_NAME}.png" \
815 "hicolor/scalable/apps/${EMACS_NAME}.svg" \
816 "hicolor/scalable/apps/${EMACS_NAME}.ico" \
817 "hicolor/scalable/mimetypes/${EMACS_NAME}-document.svg" \
818 "hicolor/scalable/mimetypes/${EMACS_NAME}-document23.svg"; \
820 -rm -f "$(DESTDIR)${desktopdir}/${EMACS_NAME}.desktop"
821 -rm -f "$(DESTDIR)${metainfodir}/${EMACS_NAME}.metainfo.xml"
822 -rm -f "$(DESTDIR)$(systemdunitdir)/${EMACS_NAME}.service"
823 ifneq (,$(use_gamedir))
824 for file in snake-scores tetris-scores; do \
825 file="$(DESTDIR)${gamedir}/$${file}"; \
826 [ -s "$${file}" ] || rm -f "$$file"; \
827 done
828 endif
830 ### Windows-specific uninstall target for removing programs produced
831 ### in nt/, and its Posix do-nothing shadow.
832 uninstall-:
833 uninstall-nt:
834 $(MAKE) -C $(NTDIR) uninstall
836 # ==================== Cleaning up and miscellanea ====================
838 .PHONY: mostlyclean clean distclean bootstrap-clean maintainer-clean extraclean
840 ## Eg:
841 ## src_clean:
842 ## make -C src clean
843 define submake_template
844 .PHONY: $(1)_$(2)
845 $(1)_$(2):
846 $$(MAKE) -C $(1) $(2)
847 endef
849 ### 'mostlyclean'
850 ### Like 'clean', but may refrain from deleting a few files that people
851 ### normally don't want to recompile. For example, the 'mostlyclean'
852 ### target for GCC does not delete 'libgcc.a', because recompiling it
853 ### is rarely necessary and takes a lot of time.
854 mostlyclean_dirs = src oldXMenu lwlib lib lib-src nt doc/emacs doc/misc \
855 doc/lispref doc/lispintro test
857 $(foreach dir,$(mostlyclean_dirs),$(eval $(call submake_template,$(dir),mostlyclean)))
859 mostlyclean: $(mostlyclean_dirs:=_mostlyclean)
861 ### 'clean'
862 ### Delete all files from the current directory that are normally
863 ### created by building the program. Don't delete the files that
864 ### record the configuration. Also preserve files that could be made
865 ### by building, but normally aren't because the distribution comes
866 ### with them.
868 ### Delete '.dvi' files here if they are not part of the distribution.
869 clean_dirs = $(mostlyclean_dirs) nextstep admin/charsets admin/unidata
871 $(foreach dir,$(clean_dirs),$(eval $(call submake_template,$(dir),clean)))
873 clean: $(clean_dirs:=_clean)
874 -rm -f ./*.tmp etc/*.tmp*
875 -rm -rf info-dir.*
876 -rm -rf native-lisp
878 ### 'bootclean'
879 ### Delete all files that need to be remade for a clean bootstrap.
880 top_bootclean=\
881 rm -f config.cache config.log ${srcdir}/doc/man/emacs.1
883 ### 'distclean'
884 ### Delete all files from the current directory that are created by
885 ### configuring or building the program. If you have unpacked the
886 ### source and built the program without creating any other files,
887 ### 'make distclean' should leave only the files that were in the
888 ### distribution.
889 top_distclean=\
890 ${top_bootclean}; \
891 rm -f config.status config.log~ \
892 Makefile makefile lib/gnulib.mk ${SUBDIR_MAKEFILES}
894 distclean_dirs = $(clean_dirs) leim lisp admin/grammars
896 $(foreach dir,$(distclean_dirs),$(eval $(call submake_template,$(dir),distclean)))
898 distclean: $(distclean_dirs:=_distclean)
899 ${top_distclean}
901 ### 'bootstrap-clean'
902 ### Delete everything that can be reconstructed by 'make' and that
903 ### needs to be deleted in order to force a bootstrap from a clean state.
904 $(foreach dir,$(distclean_dirs),$(eval $(call submake_template,$(dir),bootstrap-clean)))
906 bootstrap-clean: $(distclean_dirs:=_bootstrap-clean)
907 [ ! -f config.log ] || mv -f config.log config.log~
908 rm -rf ${srcdir}/info
909 rm -f ${srcdir}/etc/refcards/emacsver.tex
910 ${top_bootclean}
912 ### 'maintainer-clean'
913 ### Delete everything from the current directory that can be
914 ### reconstructed with this Makefile. This typically includes
915 ### everything deleted by distclean, plus more: C source files
916 ### produced by Bison, tags tables, info files, and so on.
918 ### One exception, however: 'make maintainer-clean' should not delete
919 ### 'configure' even if 'configure' can be remade using a rule in the
920 ### Makefile. More generally, 'make maintainer-clean' should not delete
921 ### anything that needs to exist in order to run 'configure' and then
922 ### begin to build the program.
923 top_maintainer_clean=\
924 ${top_distclean}; \
925 rm -fr ${srcdir}/autom4te.cache
927 $(foreach dir,$(distclean_dirs),$(eval $(call submake_template,$(dir),maintainer-clean)))
929 maintainer-clean: $(distclean_dirs:=_maintainer-clean)
930 rm -rf ${srcdir}/info
931 rm -f ${srcdir}/etc/refcards/emacsver.tex
932 ${top_maintainer_clean}
934 ### This doesn't actually appear in the coding standards, but Karl
935 ### says GCC supports it, and that's where the configuration part of
936 ### the coding standards seem to come from. It's like distclean, but
937 ### it deletes backup and autosave files too.
938 extraclean: maintainer-clean
939 -rm -f config-tmp-* ${srcdir}/aclocal.m4 ${srcdir}/configure \
940 ${srcdir}/src/config.in
941 -[ "${srcdir}" = "." ] || \
942 find ${srcdir} '(' -name '*~' -o -name '#*' ')' ${FIND_DELETE}
943 -find . '(' -name '*~' -o -name '#*' ')' ${FIND_DELETE}
945 # The src subdir knows how to do the right thing
946 # even when the build directory and source dir are different.
947 .PHONY: TAGS tags
948 # FIXME: We used to include `src` in the dependencies, not sure why.
949 # I removed it because it causes `make tags` to build Emacs.
950 TAGS tags: lib lib-src # src
951 $(MAKE) -C src tags
952 $(MAKE) -C doc/emacs tags
953 $(MAKE) -C doc/lispintro tags
954 $(MAKE) -C doc/lispref tags
955 $(MAKE) -C doc/misc tags
957 CHECK_TARGETS = check check-maybe check-expensive check-all
958 .PHONY: $(CHECK_TARGETS)
959 $(CHECK_TARGETS): all
960 $(MAKE) -C test $@
962 test/%:
963 $(MAKE) -C test $*
966 dist:
967 cd ${srcdir}; ./make-dist
969 DVIS = lispref-dvi lispintro-dvi emacs-dvi misc-dvi
970 HTMLS = lispref-html lispintro-html emacs-html misc-html
971 INFOS = lispref-info lispintro-info emacs-info misc-info
972 PDFS = lispref-pdf lispintro-pdf emacs-pdf misc-pdf
973 PSS = lispref-ps lispintro-ps emacs-ps misc-ps
975 DOCS = $(DVIS) $(HTMLS) $(INFOS) $(PDFS) $(PSS)
976 $(DOCS):
977 $(MAKE) -C doc/$(subst -, ,$@)
979 .PHONY: $(DOCS) docs pdf ps
980 .PHONY: info dvi dist html info-dir check-info
982 ## TODO add etc/refcards.
983 docs: $(DOCS)
984 dvi: $(DVIS)
985 html: $(HTMLS)
986 info: $(INFOS) info-dir
987 pdf: $(PDFS)
988 ps: $(PSS)
990 # This dependency is due to those doc/misc/ manuals that use .org sources.
991 # Depending on src is sufficient, but ends up being slow, since the
992 # uncompiled lisp/org/*.el files are used to build the .texi files
993 # (which can be slow even with the elc files).
994 misc-info: lisp
995 # Using src rather than lisp because one is less likely to get unnecessary
996 # rebuilds of stuff that is not strictly necessary for generating manuals.
997 misc-dvi misc-html misc-pdf misc-ps: src
999 info-dir: ${srcdir}/info/dir
1001 texi_misc = $(shell MAKEFLAGS= ${MAKE} --no-print-directory -s -C doc/misc echo-sources)
1003 srcdir_doc_info_dir_inputs = \
1004 ${srcdir}/doc/emacs/emacs.texi \
1005 ${srcdir}/doc/lispintro/emacs-lisp-intro.texi \
1006 ${srcdir}/doc/lispref/elisp.texi \
1007 $(addprefix ${srcdir}/doc/misc/,${texi_misc})
1008 info_dir_inputs = \
1009 ../build-aux/dir_top \
1010 $(subst ${srcdir}/doc/,,${srcdir_doc_info_dir_inputs})
1011 info_dir_deps = \
1012 ${srcdir}/build-aux/make-info-dir \
1013 ${srcdir}/build-aux/dir_top \
1014 ${srcdir_doc_info_dir_inputs}
1016 ## It would be much simpler if info/dir was only created in the
1017 ## installation location by the install-info rule, but we also
1018 ## need one in the source directory for people running uninstalled.
1019 ## FIXME it would be faster to use the install-info program if we have it,
1020 ## but then we would need to depend on ${INFOS}, which would
1021 ## slow down parallelization.
1022 ${srcdir}/info/dir: ${info_dir_deps}
1023 $(AM_V_at)${MKDIR_P} ${srcdir}/info
1024 $(AM_V_GEN)(cd ${srcdir}/doc && \
1025 AWK='${AWK}' ../build-aux/make-info-dir ${info_dir_inputs} \
1026 ) >$@.tmp && mv $@.tmp $@
1028 INSTALL_DVI = install-emacs-dvi install-lispref-dvi \
1029 install-lispintro-dvi install-misc-dvi
1030 INSTALL_HTML = install-emacs-html install-lispref-html \
1031 install-lispintro-html install-misc-html
1032 INSTALL_PDF = install-emacs-pdf install-lispref-pdf \
1033 install-lispintro-pdf install-misc-pdf
1034 INSTALL_PS = install-emacs-ps install-lispref-ps \
1035 install-lispintro-ps install-misc-ps
1036 INSTALL_DOC = $(INSTALL_DVI) $(INSTALL_HTML) $(INSTALL_PDF) $(INSTALL_PS)
1038 ## Install non .info forms of the documentation.
1039 ## TODO add etc/refcards.
1040 $(INSTALL_DOC):
1041 $(MAKE) -C doc/$(subst -, install-,$(subst install-,,$@))
1043 .PHONY: $(INSTALL_DOC) install-doc
1044 .PHONY: install-dvi install-html install-pdf install-ps
1046 install-doc: $(INSTALL_DOC)
1047 install-dvi: $(INSTALL_DVI)
1048 install-html: $(INSTALL_HTML)
1049 install-pdf: $(INSTALL_PDF)
1050 install-ps: $(INSTALL_PS)
1053 UNINSTALL_DVI = uninstall-emacs-dvi uninstall-lispref-dvi \
1054 uninstall-lispintro-dvi uninstall-misc-dvi
1055 UNINSTALL_HTML = uninstall-emacs-html uninstall-lispref-html \
1056 uninstall-lispintro-html uninstall-misc-html
1057 UNINSTALL_PDF = uninstall-emacs-pdf uninstall-lispref-pdf \
1058 uninstall-lispintro-pdf uninstall-misc-pdf
1059 UNINSTALL_PS = uninstall-emacs-ps uninstall-lispref-ps \
1060 uninstall-lispintro-ps uninstall-misc-ps
1061 UNINSTALL_DOC = $(UNINSTALL_DVI) $(UNINSTALL_HTML) $(UNINSTALL_PDF) $(UNINSTALL_PS)
1063 $(UNINSTALL_DOC):
1064 $(MAKE) -C doc/$(subst -, uninstall-,$(subst uninstall-,,$@))
1066 .PHONY: $(UNINSTALL_DOC) uninstall-doc
1067 .PHONY: uninstall-dvi uninstall-html uninstall-pdf uninstall-ps
1069 uninstall-doc: $(UNINSTALL_DOC)
1070 uninstall-dvi: $(UNINSTALL_DVI)
1071 uninstall-html: $(UNINSTALL_HTML)
1072 uninstall-pdf: $(UNINSTALL_PDF)
1073 uninstall-ps: $(UNINSTALL_PS)
1075 ## build-aux/make-info-dir expects only certain dircategories.
1076 check-info: info
1077 cd info ; \
1078 bad= ; \
1079 for file in *; do \
1080 test -f "$${file}" || continue ; \
1081 case $${file} in \
1082 *-[0-9]*|COPYING|dir) continue ;; \
1083 esac ; \
1084 cat=`sed -n 's/^INFO-DIR-SECTION //p' $${file}`; \
1085 case $${cat} in \
1086 "Texinfo documentation system" | "Emacs"| "Emacs lisp" | \
1087 "Emacs editing modes" | "Emacs network features" | \
1088 "Emacs misc features" | "Emacs lisp libraries" ) : ;; \
1089 *) bad="$${bad} $${file}" ;; \
1090 esac; \
1091 done ; \
1092 if test -n "$${bad}"; then \
1093 echo "Unexpected dircategory in: $${bad}" ; \
1094 exit 1 ; \
1095 fi ; \
1096 echo "info files are OK"
1098 #### Bootstrapping.
1100 ### This first cleans the lisp subdirectory, removing all compiled
1101 ### Lisp files. Then re-run make to build all the files anew.
1103 .PHONY: bootstrap
1105 # Bootstrapping does the following:
1106 # * Remove files to start from a bootstrap-clean slate.
1107 # * Run autogen.sh.
1108 # * Rebuild Makefile, to update the build procedure itself.
1109 # * Do the actual build.
1110 bootstrap: bootstrap-clean
1111 cd $(srcdir) && ./autogen.sh autoconf
1112 $(MAKE) MAKEFILE_NAME=force-Makefile force-Makefile
1113 $(MAKE) all
1115 .PHONY: ChangeLog change-history change-history-commit change-history-nocommit
1116 .PHONY: preferred-branch-is-current unchanged-history-files
1118 CHANGELOG = ChangeLog
1119 emacslog = build-aux/gitlog-to-emacslog
1120 # The ChangeLog history files are called ChangeLog.1, ChangeLog.2, ...,
1121 # ChangeLog.$(CHANGELOG_HISTORY_INDEX_MAX). $(CHANGELOG_N) stands for
1122 # the newest (highest-numbered) ChangeLog history file.
1123 CHANGELOG_HISTORY_INDEX_MAX = 3
1124 CHANGELOG_N = ChangeLog.$(CHANGELOG_HISTORY_INDEX_MAX)
1126 # Convert git commit log to ChangeLog file. make-dist uses this.
1127 # I guess this is PHONY so it always updates?
1128 ChangeLog:
1129 $(AM_V_GEN)cd $(srcdir) && \
1130 ./$(emacslog) -o $(CHANGELOG) -n $(CHANGELOG_HISTORY_INDEX_MAX)
1132 # Check that we are in a good state for changing history.
1133 PREFERRED_BRANCH = emacs-27
1134 preferred-branch-is-current:
1135 git branch | grep -q '^\* $(PREFERRED_BRANCH)$$'
1136 unchanged-history-files:
1137 x=$$(git diff-files --name-only $(CHANGELOG_N) $(emacslog)) && \
1138 test -z "$$x"
1140 # Regular expression that matches the newest commit covered by a ChangeLog.
1141 new_commit_regexp = ^commit [0123456789abcdef]* (inclusive)
1143 # Copy newer commit messages to the start of the ChangeLog history file,
1144 # and consider them to be older.
1145 change-history-nocommit: preferred-branch-is-current unchanged-history-files
1146 -rm -f ChangeLog.tmp
1147 $(MAKE) ChangeLog CHANGELOG=ChangeLog.tmp
1148 sed '/^This file records repository revisions/,$$d' \
1149 ChangeLog.tmp >$(CHANGELOG_N).tmp
1150 new_commit_line=`grep '$(new_commit_regexp)' ChangeLog.tmp` && \
1151 sed 's/$(new_commit_regexp).*/'"$$new_commit_line/" \
1152 $(CHANGELOG_N) >>$(CHANGELOG_N).tmp
1153 rm ChangeLog.tmp
1154 mv $(CHANGELOG_N).tmp $(CHANGELOG_N)
1156 change-history: change-history-nocommit
1157 $(MAKE) $@-commit
1159 # If 'make change-history' fails because the newest ChangeLog history
1160 # file contains invalid text, fix the file by hand and then run
1161 # 'make change-history-commit'.
1162 change-history-commit:
1163 git commit -m'; make $@' $(CHANGELOG_N) $(emacslog)
1165 .PHONY: check-declare
1167 check-declare:
1168 @if [ ! -f $(srcdir)/src/emacs ]; then \
1169 echo "You must build Emacs to use this command"; \
1170 exit 1; \
1172 $(MAKE) -C lisp $@
1173 $(MAKE) -C test $@
1175 .PHONY: gitmerge
1177 GITMERGE_EMACS = ./src/emacs${EXEEXT}
1178 GITMERGE_NMIN = 10
1180 gitmerge:
1181 ${GITMERGE_EMACS} -batch --no-site-file --no-site-lisp \
1182 -l ${srcdir}/admin/gitmerge.el \
1183 --eval '(setq gitmerge-minimum-missing ${GITMERGE_NMIN})' -f gitmerge