2011-07-27 20:25:22 +00:00
|
|
|
# Build Emacs from a fresh tarball or version-control checkout.
|
|
|
|
|
2017-01-01 03:14:01 +00:00
|
|
|
# Copyright (C) 2011-2017 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
|
|
|
|
# along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
#
|
|
|
|
# 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.
|
|
|
|
|
|
|
|
# If you are using a non-GNU 'make', or if you want non-default build
|
|
|
|
# options, or if you want to build in an out-of-source tree, please
|
|
|
|
# run "configure" by hand. But run autogen.sh first, if the source
|
|
|
|
# was checked out directly from the repository.
|
|
|
|
|
|
|
|
# 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):
|
|
|
|
@echo >&2 'No Makefile; skipping $@.'
|
|
|
|
|
|
|
|
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:
|
|
|
|
|
autogen.sh now configures git only on request
* autogen.sh (do_autoconf, do_git): New vars.
Support new arguments --help, all, autoconf, git.
By default, just do autoconf-related configuration, not git.
Prefer 'echo' to 'cat <<EOF ...', as this tends to avoid temp files.
If GNU cp is available, use it to backup .git/config before
changing it. When configuring git, chatter about what is being
done, and configure git to check hashes. Avoid some duplicate
file name specification when creating git hooks.
* GNUmakefile (ALL_IF_GIT): New macro.
(configure): Use it.
* INSTALL.REPO: Suggest './autogen.sh all'.
2016-02-03 07:11:36 +00:00
|
|
|
# 'all' if a .git subdirectory is present, empty otherwise.
|
|
|
|
ALL_IF_GIT = $(subst .git,all,$(wildcard .git))
|
|
|
|
|
2011-07-27 20:25:22 +00:00
|
|
|
configure:
|
|
|
|
@echo >&2 'There seems to be no "configure" file in this directory.'
|
autogen.sh now configures git only on request
* autogen.sh (do_autoconf, do_git): New vars.
Support new arguments --help, all, autoconf, git.
By default, just do autoconf-related configuration, not git.
Prefer 'echo' to 'cat <<EOF ...', as this tends to avoid temp files.
If GNU cp is available, use it to backup .git/config before
changing it. When configuring git, chatter about what is being
done, and configure git to check hashes. Avoid some duplicate
file name specification when creating git hooks.
* GNUmakefile (ALL_IF_GIT): New macro.
(configure): Use it.
* INSTALL.REPO: Suggest './autogen.sh all'.
2016-02-03 07:11:36 +00:00
|
|
|
@echo >&2 Running ./autogen.sh $(ALL_IF_GIT) ...
|
|
|
|
./autogen.sh $(ALL_IF_GIT)
|
2011-07-27 20:25:22 +00:00
|
|
|
@echo >&2 '"configure" file built.'
|
|
|
|
|
|
|
|
Makefile: configure
|
|
|
|
@echo >&2 'There seems to be no Makefile in this directory.'
|
|
|
|
@echo >&2 'Running ./configure ...'
|
2013-11-28 17:45:26 +00:00
|
|
|
./configure
|
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
|
|
|
|
$(MAKE) -f Makefile all
|
|
|
|
|
|
|
|
.PHONY: bootstrap default $(ORDINARY_GOALS)
|
|
|
|
|
2011-07-27 20:25:22 +00:00
|
|
|
endif
|
|
|
|
endif
|