Fix the call to set_network_coding_system
[emacs.git] / GNUmakefile
blobe6941b03b30912f07ec1b9cdac1e8d63f4f1d0a1
1 # Build Emacs from a fresh tarball or version-control checkout.
3 # Copyright (C) 2011-2016 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 <http://www.gnu.org/licenses/>.
20 # written by Paul Eggert
23 # This GNUmakefile is for GNU Make. It is for convenience, so that
24 # one can run 'make' in an unconfigured source tree. In such a tree,
25 # this file causes GNU Make to first create a standard configuration
26 # with the default options, and then reinvokes itself on the
27 # newly-built Makefile. If the source tree is already configured,
28 # this file defers to the existing Makefile.
30 # If you are using a non-GNU 'make', or if you want non-default build
31 # options, or if you want to build in an out-of-source tree, please
32 # run "configure" by hand. But run autogen.sh first, if the source
33 # was checked out directly from the repository.
35 # If a Makefile already exists, just use it.
37 ifeq ($(wildcard Makefile),Makefile)
38 include Makefile
39 else
41 # If cleaning and Makefile does not exist, don't bother creating it.
42 # The source tree is already clean, or is in a weird state that
43 # requires expert attention.
45 ifeq ($(filter-out %clean,$(or $(MAKECMDGOALS),default)),)
47 $(MAKECMDGOALS):
48 @echo >&2 'No Makefile; skipping $@.'
50 else
52 # No Makefile, and not cleaning.
53 # If 'configure' does not exist, Emacs must have been checked
54 # out directly from the repository; run ./autogen.sh.
55 # Once 'configure' exists, run it.
56 # Finally, run the actual 'make'.
58 ORDINARY_GOALS = $(filter-out configure Makefile bootstrap,$(MAKECMDGOALS))
60 default $(ORDINARY_GOALS): Makefile
61 $(MAKE) -f Makefile $(MAKECMDGOALS)
62 # Execute in sequence, so that multiple user goals don't conflict.
63 .NOTPARALLEL:
65 # 'all' if a .git subdirectory is present, empty otherwise.
66 ALL_IF_GIT = $(subst .git,all,$(wildcard .git))
68 configure:
69 @echo >&2 'There seems to be no "configure" file in this directory.'
70 @echo >&2 Running ./autogen.sh $(ALL_IF_GIT) ...
71 ./autogen.sh $(ALL_IF_GIT)
72 @echo >&2 '"configure" file built.'
74 Makefile: configure
75 @echo >&2 'There seems to be no Makefile in this directory.'
76 @echo >&2 'Running ./configure ...'
77 ./configure
78 @echo >&2 'Makefile built.'
80 # 'make bootstrap' in a fresh checkout needn't run 'configure' twice.
81 bootstrap: Makefile
82 $(MAKE) -f Makefile all
84 .PHONY: bootstrap default $(ORDINARY_GOALS)
86 endif
87 endif