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