Sort items in tmm properly, and allow clicking the final item
[emacs.git] / GNUmakefile
blobc6407d0491857988df030a3b3d0f82bd1ea222bf
1 # Build Emacs from a fresh tarball or version-control checkout.
3 # Copyright (C) 2011-2020 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 # 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 want non-default build options, or if you want to build in an
31 # out-of-source tree, you should run 'configure' before running 'make'.
32 # But run 'autogen.sh' first, if the source was checked out directly
33 # from the repository.
35 # Display help.
37 ifeq (help,$(filter help,$(MAKECMDGOALS)))
38 help:
39 @echo "NOTE: This is a brief summary of some common make targets."
40 @echo "For more detailed information, please read the files INSTALL,"
41 @echo "INSTALL.REPO, Makefile or visit this URL:"
42 @echo "https://www.gnu.org/prep/standards/html_node/Standard-Targets.html"
43 @echo ""
44 @echo "make all -- compile and build Emacs"
45 @echo "make install -- install Emacs"
46 @echo "make TAGS -- update tags tables"
47 @echo "make clean -- delete built files but preserve configuration"
48 @echo "make mostlyclean -- like 'make clean', but leave those files that"
49 @echo " usually do not need to be recompiled"
50 @echo "make distclean -- delete all build and configuration files,"
51 @echo " leave only files included in source distribution"
52 @echo "make maintainer-clean -- delete almost everything that can be regenerated"
53 @echo "make bootstrap -- delete all compiled files to force a new bootstrap"
54 @echo " from a clean slate, then build in the normal way"
55 @echo "make uninstall -- remove files installed by 'make install'"
56 @echo "make check -- run the Emacs test suite"
57 @echo "make docs -- generate Emacs documentation in info format"
58 @echo "make html -- generate documentation in html format"
59 @echo "make ps -- generate documentation in ps format"
60 @echo "make pdf -- generate documentation in pdf format "
61 @exit
63 .PHONY: help
65 else
67 # If a Makefile already exists, just use it.
69 ifeq ($(wildcard Makefile),Makefile)
70 include Makefile
71 else
73 # If cleaning and Makefile does not exist, don't bother creating it.
74 # The source tree is already clean, or is in a weird state that
75 # requires expert attention.
77 ifeq ($(filter-out %clean,$(or $(MAKECMDGOALS),default)),)
79 $(MAKECMDGOALS):
80 @echo >&2 'No Makefile; skipping $@.'
82 else
84 # No Makefile, and not cleaning.
85 # If 'configure' does not exist, Emacs must have been checked
86 # out directly from the repository; run ./autogen.sh.
87 # Once 'configure' exists, run it.
88 # Finally, run the actual 'make'.
90 ORDINARY_GOALS = $(filter-out configure Makefile bootstrap,$(MAKECMDGOALS))
92 default $(ORDINARY_GOALS): Makefile
93 $(MAKE) -f Makefile $(MAKECMDGOALS)
94 # Execute in sequence, so that multiple user goals don't conflict.
95 .NOTPARALLEL:
97 configure:
98 @echo >&2 'There seems to be no "configure" file in this directory.'
99 @echo >&2 Running ./autogen.sh ...
100 ./autogen.sh
101 @echo >&2 '"configure" file built.'
103 Makefile: configure
104 @echo >&2 'There seems to be no Makefile in this directory.'
105 @echo >&2 'Running ./configure ...'
106 ./configure
107 @echo >&2 'Makefile built.'
109 # 'make bootstrap' in a fresh checkout needn't run 'configure' twice.
110 bootstrap: Makefile
111 $(MAKE) -f Makefile all
113 .PHONY: bootstrap default $(ORDINARY_GOALS)
115 endif
116 endif
117 endif