2011-07-27 20:25:22 +00:00
|
|
|
# Build Emacs from a fresh tarball or version-control checkout.
|
|
|
|
|
2024-01-02 01:47:10 +00:00
|
|
|
# Copyright (C) 2011-2024 Free Software Foundation, Inc.
|
2011-07-27 20:25:22 +00:00
|
|
|
#
|
|
|
|
# This file is part of GNU Emacs.
|
|
|
|
#
|
|
|
|
# GNU Emacs is free software: you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
|
|
|
# the Free Software Foundation, either version 3 of the License, or
|
|
|
|
# (at your option) any later version.
|
|
|
|
#
|
|
|
|
# GNU Emacs is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
2017-09-13 22:52:52 +00:00
|
|
|
# along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
|
2011-07-27 20:25:22 +00:00
|
|
|
#
|
|
|
|
# written by Paul Eggert
|
|
|
|
|
|
|
|
|
|
|
|
# This GNUmakefile is for GNU Make. It is for convenience, so that
|
|
|
|
# one can run 'make' in an unconfigured source tree. In such a tree,
|
|
|
|
# this file causes GNU Make to first create a standard configuration
|
|
|
|
# with the default options, and then reinvokes itself on the
|
|
|
|
# newly-built Makefile. If the source tree is already configured,
|
|
|
|
# this file defers to the existing Makefile.
|
|
|
|
|
2024-02-09 07:17:04 +00:00
|
|
|
. :=
|
|
|
|
|
2019-04-16 18:04:16 +00:00
|
|
|
# If you want non-default build options, or if you want to build in an
|
|
|
|
# out-of-source tree, you should run 'configure' before running 'make'.
|
|
|
|
# But run 'autogen.sh' first, if the source was checked out directly
|
|
|
|
# from the repository.
|
2011-07-27 20:25:22 +00:00
|
|
|
|
2019-08-20 23:02:43 +00:00
|
|
|
# Display help.
|
|
|
|
|
|
|
|
ifeq (help,$(filter help,$(MAKECMDGOALS)))
|
|
|
|
help:
|
2024-02-09 07:17:04 +00:00
|
|
|
$(info $.NOTE: This is a brief summary of some common make targets.)
|
|
|
|
$(info $.For more detailed information, please read the files INSTALL,)
|
|
|
|
$(info $.INSTALL.REPO, Makefile or visit this URL:)
|
|
|
|
$(info $.https://www.gnu.org/prep/standards/html_node/Standard-Targets.html)
|
|
|
|
$(info $.)
|
|
|
|
$(info $.make all -- compile and build Emacs)
|
|
|
|
$(info $.make install -- install Emacs)
|
|
|
|
$(info $.make TAGS -- update tags tables)
|
|
|
|
$(info $.make clean -- delete built files but preserve configuration)
|
|
|
|
$(info $.make mostlyclean -- like 'make clean', but leave those files that)
|
|
|
|
$(info $. usually do not need to be recompiled)
|
|
|
|
$(info $.make distclean -- delete all build and configuration files,)
|
|
|
|
$(info $. leave only files included in source distribution)
|
|
|
|
$(info $.make maintainer-clean -- delete almost everything that can be regenerated)
|
|
|
|
$(info $.make extraclean -- like maintainer-clean, and also delete)
|
|
|
|
$(info $. backup and autosave files)
|
|
|
|
$(info $.make bootstrap -- delete all compiled files to force a new bootstrap)
|
|
|
|
$(info $. from a clean slate, then build in the normal way)
|
|
|
|
$(info $.make uninstall -- remove files installed by 'make install')
|
|
|
|
$(info $.make check -- run the Emacs test suite)
|
|
|
|
$(info $.make docs -- generate Emacs documentation in info format)
|
|
|
|
$(info $.make html -- generate documentation in html format)
|
|
|
|
$(info $.make ps -- generate documentation in ps format)
|
|
|
|
$(info $.make pdf -- generate documentation in pdf format )
|
Prefer $(info) to @echo
Have GNU Make output some diagnostics directly, instead of forking
and execing a shell to do it.
* GNUmakefile (help):
* doc/lispref/two-volume.make (vol2.pdf, elisp2med-init)
(elisp2-init):
* doc/misc/Makefile.in (echo-info, echo-sources):
* lib-src/Makefile.in (archlibdir, install, check):
* src/verbose.mk.in (AM_V_AR, AM_V_CC, AM_V_CXX, AM_V_CCLD)
(AM_V_CXXLD, AM_V_ELC, AM_V_ELN, AM_V_GEN, AM_V_GLOBALS)
(AM_V_RC):
* test/Makefile.in (subdirs, subdir-targets):
Prefer $(info) to @echo.
* GNUmakefile (MAKECMDGOALS, configure, Makefile):
Prefer $(warning) to @echo >&2.
* src/verbose.mk.in (AM_V_ELN): Output target, like the others.
2021-12-20 20:14:07 +00:00
|
|
|
@:
|
2019-08-20 23:02:43 +00:00
|
|
|
|
|
|
|
.PHONY: help
|
|
|
|
|
|
|
|
else
|
|
|
|
|
2011-07-27 20:25:22 +00:00
|
|
|
# If a Makefile already exists, just use it.
|
|
|
|
|
|
|
|
ifeq ($(wildcard Makefile),Makefile)
|
|
|
|
include Makefile
|
|
|
|
else
|
|
|
|
|
|
|
|
# If cleaning and Makefile does not exist, don't bother creating it.
|
|
|
|
# The source tree is already clean, or is in a weird state that
|
|
|
|
# requires expert attention.
|
|
|
|
|
|
|
|
ifeq ($(filter-out %clean,$(or $(MAKECMDGOALS),default)),)
|
|
|
|
|
|
|
|
$(MAKECMDGOALS):
|
Prefer $(info) to @echo
Have GNU Make output some diagnostics directly, instead of forking
and execing a shell to do it.
* GNUmakefile (help):
* doc/lispref/two-volume.make (vol2.pdf, elisp2med-init)
(elisp2-init):
* doc/misc/Makefile.in (echo-info, echo-sources):
* lib-src/Makefile.in (archlibdir, install, check):
* src/verbose.mk.in (AM_V_AR, AM_V_CC, AM_V_CXX, AM_V_CCLD)
(AM_V_CXXLD, AM_V_ELC, AM_V_ELN, AM_V_GEN, AM_V_GLOBALS)
(AM_V_RC):
* test/Makefile.in (subdirs, subdir-targets):
Prefer $(info) to @echo.
* GNUmakefile (MAKECMDGOALS, configure, Makefile):
Prefer $(warning) to @echo >&2.
* src/verbose.mk.in (AM_V_ELN): Output target, like the others.
2021-12-20 20:14:07 +00:00
|
|
|
$(warning No Makefile; skipping $@.)
|
2011-07-27 20:25:22 +00:00
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
# No Makefile, and not cleaning.
|
|
|
|
# If 'configure' does not exist, Emacs must have been checked
|
|
|
|
# out directly from the repository; run ./autogen.sh.
|
|
|
|
# Once 'configure' exists, run it.
|
|
|
|
# Finally, run the actual 'make'.
|
|
|
|
|
2014-04-17 06:40:25 +00:00
|
|
|
ORDINARY_GOALS = $(filter-out configure Makefile bootstrap,$(MAKECMDGOALS))
|
|
|
|
|
|
|
|
default $(ORDINARY_GOALS): Makefile
|
2011-07-27 20:25:22 +00:00
|
|
|
$(MAKE) -f Makefile $(MAKECMDGOALS)
|
|
|
|
# Execute in sequence, so that multiple user goals don't conflict.
|
|
|
|
.NOTPARALLEL:
|
|
|
|
|
|
|
|
configure:
|
Prefer $(info) to @echo
Have GNU Make output some diagnostics directly, instead of forking
and execing a shell to do it.
* GNUmakefile (help):
* doc/lispref/two-volume.make (vol2.pdf, elisp2med-init)
(elisp2-init):
* doc/misc/Makefile.in (echo-info, echo-sources):
* lib-src/Makefile.in (archlibdir, install, check):
* src/verbose.mk.in (AM_V_AR, AM_V_CC, AM_V_CXX, AM_V_CCLD)
(AM_V_CXXLD, AM_V_ELC, AM_V_ELN, AM_V_GEN, AM_V_GLOBALS)
(AM_V_RC):
* test/Makefile.in (subdirs, subdir-targets):
Prefer $(info) to @echo.
* GNUmakefile (MAKECMDGOALS, configure, Makefile):
Prefer $(warning) to @echo >&2.
* src/verbose.mk.in (AM_V_ELN): Output target, like the others.
2021-12-20 20:14:07 +00:00
|
|
|
$(warning There seems to be no "configure" file in this directory.)
|
|
|
|
$(warning Running ./autogen.sh ...)
|
2017-08-12 16:06:55 +00:00
|
|
|
./autogen.sh
|
2011-07-27 20:25:22 +00:00
|
|
|
@echo >&2 '"configure" file built.'
|
|
|
|
|
|
|
|
Makefile: configure
|
Prefer $(info) to @echo
Have GNU Make output some diagnostics directly, instead of forking
and execing a shell to do it.
* GNUmakefile (help):
* doc/lispref/two-volume.make (vol2.pdf, elisp2med-init)
(elisp2-init):
* doc/misc/Makefile.in (echo-info, echo-sources):
* lib-src/Makefile.in (archlibdir, install, check):
* src/verbose.mk.in (AM_V_AR, AM_V_CC, AM_V_CXX, AM_V_CCLD)
(AM_V_CXXLD, AM_V_ELC, AM_V_ELN, AM_V_GEN, AM_V_GLOBALS)
(AM_V_RC):
* test/Makefile.in (subdirs, subdir-targets):
Prefer $(info) to @echo.
* GNUmakefile (MAKECMDGOALS, configure, Makefile):
Prefer $(warning) to @echo >&2.
* src/verbose.mk.in (AM_V_ELN): Output target, like the others.
2021-12-20 20:14:07 +00:00
|
|
|
$(warning There seems to be no Makefile in this directory.)
|
2021-11-24 06:58:11 +00:00
|
|
|
ifeq ($(configure),default)
|
Prefer $(info) to @echo
Have GNU Make output some diagnostics directly, instead of forking
and execing a shell to do it.
* GNUmakefile (help):
* doc/lispref/two-volume.make (vol2.pdf, elisp2med-init)
(elisp2-init):
* doc/misc/Makefile.in (echo-info, echo-sources):
* lib-src/Makefile.in (archlibdir, install, check):
* src/verbose.mk.in (AM_V_AR, AM_V_CC, AM_V_CXX, AM_V_CCLD)
(AM_V_CXXLD, AM_V_ELC, AM_V_ELN, AM_V_GEN, AM_V_GLOBALS)
(AM_V_RC):
* test/Makefile.in (subdirs, subdir-targets):
Prefer $(info) to @echo.
* GNUmakefile (MAKECMDGOALS, configure, Makefile):
Prefer $(warning) to @echo >&2.
* src/verbose.mk.in (AM_V_ELN): Output target, like the others.
2021-12-20 20:14:07 +00:00
|
|
|
$(warning Running ./configure ...)
|
2013-11-28 17:45:26 +00:00
|
|
|
./configure
|
2021-11-24 06:58:11 +00:00
|
|
|
else
|
Prefer $(info) to @echo
Have GNU Make output some diagnostics directly, instead of forking
and execing a shell to do it.
* GNUmakefile (help):
* doc/lispref/two-volume.make (vol2.pdf, elisp2med-init)
(elisp2-init):
* doc/misc/Makefile.in (echo-info, echo-sources):
* lib-src/Makefile.in (archlibdir, install, check):
* src/verbose.mk.in (AM_V_AR, AM_V_CC, AM_V_CXX, AM_V_CCLD)
(AM_V_CXXLD, AM_V_ELC, AM_V_ELN, AM_V_GEN, AM_V_GLOBALS)
(AM_V_RC):
* test/Makefile.in (subdirs, subdir-targets):
Prefer $(info) to @echo.
* GNUmakefile (MAKECMDGOALS, configure, Makefile):
Prefer $(warning) to @echo >&2.
* src/verbose.mk.in (AM_V_ELN): Output target, like the others.
2021-12-20 20:14:07 +00:00
|
|
|
$(warning Running ./configure $(configure)...)
|
2021-11-24 06:58:11 +00:00
|
|
|
./configure $(configure)
|
|
|
|
endif
|
2011-07-27 20:25:22 +00:00
|
|
|
@echo >&2 'Makefile built.'
|
|
|
|
|
2014-04-17 06:40:25 +00:00
|
|
|
# 'make bootstrap' in a fresh checkout needn't run 'configure' twice.
|
|
|
|
bootstrap: Makefile
|
2022-09-18 21:22:13 +00:00
|
|
|
$(MAKE) -f Makefile bootstrap-all
|
2014-04-17 06:40:25 +00:00
|
|
|
|
|
|
|
.PHONY: bootstrap default $(ORDINARY_GOALS)
|
|
|
|
|
2011-07-27 20:25:22 +00:00
|
|
|
endif
|
|
|
|
endif
|
2019-08-20 23:02:43 +00:00
|
|
|
endif
|