blob: 2e5a9f40ed1365db515fafaae7f2dfdf163961a5 [file] [log] [blame]
Junio C Hamano2731d042005-12-01 12:26:41 -08001# The default target of this Makefile is...
Junio C Hamano6fc301b2007-01-10 12:24:54 -08002all::
Junio C Hamano2731d042005-12-01 12:26:41 -08003
Shawn O. Pearce2314c942007-03-06 02:09:14 -05004# Define V=1 to have a more verbose compile.
Shawn O. Pearce74f2b2a2007-03-06 01:35:01 -05005#
Junio C Hamano0e0aea52009-06-05 18:36:15 -05006# Define SHELL_PATH to a POSIX shell if your /bin/sh is broken.
7#
8# Define SANE_TOOL_PATH to a colon-separated list of paths to prepend
9# to PATH if your tools in /usr/bin are broken.
10#
Gary V. Vaughane88a1352010-05-14 09:31:42 +000011# Define SOCKLEN_T to a suitable type (such as 'size_t') if your
12# system headers do not define a socklen_t type.
13#
Gary V. Vaughanf9f33cd2010-05-14 09:31:43 +000014# Define INLINE to a suitable substitute (such as '__inline' or '') if git
15# fails to compile with errors about undefined inline functions or similar.
16#
Ian Liu Rodrigues3b2c5412014-09-13 11:20:22 -030017# Define SNPRINTF_RETURNS_BOGUS if you are on a system which snprintf()
Michal Rokosc4582f92008-03-05 16:46:13 +010018# or vsnprintf() return -1 instead of number of characters which would
19# have been written to the final string if enough space had been available.
20#
Ian Liu Rodrigues3b2c5412014-09-13 11:20:22 -030021# Define FREAD_READS_DIRECTORIES if you are on a system which succeeds
Jeff King3adf9fd2017-06-14 01:30:18 -040022# when attempting to read from an fopen'ed directory (or even to fopen
23# it at all).
Brandon Caseycba22522008-02-08 20:32:47 -060024#
Jeff King2b081012021-02-26 01:14:35 -050025# Define OPEN_RETURNS_EINTR if your open() system call may return EINTR
26# when a signal is received (as opposed to restarting).
27#
Linus Torvalds765ac8e2006-02-28 15:07:20 -080028# Define NO_OPENSSL environment variable if you do not have OpenSSL.
Petr Baudis5bdac8b2005-07-29 17:48:26 +020029#
Ævar Arnfjörð Bjarmason072473e2017-05-20 21:42:04 +000030# Define USE_LIBPCRE if you have and want to use libpcre. Various
31# commands such as log and grep offer runtime options to use
32# Perl-compatible regular expressions instead of standard or extended
33# POSIX regular expressions.
Michał Kiedrowicz63e7e9d2011-05-09 23:52:05 +020034#
Ævar Arnfjörð Bjarmason75997302021-01-24 02:58:33 +010035# Only libpcre version 2 is supported. USE_LIBPCRE2 is a synonym for
36# USE_LIBPCRE, support for the old USE_LIBPCRE1 has been removed.
Ævar Arnfjörð Bjarmasonfb95e2e2017-06-01 18:20:55 +000037#
Ævar Arnfjörð Bjarmason94da9192017-06-01 18:20:56 +000038# Define LIBPCREDIR=/foo/bar if your PCRE header and library files are
Ævar Arnfjörð Bjarmason75997302021-01-24 02:58:33 +010039# in /foo/bar/include and /foo/bar/lib directories.
Michał Kiedrowicz63e7e9d2011-05-09 23:52:05 +020040#
Kirill Smelkov61f76a32014-03-27 18:22:50 +040041# Define HAVE_ALLOCA_H if you have working alloca(3) defined in that header.
42#
Tay Ray Chuand24d9052011-08-03 20:07:57 +080043# Define NO_CURL if you do not have libcurl installed. git-http-fetch and
Nick Hengeveld58e60dd2005-11-02 11:19:24 -080044# git-http-push are not built, and you cannot use http:// and https://
Tay Ray Chuand24d9052011-08-03 20:07:57 +080045# transports (neither smart nor dumb).
Johannes Schindelinb2c0bd62005-07-31 02:14:23 +020046#
Patrick Mauritz6d9bbc52005-09-19 16:11:19 +020047# Define CURLDIR=/foo/bar if your curl header and library files are in
Junio C Hamanob2feb642014-04-30 10:58:10 -070048# /foo/bar/include and /foo/bar/lib directories.
Patrick Mauritz6d9bbc52005-09-19 16:11:19 +020049#
Remi Pommarelf8915872015-10-21 19:10:46 +020050# Define CURL_CONFIG to curl's configuration program that prints information
51# about the library (e.g., its version number). The default is 'curl-config'.
52#
James Knight23c4bbe2018-11-03 05:12:11 +000053# Define CURL_LDFLAGS to specify flags that you need to link when using libcurl,
54# if you do not want to rely on the libraries provided by CURL_CONFIG. The
55# default value is a result of `curl-config --libs`. An example value for
56# CURL_LDFLAGS is as follows:
57#
58# CURL_LDFLAGS=-lcurl
59#
Nick Hengeveld58e60dd2005-11-02 11:19:24 -080060# Define NO_EXPAT if you do not have expat installed. git-http-push is
Tay Ray Chuand24d9052011-08-03 20:07:57 +080061# not built, and you cannot push using http:// and https:// transports (dumb).
Nick Hengeveld58e60dd2005-11-02 11:19:24 -080062#
Serge van den Boom85b45182009-01-28 21:43:57 +010063# Define EXPATDIR=/foo/bar if your expat header and library files are in
64# /foo/bar/include and /foo/bar/lib directories.
65#
Matt Kraai081fd8d2013-02-11 14:03:45 -080066# Define EXPAT_NEEDS_XMLPARSE_H if you have an old version of expat (e.g.,
67# 1.1 or 1.2) that provides xmlparse.h instead of expat.h.
68#
Ævar Arnfjörð Bjarmason5e9637c2011-11-18 00:14:42 +010069# Define NO_GETTEXT if you don't want Git output to be translated.
70# A translated Git requires GNU libintl or another gettext implementation,
71# plus libintl-perl at runtime.
72#
Alex Riesenad17ea72012-01-23 14:04:29 -080073# Define USE_GETTEXT_SCHEME and set it to 'fallthrough', if you don't trust
74# the installed gettext translation of the shell scripts output.
75#
Ævar Arnfjörð Bjarmason5e9637c2011-11-18 00:14:42 +010076# Define HAVE_LIBCHARSET_H if you haven't set NO_GETTEXT and you can't
77# trust the langinfo.h's nl_langinfo(CODESET) function to return the
78# current character set. GNU and Solaris have a nl_langinfo(CODESET),
79# FreeBSD can use either, but MinGW and some others need to use
80# libcharset.h's locale_charset() instead.
81#
Дилян Палаузов3064b132014-03-11 23:37:33 +010082# Define CHARSET_LIB to the library you need to link with in order to
Дилян Палаузовb5225282012-02-12 17:23:36 +010083# use locale_charset() function. On some platforms this needs to set to
Дилян Палаузов3064b132014-03-11 23:37:33 +010084# -lcharset, on others to -liconv .
Дилян Палаузовb5225282012-02-12 17:23:36 +010085#
Ævar Arnfjörð Bjarmason5e9637c2011-11-18 00:14:42 +010086# Define LIBC_CONTAINS_LIBINTL if your gettext implementation doesn't
87# need -lintl when linking.
88#
89# Define NO_MSGFMT_EXTENDED_OPTIONS if your implementation of msgfmt
90# doesn't support GNU extensions like --check and --statistics
91#
Chris Webbcb6a22c2010-04-13 10:07:13 +010092# Define HAVE_PATHS_H if you have paths.h and want to use the default PATH
93# it specifies.
94#
Junio C Hamano63be37b2006-01-19 17:13:57 -080095# Define NO_D_TYPE_IN_DIRENT if your platform defines DT_UNKNOWN but lacks
Eric Blakea50dec22010-04-01 16:43:54 -060096# d_type in struct dirent (Cygwin 1.5, fixed in Cygwin 1.7).
Junio C Hamano63be37b2006-01-19 17:13:57 -080097#
David Michaelb3e103d2012-12-14 14:57:01 -050098# Define HAVE_STRINGS_H if you have strings.h and need it for strcasecmp.
99#
Linus Torvaldsef34af22005-09-18 18:30:50 -0700100# Define NO_STRCASESTR if you don't have strcasestr.
101#
René Scharfeb21b9f12007-09-07 00:32:54 +0200102# Define NO_MEMMEM if you don't have memmem.
103#
Matt Kraai40036be2012-12-18 14:03:55 -0800104# Define NO_GETPAGESIZE if you don't have getpagesize.
105#
Peter Eriksen817151e2006-06-24 16:01:25 +0200106# Define NO_STRLCPY if you don't have strlcpy.
107#
Nick Alcocke3eed7f2011-11-02 15:46:22 +0000108# Define NO_STRTOUMAX if you don't have both strtoimax and strtoumax in the
109# C library. If your compiler also does not support long long or does not have
Jason Riedybc6b4f52007-02-19 16:22:56 -0800110# strtoull, define NO_STRTOULL.
111#
Jason Riedye40b61f2005-12-02 15:08:28 -0800112# Define NO_SETENV if you don't have setenv in the C library.
113#
Jakub Narebskibfa8fcc2008-01-18 02:03:51 +0100114# Define NO_UNSETENV if you don't have unsetenv in the C library.
115#
Shawn O. Pearceca5bb5d2007-10-20 16:03:49 -0400116# Define NO_MKDTEMP if you don't have mkdtemp in the C library.
117#
Joachim Schmitzdc9f4622012-09-08 19:01:31 +0200118# Define MKDIR_WO_TRAILING_SLASH if your mkdir() can't deal with trailing slash.
119#
Rafael Gieschke590e0812011-05-19 13:37:55 +0200120# Define NO_GECOS_IN_PWENT if you don't have pw_gecos in struct passwd
121# in the C library.
122#
David Aguilare1c06882009-05-31 01:35:51 -0700123# Define NO_LIBGEN_H if you don't have libgen.h.
124#
Brandon Caseyecc395c2009-07-10 12:10:45 -0500125# Define NEEDS_LIBGEN if your libgen needs -lgen when linking
126#
Robert Schiele26009732008-01-24 19:34:46 +0100127# Define NO_SYS_SELECT_H if you don't have sys/select.h.
128#
Junio C Hamano9f0bb902006-05-02 00:40:24 -0700129# Define NO_SYMLINK_HEAD if you never want .git/HEAD to be a symbolic link.
130# Enable it on Windows. By default, symrefs are still used.
Pavel Roskin2fabd212005-11-15 00:59:50 -0500131#
Pavel Roskin02853582006-07-09 02:44:58 -0700132# Define NO_SVN_TESTS if you want to skip time-consuming SVN interoperability
Eric Wong60d02cc2006-07-06 00:14:16 -0700133# tests. These tests take up a significant amount of the total test time
134# but are not needed unless you plan to talk to SVN repos.
135#
Shawn Pearce8eb38ca2006-07-24 00:28:28 -0400136# Define NO_FINK if you are building on Darwin/Mac OS X, have Fink
137# installed in /sw, but don't want GIT to link against any libraries
138# installed there. If defined you may specify your own (or Fink's)
139# include directories and library directories by defining CFLAGS
140# and LDFLAGS appropriately.
141#
142# Define NO_DARWIN_PORTS if you are building on Darwin/Mac OS X,
143# have DarwinPorts installed in /opt/local, but don't want GIT to
144# link against any libraries installed there. If defined you may
145# specify your own (or DarwinPort's) include directories and
146# library directories by defining CFLAGS and LDFLAGS appropriately.
147#
David Aguilar4dcd7732013-05-19 06:23:34 -0400148# Define NO_APPLE_COMMON_CRYPTO if you are building on Darwin/Mac OS X
149# and do not want to use Apple's CommonCrypto library. This allows you
150# to provide your own OpenSSL library, for example from MacPorts.
151#
Jonathan Niederf2001972012-07-23 01:29:14 -0500152# Define BLK_SHA1 environment variable to make use of the bundled
153# optimized C SHA1 routine.
Linus Torvaldsd7c208a2009-08-05 16:13:20 -0700154#
Petr Baudis5bdac8b2005-07-29 17:48:26 +0200155# Define PPC_SHA1 environment variable when running make to make use of
156# a bundled SHA1 routine optimized for PowerPC.
Junio C Hamano597c9cc2005-09-07 12:22:56 -0700157#
Jeff King8325e432017-03-16 18:09:12 -0400158# Define DC_SHA1 to unconditionally enable the collision-detecting sha1
159# algorithm. This is slower, but may detect attempted collision attacks.
160# Takes priority over other *_SHA1 knobs.
161#
Takashi Iwai3964cbb2017-08-15 14:04:17 +0200162# Define DC_SHA1_EXTERNAL in addition to DC_SHA1 if you want to build / link
163# git with the external SHA1 collision-detect library.
164# Without this option, i.e. the default behavior is to build git with its
165# own built-in code (or submodule).
166#
Ævar Arnfjörð Bjarmason86cfd612017-07-01 22:05:46 +0000167# Define DC_SHA1_SUBMODULE in addition to DC_SHA1 to use the
168# sha1collisiondetection shipped as a submodule instead of the
169# non-submodule copy in sha1dc/. This is an experimental option used
170# by the git project to migrate to using sha1collisiondetection as a
171# submodule.
172#
Junio C Hamanoe6b07da2017-03-17 10:00:15 -0700173# Define OPENSSL_SHA1 environment variable when running make to link
174# with the SHA1 routine from openssl library.
175#
Atousa Pahlevan Duprat001fd7a2015-11-04 22:38:42 -0800176# Define SHA1_MAX_BLOCK_SIZE to limit the amount of data that will be hashed
177# in one call to the platform's SHA1_Update(). e.g. APPLE_COMMON_CRYPTO
178# wants 'SHA1_MAX_BLOCK_SIZE=1024L*1024L*1024L' defined.
179#
brian m. carlson27dc04c2018-11-14 04:09:37 +0000180# Define BLK_SHA256 to use the built-in SHA-256 routines.
181#
182# Define GCRYPT_SHA256 to use the SHA-256 routines in libgcrypt.
183#
brian m. carlson4b4e2912018-11-14 04:09:38 +0000184# Define OPENSSL_SHA256 to use the SHA-256 routines in OpenSSL.
185#
Brian Gernhardt0460dba2009-09-08 09:54:38 -0400186# Define NEEDS_CRYPTO_WITH_SSL if you need -lcrypto when using -lssl (Darwin).
187#
188# Define NEEDS_SSL_WITH_CRYPTO if you need -lssl when using -lcrypto (Darwin).
Patrick Mauritzf0ebff02005-09-06 01:24:03 +0200189#
Junio C Hamano597c9cc2005-09-07 12:22:56 -0700190# Define NEEDS_LIBICONV if linking with libc is not enough (Darwin).
Patrick Mauritzf0ebff02005-09-06 01:24:03 +0200191#
Joachim Schmitz6c109902012-09-19 12:03:30 +0200192# Define NEEDS_LIBINTL_BEFORE_LIBICONV if you need libintl before libiconv.
193#
Justin Lebar01689902014-03-31 15:11:46 -0700194# Define NO_INTPTR_T if you don't have intptr_t or uintptr_t.
Joachim Schmitz6c109902012-09-19 12:03:30 +0200195#
196# Define NO_UINTMAX_T if you don't have uintmax_t.
197#
Patrick Mauritzf0ebff02005-09-06 01:24:03 +0200198# Define NEEDS_SOCKET if linking with libc is not enough (SunOS,
199# Patrick Mauritz).
200#
Brandon Casey70cf9912009-06-05 18:36:10 -0500201# Define NEEDS_RESOLV if linking with -lnsl and/or -lsocket is not enough.
202# Notably on Solaris hstrerror resides in libresolv and on Solaris 7
203# inet_ntop and inet_pton additionally reside there.
204#
Johannes Schindelin730d48a2005-10-08 15:54:36 -0700205# Define NO_MMAP if you want to avoid mmap.
206#
Michael Haggerty5b633612017-09-25 10:00:10 +0200207# Define MMAP_PREVENTS_DELETE if a file that is currently mmapped cannot be
208# deleted or cannot be replaced using rename().
209#
Đoàn Trần Công Danh2648ccc2018-11-14 08:10:43 +0700210# Define NO_POLL_H if you don't have poll.h.
211#
Joachim Schmitz6d45eb12012-09-17 23:16:39 +0200212# Define NO_SYS_POLL_H if you don't have sys/poll.h.
213#
214# Define NO_POLL if you do not have or don't want to use poll().
Đoàn Trần Công Danh2648ccc2018-11-14 08:10:43 +0700215# This also implies NO_POLL_H and NO_SYS_POLL_H.
Joachim Schmitz6d45eb12012-09-17 23:16:39 +0200216#
Junio C Hamanob2d05e02012-12-18 09:35:33 -0800217# Define NEEDS_SYS_PARAM_H if you need to include sys/param.h to compile,
218# *PLEASE* REPORT to git@vger.kernel.org if your platform needs this;
219# we want to know more about the issue.
David Michael6ede7202012-12-14 14:56:58 -0500220#
Junio C Hamano46059cc2008-11-15 04:08:14 -0800221# Define NO_PTHREADS if you do not have or do not want to use Pthreads.
222#
Stefan-W. Hahn69006792007-01-09 22:04:12 +0100223# Define NO_PREAD if you have a problem with pread() system call (e.g.
Eric Blakea50dec22010-04-01 16:43:54 -0600224# cygwin1.dll before v1.5.22).
Stefan-W. Hahn69006792007-01-09 22:04:12 +0100225#
Joachim Schmitz7f9e8482012-09-08 18:54:34 +0200226# Define NO_SETITIMER if you don't have setitimer()
227#
228# Define NO_STRUCT_ITIMERVAL if you don't have struct itimerval
229# This also implies NO_SETITIMER
230#
Shawn O. Pearce1510fea2006-12-14 06:15:57 -0500231# Define NO_FAST_WORKING_DIRECTORY if accessing objects in pack files is
232# generally faster on your platform than accessing the working directory.
233#
Shawn O. Pearcec8697532006-12-30 23:53:55 -0500234# Define NO_TRUSTABLE_FILEMODE if your filesystem may claim to support
235# the executable mode bit, but doesn't really do so.
236#
David Michaeld543d9c2014-12-03 21:24:17 -0500237# Define NEEDS_MODE_TRANSLATION if your OS strays from the typical file type
238# bits in mode values (e.g. z/OS defines I_SFMT to 0xFF000000 as opposed to the
239# usual 0xF000).
240#
hpa49744d62005-09-28 16:52:21 -0700241# Define NO_IPV6 if you lack IPv6 support and getaddrinfo().
242#
Johannes Sixt63203582011-12-12 22:12:56 +0100243# Define NO_UNIX_SOCKETS if your system does not offer unix sockets.
244#
Junio C Hamanobdc37f52006-01-19 17:13:32 -0800245# Define NO_SOCKADDR_STORAGE if your platform does not have struct
246# sockaddr_storage.
247#
Fernando J. Peredab6e56ec2006-02-16 09:38:01 +0100248# Define NO_ICONV if your libc does not properly support iconv.
249#
Ramsay Jonesfd547a92007-03-03 18:29:03 +0000250# Define OLD_ICONV if your library has an old iconv(), where the second
251# (input buffer pointer) parameter is declared with type (const char **).
252#
brian m. carlson79444c92019-02-12 00:52:06 +0000253# Define ICONV_OMITS_BOM if your iconv implementation does not write a
254# byte-order mark (BOM) when writing UTF-16 or UTF-32 and always writes in
255# big-endian format.
256#
David Symonds609a2282007-11-07 14:24:28 +1100257# Define NO_DEFLATE_BOUND if your zlib does not have deflateBound.
258#
Han-Wen Nienhuysa3229202021-10-07 20:25:03 +0000259# Define NO_UNCOMPRESS2 if your zlib does not have uncompress2.
260#
Junio C Hamano6520c842011-06-18 18:07:03 -0700261# Define NO_NORETURN if using buggy versions of gcc 4.6+ and profile feedback,
262# as the compiler can crash (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49299)
263#
Petr Baudis5bdac8b2005-07-29 17:48:26 +0200264# Define USE_NSEC below if you want git to care about sub-second file mtimes
Karsten Bleesb1ffafa2015-07-01 21:10:52 +0200265# and ctimes. Note that you need recent glibc (at least 2.2.4) for this. On
266# Linux, kernel 2.6.11 or newer is required for reliable sub-second file times
267# on file systems with exactly 1 ns or 1 s resolution. If you intend to use Git
268# on other file systems (e.g. CEPH, CIFS, NTFS, UDF), don't enable USE_NSEC. See
269# Documentation/technical/racy-git.txt for details.
Junio C Hamanof6af75d2006-06-23 17:57:48 -0700270#
Brian Gernhardtc5673832009-03-08 16:04:28 -0400271# Define USE_ST_TIMESPEC if your "struct stat" uses "st_ctimespec" instead of
272# "st_ctim"
273#
Kjetil Barvikc06ff492009-03-04 18:47:40 +0100274# Define NO_NSEC if your "struct stat" does not have "st_ctim.tv_nsec"
275# available. This automatically turns USE_NSEC off.
276#
Petr Baudis5bdac8b2005-07-29 17:48:26 +0200277# Define USE_STDEV below if you want git to care about the underlying device
Johannes Schindelin10455d22007-11-30 11:35:23 +0000278# change being considered an inode change from the update-index perspective.
Alex Riesenf8487182006-12-04 10:50:04 +0100279#
Junio C Hamanofdb2a2a2008-08-18 21:57:16 +0200280# Define NO_ST_BLOCKS_IN_STRUCT_STAT if your platform does not have st_blocks
281# field that counts the on-disk footprint in 512-byte blocks.
282#
Thomas Rast204d3632009-10-22 10:19:06 +0200283# Define GNU_ROFF if your target system uses GNU groff. This forces
284# apostrophes to be ASCII so that cut&pasting examples to the shell
285# will work.
286#
brian m. carlsonec3366e2017-01-22 02:41:56 +0000287# Define USE_ASCIIDOCTOR to use Asciidoctor instead of AsciiDoc to build the
288# documentation.
289#
290# Define ASCIIDOCTOR_EXTENSIONS_LAB to point to the location of the Asciidoctor
291# Extensions Lab if you have it available.
292#
Junio C Hamanocdbada72013-01-13 22:48:07 -0800293# Define PERL_PATH to the path of your Perl binary (usually /usr/bin/perl).
294#
Jeff King499c2932009-04-03 15:32:20 -0400295# Define NO_PERL if you do not want Perl scripts or libraries at all.
296#
Todd Zullinger075321c2018-03-03 15:38:16 +0000297# Define NO_PERL_CPAN_FALLBACKS if you do not want to install bundled
298# copies of CPAN modules that serve as a fallback in case the modules
299# are not available on the system. This option is intended for
300# distributions that want to use their packaged versions of Perl
301# modules, instead of the fallbacks shipped with Git.
302#
Junio C Hamanocdbada72013-01-13 22:48:07 -0800303# Define PYTHON_PATH to the path of your Python binary (often /usr/bin/python
Đoàn Trần Công Danhfcedbc12020-12-10 21:30:17 +0700304# but /usr/bin/python2.7 or /usr/bin/python3 on some platforms).
Junio C Hamanocdbada72013-01-13 22:48:07 -0800305#
Johan Herlandd4e1b472009-11-18 02:42:31 +0100306# Define NO_PYTHON if you do not want Python scripts or libraries at all.
307#
Eygene Ryabinkin3cfaf112007-03-28 04:00:23 -0700308# Define NO_TCLTK if you do not want Tcl/Tk GUI.
309#
Junio C Hamano71b40102016-03-08 15:47:57 -0800310# Define SANE_TEXT_GREP to "-a" if you use recent versions of GNU grep
311# and egrep that are pickier when their input contains non-ASCII data.
312#
Shawn O. Pearce5f5dbd72007-05-07 23:36:31 -0400313# The TCL_PATH variable governs the location of the Tcl interpreter
314# used to optimize git-gui for your system. Only used if NO_TCLTK
315# is not set. Defaults to the bare 'tclsh'.
316#
317# The TCLTK_PATH variable governs the location of the Tcl/Tk interpreter.
Eygene Ryabinkin81b63c72007-03-28 04:12:07 -0700318# If not set it defaults to the bare 'wish'. If it is set to the empty
319# string then NO_TCLTK will be forced (this is used by configure script).
320#
Brian Downing43fe9012008-02-05 15:10:44 -0600321# Define INTERNAL_QSORT to use Git's implementation of qsort(), which
322# is a simplified version of the merge sort used in glibc. This is
323# recommended if Git triggers O(n^2) behavior in your platform's qsort().
324#
René Scharfe04ee8b82017-01-22 18:51:11 +0100325# Define HAVE_ISO_QSORT_S if your platform provides a qsort_s() that's
326# compatible with the one described in C11 Annex K.
327#
Johannes Sixt34779c52009-04-20 10:17:00 +0200328# Define UNRELIABLE_FSTAT if your system's fstat does not return the same
329# information on a not yet closed file that lstat would return for the same
330# file after it was closed.
Johannes Schindelinbe66a6c2009-04-25 11:57:14 +0200331#
Johannes Schindelin348df162009-04-28 00:32:25 +0200332# Define OBJECT_CREATION_USES_RENAMES if your operating systems has problems
333# when hardlinking a file to another name and unlinking the original file right
Johannes Schindelinbe66a6c2009-04-25 11:57:14 +0200334# away (some NTFS drivers seem to zero the contents in that scenario).
Junio C Hamano2c8f8b12009-05-23 01:43:08 -0700335#
Ævar Arnfjörð Bjarmasonad874602018-03-13 20:39:35 +0000336# Define INSTALL_SYMLINKS if you prefer to have everything that can be
337# symlinked between bin/ and libexec/ to use relative symlinks between
338# the two. This option overrides NO_CROSS_DIRECTORY_HARDLINKS and
339# NO_INSTALL_HARDLINKS which will also use symlinking by indirection
340# within the same directory in some cases, INSTALL_SYMLINKS will
341# always symlink to the final target directly.
342#
Johannes Schindelin3426e342009-05-11 13:02:18 +0200343# Define NO_CROSS_DIRECTORY_HARDLINKS if you plan to distribute the installed
344# programs as a tar, where bin/ and libexec/ might be on different file systems.
Marius Storm-Olsenf0ed8222009-05-31 18:15:23 +0200345#
Junio C Hamano70de5e62012-05-02 15:12:10 -0700346# Define NO_INSTALL_HARDLINKS if you prefer to use either symbolic links or
347# copies to install built-in git commands e.g. git-cat-file.
348#
Johannes Schindelin179227d2020-09-21 22:28:16 +0000349# Define SKIP_DASHED_BUILT_INS if you do not need the dashed versions of the
350# built-ins to be linked/copied at all.
351#
Marius Storm-Olsenf0ed8222009-05-31 18:15:23 +0200352# Define USE_NED_ALLOCATOR if you want to replace the platforms default
353# memory allocators with the nedmalloc allocator written by Niall Douglas.
Jeff King02232ad2009-06-16 15:07:40 -0400354#
René Scharfeca2baa32016-09-03 17:59:15 +0200355# Define OVERRIDE_STRDUP to override the libc version of strdup(3).
356# This is necessary when using a custom allocator in order to avoid
357# crashes due to allocation and free working on different 'heaps'.
358# It's defined automatically if USE_NED_ALLOCATOR is set.
359#
Johannes Schindelin2f895222016-09-21 20:24:04 +0200360# Define NO_REGEX if your C library lacks regex support with REG_STARTEND
361# feature.
Jonathan Nieder8f4b5762009-10-30 20:44:41 -0500362#
Jeff King21aeafc2011-12-10 05:41:01 -0500363# Define HAVE_DEV_TTY if your system can open /dev/tty to interact with the
364# user.
365#
Jakub Narebski63267de2009-09-01 13:39:20 +0200366# Define JSMIN to point to JavaScript minifier that functions as
367# a filter to have gitweb.js minified.
Junio C Hamano8678bc02009-12-01 11:28:15 -0800368#
Mark Rada0e6ce212010-04-02 20:35:05 -0400369# Define CSSMIN to point to a CSS minifier in order to generate a minified
370# version of gitweb.css
371#
Junio C Hamanoa3d023d2009-10-30 20:45:34 -0500372# Define DEFAULT_PAGER to a sensible pager command (defaults to "less") if
373# you want to use something different. The value will be interpreted by the
374# shell at runtime when it is used.
375#
Jonathan Nieder8f4b5762009-10-30 20:44:41 -0500376# Define DEFAULT_EDITOR to a sensible editor command (defaults to "vi") if you
377# want to use something different. The value will be interpreted by the shell
378# if necessary when it is used. Examples:
379#
380# DEFAULT_EDITOR='~/bin/vi',
381# DEFAULT_EDITOR='$GIT_FALLBACK_EDITOR',
382# DEFAULT_EDITOR='"C:\Program Files\Vim\gvim.exe" --nofork'
Jonathan Niederdfea5752010-01-26 09:52:49 -0600383#
Jonathan Nieder024c8432011-11-18 03:58:21 -0600384# Define COMPUTE_HEADER_DEPENDENCIES to "yes" if you want dependencies on
385# header files to be automatically computed, to avoid rebuilding objects when
386# an unrelated header file changes. Define it to "no" to use the hard-coded
387# dependency rules. The default is "auto", which means to use computed header
388# dependencies if your compiler is detected to support it.
389#
Eyvind Bernhardsen942e7742010-06-04 21:29:08 +0200390# Define NATIVE_CRLF if your platform uses CRLF for line endings.
Thomas Rast6942efc2012-04-06 23:01:23 +0200391#
Jeff King42dcbb72012-06-02 15:01:12 -0400392# Define GIT_USER_AGENT if you want to change how git identifies itself during
393# network interactions. The default is "git/$(GIT_VERSION)".
Junio C Hamanoa88d7aa2012-06-21 14:42:38 -0700394#
Vincent van Ravesteijn1cc8af02012-06-06 20:28:16 +0000395# Define DEFAULT_HELP_FORMAT to "man", "info" or "html"
396# (defaults to "man") if you want to have a different default when
397# "git help" is called without a parameter specifying the format.
Thomas Gummerer5d9fc882014-02-23 21:49:58 +0100398#
Ben Peart1f357b02018-09-18 23:29:36 +0000399# Define GIT_TEST_INDEX_VERSION to 2, 3 or 4 to run the test suite
Thomas Gummerer5d9fc882014-02-23 21:49:58 +0100400# with a different indexfile format version. If it isn't set the index
401# file format used is index-v[23].
Junio C Hamanobdb830c2014-04-08 11:59:05 -0700402#
Đoàn Trần Công Danh482c9622021-06-08 13:56:28 +0700403# Define GIT_TEST_UTF8_LOCALE to preferred utf-8 locale for testing.
404# If it isn't set, fallback to $LC_ALL, $LANG or use the first utf-8
405# locale returned by "locale -a".
406#
Ronald Wamplerd19e3a52016-07-07 16:45:54 -0400407# Define HAVE_CLOCK_GETTIME if your platform has clock_gettime.
Reuben Hawkinsa6c3c632015-01-08 12:00:56 -0800408#
Ronald Wamplerd19e3a52016-07-07 16:45:54 -0400409# Define HAVE_CLOCK_MONOTONIC if your platform has CLOCK_MONOTONIC.
410#
411# Define NEEDS_LIBRT if your platform requires linking with librt (glibc version
412# before 2.17) for clock_gettime and CLOCK_MONOTONIC.
Reuben Hawkins88e01182015-01-08 12:00:57 -0800413#
Kyle J. McKay290c8e72015-01-11 12:09:22 -0800414# Define USE_PARENS_AROUND_GETTEXT_N to "yes" if your compiler happily
415# compiles the following initialization:
416#
417# static const char s[] = ("FOO");
418#
419# and define it to "no" if you need to remove the parentheses () around the
420# constant. The default is "auto", which means to use parentheses if your
421# compiler is detected to support it.
Junio C Hamano551fc7a2015-03-20 13:11:49 -0700422#
Kyle J. McKay95290802015-03-07 23:14:36 -0800423# Define HAVE_BSD_SYSCTL if your platform has a BSD-compatible sysctl function.
Jeff King0cc30e02015-04-16 05:01:38 -0400424#
425# Define HAVE_GETDELIM if your system has the getdelim() function.
Eric Wong995bc222016-08-04 11:40:25 +0000426#
Duy Nguyen18a4f6b2019-02-12 21:14:41 +0700427# Define FILENO_IS_A_MACRO if fileno() is a macro, not a real function.
428#
Clément Chigot400caaf2019-04-25 07:01:56 +0000429# Define NEED_ACCESS_ROOT_HANDLER if access() under root may success for X_OK
430# even if execution permission isn't granted for any user.
431#
Eric Wong995bc222016-08-04 11:40:25 +0000432# Define PAGER_ENV to a SP separated VAR=VAL pairs to define
433# default environment variables to be passed when a pager is spawned, e.g.
434#
435# PAGER_ENV = LESS=FRX LV=-c
436#
437# to say "export LESS=FRX (and LV=-c) if the environment variable
438# LESS (and LV) is not set, respectively".
Eric Sunshineb2289402017-12-15 00:34:34 +0100439#
Jeff King3f824e92017-12-08 05:47:22 -0500440# Define TEST_SHELL_PATH if you want to use a shell besides SHELL_PATH for
441# running the test scripts (e.g., bash has better support for "set -x"
442# tracing).
Junio C Hamano07b747d2018-01-05 13:28:09 -0800443#
Eric Sunshineb2289402017-12-15 00:34:34 +0100444# When cross-compiling, define HOST_CPU as the canonical name of the CPU on
445# which the built Git will run (for instance "x86_64").
Dan Jacques07d90ea2018-04-10 11:05:43 -0400446#
447# Define RUNTIME_PREFIX to configure Git to resolve its ancillary tooling and
448# support files relative to the location of the runtime binary, rather than
449# hard-coding them into the binary. Git installations built with RUNTIME_PREFIX
450# can be moved to arbitrary filesystem locations. RUNTIME_PREFIX also causes
451# Perl scripts to use a modified entry point header allowing them to resolve
452# support files at runtime.
Dan Jacques226c0dd2018-04-10 11:05:44 -0400453#
454# When using RUNTIME_PREFIX, define HAVE_BSD_KERN_PROC_SYSCTL if your platform
455# supports the KERN_PROC BSD sysctl function.
456#
457# When using RUNTIME_PREFIX, define PROCFS_EXECUTABLE_PATH if your platform
458# mounts a "procfs" filesystem capable of resolving the path of the current
459# executable. If defined, this must be the canonical path for the "procfs"
460# current executable path.
461#
462# When using RUNTIME_PREFIX, define HAVE_NS_GET_EXECUTABLE_PATH if your platform
463# supports calling _NSGetExecutablePath to retrieve the path of the running
464# executable.
Johannes Schindelinc1be1cb2018-04-10 11:05:45 -0400465#
466# When using RUNTIME_PREFIX, define HAVE_WPGMPTR if your platform offers
467# the global variable _wpgmptr containing the absolute path of the current
468# executable (this is the case on Windows).
Junio C Hamanoe998e7a2018-05-08 15:59:21 +0900469#
Philippe Blain3821c382020-09-03 22:13:38 +0000470# Define GENERATE_COMPILATION_DATABASE to "yes" to generate JSON compilation
471# database entries during compilation if your compiler supports it, using the
472# `-MJ` flag. The JSON entries will be placed in the `compile_commands/`
473# directory, and the JSON compilation database 'compile_commands.json' will be
474# created at the root of the repository.
475#
Nguyễn Thái Ngọc Duy1da15802018-04-14 19:19:44 +0000476# Define DEVELOPER to enable more compiler warnings. Compiler version
477# and family are auto detected, but could be overridden by defining
Ævar Arnfjörð Bjarmason6d5d4b42019-02-22 15:41:27 +0100478# COMPILER_FEATURES (see config.mak.dev). You can still set
479# CFLAGS="..." in combination with DEVELOPER enables, whether that's
480# for tweaking something unrelated (e.g. optimization level), or for
481# selectively overriding something DEVELOPER or one of the DEVOPTS
482# (see just below) brings in.
Ævar Arnfjörð Bjarmason99f763b2018-04-14 19:19:45 +0000483#
484# When DEVELOPER is set, DEVOPTS can be used to control compiler
485# options. This variable contains keywords separated by
ryenus571fb962019-12-15 15:12:24 +0000486# whitespace. The following keywords are recognized:
Ævar Arnfjörð Bjarmason99f763b2018-04-14 19:19:45 +0000487#
488# no-error:
489#
490# suppresses the -Werror that implicitly comes with
491# DEVELOPER=1. Useful for getting the full set of errors
492# without immediately dying, or for logging them.
Ævar Arnfjörð Bjarmason26d2e4f2018-04-14 19:19:46 +0000493#
494# extra-all:
495#
496# The DEVELOPER mode enables -Wextra with a few exceptions. By
497# setting this flag the exceptions are removed, and all of
498# -Wextra is used.
Beat Bolli729b3922018-07-24 21:26:43 +0200499#
500# pedantic:
501#
502# Enable -pedantic compilation. This also disables
503# USE_PARENS_AROUND_GETTEXT_N to produce only relevant warnings.
Petr Baudis5bdac8b2005-07-29 17:48:26 +0200504
Jonathan Nieder13fca9f2010-01-06 02:06:58 -0600505GIT-VERSION-FILE: FORCE
Fredrik Kuivinen36546382006-02-14 00:15:14 +0100506 @$(SHELL_PATH) ./GIT-VERSION-GEN
Junio C Hamano9b88fce2005-12-27 14:40:17 -0800507-include GIT-VERSION-FILE
Petr Baudis5bdac8b2005-07-29 17:48:26 +0200508
Ævar Arnfjörð Bjarmason65260a42019-02-22 15:41:24 +0100509# Set our default configuration.
510#
Johannes Sixt49fa65a2008-07-23 21:12:18 +0200511# Among the variables below, these:
512# gitexecdir
513# template_dir
Johannes Sixt9fb1e692011-05-09 10:24:55 +0200514# sysconfdir
Steffen Prohaska026fa0d2009-01-18 13:00:09 +0100515# can be specified as a relative path some/where/else;
516# this is interpreted as relative to $(prefix) and "git" at
Johannes Sixt49fa65a2008-07-23 21:12:18 +0200517# runtime figures out where they are based on the path to the executable.
John Keeping971f8532013-02-24 19:55:01 +0000518# Additionally, the following will be treated as relative by "git" if they
519# begin with "$(prefix)/":
520# mandir
521# infodir
522# htmldir
Dan Jacques07d90ea2018-04-10 11:05:43 -0400523# localedir
524# perllibdir
Johannes Sixt49fa65a2008-07-23 21:12:18 +0200525# This can help installing the suite in a relocatable way.
526
Pavel Roskinb05701c2005-08-06 01:36:15 -0400527prefix = $(HOME)
Ævar Arnfjörð Bjarmason7bc506d2018-03-13 20:39:33 +0000528bindir = $(prefix)/bin
John Keeping971f8532013-02-24 19:55:01 +0000529mandir = $(prefix)/share/man
530infodir = $(prefix)/share/info
Steffen Prohaska026fa0d2009-01-18 13:00:09 +0100531gitexecdir = libexec/git-core
David Aguilarbc7a96a2011-08-18 00:23:46 -0700532mergetoolsdir = $(gitexecdir)/mergetools
Johannes Sixt93547682007-06-11 10:02:17 +0200533sharedir = $(prefix)/share
Pavan Kumar Sunkarabc951962010-05-28 11:55:50 +0530534gitwebdir = $(sharedir)/gitweb
Ævar Arnfjörð Bjarmason20d2a302017-12-10 21:13:33 +0000535perllibdir = $(sharedir)/perl5
Ævar Arnfjörð Bjarmason5e9637c2011-11-18 00:14:42 +0100536localedir = $(sharedir)/locale
Steffen Prohaska026fa0d2009-01-18 13:00:09 +0100537template_dir = share/git-core/templates
John Keeping971f8532013-02-24 19:55:01 +0000538htmldir = $(prefix)/share/doc/git-doc
Steffen Prohaska026fa0d2009-01-18 13:00:09 +0100539ETC_GITCONFIG = $(sysconfdir)/gitconfig
Petr Onderka6df42ab2010-09-01 00:42:43 +0200540ETC_GITATTRIBUTES = $(sysconfdir)/gitattributes
Robert Schiele10861be2007-08-01 06:30:35 +0200541lib = lib
Stefano Lattarinidd6fc7c2012-12-09 11:36:17 +0100542# DESTDIR =
Johannes Schindelin352c8112009-05-23 10:04:48 +0200543pathsep = :
Petr Baudis5c2a7fb2005-04-13 02:14:06 -0700544
Ævar Arnfjörð Bjarmason7bc506d2018-03-13 20:39:33 +0000545bindir_relative = $(patsubst $(prefix)/%,%,$(bindir))
John Keeping971f8532013-02-24 19:55:01 +0000546mandir_relative = $(patsubst $(prefix)/%,%,$(mandir))
547infodir_relative = $(patsubst $(prefix)/%,%,$(infodir))
Ævar Arnfjörð Bjarmasona4d79b92018-03-13 20:39:34 +0000548gitexecdir_relative = $(patsubst $(prefix)/%,%,$(gitexecdir))
Dan Jacques07d90ea2018-04-10 11:05:43 -0400549localedir_relative = $(patsubst $(prefix)/%,%,$(localedir))
John Keeping971f8532013-02-24 19:55:01 +0000550htmldir_relative = $(patsubst $(prefix)/%,%,$(htmldir))
Dan Jacques07d90ea2018-04-10 11:05:43 -0400551perllibdir_relative = $(patsubst $(prefix)/%,%,$(perllibdir))
John Keeping971f8532013-02-24 19:55:01 +0000552
Ævar Arnfjörð Bjarmason20d2a302017-12-10 21:13:33 +0000553export prefix bindir sharedir sysconfdir gitwebdir perllibdir localedir
Jakub Narebskie14421b2006-06-29 22:11:25 +0200554
Ævar Arnfjörð Bjarmason65260a42019-02-22 15:41:24 +0100555# Set our default programs
Ævar Arnfjörð Bjarmason6d62c982011-12-20 23:40:47 +0000556CC = cc
Pavel Roskinb05701c2005-08-06 01:36:15 -0400557AR = ar
Emil Medve4cb08df2007-07-14 12:51:44 -0500558RM = rm -f
Gary V. Vaughand1b1a912010-05-14 09:31:36 +0000559DIFF = diff
Junio C Hamano229a7ed2005-09-23 10:41:40 -0700560TAR = tar
David Kastrup89b2f192007-07-29 15:23:28 -0700561FIND = find
Pavel Roskinb05701c2005-08-06 01:36:15 -0400562INSTALL = install
Shawn O. Pearce5f5dbd72007-05-07 23:36:31 -0400563TCL_PATH = tclsh
Eygene Ryabinkin81b63c72007-03-28 04:12:07 -0700564TCLTK_PATH = wish
Ævar Arnfjörð Bjarmasoncd5513a2011-02-22 23:41:23 +0000565XGETTEXT = xgettext
Ævar Arnfjörð Bjarmason5e9637c2011-11-18 00:14:42 +0100566MSGFMT = msgfmt
Remi Pommarelf8915872015-10-21 19:10:46 +0200567CURL_CONFIG = curl-config
Thomas Raste146d172010-07-26 09:43:41 +0200568GCOV = gcov
Ævar Arnfjörð Bjarmason9559f8f2019-02-22 15:41:23 +0100569STRIP = strip
René Scharfe63f0a752016-09-15 20:30:56 +0200570SPATCH = spatch
Linus Torvaldse83c5162005-04-07 15:13:13 -0700571
Shawn O. Pearce5f5dbd72007-05-07 23:36:31 -0400572export TCL_PATH TCLTK_PATH
573
Ævar Arnfjörð Bjarmason8fb2a232019-02-22 15:41:25 +0100574# Set our default LIBS variables
575PTHREAD_LIBS = -lpthread
Petr Baudis8d7f5862006-06-25 03:47:03 +0200576
Johannes Schindelin5c928c02009-03-25 17:27:28 +0100577# Guard against environment variables
578BUILTIN_OBJS =
579BUILT_INS =
580COMPAT_CFLAGS =
581COMPAT_OBJS =
Jonathan Nieder3371f9b2011-03-27 13:13:22 -0500582XDIFF_OBJS =
Jeff Kingb8ba6292012-06-20 14:30:56 -0400583GENERATED_H =
Jonathan Niedera673cfe2010-03-19 22:20:12 -0500584EXTRA_CPPFLAGS =
Josh Steadmon5e472152018-10-12 17:58:40 -0700585FUZZ_OBJS =
586FUZZ_PROGRAMS =
Ævar Arnfjörð Bjarmasonabc3c872021-02-23 12:41:30 +0100587GIT_OBJS =
Johannes Schindelin5c928c02009-03-25 17:27:28 +0100588LIB_OBJS =
Ævar Arnfjörð Bjarmason752b3ef2021-02-23 12:41:28 +0100589OBJECTS =
Jonathan Nieder1b22c992010-01-26 09:54:23 -0600590PROGRAM_OBJS =
Johannes Schindelin5c928c02009-03-25 17:27:28 +0100591PROGRAMS =
Johannes Schindelin724d6352019-04-18 06:16:40 -0700592EXCLUDED_PROGRAMS =
Johannes Schindelin5c928c02009-03-25 17:27:28 +0100593SCRIPT_PERL =
Johan Herlandd4e1b472009-11-18 02:42:31 +0100594SCRIPT_PYTHON =
Johannes Schindelin5c928c02009-03-25 17:27:28 +0100595SCRIPT_SH =
Jonathan Nieder46bac902010-01-31 11:46:53 -0800596SCRIPT_LIB =
Nguyễn Thái Ngọc Duyefd71f82018-03-24 08:44:30 +0100597TEST_BUILTINS_OBJS =
Ævar Arnfjörð Bjarmasonbed34192021-02-23 12:41:27 +0100598TEST_OBJS =
Jonathan Nieder225f78c2010-01-26 10:08:44 -0600599TEST_PROGRAMS_NEED_X =
Denton Liu5dedf7d2019-09-16 12:23:11 -0700600THIRD_PARTY_SOURCES =
Johannes Schindelin5c928c02009-03-25 17:27:28 +0100601
Jonathan Niederc40d92e2010-03-19 19:06:15 -0500602# Having this variable in your environment would break pipelines because
603# you cause "cd" to echo its destination to stdout. It can also take
604# scripts to unexpected places. If you like CDPATH, define it for your
605# interactive shell sessions without exporting it.
606unexport CDPATH
607
Junio C Hamano74ca5e62008-03-12 01:46:26 -0700608SCRIPT_SH += git-bisect.sh
David Aguilarafcbc8e2009-04-07 01:21:20 -0700609SCRIPT_SH += git-difftool--helper.sh
Junio C Hamano74ca5e62008-03-12 01:46:26 -0700610SCRIPT_SH += git-filter-branch.sh
Junio C Hamano74ca5e62008-03-12 01:46:26 -0700611SCRIPT_SH += git-merge-octopus.sh
612SCRIPT_SH += git-merge-one-file.sh
613SCRIPT_SH += git-merge-resolve.sh
Junio C Hamano74ca5e62008-03-12 01:46:26 -0700614SCRIPT_SH += git-mergetool.sh
Junio C Hamano74ca5e62008-03-12 01:46:26 -0700615SCRIPT_SH += git-quiltimport.sh
Junio C Hamano74ca5e62008-03-12 01:46:26 -0700616SCRIPT_SH += git-request-pull.sh
Junio C Hamano74ca5e62008-03-12 01:46:26 -0700617SCRIPT_SH += git-submodule.sh
618SCRIPT_SH += git-web--browse.sh
Petr Baudis28818ff2005-07-29 17:50:24 +0200619
Jonathan Nieder46bac902010-01-31 11:46:53 -0800620SCRIPT_LIB += git-mergetool--lib
Alban Gruinc42abfe2018-05-28 14:34:19 +0200621SCRIPT_LIB += git-rebase--preserve-merges
Ævar Arnfjörð Bjarmasone00cf072011-05-14 13:47:43 +0000622SCRIPT_LIB += git-sh-i18n
Denton Liu805d9ea2020-03-21 05:21:20 -0400623SCRIPT_LIB += git-sh-setup
Jonathan Nieder46bac902010-01-31 11:46:53 -0800624
Junio C Hamano74ca5e62008-03-12 01:46:26 -0700625SCRIPT_PERL += git-add--interactive.perl
626SCRIPT_PERL += git-archimport.perl
627SCRIPT_PERL += git-cvsexportcommit.perl
628SCRIPT_PERL += git-cvsimport.perl
629SCRIPT_PERL += git-cvsserver.perl
Junio C Hamano74ca5e62008-03-12 01:46:26 -0700630SCRIPT_PERL += git-send-email.perl
631SCRIPT_PERL += git-svn.perl
Junio C Hamano60036a42005-07-30 17:31:47 -0700632
Pete Wyckoffb6f93052012-04-08 20:18:00 -0400633SCRIPT_PYTHON += git-p4.py
Sverre Rabbelier7aeaa2f2010-03-29 11:48:28 -0500634
Matthieu Moy4c06b412013-02-08 18:31:16 +0100635# Generated files for scripts
636SCRIPT_SH_GEN = $(patsubst %.sh,%,$(SCRIPT_SH))
637SCRIPT_PERL_GEN = $(patsubst %.perl,%,$(SCRIPT_PERL))
638SCRIPT_PYTHON_GEN = $(patsubst %.py,%,$(SCRIPT_PYTHON))
639
640# Individual rules to allow e.g.
641# "make -C ../.. SCRIPT_PERL=contrib/foo/bar.perl build-perl-script"
642# from subdirectories like contrib/*/
643.PHONY: build-perl-script build-sh-script build-python-script
644build-perl-script: $(SCRIPT_PERL_GEN)
645build-sh-script: $(SCRIPT_SH_GEN)
646build-python-script: $(SCRIPT_PYTHON_GEN)
647
648.PHONY: install-perl-script install-sh-script install-python-script
Johannes Schindelin0b64e212019-04-18 06:16:39 -0700649install-sh-script: $(SCRIPT_SH_GEN)
Felipe Contreras654f23f2013-05-24 21:41:02 -0500650 $(INSTALL) $^ '$(DESTDIR_SQ)$(gitexec_instdir_SQ)'
Johannes Schindelin0b64e212019-04-18 06:16:39 -0700651install-perl-script: $(SCRIPT_PERL_GEN)
Felipe Contreras654f23f2013-05-24 21:41:02 -0500652 $(INSTALL) $^ '$(DESTDIR_SQ)$(gitexec_instdir_SQ)'
Johannes Schindelin0b64e212019-04-18 06:16:39 -0700653install-python-script: $(SCRIPT_PYTHON_GEN)
Felipe Contreras654f23f2013-05-24 21:41:02 -0500654 $(INSTALL) $^ '$(DESTDIR_SQ)$(gitexec_instdir_SQ)'
Matthieu Moy4c06b412013-02-08 18:31:16 +0100655
656.PHONY: clean-perl-script clean-sh-script clean-python-script
657clean-sh-script:
658 $(RM) $(SCRIPT_SH_GEN)
659clean-perl-script:
660 $(RM) $(SCRIPT_PERL_GEN)
661clean-python-script:
662 $(RM) $(SCRIPT_PYTHON_GEN)
663
Johannes Schindelin0b64e212019-04-18 06:16:39 -0700664SCRIPTS = $(SCRIPT_SH_GEN) \
665 $(SCRIPT_PERL_GEN) \
666 $(SCRIPT_PYTHON_GEN) \
Shawn O. Pearcee475fe12007-11-23 15:35:08 -0500667 git-instaweb
Andreas Ericssond6ebd252005-11-22 00:44:15 +0100668
Junio C Hamano2f769192010-09-28 16:08:38 -0500669ETAGS_TARGET = TAGS
670
Josh Steadmonaa658572019-01-15 14:25:50 -0800671FUZZ_OBJS += fuzz-commit-graph.o
Josh Steadmon5e472152018-10-12 17:58:40 -0700672FUZZ_OBJS += fuzz-pack-headers.o
Josh Steadmon1127a982018-10-12 17:58:41 -0700673FUZZ_OBJS += fuzz-pack-idx.o
Ævar Arnfjörð Bjarmason029bac02021-02-23 12:41:31 +0100674.PHONY: fuzz-objs
675fuzz-objs: $(FUZZ_OBJS)
Josh Steadmon5e472152018-10-12 17:58:40 -0700676
677# Always build fuzz objects even if not testing, to prevent bit-rot.
678all:: $(FUZZ_OBJS)
679
680FUZZ_PROGRAMS += $(patsubst %.o,%,$(FUZZ_OBJS))
681
Junio C Hamano42f77402006-08-15 21:38:07 -0700682# Empty...
683EXTRA_PROGRAMS =
Andreas Ericssond6ebd252005-11-22 00:44:15 +0100684
Junio C Hamano74ca5e62008-03-12 01:46:26 -0700685# ... and all the rest that could be moved out of bindir to gitexecdir
686PROGRAMS += $(EXTRA_PROGRAMS)
Jonathan Nieder1b22c992010-01-26 09:54:23 -0600687
Erik Faye-Lunda666b472010-11-04 02:35:24 +0100688PROGRAM_OBJS += daemon.o
Nguyễn Thái Ngọc Duy82759052012-05-04 20:52:36 +0700689PROGRAM_OBJS += http-backend.o
Jonathan Nieder1b22c992010-01-26 09:54:23 -0600690PROGRAM_OBJS += imap-send.o
Nguyễn Thái Ngọc Duy82759052012-05-04 20:52:36 +0700691PROGRAM_OBJS += sh-i18n--envsubst.o
Jonathan Nieder1b22c992010-01-26 09:54:23 -0600692PROGRAM_OBJS += shell.o
Ævar Arnfjörð Bjarmason029bac02021-02-23 12:41:31 +0100693.PHONY: program-objs
694program-objs: $(PROGRAM_OBJS)
Jonathan Nieder1b22c992010-01-26 09:54:23 -0600695
Michael Palimakaace5e972012-02-08 21:59:04 +1100696# Binary suffix, set to .exe for Windows builds
697X =
698
Jonathan Nieder1b22c992010-01-26 09:54:23 -0600699PROGRAMS += $(patsubst %.o,git-%$X,$(PROGRAM_OBJS))
Junio C Hamano74ca5e62008-03-12 01:46:26 -0700700
Heba Walyb3b18d12020-03-02 20:01:59 +0000701TEST_BUILTINS_OBJS += test-advise.o
Taylor Blau483fa7f2021-03-31 21:32:11 -0400702TEST_BUILTINS_OBJS += test-bitmap.o
Garima Singhf52207a2020-03-30 00:31:24 +0000703TEST_BUILTINS_OBJS += test-bloom.o
Nguyễn Thái Ngọc Duy0e496492018-03-24 08:44:31 +0100704TEST_BUILTINS_OBJS += test-chmtime.o
Nguyễn Thái Ngọc Duy0e2678a2018-03-24 08:44:34 +0100705TEST_BUILTINS_OBJS += test-config.o
Derrick Stolee2fec6042020-09-11 17:49:18 +0000706TEST_BUILTINS_OBJS += test-crontab.o
Nguyễn Thái Ngọc Duye4998942018-03-24 08:44:35 +0100707TEST_BUILTINS_OBJS += test-ctype.o
Nguyễn Thái Ngọc Duya801a7c2018-03-24 08:44:36 +0100708TEST_BUILTINS_OBJS += test-date.o
Nguyễn Thái Ngọc Duy9153dde2018-03-24 08:44:37 +0100709TEST_BUILTINS_OBJS += test-delta.o
Daniel Ferreira150791a2019-07-10 20:58:57 -0300710TEST_BUILTINS_OBJS += test-dir-iterator.o
Nguyễn Thái Ngọc Duy1c854742018-03-24 08:44:38 +0100711TEST_BUILTINS_OBJS += test-drop-caches.o
Nguyễn Thái Ngọc Duy06ccb292018-03-24 08:44:39 +0100712TEST_BUILTINS_OBJS += test-dump-cache-tree.o
Nguyễn Thái Ngọc Duyf1ef0b02018-09-09 19:36:30 +0200713TEST_BUILTINS_OBJS += test-dump-fsmonitor.o
Nguyễn Thái Ngọc Duy81330612018-03-24 08:44:40 +0100714TEST_BUILTINS_OBJS += test-dump-split-index.o
Nguyễn Thái Ngọc Duycd780f02018-09-09 19:36:27 +0200715TEST_BUILTINS_OBJS += test-dump-untracked-cache.o
Nguyễn Thái Ngọc Duydbceb3e2018-03-24 08:44:41 +0100716TEST_BUILTINS_OBJS += test-example-decorate.o
Elijah Newrenfe1a21d2020-10-29 20:32:13 +0000717TEST_BUILTINS_OBJS += test-fast-rebase.o
Nguyễn Thái Ngọc Duyc6806682018-03-24 08:44:42 +0100718TEST_BUILTINS_OBJS += test-genrandom.o
Johannes Schindelind5cfd142019-02-14 13:33:12 -0800719TEST_BUILTINS_OBJS += test-genzeros.o
Ævar Arnfjörð Bjarmason482e1482021-07-30 18:18:14 +0200720TEST_BUILTINS_OBJS += test-getcwd.o
Denton Liu805d9ea2020-03-21 05:21:20 -0400721TEST_BUILTINS_OBJS += test-hash-speed.o
brian m. carlson50c817e2018-11-14 04:09:32 +0000722TEST_BUILTINS_OBJS += test-hash.o
Nguyễn Thái Ngọc Duy7c18cbd2018-03-24 08:44:43 +0100723TEST_BUILTINS_OBJS += test-hashmap.o
Nguyễn Thái Ngọc Duycc6f6632018-03-24 08:44:44 +0100724TEST_BUILTINS_OBJS += test-index-version.o
Jeff Hostetler75459412018-07-13 16:54:08 +0000725TEST_BUILTINS_OBJS += test-json-writer.o
Nguyễn Thái Ngọc Duy64eb82f2018-03-24 08:44:33 +0100726TEST_BUILTINS_OBJS += test-lazy-init-name-hash.o
Nguyễn Thái Ngọc Duy9080e752018-03-24 08:44:45 +0100727TEST_BUILTINS_OBJS += test-match-trees.o
Nguyễn Thái Ngọc Duy34889d32018-03-24 08:44:46 +0100728TEST_BUILTINS_OBJS += test-mergesort.o
Nguyễn Thái Ngọc Duyd9cc2c82018-03-24 08:44:47 +0100729TEST_BUILTINS_OBJS += test-mktemp.o
Junio C Hamanobf102002020-04-29 16:15:27 -0700730TEST_BUILTINS_OBJS += test-oid-array.o
Christian Couder11510de2019-06-15 12:06:59 +0200731TEST_BUILTINS_OBJS += test-oidmap.o
Eric Wong92d8ed82021-07-07 23:10:19 +0000732TEST_BUILTINS_OBJS += test-oidtree.o
Nguyễn Thái Ngọc Duyc033cc12018-03-24 08:44:48 +0100733TEST_BUILTINS_OBJS += test-online-cpus.o
Nguyễn Thái Ngọc Duy2f17c782018-09-09 19:36:29 +0200734TEST_BUILTINS_OBJS += test-parse-options.o
Alexandr Miloslavskiyd0d0a352019-12-31 10:15:12 +0000735TEST_BUILTINS_OBJS += test-parse-pathspec-file.o
Jonathan Tanef830cc2021-06-17 10:13:26 -0700736TEST_BUILTINS_OBJS += test-partial-clone.o
Nguyễn Thái Ngọc Duyb8d5cf42018-03-24 08:44:49 +0100737TEST_BUILTINS_OBJS += test-path-utils.o
Ævar Arnfjörð Bjarmason95ca1f92021-01-24 18:28:13 +0100738TEST_BUILTINS_OBJS += test-pcre2-config.o
Nguyễn Thái Ngọc Duy8ea40cc2018-09-09 19:36:28 +0200739TEST_BUILTINS_OBJS += test-pkt-line.o
Nguyễn Thái Ngọc Duy15b75812018-03-24 08:44:50 +0100740TEST_BUILTINS_OBJS += test-prio-queue.o
Jiang Xin15d3af52020-08-27 11:45:44 -0400741TEST_BUILTINS_OBJS += test-proc-receive.o
SZEDER Gábor2bb74b52019-09-16 22:54:12 +0200742TEST_BUILTINS_OBJS += test-progress.o
Derrick Stoleeab176ac2018-07-20 16:33:15 +0000743TEST_BUILTINS_OBJS += test-reach.o
Nguyễn Thái Ngọc Duy5fbe6002018-03-24 08:44:51 +0100744TEST_BUILTINS_OBJS += test-read-cache.o
Derrick Stolee4bd05932019-11-12 16:58:20 +0000745TEST_BUILTINS_OBJS += test-read-graph.o
Derrick Stolee4d805602018-07-12 15:39:23 -0400746TEST_BUILTINS_OBJS += test-read-midx.o
Nguyễn Thái Ngọc Duy65370d82018-03-24 08:44:52 +0100747TEST_BUILTINS_OBJS += test-ref-store.o
Han-Wen Nienhuysef8a6c62021-10-07 20:25:00 +0000748TEST_BUILTINS_OBJS += test-reftable.o
Nguyễn Thái Ngọc Duy90385312018-03-24 08:44:53 +0100749TEST_BUILTINS_OBJS += test-regex.o
Jonathan Tandade47c2018-07-11 15:42:42 -0700750TEST_BUILTINS_OBJS += test-repository.o
Nguyễn Thái Ngọc Duy77d4b8c2018-03-24 08:44:54 +0100751TEST_BUILTINS_OBJS += test-revision-walking.o
Nguyễn Thái Ngọc Duyae6a51f2018-03-24 08:44:55 +0100752TEST_BUILTINS_OBJS += test-run-command.o
Nguyễn Thái Ngọc Duyff5fb8b2018-03-24 08:44:56 +0100753TEST_BUILTINS_OBJS += test-scrap-cache-tree.o
Johannes Schindelinb7ce24d2019-04-18 06:16:51 -0700754TEST_BUILTINS_OBJS += test-serve-v2.o
Nguyễn Thái Ngọc Duydae2ff92018-03-24 08:44:32 +0100755TEST_BUILTINS_OBJS += test-sha1.o
brian m. carlson13eeedb2018-11-14 04:09:36 +0000756TEST_BUILTINS_OBJS += test-sha256.o
Nguyễn Thái Ngọc Duye154a6f2018-03-24 08:44:58 +0100757TEST_BUILTINS_OBJS += test-sigchain.o
Jeff Hostetler36a7eb62021-03-22 10:29:48 +0000758TEST_BUILTINS_OBJS += test-simple-ipc.o
Nguyễn Thái Ngọc Duy1a5f3d72018-03-24 08:44:59 +0100759TEST_BUILTINS_OBJS += test-strcmp-offset.o
Nguyễn Thái Ngọc Duyc932a5f2018-03-24 08:45:00 +0100760TEST_BUILTINS_OBJS += test-string-list.o
Nguyễn Thái Ngọc Duyb6188212018-03-24 08:45:01 +0100761TEST_BUILTINS_OBJS += test-submodule-config.o
Antonio Ospite2b1257e2018-10-25 18:18:13 +0200762TEST_BUILTINS_OBJS += test-submodule-nested-repo-config.o
Nguyễn Thái Ngọc Duy112edd62018-03-24 08:45:02 +0100763TEST_BUILTINS_OBJS += test-subprocess.o
Jeff Hostetlera15860d2019-02-22 14:25:10 -0800764TEST_BUILTINS_OBJS += test-trace2.o
Nguyễn Thái Ngọc Duy599fbd82018-03-24 08:45:03 +0100765TEST_BUILTINS_OBJS += test-urlmatch-normalization.o
Ævar Arnfjörð Bjarmason28e8f0d2021-04-08 17:04:21 +0200766TEST_BUILTINS_OBJS += test-userdiff.o
Nguyễn Thái Ngọc Duy04892892018-03-24 08:45:04 +0100767TEST_BUILTINS_OBJS += test-wildmatch.o
Jeff Hostetler06ba9d02018-09-11 13:06:01 -0700768TEST_BUILTINS_OBJS += test-windows-named-pipe.o
Nguyễn Thái Ngọc Duyc81f8432018-03-24 08:45:05 +0100769TEST_BUILTINS_OBJS += test-write-cache.o
Denton Liu805d9ea2020-03-21 05:21:20 -0400770TEST_BUILTINS_OBJS += test-xml-encode.o
Nguyễn Thái Ngọc Duy0e496492018-03-24 08:44:31 +0100771
Nguyễn Thái Ngọc Duyc9a1f412018-09-09 19:36:31 +0200772# Do not add more tests here unless they have extra dependencies. Add
773# them in TEST_BUILTINS_OBJS above.
Johannes Schindelin3064d5a2016-01-27 17:19:37 +0100774TEST_PROGRAMS_NEED_X += test-fake-ssh
Nguyễn Thái Ngọc Duyefd71f82018-03-24 08:44:30 +0100775TEST_PROGRAMS_NEED_X += test-tool
Jonathan Nieder225f78c2010-01-26 10:08:44 -0600776
Nguyễn Thái Ngọc Duye6e75302016-04-13 20:22:42 +0700777TEST_PROGRAMS = $(patsubst %,t/helper/%$X,$(TEST_PROGRAMS_NEED_X))
Andreas Ericssond6ebd252005-11-22 00:44:15 +0100778
Junio C Hamano17368552008-02-23 11:08:25 -0800779# List built-in command $C whose implementation cmd_$C() is not in
Linus Torvalds81b50f32010-02-22 08:42:18 -0800780# builtin/$C.o but is linked in as part of some other command.
781BUILT_INS += $(patsubst builtin/%.o,git-%$X,$(BUILTIN_OBJS))
Junio C Hamano74ca5e62008-03-12 01:46:26 -0700782
Junio C Hamano74ca5e62008-03-12 01:46:26 -0700783BUILT_INS += git-cherry$X
Stephan Beyerfcb6c072009-02-09 23:00:45 +0100784BUILT_INS += git-cherry-pick$X
Junio C Hamano74ca5e62008-03-12 01:46:26 -0700785BUILT_INS += git-format-patch$X
786BUILT_INS += git-fsck-objects$X
Junio C Hamano74ca5e62008-03-12 01:46:26 -0700787BUILT_INS += git-init$X
Jeff King0a21d0e2020-12-01 21:34:11 -0500788BUILT_INS += git-maintenance$X
Junio C Hamano74ca5e62008-03-12 01:46:26 -0700789BUILT_INS += git-merge-subtree$X
Nguyễn Thái Ngọc Duy46e91b62019-04-25 16:45:45 +0700790BUILT_INS += git-restore$X
Junio C Hamano74ca5e62008-03-12 01:46:26 -0700791BUILT_INS += git-show$X
Junio C Hamano24b1f652008-12-03 00:30:34 -0800792BUILT_INS += git-stage$X
Junio C Hamano74ca5e62008-03-12 01:46:26 -0700793BUILT_INS += git-status$X
Nguyễn Thái Ngọc Duyd787d312019-03-29 17:39:05 +0700794BUILT_INS += git-switch$X
Junio C Hamano74ca5e62008-03-12 01:46:26 -0700795BUILT_INS += git-whatchanged$X
Junio C Hamano91730802006-04-10 17:37:58 -0700796
Eygene Ryabinkin3cfaf112007-03-28 04:00:23 -0700797# what 'all' will build but not install in gitexecdir
Jeff King499c2932009-04-03 15:32:20 -0400798OTHER_PROGRAMS = git$X
Eygene Ryabinkin3cfaf112007-03-28 04:00:23 -0700799
Matthew Ogilvieea925192009-12-02 22:14:05 -0700800# what test wrappers are needed and 'install' will install, in bindir
801BINDIR_PROGRAMS_NEED_X += git
Matthew Ogilvieea925192009-12-02 22:14:05 -0700802BINDIR_PROGRAMS_NEED_X += git-receive-pack
Matthew Ogilvieea925192009-12-02 22:14:05 -0700803BINDIR_PROGRAMS_NEED_X += git-shell
Denton Liu805d9ea2020-03-21 05:21:20 -0400804BINDIR_PROGRAMS_NEED_X += git-upload-archive
805BINDIR_PROGRAMS_NEED_X += git-upload-pack
Matthew Ogilvieea925192009-12-02 22:14:05 -0700806
807BINDIR_PROGRAMS_NO_X += git-cvsserver
808
Ryan Anderson3d320512005-11-21 00:11:22 -0500809# Set paths to tools early so that they can be used for version tests.
810ifndef SHELL_PATH
811 SHELL_PATH = /bin/sh
812endif
813ifndef PERL_PATH
814 PERL_PATH = /usr/bin/perl
815endif
Johan Herlandd4e1b472009-11-18 02:42:31 +0100816ifndef PYTHON_PATH
817 PYTHON_PATH = /usr/bin/python
818endif
Junio C Hamano720d1502005-09-10 17:46:27 -0700819
Luben Tuikov3a793472006-12-14 23:03:03 -0800820export PERL_PATH
Johan Herlandd4e1b472009-11-18 02:42:31 +0100821export PYTHON_PATH
Luben Tuikov3a793472006-12-14 23:03:03 -0800822
Jeff King3f824e92017-12-08 05:47:22 -0500823TEST_SHELL_PATH = $(SHELL_PATH)
824
Stefano Lattarinidd6fc7c2012-12-09 11:36:17 +0100825LIB_FILE = libgit.a
826XDIFF_LIB = xdiff/lib.a
Han-Wen Nienhuysef8a6c62021-10-07 20:25:00 +0000827REFTABLE_LIB = reftable/libreftable.a
828REFTABLE_TEST_LIB = reftable/libreftable_test.a
Linus Torvalds0a02ce72005-04-18 12:49:39 -0700829
Nguyễn Thái Ngọc Duy60f487a2018-05-10 10:46:43 +0200830GENERATED_H += command-list.h
Denton Liu8474f262020-10-08 00:39:26 -0700831GENERATED_H += config-list.h
Nguyễn Thái Ngọc Duy1b8b2e42012-04-23 19:30:21 +0700832
Denton Liucf6a2d22019-09-16 12:23:08 -0700833LIB_H := $(sort $(patsubst ./%,%,$(shell git ls-files '*.h' ':!t/' ':!Documentation/' 2>/dev/null || \
Johannes Schindelin92b88eb2019-03-04 05:47:06 -0800834 $(FIND) . \
Jeff Kingd85b0df2014-08-25 16:00:42 -0400835 -name .git -prune -o \
836 -name t -prune -o \
837 -name Documentation -prune -o \
Denton Liucf6a2d22019-09-16 12:23:08 -0700838 -name '*.h' -print)))
Junio C Hamano8f3f9b02005-07-23 17:54:41 -0700839
Dmitry Potapov5b8e6f82008-06-28 00:46:42 +0400840LIB_OBJS += abspath.o
Johannes Schindelinf83dff62019-11-13 12:40:57 +0000841LIB_OBJS += add-interactive.o
Johannes Schindelinf6aa7ec2019-12-13 08:07:48 +0000842LIB_OBJS += add-patch.o
Jeff King75194432009-09-09 07:38:58 -0400843LIB_OBJS += advice.o
Junio C Hamano74ca5e62008-03-12 01:46:26 -0700844LIB_OBJS += alias.o
845LIB_OBJS += alloc.o
Christian Couderbb493a52016-08-08 23:03:07 +0200846LIB_OBJS += apply.o
Junio C Hamano74ca5e62008-03-12 01:46:26 -0700847LIB_OBJS += archive-tar.o
848LIB_OBJS += archive-zip.o
Denton Liu805d9ea2020-03-21 05:21:20 -0400849LIB_OBJS += archive.o
Junio C Hamano74ca5e62008-03-12 01:46:26 -0700850LIB_OBJS += attr.o
851LIB_OBJS += base85.o
Christian Coudera2ad79c2009-03-26 05:55:24 +0100852LIB_OBJS += bisect.o
Jeff Smithf5dd7542017-05-24 00:15:33 -0500853LIB_OBJS += blame.o
Junio C Hamano74ca5e62008-03-12 01:46:26 -0700854LIB_OBJS += blob.o
Garima Singhf52207a2020-03-30 00:31:24 +0000855LIB_OBJS += bloom.o
Junio C Hamano74ca5e62008-03-12 01:46:26 -0700856LIB_OBJS += branch.o
Junio C Hamano568508e2011-10-28 14:48:40 -0700857LIB_OBJS += bulk-checkin.o
Junio C Hamano74ca5e62008-03-12 01:46:26 -0700858LIB_OBJS += bundle.o
859LIB_OBJS += cache-tree.o
Eric Wong92d8ed82021-07-07 23:10:19 +0000860LIB_OBJS += cbtree.o
Jeff King2b5ed372018-03-30 14:35:04 -0400861LIB_OBJS += chdir-notify.o
Thomas Gummerer7c85a872017-11-26 19:43:51 +0000862LIB_OBJS += checkout.o
Derrick Stolee570df422021-02-18 14:07:24 +0000863LIB_OBJS += chunk-format.o
Junio C Hamano74ca5e62008-03-12 01:46:26 -0700864LIB_OBJS += color.o
Nguyễn Thái Ngọc Duy7e29b822012-04-21 11:44:32 +0700865LIB_OBJS += column.o
Junio C Hamano74ca5e62008-03-12 01:46:26 -0700866LIB_OBJS += combine-diff.o
Derrick Stolee08fd81c2018-04-02 16:34:19 -0400867LIB_OBJS += commit-graph.o
Derrick Stolee5227c382018-07-20 16:33:02 +0000868LIB_OBJS += commit-reach.o
Denton Liu805d9ea2020-03-21 05:21:20 -0400869LIB_OBJS += commit.o
Fredrik Kuivinene8311712011-08-21 00:40:40 +0200870LIB_OBJS += compat/obstack.o
Jeff King21aeafc2011-12-10 05:41:01 -0500871LIB_OBJS += compat/terminal.o
Junio C Hamano74ca5e62008-03-12 01:46:26 -0700872LIB_OBJS += config.o
873LIB_OBJS += connect.o
Junio C Hamanof96400c2011-09-02 16:33:22 -0700874LIB_OBJS += connected.o
Junio C Hamano74ca5e62008-03-12 01:46:26 -0700875LIB_OBJS += convert.o
876LIB_OBJS += copy.o
Jeff Kingabca9272011-12-10 05:31:11 -0500877LIB_OBJS += credential.o
Junio C Hamano74ca5e62008-03-12 01:46:26 -0700878LIB_OBJS += csum-file.o
879LIB_OBJS += ctype.o
880LIB_OBJS += date.o
881LIB_OBJS += decorate.o
Jeff Kingc8d521f2018-08-16 08:13:07 +0200882LIB_OBJS += delta-islands.o
Denton Liu805d9ea2020-03-21 05:21:20 -0400883LIB_OBJS += diff-delta.o
Sergey Organova37eec62020-12-21 18:19:33 +0300884LIB_OBJS += diff-merges.o
Denton Liu805d9ea2020-03-21 05:21:20 -0400885LIB_OBJS += diff-lib.o
886LIB_OBJS += diff-no-index.o
887LIB_OBJS += diff.o
Junio C Hamano74ca5e62008-03-12 01:46:26 -0700888LIB_OBJS += diffcore-break.o
889LIB_OBJS += diffcore-delta.o
890LIB_OBJS += diffcore-order.o
891LIB_OBJS += diffcore-pickaxe.o
892LIB_OBJS += diffcore-rename.o
Junio C Hamano1eb41362021-02-11 11:57:50 -0800893LIB_OBJS += diffcore-rotate.o
Michael Haggerty0fe50432016-06-18 06:15:18 +0200894LIB_OBJS += dir-iterator.o
Denton Liu805d9ea2020-03-21 05:21:20 -0400895LIB_OBJS += dir.o
Stephan Beyerd82f33e2008-07-25 18:28:41 +0200896LIB_OBJS += editor.o
Junio C Hamano74ca5e62008-03-12 01:46:26 -0700897LIB_OBJS += entry.o
898LIB_OBJS += environment.o
Vicent Martie1273102013-11-14 07:43:51 -0500899LIB_OBJS += ewah/bitmap.o
900LIB_OBJS += ewah/ewah_bitmap.o
901LIB_OBJS += ewah/ewah_io.o
902LIB_OBJS += ewah/ewah_rlw.o
Stefan Bellerd807c4a2018-04-10 14:26:18 -0700903LIB_OBJS += exec-cmd.o
Jonathan Tanec062832018-06-14 15:54:28 -0700904LIB_OBJS += fetch-negotiator.o
Nguyễn Thái Ngọc Duy745f7a82012-10-26 22:53:55 +0700905LIB_OBJS += fetch-pack.o
Denton Liuce6521e2020-03-23 21:07:51 -0400906LIB_OBJS += fmt-merge-msg.o
Junio C Hamano74ca5e62008-03-12 01:46:26 -0700907LIB_OBJS += fsck.o
Ben Peart883e2482017-09-22 12:35:40 -0400908LIB_OBJS += fsmonitor.o
Ævar Arnfjörð Bjarmason5e9637c2011-11-18 00:14:42 +0100909LIB_OBJS += gettext.o
Nguyễn Thái Ngọc Duy82759052012-05-04 20:52:36 +0700910LIB_OBJS += gpg-interface.o
Adam Simpkinsc12172d2008-05-04 03:36:53 -0700911LIB_OBJS += graph.o
Junio C Hamano74ca5e62008-03-12 01:46:26 -0700912LIB_OBJS += grep.o
Martin Ågrenbc626922020-12-31 12:56:23 +0100913LIB_OBJS += hash-lookup.o
Karsten Blees6a364ce2013-11-14 20:17:54 +0100914LIB_OBJS += hashmap.o
Junio C Hamano74ca5e62008-03-12 01:46:26 -0700915LIB_OBJS += help.o
Linus Torvaldsa5031212010-01-21 15:25:19 -0800916LIB_OBJS += hex.o
Junio C Hamano74ca5e62008-03-12 01:46:26 -0700917LIB_OBJS += ident.o
Jeff Hostetler75459412018-07-13 16:54:08 +0000918LIB_OBJS += json-writer.o
Fredrik Kuivinenb95c5ad2011-08-21 00:41:57 +0200919LIB_OBJS += kwset.o
Johannes Schindelin8af84da2008-08-31 15:50:23 +0200920LIB_OBJS += levenshtein.o
Thomas Rast12da1d12013-03-28 17:47:32 +0100921LIB_OBJS += line-log.o
Bo Yang25ed3412013-03-28 17:47:30 +0100922LIB_OBJS += line-range.o
Denton Liu805d9ea2020-03-21 05:21:20 -0400923LIB_OBJS += linear-assignment.o
Jeff Hostetler25ec7bc2017-11-21 20:58:50 +0000924LIB_OBJS += list-objects-filter-options.o
Denton Liu805d9ea2020-03-21 05:21:20 -0400925LIB_OBJS += list-objects-filter.o
926LIB_OBJS += list-objects.o
Junio C Hamano74ca5e62008-03-12 01:46:26 -0700927LIB_OBJS += ll-merge.o
928LIB_OBJS += lockfile.o
929LIB_OBJS += log-tree.o
Brandon Williams72d0ea02018-03-15 10:31:20 -0700930LIB_OBJS += ls-refs.o
Junio C Hamanoc6905e42015-10-14 17:44:55 -0700931LIB_OBJS += mailinfo.o
Junio C Hamano74ca5e62008-03-12 01:46:26 -0700932LIB_OBJS += mailmap.o
933LIB_OBJS += match-trees.o
Jameson Miller065feab2018-04-11 18:37:55 +0000934LIB_OBJS += mem-pool.o
Junio C Hamanofa2364e2012-12-06 15:08:01 -0800935LIB_OBJS += merge-blobs.o
Elijah Newren17e55742020-10-27 02:08:07 +0000936LIB_OBJS += merge-ort.o
Elijah Newren47b1e892020-10-27 02:08:08 +0000937LIB_OBJS += merge-ort-wrappers.o
Miklos Vajna9047ebb2008-08-12 18:45:14 +0200938LIB_OBJS += merge-recursive.o
Denton Liu805d9ea2020-03-21 05:21:20 -0400939LIB_OBJS += merge.o
René Scharfe0db71e02012-04-01 00:10:11 +0200940LIB_OBJS += mergesort.o
Derrick Stoleea3407732018-07-12 15:39:21 -0400941LIB_OBJS += midx.o
Linus Torvalds96872bc2008-03-21 13:16:24 -0700942LIB_OBJS += name-hash.o
Jonathan Tanec062832018-06-14 15:54:28 -0700943LIB_OBJS += negotiator/default.o
Jonathan Tancbe566a2020-08-17 21:01:31 -0700944LIB_OBJS += negotiator/noop.o
Jonathan Tan42cc7482018-07-16 11:44:01 -0700945LIB_OBJS += negotiator/skipping.o
Jeff Kinga941d5e2010-04-01 20:07:40 -0400946LIB_OBJS += notes-cache.o
Johan Herland75ef3f42010-11-09 22:49:46 +0100947LIB_OBJS += notes-merge.o
Johan Herland49c24702013-06-12 02:13:00 +0200948LIB_OBJS += notes-utils.o
Denton Liu805d9ea2020-03-21 05:21:20 -0400949LIB_OBJS += notes.o
Martin Ågrene5afd442020-12-31 12:56:21 +0100950LIB_OBJS += object-file.o
Martin Ågren1e6771e2020-12-31 12:56:20 +0100951LIB_OBJS += object-name.o
Junio C Hamano74ca5e62008-03-12 01:46:26 -0700952LIB_OBJS += object.o
Junio C Hamanobf102002020-04-29 16:15:27 -0700953LIB_OBJS += oid-array.o
Jonathan Tan9e6fabde2017-09-29 15:54:22 -0700954LIB_OBJS += oidmap.o
Jeff King29c2bd52017-02-08 15:53:07 -0500955LIB_OBJS += oidset.o
Eric Wong92d8ed82021-07-07 23:10:19 +0000956LIB_OBJS += oidtree.o
Vicent Marti7cc8f972013-12-21 09:00:16 -0500957LIB_OBJS += pack-bitmap-write.o
Denton Liu805d9ea2020-03-21 05:21:20 -0400958LIB_OBJS += pack-bitmap.o
Junio C Hamano74ca5e62008-03-12 01:46:26 -0700959LIB_OBJS += pack-check.o
Vicent Marti2834bc22013-10-24 14:01:06 -0400960LIB_OBJS += pack-objects.o
Junio C Hamano74ca5e62008-03-12 01:46:26 -0700961LIB_OBJS += pack-revindex.o
962LIB_OBJS += pack-write.o
Denton Liu805d9ea2020-03-21 05:21:20 -0400963LIB_OBJS += packfile.o
Junio C Hamano74ca5e62008-03-12 01:46:26 -0700964LIB_OBJS += pager.o
Matheus Tavares04155bd2021-04-18 21:14:53 -0300965LIB_OBJS += parallel-checkout.o
Dmitry Ivankov06876282011-08-11 15:15:38 +0600966LIB_OBJS += parse-options-cb.o
Denton Liu805d9ea2020-03-21 05:21:20 -0400967LIB_OBJS += parse-options.o
Junio C Hamano74ca5e62008-03-12 01:46:26 -0700968LIB_OBJS += patch-delta.o
969LIB_OBJS += patch-ids.o
Junio C Hamano74ca5e62008-03-12 01:46:26 -0700970LIB_OBJS += path.o
Adam Spiers6f525e72013-01-06 16:58:08 +0000971LIB_OBJS += pathspec.o
Junio C Hamano74ca5e62008-03-12 01:46:26 -0700972LIB_OBJS += pkt-line.o
Stephan Beyerfcb6c072009-02-09 23:00:45 +0100973LIB_OBJS += preload-index.o
Junio C Hamano74ca5e62008-03-12 01:46:26 -0700974LIB_OBJS += pretty.o
Junio C Hamanob4b594a2013-06-06 19:13:50 -0700975LIB_OBJS += prio-queue.o
Junio C Hamano74ca5e62008-03-12 01:46:26 -0700976LIB_OBJS += progress.o
Christian Couder48de3152019-06-25 15:40:27 +0200977LIB_OBJS += promisor-remote.o
Jeff Kingd3c58b82011-12-10 05:40:54 -0500978LIB_OBJS += prompt.o
Brandon Williams373d70e2017-10-16 10:55:24 -0700979LIB_OBJS += protocol.o
Bruno Albuquerquea2ba1622021-04-20 16:38:31 -0700980LIB_OBJS += protocol-caps.o
Denton Liu9460fd42020-03-23 21:07:52 -0400981LIB_OBJS += prune-packed.o
Junio C Hamano74ca5e62008-03-12 01:46:26 -0700982LIB_OBJS += quote.o
Johannes Schindelind9c66f02018-08-13 04:33:04 -0700983LIB_OBJS += range-diff.o
Junio C Hamano74ca5e62008-03-12 01:46:26 -0700984LIB_OBJS += reachable.o
985LIB_OBJS += read-cache.o
Alban Gruin145e05a2018-08-10 18:51:29 +0200986LIB_OBJS += rebase-interactive.o
Denton Liu805d9ea2020-03-21 05:21:20 -0400987LIB_OBJS += rebase.o
988LIB_OBJS += ref-filter.o
Junio C Hamano74ca5e62008-03-12 01:46:26 -0700989LIB_OBJS += reflog-walk.o
990LIB_OBJS += refs.o
Han-Wen Nienhuys4441f422020-09-09 10:15:08 +0000991LIB_OBJS += refs/debug.o
Michael Haggerty7bd9bcf2015-11-09 14:34:01 +0100992LIB_OBJS += refs/files-backend.o
Michael Haggerty3bc581b2016-06-18 06:15:15 +0200993LIB_OBJS += refs/iterator.o
Michael Haggerty67be7c52017-06-23 09:01:37 +0200994LIB_OBJS += refs/packed-backend.o
Michael Haggerty958f9642017-04-16 08:41:31 +0200995LIB_OBJS += refs/ref-cache.o
Brandon Williamsec0cb492018-05-16 15:57:48 -0700996LIB_OBJS += refspec.o
Junio C Hamano74ca5e62008-03-12 01:46:26 -0700997LIB_OBJS += remote.o
Stefan Beller11bc0582018-04-10 14:26:21 -0700998LIB_OBJS += replace-object.o
Derrick Stolee7211b9e2019-08-13 11:37:43 -0700999LIB_OBJS += repo-settings.o
Brandon Williams359efef2017-06-22 11:43:32 -07001000LIB_OBJS += repository.o
Stephan Beyer5b2fd952008-07-09 14:58:57 +02001001LIB_OBJS += rerere.o
Denton Liub309a972020-04-07 10:28:00 -04001002LIB_OBJS += reset.o
Junio C Hamanocfc57892009-12-25 00:30:51 -08001003LIB_OBJS += resolve-undo.o
Junio C Hamano74ca5e62008-03-12 01:46:26 -07001004LIB_OBJS += revision.o
1005LIB_OBJS += run-command.o
Nguyễn Thái Ngọc Duyf5d942e2012-10-26 22:53:53 +07001006LIB_OBJS += send-pack.o
Nguyễn Thái Ngọc Duy82759052012-05-04 20:52:36 +07001007LIB_OBJS += sequencer.o
Brandon Williamsed10cb92018-03-15 10:31:19 -07001008LIB_OBJS += serve.o
Junio C Hamano74ca5e62008-03-12 01:46:26 -07001009LIB_OBJS += server-info.o
1010LIB_OBJS += setup.o
Junio C Hamano74ca5e62008-03-12 01:46:26 -07001011LIB_OBJS += shallow.o
1012LIB_OBJS += sideband.o
Jeff King4a16d072009-01-22 01:02:35 -05001013LIB_OBJS += sigchain.o
Derrick Stolee3964fc22021-03-30 13:10:47 +00001014LIB_OBJS += sparse-index.o
Nguyễn Thái Ngọc Duy5fc2fc82014-06-13 19:19:36 +07001015LIB_OBJS += split-index.o
Johannes Schindelin97fff612019-09-30 10:21:54 -07001016LIB_OBJS += stable-qsort.o
Junio C Hamano74ca5e62008-03-12 01:46:26 -07001017LIB_OBJS += strbuf.o
Junio C Hamano46bf0432011-05-11 19:30:25 -07001018LIB_OBJS += streaming.o
Stephan Beyerfcb6c072009-02-09 23:00:45 +01001019LIB_OBJS += string-list.o
Elijah Newrenae20bf12020-11-02 18:55:06 +00001020LIB_OBJS += strmap.o
Denton Liu8474f262020-10-08 00:39:26 -07001021LIB_OBJS += strvec.o
Ben Peart99605d62017-05-05 11:28:01 -04001022LIB_OBJS += sub-process.o
Denton Liu805d9ea2020-03-21 05:21:20 -04001023LIB_OBJS += submodule-config.o
1024LIB_OBJS += submodule.o
Junio C Hamano74ca5e62008-03-12 01:46:26 -07001025LIB_OBJS += symlinks.o
1026LIB_OBJS += tag.o
Michael Haggerty1a9d15d2015-08-10 11:47:41 +02001027LIB_OBJS += tempfile.o
Nguyễn Thái Ngọc Duy0ec79352018-10-27 19:29:59 +02001028LIB_OBJS += thread-utils.o
Jeff King2564d992016-10-03 16:49:11 -04001029LIB_OBJS += tmp-objdir.o
Junio C Hamano74ca5e62008-03-12 01:46:26 -07001030LIB_OBJS += trace.o
Jeff Hostetleree4512e2019-02-22 14:25:01 -08001031LIB_OBJS += trace2.o
1032LIB_OBJS += trace2/tr2_cfg.o
1033LIB_OBJS += trace2/tr2_cmd_name.o
1034LIB_OBJS += trace2/tr2_dst.o
1035LIB_OBJS += trace2/tr2_sid.o
Jeff Hostetlerbce9db62019-04-15 13:39:47 -07001036LIB_OBJS += trace2/tr2_sysenv.o
Jeff Hostetleree4512e2019-02-22 14:25:01 -08001037LIB_OBJS += trace2/tr2_tbuf.o
1038LIB_OBJS += trace2/tr2_tgt_event.o
1039LIB_OBJS += trace2/tr2_tgt_normal.o
1040LIB_OBJS += trace2/tr2_tgt_perf.o
1041LIB_OBJS += trace2/tr2_tls.o
Christian Couder9385b5d2014-10-13 20:16:23 +02001042LIB_OBJS += trailer.o
Daniel Barkalow6eb996b2009-08-05 01:01:53 -04001043LIB_OBJS += transport-helper.o
Denton Liu805d9ea2020-03-21 05:21:20 -04001044LIB_OBJS += transport.o
Junio C Hamano74ca5e62008-03-12 01:46:26 -07001045LIB_OBJS += tree-diff.o
Junio C Hamano74ca5e62008-03-12 01:46:26 -07001046LIB_OBJS += tree-walk.o
Denton Liu805d9ea2020-03-21 05:21:20 -04001047LIB_OBJS += tree.o
Junio C Hamano74ca5e62008-03-12 01:46:26 -07001048LIB_OBJS += unpack-trees.o
Brandon Williamsa3d6b532018-03-14 11:31:41 -07001049LIB_OBJS += upload-pack.o
Jeff King638794c2010-05-23 05:17:55 -04001050LIB_OBJS += url.o
Kyle J. McKay6a569932013-08-05 13:20:36 -07001051LIB_OBJS += urlmatch.o
Junio C Hamano74ca5e62008-03-12 01:46:26 -07001052LIB_OBJS += usage.o
Stephan Beyerfcb6c072009-02-09 23:00:45 +01001053LIB_OBJS += userdiff.o
Junio C Hamano74ca5e62008-03-12 01:46:26 -07001054LIB_OBJS += utf8.o
Junio C Hamanod2c18982012-04-03 15:53:08 -07001055LIB_OBJS += varint.o
Jeff King816fb462012-06-02 14:51:42 -04001056LIB_OBJS += version.o
Nguyễn Thái Ngọc Duy9ef176b2014-02-27 19:56:52 +07001057LIB_OBJS += versioncmp.o
Junio C Hamano74ca5e62008-03-12 01:46:26 -07001058LIB_OBJS += walker.o
Nguyễn Thái Ngọc Duyfeabcc12012-10-15 13:25:55 +07001059LIB_OBJS += wildmatch.o
Michael Rappazzoac6c5612015-10-02 07:55:31 -04001060LIB_OBJS += worktree.o
Linus Torvalds112db552008-06-22 12:19:25 -07001061LIB_OBJS += wrapper.o
Stefan Bellerfa2656f2018-04-10 14:26:16 -07001062LIB_OBJS += write-or-die.o
Junio C Hamano74ca5e62008-03-12 01:46:26 -07001063LIB_OBJS += ws.o
1064LIB_OBJS += wt-status.o
1065LIB_OBJS += xdiff-interface.o
Jonathan Niederb0613ce2010-11-06 06:47:34 -05001066LIB_OBJS += zlib.o
Josef Weidendorferb1bf95b2005-07-31 21:17:43 +02001067
Linus Torvalds81b50f32010-02-22 08:42:18 -08001068BUILTIN_OBJS += builtin/add.o
Paul Tan73c27792015-08-04 21:51:24 +08001069BUILTIN_OBJS += builtin/am.o
Linus Torvalds81b50f32010-02-22 08:42:18 -08001070BUILTIN_OBJS += builtin/annotate.o
1071BUILTIN_OBJS += builtin/apply.o
1072BUILTIN_OBJS += builtin/archive.o
1073BUILTIN_OBJS += builtin/bisect--helper.o
1074BUILTIN_OBJS += builtin/blame.o
1075BUILTIN_OBJS += builtin/branch.o
Jeff Kingd7a56492020-08-13 10:59:36 -04001076BUILTIN_OBJS += builtin/bugreport.o
Linus Torvalds81b50f32010-02-22 08:42:18 -08001077BUILTIN_OBJS += builtin/bundle.o
1078BUILTIN_OBJS += builtin/cat-file.o
1079BUILTIN_OBJS += builtin/check-attr.o
Adam Spiers368aa522013-01-06 16:58:13 +00001080BUILTIN_OBJS += builtin/check-ignore.o
Eric Sunshine226ad342013-07-12 20:53:10 -04001081BUILTIN_OBJS += builtin/check-mailmap.o
Linus Torvalds81b50f32010-02-22 08:42:18 -08001082BUILTIN_OBJS += builtin/check-ref-format.o
Matheus Tavarese9e8adf2021-04-18 21:14:54 -03001083BUILTIN_OBJS += builtin/checkout--worker.o
Linus Torvalds81b50f32010-02-22 08:42:18 -08001084BUILTIN_OBJS += builtin/checkout-index.o
1085BUILTIN_OBJS += builtin/checkout.o
1086BUILTIN_OBJS += builtin/clean.o
1087BUILTIN_OBJS += builtin/clone.o
Nguyễn Thái Ngọc Duy7e29b822012-04-21 11:44:32 +07001088BUILTIN_OBJS += builtin/column.o
Denton Liu805d9ea2020-03-21 05:21:20 -04001089BUILTIN_OBJS += builtin/commit-graph.o
Linus Torvalds81b50f32010-02-22 08:42:18 -08001090BUILTIN_OBJS += builtin/commit-tree.o
1091BUILTIN_OBJS += builtin/commit.o
1092BUILTIN_OBJS += builtin/config.o
1093BUILTIN_OBJS += builtin/count-objects.o
Denton Liu8474f262020-10-08 00:39:26 -07001094BUILTIN_OBJS += builtin/credential-cache--daemon.o
1095BUILTIN_OBJS += builtin/credential-cache.o
1096BUILTIN_OBJS += builtin/credential-store.o
Javier Roucher Iglesiase30b2fe2012-06-24 13:39:59 +02001097BUILTIN_OBJS += builtin/credential.o
Linus Torvalds81b50f32010-02-22 08:42:18 -08001098BUILTIN_OBJS += builtin/describe.o
1099BUILTIN_OBJS += builtin/diff-files.o
1100BUILTIN_OBJS += builtin/diff-index.o
1101BUILTIN_OBJS += builtin/diff-tree.o
1102BUILTIN_OBJS += builtin/diff.o
Johannes Schindelinbe8a90e2017-01-17 16:54:57 +01001103BUILTIN_OBJS += builtin/difftool.o
Ævar Arnfjörð Bjarmasonb4f207f2019-06-21 12:18:06 +02001104BUILTIN_OBJS += builtin/env--helper.o
Linus Torvalds81b50f32010-02-22 08:42:18 -08001105BUILTIN_OBJS += builtin/fast-export.o
Jeff Kinga006f872020-08-13 10:59:45 -04001106BUILTIN_OBJS += builtin/fast-import.o
Linus Torvalds81b50f32010-02-22 08:42:18 -08001107BUILTIN_OBJS += builtin/fetch-pack.o
1108BUILTIN_OBJS += builtin/fetch.o
1109BUILTIN_OBJS += builtin/fmt-merge-msg.o
1110BUILTIN_OBJS += builtin/for-each-ref.o
Derrick Stolee4950b2a2020-09-11 17:49:16 +00001111BUILTIN_OBJS += builtin/for-each-repo.o
Linus Torvalds81b50f32010-02-22 08:42:18 -08001112BUILTIN_OBJS += builtin/fsck.o
1113BUILTIN_OBJS += builtin/gc.o
Jonathan Niederbb5d5312013-12-02 15:37:10 -08001114BUILTIN_OBJS += builtin/get-tar-commit-id.o
Linus Torvalds81b50f32010-02-22 08:42:18 -08001115BUILTIN_OBJS += builtin/grep.o
1116BUILTIN_OBJS += builtin/hash-object.o
1117BUILTIN_OBJS += builtin/help.o
1118BUILTIN_OBJS += builtin/index-pack.o
1119BUILTIN_OBJS += builtin/init-db.o
Christian Couder6634f052014-10-13 20:16:29 +02001120BUILTIN_OBJS += builtin/interpret-trailers.o
Linus Torvalds81b50f32010-02-22 08:42:18 -08001121BUILTIN_OBJS += builtin/log.o
1122BUILTIN_OBJS += builtin/ls-files.o
1123BUILTIN_OBJS += builtin/ls-remote.o
1124BUILTIN_OBJS += builtin/ls-tree.o
1125BUILTIN_OBJS += builtin/mailinfo.o
1126BUILTIN_OBJS += builtin/mailsplit.o
Linus Torvalds81b50f32010-02-22 08:42:18 -08001127BUILTIN_OBJS += builtin/merge-base.o
1128BUILTIN_OBJS += builtin/merge-file.o
1129BUILTIN_OBJS += builtin/merge-index.o
1130BUILTIN_OBJS += builtin/merge-ours.o
1131BUILTIN_OBJS += builtin/merge-recursive.o
1132BUILTIN_OBJS += builtin/merge-tree.o
Denton Liu805d9ea2020-03-21 05:21:20 -04001133BUILTIN_OBJS += builtin/merge.o
Linus Torvalds81b50f32010-02-22 08:42:18 -08001134BUILTIN_OBJS += builtin/mktag.o
1135BUILTIN_OBJS += builtin/mktree.o
Derrick Stolee6a257f02018-07-12 15:39:20 -04001136BUILTIN_OBJS += builtin/multi-pack-index.o
Linus Torvalds81b50f32010-02-22 08:42:18 -08001137BUILTIN_OBJS += builtin/mv.o
1138BUILTIN_OBJS += builtin/name-rev.o
Junio C Hamano29491512010-03-15 00:52:06 -07001139BUILTIN_OBJS += builtin/notes.o
Linus Torvalds81b50f32010-02-22 08:42:18 -08001140BUILTIN_OBJS += builtin/pack-objects.o
1141BUILTIN_OBJS += builtin/pack-redundant.o
1142BUILTIN_OBJS += builtin/pack-refs.o
1143BUILTIN_OBJS += builtin/patch-id.o
1144BUILTIN_OBJS += builtin/prune-packed.o
1145BUILTIN_OBJS += builtin/prune.o
Paul Tan1e1ea692015-06-14 16:41:51 +08001146BUILTIN_OBJS += builtin/pull.o
Linus Torvalds81b50f32010-02-22 08:42:18 -08001147BUILTIN_OBJS += builtin/push.o
Johannes Schindelin348ae562018-08-13 04:33:02 -07001148BUILTIN_OBJS += builtin/range-diff.o
Linus Torvalds81b50f32010-02-22 08:42:18 -08001149BUILTIN_OBJS += builtin/read-tree.o
Pratik Karki55071ea2018-08-07 01:16:09 +05451150BUILTIN_OBJS += builtin/rebase.o
Linus Torvalds81b50f32010-02-22 08:42:18 -08001151BUILTIN_OBJS += builtin/receive-pack.o
1152BUILTIN_OBJS += builtin/reflog.o
Ilari Liusvaara7f3eceb2010-10-12 19:39:43 +03001153BUILTIN_OBJS += builtin/remote-ext.o
Ilari Liusvaara3a9ed4b2010-10-12 19:39:42 +03001154BUILTIN_OBJS += builtin/remote-fd.o
Denton Liu805d9ea2020-03-21 05:21:20 -04001155BUILTIN_OBJS += builtin/remote.o
Stefan Bellera1bbc6c2013-09-15 17:33:20 +02001156BUILTIN_OBJS += builtin/repack.o
Linus Torvalds81b50f32010-02-22 08:42:18 -08001157BUILTIN_OBJS += builtin/replace.o
1158BUILTIN_OBJS += builtin/rerere.o
1159BUILTIN_OBJS += builtin/reset.o
1160BUILTIN_OBJS += builtin/rev-list.o
1161BUILTIN_OBJS += builtin/rev-parse.o
1162BUILTIN_OBJS += builtin/revert.o
1163BUILTIN_OBJS += builtin/rm.o
1164BUILTIN_OBJS += builtin/send-pack.o
1165BUILTIN_OBJS += builtin/shortlog.o
1166BUILTIN_OBJS += builtin/show-branch.o
Jeff Kingff417262018-05-28 05:38:53 -04001167BUILTIN_OBJS += builtin/show-index.o
Linus Torvalds81b50f32010-02-22 08:42:18 -08001168BUILTIN_OBJS += builtin/show-ref.o
Derrick Stolee94c09562019-11-21 22:04:33 +00001169BUILTIN_OBJS += builtin/sparse-checkout.o
Paul-Sebastian Ungureanu40af1462019-02-25 23:16:28 +00001170BUILTIN_OBJS += builtin/stash.o
Linus Torvalds81b50f32010-02-22 08:42:18 -08001171BUILTIN_OBJS += builtin/stripspace.o
Stefan Beller74703a12015-09-02 14:42:24 -07001172BUILTIN_OBJS += builtin/submodule--helper.o
Linus Torvalds81b50f32010-02-22 08:42:18 -08001173BUILTIN_OBJS += builtin/symbolic-ref.o
1174BUILTIN_OBJS += builtin/tag.o
Linus Torvalds81b50f32010-02-22 08:42:18 -08001175BUILTIN_OBJS += builtin/unpack-file.o
1176BUILTIN_OBJS += builtin/unpack-objects.o
1177BUILTIN_OBJS += builtin/update-index.o
1178BUILTIN_OBJS += builtin/update-ref.o
1179BUILTIN_OBJS += builtin/update-server-info.o
1180BUILTIN_OBJS += builtin/upload-archive.o
Brandon Williamsa3d6b532018-03-14 11:31:41 -07001181BUILTIN_OBJS += builtin/upload-pack.o
Linus Torvalds81b50f32010-02-22 08:42:18 -08001182BUILTIN_OBJS += builtin/var.o
Michael J Gruberd07b00b2014-06-23 09:05:49 +02001183BUILTIN_OBJS += builtin/verify-commit.o
Linus Torvalds81b50f32010-02-22 08:42:18 -08001184BUILTIN_OBJS += builtin/verify-pack.o
1185BUILTIN_OBJS += builtin/verify-tag.o
Nguyễn Thái Ngọc Duydf0b6cf2015-06-29 19:51:18 +07001186BUILTIN_OBJS += builtin/worktree.o
Linus Torvalds81b50f32010-02-22 08:42:18 -08001187BUILTIN_OBJS += builtin/write-tree.o
Linus Torvalds70827b12006-04-21 10:27:34 -07001188
Denton Liu5dedf7d2019-09-16 12:23:11 -07001189# THIRD_PARTY_SOURCES is a list of patterns compatible with the
1190# $(filter) and $(filter-out) family of functions. They specify source
1191# files which are taken from some third-party source where we want to be
1192# less strict about issues such as coding style so we don't diverge from
1193# upstream unnecessarily (making merging in future changes easier).
1194THIRD_PARTY_SOURCES += compat/inet_ntop.c
1195THIRD_PARTY_SOURCES += compat/inet_pton.c
1196THIRD_PARTY_SOURCES += compat/nedmalloc/%
1197THIRD_PARTY_SOURCES += compat/obstack.%
1198THIRD_PARTY_SOURCES += compat/poll/%
1199THIRD_PARTY_SOURCES += compat/regex/%
1200THIRD_PARTY_SOURCES += sha1collisiondetection/%
1201THIRD_PARTY_SOURCES += sha1dc/%
1202
Han-Wen Nienhuysef8a6c62021-10-07 20:25:00 +00001203GITLIBS = common-main.o $(LIB_FILE) $(XDIFF_LIB) $(REFTABLE_LIB)
Robert Schielebef19da2007-07-29 20:35:45 +02001204EXTLIBS =
Linus Torvaldscef661f2005-04-21 12:33:22 -07001205
Jeff King42dcbb72012-06-02 15:01:12 -04001206GIT_USER_AGENT = git/$(GIT_VERSION)
1207
Junio C Hamanocac87dc2017-07-01 22:05:47 +00001208ifeq ($(wildcard sha1collisiondetection/lib/sha1.h),sha1collisiondetection/lib/sha1.h)
1209DC_SHA1_SUBMODULE = auto
1210endif
1211
Ævar Arnfjörð Bjarmason71a78942019-02-22 15:41:26 +01001212# Set CFLAGS, LDFLAGS and other *FLAGS variables. These might be
1213# tweaked by config.* below as well as the command-line, both of
1214# which'll override these defaults.
1215CFLAGS = -g -O2 -Wall
1216LDFLAGS =
Ævar Arnfjörð Bjarmason0f50c8e2019-05-17 23:58:47 +02001217CC_LD_DYNPATH = -Wl,-rpath,
Ævar Arnfjörð Bjarmason71a78942019-02-22 15:41:26 +01001218BASIC_CFLAGS = -I.
1219BASIC_LDFLAGS =
1220
1221# library flags
1222ARFLAGS = rcs
1223PTHREAD_CFLAGS =
1224
1225# For the 'sparse' target
1226SPARSE_FLAGS ?=
Luc Van Oostenryck1c9664232020-05-22 02:25:02 +02001227SP_EXTRA_FLAGS = -Wno-universal-initializer
Ævar Arnfjörð Bjarmason71a78942019-02-22 15:41:26 +01001228
Jeff King960154b2019-05-06 19:43:34 -04001229# For the 'coccicheck' target; setting SPATCH_BATCH_SIZE higher will
1230# usually result in less CPU usage at the cost of higher peak memory.
Jeff Kingbcb4edf2019-05-08 03:07:54 -04001231# Setting it to 0 will feed all files in a single spatch invocation.
Ævar Arnfjörð Bjarmason71a78942019-02-22 15:41:26 +01001232SPATCH_FLAGS = --all-includes --patch .
Jeff King960154b2019-05-06 19:43:34 -04001233SPATCH_BATCH_SIZE = 1
Ævar Arnfjörð Bjarmason71a78942019-02-22 15:41:26 +01001234
Jeff Kinge1b6dbb2013-01-03 16:05:41 -05001235include config.mak.uname
Jakub Narebski55667712006-07-03 01:56:48 +02001236-include config.mak.autogen
Johannes Schindelinf2d6a252005-10-11 15:22:47 -07001237-include config.mak
Junio C Hamano597c9cc2005-09-07 12:22:56 -07001238
Matthieu Moyd6156282016-05-31 15:24:43 +02001239ifdef DEVELOPER
Nguyễn Thái Ngọc Duy1da15802018-04-14 19:19:44 +00001240include config.mak.dev
Matthieu Moyd6156282016-05-31 15:24:43 +02001241endif
1242
Johannes Schindelin4a5ec7d2021-01-21 13:09:45 +00001243# what 'all' will build and 'install' will install in gitexecdir,
1244# excluding programs for built-in commands
1245ALL_PROGRAMS = $(PROGRAMS) $(SCRIPTS)
1246ALL_COMMANDS_TO_INSTALL = $(ALL_PROGRAMS)
1247ifeq (,$(SKIP_DASHED_BUILT_INS))
1248ALL_COMMANDS_TO_INSTALL += $(BUILT_INS)
1249else
1250# git-upload-pack, git-receive-pack and git-upload-archive are special: they
1251# are _expected_ to be present in the `bin/` directory in their dashed form.
1252ALL_COMMANDS_TO_INSTALL += git-receive-pack$(X)
1253ALL_COMMANDS_TO_INSTALL += git-upload-archive$(X)
1254ALL_COMMANDS_TO_INSTALL += git-upload-pack$(X)
1255endif
1256
Ævar Arnfjörð Bjarmason6d5d4b42019-02-22 15:41:27 +01001257ALL_CFLAGS = $(DEVELOPER_CFLAGS) $(CPPFLAGS) $(CFLAGS)
Ævar Arnfjörð Bjarmason71a78942019-02-22 15:41:26 +01001258ALL_LDFLAGS = $(LDFLAGS)
1259
René Scharfe425ca672017-07-15 19:18:56 +02001260comma := ,
1261empty :=
1262space := $(empty) $(empty)
1263
Jeff King56b5db32017-07-10 09:24:42 -04001264ifdef SANITIZE
René Scharfe425ca672017-07-15 19:18:56 +02001265SANITIZERS := $(foreach flag,$(subst $(comma),$(space),$(SANITIZE)),$(flag))
Jeff King56b5db32017-07-10 09:24:42 -04001266BASIC_CFLAGS += -fsanitize=$(SANITIZE) -fno-sanitize-recover=$(SANITIZE)
Jeff Kingddbc8a62017-07-10 09:24:47 -04001267BASIC_CFLAGS += -fno-omit-frame-pointer
René Scharfe425ca672017-07-15 19:18:56 +02001268ifneq ($(filter undefined,$(SANITIZERS)),)
Jeff King07a20f52019-03-12 17:06:26 -04001269BASIC_CFLAGS += -DSHA1DC_FORCE_ALIGNED_ACCESS
Jeff King566cf0b2017-07-10 09:24:50 -04001270endif
Jeff King0e5bba52017-09-08 02:38:41 -04001271ifneq ($(filter leak,$(SANITIZERS)),)
1272BASIC_CFLAGS += -DSUPPRESS_ANNOTATED_LEAKS
1273endif
Jeff Kingf65d07f2020-01-16 12:51:38 -05001274ifneq ($(filter address,$(SANITIZERS)),)
1275NO_REGEX = NeededForASAN
1276endif
Jeff King56b5db32017-07-10 09:24:42 -04001277endif
1278
Johannes Sixt9fb1e692011-05-09 10:24:55 +02001279ifndef sysconfdir
1280ifeq ($(prefix),/usr)
1281sysconfdir = /etc
1282else
1283sysconfdir = etc
1284endif
1285endif
1286
Fredrik Kuivinen111ee182011-08-18 20:34:39 +02001287ifndef COMPUTE_HEADER_DEPENDENCIES
Jonathan Nieder024c8432011-11-18 03:58:21 -06001288COMPUTE_HEADER_DEPENDENCIES = auto
1289endif
1290
1291ifeq ($(COMPUTE_HEADER_DEPENDENCIES),auto)
David Aguilar1816bf22011-08-30 01:27:35 -07001292dep_check = $(shell $(CC) $(ALL_CFLAGS) \
Jonathan Nieder69789342011-11-18 17:23:24 -06001293 -c -MF /dev/null -MQ /dev/null -MMD -MP \
1294 -x c /dev/null -o /dev/null 2>&1; \
David Aguilar1816bf22011-08-30 01:27:35 -07001295 echo $$?)
Fredrik Kuivinen111ee182011-08-18 20:34:39 +02001296ifeq ($(dep_check),0)
Jonathan Nieder024c8432011-11-18 03:58:21 -06001297override COMPUTE_HEADER_DEPENDENCIES = yes
1298else
1299override COMPUTE_HEADER_DEPENDENCIES = no
Fredrik Kuivinen111ee182011-08-18 20:34:39 +02001300endif
Jonathan Niederf2fabbf2010-01-26 09:57:15 -06001301endif
1302
Jonathan Nieder024c8432011-11-18 03:58:21 -06001303ifeq ($(COMPUTE_HEADER_DEPENDENCIES),yes)
Jonathan Niederf2fabbf2010-01-26 09:57:15 -06001304USE_COMPUTED_HEADER_DEPENDENCIES = YesPlease
Jonathan Nieder024c8432011-11-18 03:58:21 -06001305else
1306ifneq ($(COMPUTE_HEADER_DEPENDENCIES),no)
1307$(error please set COMPUTE_HEADER_DEPENDENCIES to yes, no, or auto \
1308(not "$(COMPUTE_HEADER_DEPENDENCIES)"))
1309endif
Jonathan Niederf2fabbf2010-01-26 09:57:15 -06001310endif
1311
Philippe Blain3821c382020-09-03 22:13:38 +00001312ifndef GENERATE_COMPILATION_DATABASE
1313GENERATE_COMPILATION_DATABASE = no
1314endif
1315
1316ifeq ($(GENERATE_COMPILATION_DATABASE),yes)
1317compdb_check = $(shell $(CC) $(ALL_CFLAGS) \
1318 -c -MJ /dev/null \
1319 -x c /dev/null -o /dev/null 2>&1; \
1320 echo $$?)
1321ifneq ($(compdb_check),0)
1322override GENERATE_COMPILATION_DATABASE = no
1323$(warning GENERATE_COMPILATION_DATABASE is set to "yes", but your compiler does not \
1324support generating compilation database entries)
1325endif
1326else
1327ifneq ($(GENERATE_COMPILATION_DATABASE),no)
1328$(error please set GENERATE_COMPILATION_DATABASE to "yes" or "no" \
1329(not "$(GENERATE_COMPILATION_DATABASE)"))
1330endif
1331endif
1332
Junio C Hamano0e0aea52009-06-05 18:36:15 -05001333ifdef SANE_TOOL_PATH
Junio C Hamano61dbb3c2009-06-08 09:41:49 -07001334SANE_TOOL_PATH_SQ = $(subst ','\'',$(SANE_TOOL_PATH))
Jeff Hostetlerc444bf82019-06-19 14:06:06 -07001335BROKEN_PATH_FIX = 's|^\# @@BROKEN_PATH_FIX@@$$|git_broken_path_fix "$(SANE_TOOL_PATH_SQ)"|'
Junio C Hamano0e0aea52009-06-05 18:36:15 -05001336PATH := $(SANE_TOOL_PATH):${PATH}
1337else
Junio C Hamano61dbb3c2009-06-08 09:41:49 -07001338BROKEN_PATH_FIX = '/^\# @@BROKEN_PATH_FIX@@$$/d'
Junio C Hamano0e0aea52009-06-05 18:36:15 -05001339endif
1340
Eric Sunshineb2289402017-12-15 00:34:34 +01001341ifeq (,$(HOST_CPU))
1342 BASIC_CFLAGS += -DGIT_HOST_CPU="\"$(firstword $(subst -, ,$(uname_M)))\""
1343else
1344 BASIC_CFLAGS += -DGIT_HOST_CPU="\"$(HOST_CPU)\""
1345endif
1346
Gary V. Vaughanf9f33cd2010-05-14 09:31:43 +00001347ifneq (,$(INLINE))
1348 BASIC_CFLAGS += -Dinline=$(INLINE)
1349endif
1350
Gary V. Vaughane88a1352010-05-14 09:31:42 +00001351ifneq (,$(SOCKLEN_T))
1352 BASIC_CFLAGS += -Dsocklen_t=$(SOCKLEN_T)
1353endif
1354
Kyle J. McKay290c8e72015-01-11 12:09:22 -08001355ifeq (yes,$(USE_PARENS_AROUND_GETTEXT_N))
1356 BASIC_CFLAGS += -DUSE_PARENS_AROUND_GETTEXT_N=1
1357else
1358ifeq (no,$(USE_PARENS_AROUND_GETTEXT_N))
1359 BASIC_CFLAGS += -DUSE_PARENS_AROUND_GETTEXT_N=0
1360endif
1361endif
1362
Brian Gernhardt59f86742006-12-12 12:01:47 -05001363ifeq ($(uname_S),Darwin)
1364 ifndef NO_FINK
1365 ifeq ($(shell test -d /sw/lib && echo y),y)
1366 BASIC_CFLAGS += -I/sw/include
1367 BASIC_LDFLAGS += -L/sw/lib
1368 endif
1369 endif
1370 ifndef NO_DARWIN_PORTS
1371 ifeq ($(shell test -d /opt/local/lib && echo y),y)
1372 BASIC_CFLAGS += -I/opt/local/include
1373 BASIC_LDFLAGS += -L/opt/local/lib
1374 endif
1375 endif
David Aguilar4dcd7732013-05-19 06:23:34 -04001376 ifndef NO_APPLE_COMMON_CRYPTO
Lars Schneiderf01fe922016-11-06 20:35:04 +01001377 NO_OPENSSL = YesPlease
David Aguilar4dcd7732013-05-19 06:23:34 -04001378 APPLE_COMMON_CRYPTO = YesPlease
1379 COMPAT_CFLAGS += -DAPPLE_COMMON_CRYPTO
1380 endif
David Aguilar29de2052013-05-11 01:22:26 -07001381 NO_REGEX = YesPlease
Ted Pavlicf7d9d042009-01-26 14:03:59 -05001382 PTHREAD_LIBS =
Brian Gernhardt59f86742006-12-12 12:01:47 -05001383endif
1384
David Aguilare1c06882009-05-31 01:35:51 -07001385ifdef NO_LIBGEN_H
1386 COMPAT_CFLAGS += -DNO_LIBGEN_H
1387 COMPAT_OBJS += compat/basename.o
1388endif
1389
Ævar Arnfjörð Bjarmason75997302021-01-24 02:58:33 +01001390ifdef USE_LIBPCRE1
1391$(error The USE_LIBPCRE1 build option has been removed, use version 2 with USE_LIBPCRE)
1392endif
1393
Ævar Arnfjörð Bjarmasone6c531b2018-03-11 13:26:09 +00001394USE_LIBPCRE2 ?= $(USE_LIBPCRE)
Ævar Arnfjörð Bjarmason94da9192017-06-01 18:20:56 +00001395
Ævar Arnfjörð Bjarmasone6c531b2018-03-11 13:26:09 +00001396ifneq (,$(USE_LIBPCRE2))
Ævar Arnfjörð Bjarmasone6c531b2018-03-11 13:26:09 +00001397 BASIC_CFLAGS += -DUSE_LIBPCRE2
1398 EXTLIBS += -lpcre2-8
1399endif
1400
Ævar Arnfjörð Bjarmason94da9192017-06-01 18:20:56 +00001401ifdef LIBPCREDIR
1402 BASIC_CFLAGS += -I$(LIBPCREDIR)/include
1403 EXTLIBS += -L$(LIBPCREDIR)/$(lib) $(CC_LD_DYNPATH)$(LIBPCREDIR)/$(lib)
Michał Kiedrowicz63e7e9d2011-05-09 23:52:05 +02001404endif
1405
Kirill Smelkov61f76a32014-03-27 18:22:50 +04001406ifdef HAVE_ALLOCA_H
1407 BASIC_CFLAGS += -DHAVE_ALLOCA_H
1408endif
1409
Bernhard Reiter1e16b252014-11-09 15:55:53 +01001410IMAP_SEND_BUILDDEPS =
Remi Pommarel9eaa78b2015-10-21 19:01:13 +02001411IMAP_SEND_LDFLAGS =
Bernhard Reiter1e16b252014-11-09 15:55:53 +01001412
Daniel Barkalow30ae7642007-09-10 23:02:45 -04001413ifdef NO_CURL
1414 BASIC_CFLAGS += -DNO_CURL
Johannes Sixt4256f362010-01-19 16:39:12 +01001415 REMOTE_CURL_PRIMARY =
1416 REMOTE_CURL_ALIASES =
1417 REMOTE_CURL_NAMES =
Johannes Schindelin724d6352019-04-18 06:16:40 -07001418 EXCLUDED_PROGRAMS += git-http-fetch git-http-push
Daniel Barkalow30ae7642007-09-10 23:02:45 -04001419else
Junio C Hamano229a7ed2005-09-23 10:41:40 -07001420 ifdef CURLDIR
Junio C Hamanob2feb642014-04-30 10:58:10 -07001421 # Try "-Wl,-rpath=$(CURLDIR)/$(lib)" in such a case.
Jeff King897d68e2020-03-26 04:08:55 -04001422 CURL_CFLAGS = -I$(CURLDIR)/include
James Knight23c4bbe2018-11-03 05:12:11 +00001423 CURL_LIBCURL = -L$(CURLDIR)/$(lib) $(CC_LD_DYNPATH)$(CURLDIR)/$(lib)
Dave Borowitzf3f11fa2014-04-28 14:01:23 -07001424 else
Jeff King897d68e2020-03-26 04:08:55 -04001425 CURL_CFLAGS =
James Knight23c4bbe2018-11-03 05:12:11 +00001426 CURL_LIBCURL =
Junio C Hamanob2feb642014-04-30 10:58:10 -07001427 endif
James Knight23c4bbe2018-11-03 05:12:11 +00001428
Jeff King94a88e22020-03-26 04:06:45 -04001429 ifndef CURL_LDFLAGS
Jeff King05738312020-04-04 10:58:29 -04001430 CURL_LDFLAGS = $(eval CURL_LDFLAGS := $$(shell $$(CURL_CONFIG) --libs))$(CURL_LDFLAGS)
Jeff King94a88e22020-03-26 04:06:45 -04001431 endif
James Knight23c4bbe2018-11-03 05:12:11 +00001432 CURL_LIBCURL += $(CURL_LDFLAGS)
Thomas Cortbc5f8132011-07-19 18:55:47 -04001433
Jeff King897d68e2020-03-26 04:08:55 -04001434 ifndef CURL_CFLAGS
Jeff King05738312020-04-04 10:58:29 -04001435 CURL_CFLAGS = $(eval CURL_CFLAGS := $$(shell $$(CURL_CONFIG) --cflags))$(CURL_CFLAGS)
Jeff King897d68e2020-03-26 04:08:55 -04001436 endif
1437 BASIC_CFLAGS += $(CURL_CFLAGS)
Junio C Hamano229a7ed2005-09-23 10:41:40 -07001438
Johannes Sixt4256f362010-01-19 16:39:12 +01001439 REMOTE_CURL_PRIMARY = git-remote-http$X
1440 REMOTE_CURL_ALIASES = git-remote-https$X git-remote-ftp$X git-remote-ftps$X
1441 REMOTE_CURL_NAMES = $(REMOTE_CURL_PRIMARY) $(REMOTE_CURL_ALIASES)
Jonathan Nieder1b22c992010-01-26 09:54:23 -06001442 PROGRAM_OBJS += http-fetch.o
1443 PROGRAMS += $(REMOTE_CURL_NAMES)
Remi Pommarelf8915872015-10-21 19:10:46 +02001444 curl_check := $(shell (echo 070908; $(CURL_CONFIG) --vernum | sed -e '/^70[BC]/s/^/0/') 2>/dev/null | sort -r | sed -ne 2p)
Nick Hengeveld08900982005-11-18 17:08:36 -08001445 ifeq "$(curl_check)" "070908"
1446 ifndef NO_EXPAT
Jonathan Nieder1b22c992010-01-26 09:54:23 -06001447 PROGRAM_OBJS += http-push.o
Johannes Schindelin724d6352019-04-18 06:16:40 -07001448 else
1449 EXCLUDED_PROGRAMS += git-http-push
Nick Hengeveld08900982005-11-18 17:08:36 -08001450 endif
Johannes Schindelin724d6352019-04-18 06:16:40 -07001451 else
1452 EXCLUDED_PROGRAMS += git-http-push
Nick Hengeveld58e60dd2005-11-02 11:19:24 -08001453 endif
Remi Pommarelf8915872015-10-21 19:10:46 +02001454 curl_check := $(shell (echo 072200; $(CURL_CONFIG) --vernum | sed -e '/^70[BC]/s/^/0/') 2>/dev/null | sort -r | sed -ne 2p)
Bernhard Reiter1e16b252014-11-09 15:55:53 +01001455 ifeq "$(curl_check)" "072200"
1456 USE_CURL_FOR_IMAP_SEND = YesPlease
1457 endif
1458 ifdef USE_CURL_FOR_IMAP_SEND
1459 BASIC_CFLAGS += -DUSE_CURL_FOR_IMAP_SEND
1460 IMAP_SEND_BUILDDEPS = http.o
1461 IMAP_SEND_LDFLAGS += $(CURL_LIBCURL)
1462 endif
Johannes Schindelin459a21b2006-04-05 16:22:40 +02001463 ifndef NO_EXPAT
Serge van den Boom85b45182009-01-28 21:43:57 +01001464 ifdef EXPATDIR
1465 BASIC_CFLAGS += -I$(EXPATDIR)/include
1466 EXPAT_LIBEXPAT = -L$(EXPATDIR)/$(lib) $(CC_LD_DYNPATH)$(EXPATDIR)/$(lib) -lexpat
1467 else
1468 EXPAT_LIBEXPAT = -lexpat
1469 endif
Matt Kraai081fd8d2013-02-11 14:03:45 -08001470 ifdef EXPAT_NEEDS_XMLPARSE_H
1471 BASIC_CFLAGS += -DEXPAT_NEEDS_XMLPARSE_H
1472 endif
Johannes Schindelin459a21b2006-04-05 16:22:40 +02001473 endif
Junio C Hamano229a7ed2005-09-23 10:41:40 -07001474endif
Remi Pommarel9eaa78b2015-10-21 19:01:13 +02001475IMAP_SEND_LDFLAGS += $(OPENSSL_LINK) $(OPENSSL_LIBSSL) $(LIB_4_CRYPTO)
Junio C Hamano229a7ed2005-09-23 10:41:40 -07001476
Robert Schielebef19da2007-07-29 20:35:45 +02001477ifdef ZLIB_PATH
1478 BASIC_CFLAGS += -I$(ZLIB_PATH)/include
Robert Schiele10861be2007-08-01 06:30:35 +02001479 EXTLIBS += -L$(ZLIB_PATH)/$(lib) $(CC_LD_DYNPATH)$(ZLIB_PATH)/$(lib)
Robert Schielebef19da2007-07-29 20:35:45 +02001480endif
1481EXTLIBS += -lz
1482
Petr Baudisdd53c7a2005-07-29 17:50:51 +02001483ifndef NO_OPENSSL
Junio C Hamano215a7ad2005-09-07 17:26:23 -07001484 OPENSSL_LIBSSL = -lssl
Junio C Hamano455a7f32005-09-30 13:31:16 -07001485 ifdef OPENSSLDIR
Petr Baudis8d7f5862006-06-25 03:47:03 +02001486 BASIC_CFLAGS += -I$(OPENSSLDIR)/include
Robert Schiele10861be2007-08-01 06:30:35 +02001487 OPENSSL_LINK = -L$(OPENSSLDIR)/$(lib) $(CC_LD_DYNPATH)$(OPENSSLDIR)/$(lib)
Junio C Hamano455a7f32005-09-30 13:31:16 -07001488 else
1489 OPENSSL_LINK =
1490 endif
Brian Gernhardt0460dba2009-09-08 09:54:38 -04001491 ifdef NEEDS_CRYPTO_WITH_SSL
Thomas Cortbc5f8132011-07-19 18:55:47 -04001492 OPENSSL_LIBSSL += -lcrypto
Brian Gernhardt0460dba2009-09-08 09:54:38 -04001493 endif
Petr Baudisdd53c7a2005-07-29 17:50:51 +02001494else
Petr Baudis8d7f5862006-06-25 03:47:03 +02001495 BASIC_CFLAGS += -DNO_OPENSSL
Junio C Hamano215a7ad2005-09-07 17:26:23 -07001496 OPENSSL_LIBSSL =
Petr Baudisdd53c7a2005-07-29 17:50:51 +02001497endif
Junio C Hamano5b02b9b2010-12-08 14:54:13 -08001498ifdef NO_OPENSSL
1499 LIB_4_CRYPTO =
1500else
Junio C Hamano597c9cc2005-09-07 12:22:56 -07001501ifdef NEEDS_SSL_WITH_CRYPTO
Junio C Hamano455a7f32005-09-30 13:31:16 -07001502 LIB_4_CRYPTO = $(OPENSSL_LINK) -lcrypto -lssl
Junio C Hamano597c9cc2005-09-07 12:22:56 -07001503else
Junio C Hamano455a7f32005-09-30 13:31:16 -07001504 LIB_4_CRYPTO = $(OPENSSL_LINK) -lcrypto
Junio C Hamano597c9cc2005-09-07 12:22:56 -07001505endif
Brian Gernhardtc9849382013-08-05 11:59:22 -04001506ifdef APPLE_COMMON_CRYPTO
1507 LIB_4_CRYPTO += -framework Security -framework CoreFoundation
1508endif
Junio C Hamano5b02b9b2010-12-08 14:54:13 -08001509endif
Eric Sunshinefdb1fbb2018-06-14 22:25:03 -04001510ifndef NO_ICONV
1511 ifdef NEEDS_LIBICONV
1512 ifdef ICONVDIR
1513 BASIC_CFLAGS += -I$(ICONVDIR)/include
1514 ICONV_LINK = -L$(ICONVDIR)/$(lib) $(CC_LD_DYNPATH)$(ICONVDIR)/$(lib)
1515 else
1516 ICONV_LINK =
1517 endif
1518 ifdef NEEDS_LIBINTL_BEFORE_LIBICONV
1519 ICONV_LINK += -lintl
1520 endif
1521 EXTLIBS += $(ICONV_LINK) -liconv
Junio C Hamano455a7f32005-09-30 13:31:16 -07001522 endif
Junio C Hamano597c9cc2005-09-07 12:22:56 -07001523endif
brian m. carlson79444c92019-02-12 00:52:06 +00001524ifdef ICONV_OMITS_BOM
1525 BASIC_CFLAGS += -DICONV_OMITS_BOM
1526endif
Brandon Caseyecc395c2009-07-10 12:10:45 -05001527ifdef NEEDS_LIBGEN
1528 EXTLIBS += -lgen
1529endif
Ævar Arnfjörð Bjarmason5e9637c2011-11-18 00:14:42 +01001530ifndef NO_GETTEXT
1531ifndef LIBC_CONTAINS_LIBINTL
1532 EXTLIBS += -lintl
1533endif
1534endif
Patrick Mauritzf0ebff02005-09-06 01:24:03 +02001535ifdef NEEDS_SOCKET
Petr Baudisd595a472006-06-24 18:35:12 -07001536 EXTLIBS += -lsocket
Patrick Mauritzf0ebff02005-09-06 01:24:03 +02001537endif
Junio C Hamano5a90d4a2005-09-11 22:25:49 -07001538ifdef NEEDS_NSL
Petr Baudisd595a472006-06-24 18:35:12 -07001539 EXTLIBS += -lnsl
Junio C Hamano5a90d4a2005-09-11 22:25:49 -07001540endif
Brandon Casey70cf9912009-06-05 18:36:10 -05001541ifdef NEEDS_RESOLV
1542 EXTLIBS += -lresolv
1543endif
Junio C Hamano63be37b2006-01-19 17:13:57 -08001544ifdef NO_D_TYPE_IN_DIRENT
Petr Baudis8d7f5862006-06-25 03:47:03 +02001545 BASIC_CFLAGS += -DNO_D_TYPE_IN_DIRENT
Junio C Hamano63be37b2006-01-19 17:13:57 -08001546endif
David Michael110d6982012-12-14 14:56:59 -05001547ifdef NO_GECOS_IN_PWENT
1548 BASIC_CFLAGS += -DNO_GECOS_IN_PWENT
1549endif
Junio C Hamanofdb2a2a2008-08-18 21:57:16 +02001550ifdef NO_ST_BLOCKS_IN_STRUCT_STAT
1551 BASIC_CFLAGS += -DNO_ST_BLOCKS_IN_STRUCT_STAT
1552endif
Brian Gernhardtd7371a22009-03-08 17:22:51 -04001553ifdef USE_NSEC
1554 BASIC_CFLAGS += -DUSE_NSEC
1555endif
Brian Gernhardtc5673832009-03-08 16:04:28 -04001556ifdef USE_ST_TIMESPEC
1557 BASIC_CFLAGS += -DUSE_ST_TIMESPEC
1558endif
Junio C Hamano6520c842011-06-18 18:07:03 -07001559ifdef NO_NORETURN
1560 BASIC_CFLAGS += -DNO_NORETURN
1561endif
Kjetil Barvikc06ff492009-03-04 18:47:40 +01001562ifdef NO_NSEC
1563 BASIC_CFLAGS += -DNO_NSEC
1564endif
Michal Rokosc4582f92008-03-05 16:46:13 +01001565ifdef SNPRINTF_RETURNS_BOGUS
1566 COMPAT_CFLAGS += -DSNPRINTF_RETURNS_BOGUS
1567 COMPAT_OBJS += compat/snprintf.o
1568endif
Brandon Caseycba22522008-02-08 20:32:47 -06001569ifdef FREAD_READS_DIRECTORIES
1570 COMPAT_CFLAGS += -DFREAD_READS_DIRECTORIES
1571 COMPAT_OBJS += compat/fopen.o
1572endif
Jeff King2b081012021-02-26 01:14:35 -05001573ifdef OPEN_RETURNS_EINTR
1574 COMPAT_CFLAGS += -DOPEN_RETURNS_EINTR
1575 COMPAT_OBJS += compat/open.o
1576endif
Junio C Hamano9f0bb902006-05-02 00:40:24 -07001577ifdef NO_SYMLINK_HEAD
Petr Baudis8d7f5862006-06-25 03:47:03 +02001578 BASIC_CFLAGS += -DNO_SYMLINK_HEAD
Junio C Hamano9f0bb902006-05-02 00:40:24 -07001579endif
Ævar Arnfjörð Bjarmason5e9637c2011-11-18 00:14:42 +01001580ifdef NO_GETTEXT
1581 BASIC_CFLAGS += -DNO_GETTEXT
Junio C Hamano60f40792012-01-23 18:31:09 -06001582 USE_GETTEXT_SCHEME ?= fallthrough
Ævar Arnfjörð Bjarmason5e9637c2011-11-18 00:14:42 +01001583endif
Joachim Schmitz6d45eb12012-09-17 23:16:39 +02001584ifdef NO_POLL
Đoàn Trần Công Danh2648ccc2018-11-14 08:10:43 +07001585 NO_POLL_H = YesPlease
Joachim Schmitz6d45eb12012-09-17 23:16:39 +02001586 NO_SYS_POLL_H = YesPlease
1587 COMPAT_CFLAGS += -DNO_POLL -Icompat/poll
1588 COMPAT_OBJS += compat/poll/poll.o
1589endif
Linus Torvaldsef34af22005-09-18 18:30:50 -07001590ifdef NO_STRCASESTR
Junio C Hamano4050c0d2005-12-05 11:54:29 -08001591 COMPAT_CFLAGS += -DNO_STRCASESTR
Jason Riedye40b61f2005-12-02 15:08:28 -08001592 COMPAT_OBJS += compat/strcasestr.o
1593endif
Peter Eriksen817151e2006-06-24 16:01:25 +02001594ifdef NO_STRLCPY
1595 COMPAT_CFLAGS += -DNO_STRLCPY
1596 COMPAT_OBJS += compat/strlcpy.o
1597endif
Jason Riedybc6b4f52007-02-19 16:22:56 -08001598ifdef NO_STRTOUMAX
1599 COMPAT_CFLAGS += -DNO_STRTOUMAX
Nick Alcocke3eed7f2011-11-02 15:46:22 +00001600 COMPAT_OBJS += compat/strtoumax.o compat/strtoimax.o
Jason Riedybc6b4f52007-02-19 16:22:56 -08001601endif
1602ifdef NO_STRTOULL
1603 COMPAT_CFLAGS += -DNO_STRTOULL
1604endif
Jason Riedye40b61f2005-12-02 15:08:28 -08001605ifdef NO_SETENV
Junio C Hamano4050c0d2005-12-05 11:54:29 -08001606 COMPAT_CFLAGS += -DNO_SETENV
Jason Riedye40b61f2005-12-02 15:08:28 -08001607 COMPAT_OBJS += compat/setenv.o
Linus Torvaldsef34af22005-09-18 18:30:50 -07001608endif
Shawn O. Pearceca5bb5d2007-10-20 16:03:49 -04001609ifdef NO_MKDTEMP
1610 COMPAT_CFLAGS += -DNO_MKDTEMP
1611 COMPAT_OBJS += compat/mkdtemp.o
1612endif
Joachim Schmitzdc9f4622012-09-08 19:01:31 +02001613ifdef MKDIR_WO_TRAILING_SLASH
1614 COMPAT_CFLAGS += -DMKDIR_WO_TRAILING_SLASH
1615 COMPAT_OBJS += compat/mkdir.o
1616endif
Johannes Schindelin104ff342006-08-29 12:51:14 +02001617ifdef NO_UNSETENV
Jason Riedy731043f2006-01-25 12:38:36 -08001618 COMPAT_CFLAGS += -DNO_UNSETENV
1619 COMPAT_OBJS += compat/unsetenv.o
1620endif
Robert Schiele26009732008-01-24 19:34:46 +01001621ifdef NO_SYS_SELECT_H
1622 BASIC_CFLAGS += -DNO_SYS_SELECT_H
1623endif
Đoàn Trần Công Danh2648ccc2018-11-14 08:10:43 +07001624ifdef NO_POLL_H
1625 BASIC_CFLAGS += -DNO_POLL_H
1626endif
Markus Duft28449232010-10-27 10:39:52 +02001627ifdef NO_SYS_POLL_H
1628 BASIC_CFLAGS += -DNO_SYS_POLL_H
1629endif
Junio C Hamanob2d05e02012-12-18 09:35:33 -08001630ifdef NEEDS_SYS_PARAM_H
1631 BASIC_CFLAGS += -DNEEDS_SYS_PARAM_H
David Michael6ede7202012-12-14 14:56:58 -05001632endif
Markus Duft28449232010-10-27 10:39:52 +02001633ifdef NO_INTTYPES_H
1634 BASIC_CFLAGS += -DNO_INTTYPES_H
1635endif
1636ifdef NO_INITGROUPS
1637 BASIC_CFLAGS += -DNO_INITGROUPS
1638endif
Johannes Schindelin730d48a2005-10-08 15:54:36 -07001639ifdef NO_MMAP
Junio C Hamano4050c0d2005-12-05 11:54:29 -08001640 COMPAT_CFLAGS += -DNO_MMAP
Jason Riedye40b61f2005-12-02 15:08:28 -08001641 COMPAT_OBJS += compat/mmap.o
Janos Laubeb130a722009-03-13 16:50:45 +01001642else
1643 ifdef USE_WIN32_MMAP
1644 COMPAT_CFLAGS += -DUSE_WIN32_MMAP
1645 COMPAT_OBJS += compat/win32mmap.o
1646 endif
Johannes Schindelin730d48a2005-10-08 15:54:36 -07001647endif
Michael Haggerty5b633612017-09-25 10:00:10 +02001648ifdef MMAP_PREVENTS_DELETE
1649 BASIC_CFLAGS += -DMMAP_PREVENTS_DELETE
1650endif
Johannes Schindelin348df162009-04-28 00:32:25 +02001651ifdef OBJECT_CREATION_USES_RENAMES
1652 COMPAT_CFLAGS += -DOBJECT_CREATION_MODE=1
Johannes Schindelinbe66a6c2009-04-25 11:57:14 +02001653endif
Joachim Schmitz7f9e8482012-09-08 18:54:34 +02001654ifdef NO_STRUCT_ITIMERVAL
1655 COMPAT_CFLAGS += -DNO_STRUCT_ITIMERVAL
Stefano Lattarinidd6fc7c2012-12-09 11:36:17 +01001656 NO_SETITIMER = YesPlease
Joachim Schmitz7f9e8482012-09-08 18:54:34 +02001657endif
1658ifdef NO_SETITIMER
1659 COMPAT_CFLAGS += -DNO_SETITIMER
1660endif
Stefan-W. Hahn69006792007-01-09 22:04:12 +01001661ifdef NO_PREAD
1662 COMPAT_CFLAGS += -DNO_PREAD
1663 COMPAT_OBJS += compat/pread.o
1664endif
Shawn O. Pearce1510fea2006-12-14 06:15:57 -05001665ifdef NO_FAST_WORKING_DIRECTORY
1666 BASIC_CFLAGS += -DNO_FAST_WORKING_DIRECTORY
1667endif
Shawn O. Pearcec8697532006-12-30 23:53:55 -05001668ifdef NO_TRUSTABLE_FILEMODE
1669 BASIC_CFLAGS += -DNO_TRUSTABLE_FILEMODE
1670endif
David Michaeld543d9c2014-12-03 21:24:17 -05001671ifdef NEEDS_MODE_TRANSLATION
1672 COMPAT_CFLAGS += -DNEEDS_MODE_TRANSLATION
1673 COMPAT_OBJS += compat/stat.o
1674endif
hpa49744d62005-09-28 16:52:21 -07001675ifdef NO_IPV6
Petr Baudis8d7f5862006-06-25 03:47:03 +02001676 BASIC_CFLAGS += -DNO_IPV6
Junio C Hamanobdc37f52006-01-19 17:13:32 -08001677endif
Joachim Schmitz6c109902012-09-19 12:03:30 +02001678ifdef NO_INTPTR_T
1679 COMPAT_CFLAGS += -DNO_INTPTR_T
1680endif
David M. Syzdek0bc3e782008-10-26 03:52:37 -08001681ifdef NO_UINTMAX_T
1682 BASIC_CFLAGS += -Duintmax_t=uint32_t
1683endif
Junio C Hamanobdc37f52006-01-19 17:13:32 -08001684ifdef NO_SOCKADDR_STORAGE
1685ifdef NO_IPV6
Petr Baudis8d7f5862006-06-25 03:47:03 +02001686 BASIC_CFLAGS += -Dsockaddr_storage=sockaddr_in
Junio C Hamanobdc37f52006-01-19 17:13:32 -08001687else
Petr Baudis8d7f5862006-06-25 03:47:03 +02001688 BASIC_CFLAGS += -Dsockaddr_storage=sockaddr_in6
Junio C Hamanobdc37f52006-01-19 17:13:32 -08001689endif
hpa49744d62005-09-28 16:52:21 -07001690endif
Yakov Lerner6ba68ab2006-05-22 00:37:00 +03001691ifdef NO_INET_NTOP
1692 LIB_OBJS += compat/inet_ntop.o
Mike Papeda523cc2010-11-04 02:35:11 +01001693 BASIC_CFLAGS += -DNO_INET_NTOP
Yakov Lerner6ba68ab2006-05-22 00:37:00 +03001694endif
Jon Loeligerdd467622006-09-26 09:47:43 -05001695ifdef NO_INET_PTON
1696 LIB_OBJS += compat/inet_pton.o
Mike Papeda523cc2010-11-04 02:35:11 +01001697 BASIC_CFLAGS += -DNO_INET_PTON
Jon Loeligerdd467622006-09-26 09:47:43 -05001698endif
Jeff Hostetleree4512e2019-02-22 14:25:01 -08001699ifdef NO_UNIX_SOCKETS
1700 BASIC_CFLAGS += -DNO_UNIX_SOCKETS
1701else
Johannes Sixt63203582011-12-12 22:12:56 +01001702 LIB_OBJS += unix-socket.o
Jeff Hostetler9fd19022021-03-15 21:08:27 +00001703 LIB_OBJS += unix-stream-server.o
Jeff Hostetler6aac70a2021-05-20 18:28:10 +00001704endif
1705
1706# Simple IPC requires threads and platform-specific IPC support.
1707# Only platforms that have both should include these source files
1708# in the build.
1709#
1710# On Windows-based systems, Simple IPC requires threads and Windows
1711# Named Pipes. These are always available, so Simple IPC support
1712# is optional.
1713#
1714# On Unix-based systems, Simple IPC requires pthreads and Unix
1715# domain sockets. So support is only enabled when both are present.
1716#
1717ifdef USE_WIN32_IPC
1718 BASIC_CFLAGS += -DSUPPORTS_SIMPLE_IPC
1719 LIB_OBJS += compat/simple-ipc/ipc-shared.o
1720 LIB_OBJS += compat/simple-ipc/ipc-win32.o
1721else
1722ifndef NO_PTHREADS
1723ifndef NO_UNIX_SOCKETS
1724 BASIC_CFLAGS += -DSUPPORTS_SIMPLE_IPC
Jeff Hostetler7cd5dbc2021-03-22 10:29:47 +00001725 LIB_OBJS += compat/simple-ipc/ipc-shared.o
1726 LIB_OBJS += compat/simple-ipc/ipc-unix-socket.o
Johannes Sixt63203582011-12-12 22:12:56 +01001727endif
Jeff Hostetler6aac70a2021-05-20 18:28:10 +00001728endif
Fernando J. Peredab6e56ec2006-02-16 09:38:01 +01001729endif
1730
1731ifdef NO_ICONV
Petr Baudis8d7f5862006-06-25 03:47:03 +02001732 BASIC_CFLAGS += -DNO_ICONV
Nicolas Pitre7c6ef2f2005-09-20 12:27:13 -04001733endif
1734
Ramsay Jonesfd547a92007-03-03 18:29:03 +00001735ifdef OLD_ICONV
1736 BASIC_CFLAGS += -DOLD_ICONV
1737endif
1738
David Symonds609a2282007-11-07 14:24:28 +11001739ifdef NO_DEFLATE_BOUND
1740 BASIC_CFLAGS += -DNO_DEFLATE_BOUND
1741endif
1742
Han-Wen Nienhuysa3229202021-10-07 20:25:03 +00001743ifdef NO_UNCOMPRESS2
1744 BASIC_CFLAGS += -DNO_UNCOMPRESS2
1745 REFTABLE_OBJS += compat/zlib-uncompress2.o
1746endif
1747
Erik Faye-Lunda666b472010-11-04 02:35:24 +01001748ifdef NO_POSIX_GOODIES
1749 BASIC_CFLAGS += -DNO_POSIX_GOODIES
1750endif
1751
Atousa Pahlevan Duprat001fd7a2015-11-04 22:38:42 -08001752ifdef APPLE_COMMON_CRYPTO
1753 # Apple CommonCrypto requires chunking
1754 SHA1_MAX_BLOCK_SIZE = 1024L*1024L*1024L
1755endif
1756
Junio C Hamanoe6b07da2017-03-17 10:00:15 -07001757ifdef OPENSSL_SHA1
1758 EXTLIBS += $(LIB_4_CRYPTO)
1759 BASIC_CFLAGS += -DSHA1_OPENSSL
Jeff King8325e432017-03-16 18:09:12 -04001760else
Linus Torvaldsd7c208a2009-08-05 16:13:20 -07001761ifdef BLK_SHA1
Linus Torvaldsd7c208a2009-08-05 16:13:20 -07001762 LIB_OBJS += block-sha1/sha1.o
brian m. carlsonf18f8162017-03-11 22:28:18 +00001763 BASIC_CFLAGS += -DSHA1_BLK
Linus Torvaldsd7c208a2009-08-05 16:13:20 -07001764else
Nicolas Pitre7c6ef2f2005-09-20 12:27:13 -04001765ifdef PPC_SHA1
Nicolas Pitre7c6ef2f2005-09-20 12:27:13 -04001766 LIB_OBJS += ppc/sha1.o ppc/sha1ppc.o
brian m. carlsonf18f8162017-03-11 22:28:18 +00001767 BASIC_CFLAGS += -DSHA1_PPC
Nicolas Pitre7c6ef2f2005-09-20 12:27:13 -04001768else
David Aguilar61067952013-05-19 06:23:35 -04001769ifdef APPLE_COMMON_CRYPTO
1770 COMPAT_CFLAGS += -DCOMMON_DIGEST_FOR_OPENSSL
brian m. carlsonf18f8162017-03-11 22:28:18 +00001771 BASIC_CFLAGS += -DSHA1_APPLE
David Aguilar61067952013-05-19 06:23:35 -04001772else
Junio C Hamanoe6b07da2017-03-17 10:00:15 -07001773 DC_SHA1 := YesPlease
Takashi Iwai36f048c2017-08-15 14:04:16 +02001774 BASIC_CFLAGS += -DSHA1_DC
1775 LIB_OBJS += sha1dc_git.o
Takashi Iwai3964cbb2017-08-15 14:04:17 +02001776ifdef DC_SHA1_EXTERNAL
1777 ifdef DC_SHA1_SUBMODULE
Ævar Arnfjörð Bjarmasonf39e05f2017-12-08 22:29:57 +00001778 ifneq ($(DC_SHA1_SUBMODULE),auto)
Takashi Iwai3964cbb2017-08-15 14:04:17 +02001779$(error Only set DC_SHA1_EXTERNAL or DC_SHA1_SUBMODULE, not both)
Ævar Arnfjörð Bjarmasonf39e05f2017-12-08 22:29:57 +00001780 endif
Takashi Iwai3964cbb2017-08-15 14:04:17 +02001781 endif
1782 BASIC_CFLAGS += -DDC_SHA1_EXTERNAL
1783 EXTLIBS += -lsha1detectcoll
1784else
Ævar Arnfjörð Bjarmason86cfd612017-07-01 22:05:46 +00001785ifdef DC_SHA1_SUBMODULE
1786 LIB_OBJS += sha1collisiondetection/lib/sha1.o
1787 LIB_OBJS += sha1collisiondetection/lib/ubc_check.o
1788 BASIC_CFLAGS += -DDC_SHA1_SUBMODULE
1789else
Junio C Hamanoe6b07da2017-03-17 10:00:15 -07001790 LIB_OBJS += sha1dc/sha1.o
1791 LIB_OBJS += sha1dc/ubc_check.o
Ævar Arnfjörð Bjarmason86cfd612017-07-01 22:05:46 +00001792endif
Ævar Arnfjörð Bjarmasona0103912017-05-20 11:54:28 +00001793 BASIC_CFLAGS += \
Ævar Arnfjörð Bjarmasona0103912017-05-20 11:54:28 +00001794 -DSHA1DC_NO_STANDARD_INCLUDES \
1795 -DSHA1DC_INIT_SAFE_HASH_DEFAULT=0 \
1796 -DSHA1DC_CUSTOM_INCLUDE_SHA1_C="\"cache.h\"" \
Ævar Arnfjörð Bjarmasona0103912017-05-20 11:54:28 +00001797 -DSHA1DC_CUSTOM_INCLUDE_UBC_CHECK_C="\"git-compat-util.h\""
Nicolas Pitre7c6ef2f2005-09-20 12:27:13 -04001798endif
Nicolas Pitre7c6ef2f2005-09-20 12:27:13 -04001799endif
1800endif
David Aguilar61067952013-05-19 06:23:35 -04001801endif
Takashi Iwai3964cbb2017-08-15 14:04:17 +02001802endif
David Aguilar61067952013-05-19 06:23:35 -04001803
brian m. carlson4b4e2912018-11-14 04:09:38 +00001804ifdef OPENSSL_SHA256
1805 EXTLIBS += $(LIB_4_CRYPTO)
1806 BASIC_CFLAGS += -DSHA256_OPENSSL
1807else
brian m. carlson27dc04c2018-11-14 04:09:37 +00001808ifdef GCRYPT_SHA256
1809 BASIC_CFLAGS += -DSHA256_GCRYPT
1810 EXTLIBS += -lgcrypt
1811else
1812 LIB_OBJS += sha256/block/sha256.o
1813 BASIC_CFLAGS += -DSHA256_BLK
1814endif
brian m. carlson4b4e2912018-11-14 04:09:38 +00001815endif
brian m. carlson13eeedb2018-11-14 04:09:36 +00001816
Atousa Pahlevan Duprat001fd7a2015-11-04 22:38:42 -08001817ifdef SHA1_MAX_BLOCK_SIZE
1818 LIB_OBJS += compat/sha1-chunked.o
1819 BASIC_CFLAGS += -DSHA1_MAX_BLOCK_SIZE="$(SHA1_MAX_BLOCK_SIZE)"
1820endif
Alex Riesenfa0c87c2007-06-13 20:54:32 +02001821ifdef NO_HSTRERROR
1822 COMPAT_CFLAGS += -DNO_HSTRERROR
1823 COMPAT_OBJS += compat/hstrerror.o
1824endif
René Scharfeb21b9f12007-09-07 00:32:54 +02001825ifdef NO_MEMMEM
1826 COMPAT_CFLAGS += -DNO_MEMMEM
1827 COMPAT_OBJS += compat/memmem.o
1828endif
Matt Kraai40036be2012-12-18 14:03:55 -08001829ifdef NO_GETPAGESIZE
1830 COMPAT_CFLAGS += -DNO_GETPAGESIZE
1831endif
Brian Downing43fe9012008-02-05 15:10:44 -06001832ifdef INTERNAL_QSORT
1833 COMPAT_CFLAGS += -DINTERNAL_QSORT
Brian Downing43fe9012008-02-05 15:10:44 -06001834endif
René Scharfe04ee8b82017-01-22 18:51:11 +01001835ifdef HAVE_ISO_QSORT_S
1836 COMPAT_CFLAGS += -DHAVE_ISO_QSORT_S
1837else
1838 COMPAT_OBJS += compat/qsort_s.o
1839endif
Steffen Prohaska35fb0e862009-01-18 13:00:14 +01001840ifdef RUNTIME_PREFIX
1841 COMPAT_CFLAGS += -DRUNTIME_PREFIX
1842endif
Alex Riesenb7774342007-03-07 00:44:49 +01001843
Junio C Hamano46059cc2008-11-15 04:08:14 -08001844ifdef NO_PTHREADS
Junio C Hamano46059cc2008-11-15 04:08:14 -08001845 BASIC_CFLAGS += -DNO_PTHREADS
1846else
Gary V. Vaughan48793cf2010-05-14 09:31:34 +00001847 BASIC_CFLAGS += $(PTHREAD_CFLAGS)
Junio C Hamano46059cc2008-11-15 04:08:14 -08001848 EXTLIBS += $(PTHREAD_LIBS)
Nicolas Pitre8ecce682007-09-06 02:13:11 -04001849endif
Dan McGee7eb151d2010-01-29 19:22:19 -06001850
Chris Webbcb6a22c2010-04-13 10:07:13 +01001851ifdef HAVE_PATHS_H
1852 BASIC_CFLAGS += -DHAVE_PATHS_H
1853endif
1854
Ævar Arnfjörð Bjarmason5e9637c2011-11-18 00:14:42 +01001855ifdef HAVE_LIBCHARSET_H
1856 BASIC_CFLAGS += -DHAVE_LIBCHARSET_H
Дилян Палаузовb5225282012-02-12 17:23:36 +01001857 EXTLIBS += $(CHARSET_LIB)
Ævar Arnfjörð Bjarmason5e9637c2011-11-18 00:14:42 +01001858endif
1859
David Michaelb3e103d2012-12-14 14:57:01 -05001860ifdef HAVE_STRINGS_H
1861 BASIC_CFLAGS += -DHAVE_STRINGS_H
1862endif
1863
Jeff King21aeafc2011-12-10 05:41:01 -05001864ifdef HAVE_DEV_TTY
1865 BASIC_CFLAGS += -DHAVE_DEV_TTY
1866endif
1867
Alex Riesen81a24b52008-03-05 00:15:39 +01001868ifdef DIR_HAS_BSD_GROUP_SEMANTICS
1869 COMPAT_CFLAGS += -DDIR_HAS_BSD_GROUP_SEMANTICS
1870endif
Johannes Sixt34779c52009-04-20 10:17:00 +02001871ifdef UNRELIABLE_FSTAT
1872 BASIC_CFLAGS += -DUNRELIABLE_FSTAT
1873endif
Jeff King02232ad2009-06-16 15:07:40 -04001874ifdef NO_REGEX
1875 COMPAT_CFLAGS += -Icompat/regex
1876 COMPAT_OBJS += compat/regex/regex.o
1877endif
Pat Thoyts5491e9e2014-08-30 23:38:59 +02001878ifdef NATIVE_CRLF
1879 BASIC_CFLAGS += -DNATIVE_CRLF
1880endif
Nicolas Pitre8ecce682007-09-06 02:13:11 -04001881
Marius Storm-Olsenf0ed8222009-05-31 18:15:23 +02001882ifdef USE_NED_ALLOCATOR
René Scharfeca2baa32016-09-03 17:59:15 +02001883 COMPAT_CFLAGS += -Icompat/nedmalloc
1884 COMPAT_OBJS += compat/nedmalloc/nedmalloc.o
1885 OVERRIDE_STRDUP = YesPlease
1886endif
1887
1888ifdef OVERRIDE_STRDUP
1889 COMPAT_CFLAGS += -DOVERRIDE_STRDUP
1890 COMPAT_OBJS += compat/strdup.o
Marius Storm-Olsenf0ed8222009-05-31 18:15:23 +02001891endif
1892
Junio C Hamano7b3bdbb2010-05-31 17:35:20 -07001893ifdef GIT_TEST_CMP_USE_COPIED_CONTEXT
1894 export GIT_TEST_CMP_USE_COPIED_CONTEXT
1895endif
1896
Ævar Arnfjörð Bjarmason5e9637c2011-11-18 00:14:42 +01001897ifndef NO_MSGFMT_EXTENDED_OPTIONS
1898 MSGFMT += --check --statistics
1899endif
1900
Karsten Blees148d6772014-07-12 02:05:42 +02001901ifdef HAVE_CLOCK_GETTIME
1902 BASIC_CFLAGS += -DHAVE_CLOCK_GETTIME
Karsten Blees148d6772014-07-12 02:05:42 +02001903endif
1904
Reuben Hawkinsa6c3c632015-01-08 12:00:56 -08001905ifdef HAVE_CLOCK_MONOTONIC
1906 BASIC_CFLAGS += -DHAVE_CLOCK_MONOTONIC
1907endif
1908
Ronald Wamplerd19e3a52016-07-07 16:45:54 -04001909ifdef NEEDS_LIBRT
1910 EXTLIBS += -lrt
1911endif
1912
Kyle J. McKay95290802015-03-07 23:14:36 -08001913ifdef HAVE_BSD_SYSCTL
1914 BASIC_CFLAGS += -DHAVE_BSD_SYSCTL
1915endif
1916
Dan Jacques226c0dd2018-04-10 11:05:44 -04001917ifdef HAVE_BSD_KERN_PROC_SYSCTL
1918 BASIC_CFLAGS += -DHAVE_BSD_KERN_PROC_SYSCTL
1919endif
1920
Jeff King0cc30e02015-04-16 05:01:38 -04001921ifdef HAVE_GETDELIM
1922 BASIC_CFLAGS += -DHAVE_GETDELIM
1923endif
1924
Dan Jacques226c0dd2018-04-10 11:05:44 -04001925ifneq ($(PROCFS_EXECUTABLE_PATH),)
1926 procfs_executable_path_SQ = $(subst ','\'',$(PROCFS_EXECUTABLE_PATH))
1927 BASIC_CFLAGS += '-DPROCFS_EXECUTABLE_PATH="$(procfs_executable_path_SQ)"'
1928endif
1929
Emily Shafferb7e6a412021-07-21 18:27:06 -07001930ifndef HAVE_PLATFORM_PROCINFO
1931 COMPAT_OBJS += compat/stub/procinfo.o
1932endif
1933
Dan Jacques226c0dd2018-04-10 11:05:44 -04001934ifdef HAVE_NS_GET_EXECUTABLE_PATH
1935 BASIC_CFLAGS += -DHAVE_NS_GET_EXECUTABLE_PATH
1936endif
1937
Johannes Schindelinc1be1cb2018-04-10 11:05:45 -04001938ifdef HAVE_WPGMPTR
1939 BASIC_CFLAGS += -DHAVE_WPGMPTR
1940endif
1941
Duy Nguyen18a4f6b2019-02-12 21:14:41 +07001942ifdef FILENO_IS_A_MACRO
1943 COMPAT_CFLAGS += -DFILENO_IS_A_MACRO
1944 COMPAT_OBJS += compat/fileno.o
1945endif
1946
Clément Chigot400caaf2019-04-25 07:01:56 +00001947ifdef NEED_ACCESS_ROOT_HANDLER
1948 COMPAT_CFLAGS += -DNEED_ACCESS_ROOT_HANDLER
1949 COMPAT_OBJS += compat/access.o
1950endif
1951
Eygene Ryabinkin81b63c72007-03-28 04:12:07 -07001952ifeq ($(TCLTK_PATH),)
Stefano Lattarinidd6fc7c2012-12-09 11:36:17 +01001953NO_TCLTK = NoThanks
Eygene Ryabinkin81b63c72007-03-28 04:12:07 -07001954endif
1955
Jeff King499c2932009-04-03 15:32:20 -04001956ifeq ($(PERL_PATH),)
Stefano Lattarinidd6fc7c2012-12-09 11:36:17 +01001957NO_PERL = NoThanks
Jeff King499c2932009-04-03 15:32:20 -04001958endif
1959
Johan Herlandd4e1b472009-11-18 02:42:31 +01001960ifeq ($(PYTHON_PATH),)
Stefano Lattarinidd6fc7c2012-12-09 11:36:17 +01001961NO_PYTHON = NoThanks
Johan Herlandd4e1b472009-11-18 02:42:31 +01001962endif
1963
Eric Wong995bc222016-08-04 11:40:25 +00001964ifndef PAGER_ENV
1965PAGER_ENV = LESS=FRX LV=-c
1966endif
1967
Fernando J. Pereda3b486cd2007-04-04 22:42:33 +02001968QUIET_SUBDIR0 = +$(MAKE) -C # space to separate -C and subdir
Alex Riesenb7774342007-03-07 00:44:49 +01001969QUIET_SUBDIR1 =
1970
John Keepingef49e052015-09-05 13:22:10 +01001971ifneq ($(findstring w,$(MAKEFLAGS)),w)
Alex Riesena6f37092007-03-07 00:05:34 +01001972PRINT_DIR = --no-print-directory
1973else # "make -w"
1974NO_SUBDIR = :
1975endif
1976
John Keepingef49e052015-09-05 13:22:10 +01001977ifneq ($(findstring s,$(MAKEFLAGS)),s)
Shawn O. Pearce2314c942007-03-06 02:09:14 -05001978ifndef V
Alex Riesen31d03992007-03-06 23:37:18 +01001979 QUIET_CC = @echo ' ' CC $@;
Shawn O. Pearce74f2b2a2007-03-06 01:35:01 -05001980 QUIET_AR = @echo ' ' AR $@;
1981 QUIET_LINK = @echo ' ' LINK $@;
1982 QUIET_BUILT_IN = @echo ' ' BUILTIN $@;
1983 QUIET_GEN = @echo ' ' GEN $@;
Junio C Hamano611c7f62009-08-06 22:08:09 -07001984 QUIET_LNCP = @echo ' ' LN/CP $@;
Ævar Arnfjörð Bjarmasoncd5513a2011-02-22 23:41:23 +00001985 QUIET_XGETTEXT = @echo ' ' XGETTEXT $@;
Ævar Arnfjörð Bjarmason5e9637c2011-11-18 00:14:42 +01001986 QUIET_MSGFMT = @echo ' ' MSGFMT $@;
Ævar Arnfjörð Bjarmasonbc548ef2010-07-25 19:52:40 +00001987 QUIET_GCOV = @echo ' ' GCOV $@;
Ramsay Jones0bcd9ae2011-04-21 20:14:42 +01001988 QUIET_SP = @echo ' ' SP $<;
Denton Liub503a2d2019-09-25 01:21:01 -07001989 QUIET_HDR = @echo ' ' HDR $(<:hcc=h);
Pat Thoytsce39c2e2012-05-24 00:56:24 +01001990 QUIET_RC = @echo ' ' RC $@;
Denton Liu4f3c1dc2019-10-09 13:43:46 -07001991 QUIET_SPATCH = @echo ' ' SPATCH $<;
Fernando J. Pereda3b486cd2007-04-04 22:42:33 +02001992 QUIET_SUBDIR0 = +@subdir=
Alex Riesena6f37092007-03-07 00:05:34 +01001993 QUIET_SUBDIR1 = ;$(NO_SUBDIR) echo ' ' SUBDIR $$subdir; \
1994 $(MAKE) $(PRINT_DIR) -C $$subdir
Shawn O. Pearce2314c942007-03-06 02:09:14 -05001995 export V
Alex Riesen31d03992007-03-06 23:37:18 +01001996 export QUIET_GEN
Alex Riesenb7774342007-03-07 00:44:49 +01001997 export QUIET_BUILT_IN
1998endif
Shawn O. Pearce74f2b2a2007-03-06 01:35:01 -05001999endif
Nicolas Pitre7c6ef2f2005-09-20 12:27:13 -04002000
Junio C Hamano70de5e62012-05-02 15:12:10 -07002001ifdef NO_INSTALL_HARDLINKS
2002 export NO_INSTALL_HARDLINKS
2003endif
2004
Theodore Ts'of2d713f2012-02-06 01:00:17 -05002005### profile feedback build
2006#
2007
2008# Can adjust this to be a global directory if you want to do extended
2009# data gathering
2010PROFILE_DIR := $(CURDIR)
2011
Johannes Sixte60ec752012-02-09 09:22:26 +01002012ifeq ("$(PROFILE)","GEN")
Andi Kleen0be314c2014-07-04 16:43:48 -07002013 BASIC_CFLAGS += -fprofile-generate=$(PROFILE_DIR) -DNO_NORETURN=1
Theodore Ts'of2d713f2012-02-06 01:00:17 -05002014 EXTLIBS += -lgcov
Stefano Lattarinidd6fc7c2012-12-09 11:36:17 +01002015 export CCACHE_DISABLE = t
2016 V = 1
Johannes Sixte60ec752012-02-09 09:22:26 +01002017else
2018ifneq ("$(PROFILE)","")
Andi Kleen0be314c2014-07-04 16:43:48 -07002019 BASIC_CFLAGS += -fprofile-use=$(PROFILE_DIR) -fprofile-correction -DNO_NORETURN=1
Stefano Lattarinidd6fc7c2012-12-09 11:36:17 +01002020 export CCACHE_DISABLE = t
2021 V = 1
Theodore Ts'of2d713f2012-02-06 01:00:17 -05002022endif
Johannes Sixte60ec752012-02-09 09:22:26 +01002023endif
Theodore Ts'of2d713f2012-02-06 01:00:17 -05002024
Pavel Roskinaddf88e2006-07-09 03:44:30 -04002025# Shell quote (do not use $(call) to accommodate ancient setups);
Johannes Schindelin39c015c2006-02-18 12:40:22 +01002026
Johannes Schindelin32043c92007-02-14 12:48:14 +01002027ETC_GITCONFIG_SQ = $(subst ','\'',$(ETC_GITCONFIG))
Petr Onderka6df42ab2010-09-01 00:42:43 +02002028ETC_GITATTRIBUTES_SQ = $(subst ','\'',$(ETC_GITATTRIBUTES))
Johannes Schindelin39c015c2006-02-18 12:40:22 +01002029
2030DESTDIR_SQ = $(subst ','\'',$(DESTDIR))
Ævar Arnfjörð Bjarmason256c2dc2021-05-05 14:21:41 +02002031NO_GETTEXT_SQ = $(subst ','\'',$(NO_GETTEXT))
Johannes Schindelin39c015c2006-02-18 12:40:22 +01002032bindir_SQ = $(subst ','\'',$(bindir))
Steffen Prohaska026fa0d2009-01-18 13:00:09 +01002033bindir_relative_SQ = $(subst ','\'',$(bindir_relative))
Ævar Arnfjörð Bjarmason20d2a302017-12-10 21:13:33 +00002034mandir_SQ = $(subst ','\'',$(mandir))
John Keeping971f8532013-02-24 19:55:01 +00002035mandir_relative_SQ = $(subst ','\'',$(mandir_relative))
2036infodir_relative_SQ = $(subst ','\'',$(infodir_relative))
Ævar Arnfjörð Bjarmason20d2a302017-12-10 21:13:33 +00002037perllibdir_SQ = $(subst ','\'',$(perllibdir))
Ævar Arnfjörð Bjarmason5e9637c2011-11-18 00:14:42 +01002038localedir_SQ = $(subst ','\'',$(localedir))
Dan Jacques07d90ea2018-04-10 11:05:43 -04002039localedir_relative_SQ = $(subst ','\'',$(localedir_relative))
Johannes Schindelin39c015c2006-02-18 12:40:22 +01002040gitexecdir_SQ = $(subst ','\'',$(gitexecdir))
Ævar Arnfjörð Bjarmasona4d79b92018-03-13 20:39:34 +00002041gitexecdir_relative_SQ = $(subst ','\'',$(gitexecdir_relative))
Johannes Schindelin39c015c2006-02-18 12:40:22 +01002042template_dir_SQ = $(subst ','\'',$(template_dir))
John Keeping971f8532013-02-24 19:55:01 +00002043htmldir_relative_SQ = $(subst ','\'',$(htmldir_relative))
Yakov Lernerca3bcab2006-06-15 01:36:00 +03002044prefix_SQ = $(subst ','\'',$(prefix))
Dan Jacques07d90ea2018-04-10 11:05:43 -04002045perllibdir_relative_SQ = $(subst ','\'',$(perllibdir_relative))
Pavan Kumar Sunkarac0cb4ed2010-05-28 11:55:52 +05302046gitwebdir_SQ = $(subst ','\'',$(gitwebdir))
Johannes Schindelin39c015c2006-02-18 12:40:22 +01002047
2048SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH))
Jeff King3f824e92017-12-08 05:47:22 -05002049TEST_SHELL_PATH_SQ = $(subst ','\'',$(TEST_SHELL_PATH))
Johannes Schindelin39c015c2006-02-18 12:40:22 +01002050PERL_PATH_SQ = $(subst ','\'',$(PERL_PATH))
Johan Herlandd4e1b472009-11-18 02:42:31 +01002051PYTHON_PATH_SQ = $(subst ','\'',$(PYTHON_PATH))
Eygene Ryabinkin81b63c72007-03-28 04:12:07 -07002052TCLTK_PATH_SQ = $(subst ','\'',$(TCLTK_PATH))
Junio C Hamano09ce4bb2010-06-05 09:36:13 -07002053DIFF_SQ = $(subst ','\'',$(DIFF))
Jonathan Nieder0386dd32013-11-15 13:10:28 -08002054PERLLIB_EXTRA_SQ = $(subst ','\'',$(PERLLIB_EXTRA))
Johannes Schindelin39c015c2006-02-18 12:40:22 +01002055
Dan Jacques07d90ea2018-04-10 11:05:43 -04002056# RUNTIME_PREFIX's resolution logic requires resource paths to be expressed
2057# relative to each other and share an installation path.
2058#
2059# This is a dependency in:
2060# - Git's binary RUNTIME_PREFIX logic in (see "exec_cmd.c").
2061# - The runtime prefix Perl header (see
2062# "perl/header_templates/runtime_prefix.template.pl").
2063ifdef RUNTIME_PREFIX
2064
2065ifneq ($(filter /%,$(firstword $(gitexecdir_relative))),)
2066$(error RUNTIME_PREFIX requires a relative gitexecdir, not: $(gitexecdir))
2067endif
2068
2069ifneq ($(filter /%,$(firstword $(localedir_relative))),)
2070$(error RUNTIME_PREFIX requires a relative localedir, not: $(localedir))
2071endif
2072
2073ifndef NO_PERL
2074ifneq ($(filter /%,$(firstword $(perllibdir_relative))),)
2075$(error RUNTIME_PREFIX requires a relative perllibdir, not: $(perllibdir))
2076endif
2077endif
2078
2079endif
2080
Jeff King3f2e2292016-07-01 01:58:58 -04002081# We must filter out any object files from $(GITLIBS),
2082# as it is typically used like:
2083#
2084# foo: foo.o $(GITLIBS)
2085# $(CC) $(filter %.o,$^) $(LIBS)
2086#
2087# where we use it as a dependency. Since we also pull object files
2088# from the dependency list, that would make each entry appear twice.
2089LIBS = $(filter-out %.o, $(GITLIBS)) $(EXTLIBS)
Petr Baudisd595a472006-06-24 18:35:12 -07002090
brian m. carlsonf18f8162017-03-11 22:28:18 +00002091BASIC_CFLAGS += $(COMPAT_CFLAGS)
Jason Riedye40b61f2005-12-02 15:08:28 -08002092LIB_OBJS += $(COMPAT_OBJS)
Petr Baudis8d7f5862006-06-25 03:47:03 +02002093
Jonathan Nieder8f4b5762009-10-30 20:44:41 -05002094# Quote for C
2095
2096ifdef DEFAULT_EDITOR
2097DEFAULT_EDITOR_CQ = "$(subst ",\",$(subst \,\\,$(DEFAULT_EDITOR)))"
2098DEFAULT_EDITOR_CQ_SQ = $(subst ','\'',$(DEFAULT_EDITOR_CQ))
2099
2100BASIC_CFLAGS += -DDEFAULT_EDITOR='$(DEFAULT_EDITOR_CQ_SQ)'
2101endif
2102
Junio C Hamanoa3d023d2009-10-30 20:45:34 -05002103ifdef DEFAULT_PAGER
2104DEFAULT_PAGER_CQ = "$(subst ",\",$(subst \,\\,$(DEFAULT_PAGER)))"
2105DEFAULT_PAGER_CQ_SQ = $(subst ','\'',$(DEFAULT_PAGER_CQ))
2106
2107BASIC_CFLAGS += -DDEFAULT_PAGER='$(DEFAULT_PAGER_CQ_SQ)'
2108endif
2109
Ben Waltonb3e34dd2012-03-30 21:33:21 -04002110ifdef SHELL_PATH
2111SHELL_PATH_CQ = "$(subst ",\",$(subst \,\\,$(SHELL_PATH)))"
2112SHELL_PATH_CQ_SQ = $(subst ','\'',$(SHELL_PATH_CQ))
2113
2114BASIC_CFLAGS += -DSHELL_PATH='$(SHELL_PATH_CQ_SQ)'
2115endif
2116
Jeff King42dcbb72012-06-02 15:01:12 -04002117GIT_USER_AGENT_SQ = $(subst ','\'',$(GIT_USER_AGENT))
2118GIT_USER_AGENT_CQ = "$(subst ",\",$(subst \,\\,$(GIT_USER_AGENT)))"
2119GIT_USER_AGENT_CQ_SQ = $(subst ','\'',$(GIT_USER_AGENT_CQ))
Jeff King620c2932012-06-20 14:31:51 -04002120GIT-USER-AGENT: FORCE
2121 @if test x'$(GIT_USER_AGENT_SQ)' != x"`cat GIT-USER-AGENT 2>/dev/null`"; then \
Jeff King620c2932012-06-20 14:31:51 -04002122 echo '$(GIT_USER_AGENT_SQ)' >GIT-USER-AGENT; \
2123 fi
Jeff King42dcbb72012-06-02 15:01:12 -04002124
Vincent van Ravesteijn1cc8af02012-06-06 20:28:16 +00002125ifdef DEFAULT_HELP_FORMAT
2126BASIC_CFLAGS += -DDEFAULT_HELP_FORMAT='"$(DEFAULT_HELP_FORMAT)"'
2127endif
2128
Eric Wong995bc222016-08-04 11:40:25 +00002129PAGER_ENV_SQ = $(subst ','\'',$(PAGER_ENV))
2130PAGER_ENV_CQ = "$(subst ",\",$(subst \,\\,$(PAGER_ENV)))"
2131PAGER_ENV_CQ_SQ = $(subst ','\'',$(PAGER_ENV_CQ))
2132BASIC_CFLAGS += -DPAGER_ENV='$(PAGER_ENV_CQ_SQ)'
2133
Petr Baudis8d7f5862006-06-25 03:47:03 +02002134ALL_CFLAGS += $(BASIC_CFLAGS)
2135ALL_LDFLAGS += $(BASIC_LDFLAGS)
2136
Gary V. Vaughand1b1a912010-05-14 09:31:36 +00002137export DIFF TAR INSTALL DESTDIR SHELL_PATH
Petr Baudisd595a472006-06-24 18:35:12 -07002138
2139
Petr Baudis28818ff2005-07-29 17:50:24 +02002140### Build rules
Linus Torvalds89967022005-04-30 13:19:56 -07002141
Brandon Caseyc94c8e52008-08-07 14:03:42 -05002142SHELL = $(SHELL_PATH)
2143
Theodore Ts'of2d713f2012-02-06 01:00:17 -05002144all:: shell_compatibility_test
2145
2146ifeq "$(PROFILE)" "BUILD"
Andi Kleen066dd262014-07-07 23:35:11 -07002147all:: profile
2148endif
2149
2150profile:: profile-clean
Theodore Ts'of2d713f2012-02-06 01:00:17 -05002151 $(MAKE) PROFILE=GEN all
2152 $(MAKE) PROFILE=GEN -j1 test
Jeff King93b53932014-08-19 02:12:03 -04002153 @if test -n "$$GIT_PERF_REPO" || test -d .git; then \
2154 $(MAKE) PROFILE=GEN -j1 perf; \
2155 else \
2156 echo "Skipping profile of perf tests..."; \
2157 fi
Andi Kleen066dd262014-07-07 23:35:11 -07002158 $(MAKE) PROFILE=USE all
2159
2160profile-fast: profile-clean
2161 $(MAKE) PROFILE=GEN all
2162 $(MAKE) PROFILE=GEN -j1 perf
2163 $(MAKE) PROFILE=USE all
2164
Theodore Ts'of2d713f2012-02-06 01:00:17 -05002165
Johannes Schindelin179227d2020-09-21 22:28:16 +00002166all:: $(ALL_COMMANDS_TO_INSTALL) $(SCRIPT_LIB) $(OTHER_PROGRAMS) GIT-BUILD-OPTIONS
Junio C Hamano6fc301b2007-01-10 12:24:54 -08002167ifneq (,$X)
Johannes Schindelin179227d2020-09-21 22:28:16 +00002168 $(QUIET_BUILT_IN)$(foreach p,$(patsubst %$X,%,$(filter %$X,$(ALL_COMMANDS_TO_INSTALL) git$X)), test -d '$p' -o '$p' -ef '$p$X' || $(RM) '$p';)
Junio C Hamano6fc301b2007-01-10 12:24:54 -08002169endif
Petr Baudis28818ff2005-07-29 17:50:24 +02002170
Junio C Hamano6fc301b2007-01-10 12:24:54 -08002171all::
Eygene Ryabinkin3cfaf112007-03-28 04:00:23 -07002172ifndef NO_TCLTK
Junio C Hamanoe84a0632008-07-28 00:02:48 -07002173 $(QUIET_SUBDIR0)git-gui $(QUIET_SUBDIR1) gitexecdir='$(gitexec_instdir_SQ)' all
Junio C Hamano62ba5142007-11-17 10:51:16 -08002174 $(QUIET_SUBDIR0)gitk-git $(QUIET_SUBDIR1) all
Eygene Ryabinkin3cfaf112007-03-28 04:00:23 -07002175endif
Ben Walton502be952010-03-20 10:48:08 -04002176 $(QUIET_SUBDIR0)templates $(QUIET_SUBDIR1) SHELL_PATH='$(SHELL_PATH_SQ)' PERL_PATH='$(PERL_PATH_SQ)'
Nicolas Pitrea310d432005-05-19 10:27:14 -04002177
Brandon Casey6dc46272008-08-07 14:06:26 -05002178please_set_SHELL_PATH_to_a_more_modern_shell:
2179 @$$(:)
2180
2181shell_compatibility_test: please_set_SHELL_PATH_to_a_more_modern_shell
2182
Junio C Hamano4dc00022006-01-12 21:42:25 -08002183strip: $(PROGRAMS) git$X
Felipe Contreras654f23f2013-05-24 21:41:02 -05002184 $(STRIP) $(STRIP_OPTS) $^
Junio C Hamano4dc00022006-01-12 21:42:25 -08002185
Ævar Arnfjörð Bjarmason7b76d6b2021-06-29 10:44:50 +02002186### Flags affecting all rules
2187
2188# A GNU make extension since gmake 3.72 (released in late 1994) to
2189# remove the target of rules if commands in those rules fail. The
2190# default is to only do that if make itself receives a signal. Affects
2191# all targets, see:
2192#
2193# info make --index-search=.DELETE_ON_ERROR
2194.DELETE_ON_ERROR:
2195
Jonathan Nieder7b63c772012-07-06 23:19:09 -05002196### Target-specific flags and dependencies
2197
2198# The generic compilation pattern rule and automatically
2199# computed header dependencies (falling back to a dependency on
2200# LIB_H) are enough to describe how most targets should be built,
2201# but some targets are special enough to need something a little
2202# different.
2203#
2204# - When a source file "foo.c" #includes a generated header file,
2205# we need to list that dependency for the "foo.o" target.
2206#
2207# We also list it from other targets that are built from foo.c
2208# like "foo.sp" and "foo.s", even though that is easy to forget
2209# to do because the generated header is already present around
2210# after a regular build attempt.
2211#
2212# - Some code depends on configuration kept in makefile
2213# variables. The target-specific variable EXTRA_CPPFLAGS can
2214# be used to convey that information to the C preprocessor
2215# using -D options.
2216#
2217# The "foo.o" target should have a corresponding dependency on
2218# a file that changes when the value of the makefile variable
2219# changes. For example, targets making use of the
2220# $(GIT_VERSION) variable depend on GIT-VERSION-FILE.
2221#
2222# Technically the ".sp" and ".s" targets do not need this
2223# dependency because they are force-built, but they get the
2224# same dependency for consistency. This way, you do not have to
2225# know how each target is implemented. And it means the
2226# dependencies here will not need to change if the force-build
2227# details change some day.
2228
Jeff Kingbe1dbd02012-06-20 14:31:55 -04002229git.sp git.s git.o: GIT-PREFIX
Jeff King816fb462012-06-02 14:51:42 -04002230git.sp git.s git.o: EXTRA_CPPFLAGS = \
John Keeping971f8532013-02-24 19:55:01 +00002231 '-DGIT_HTML_PATH="$(htmldir_relative_SQ)"' \
2232 '-DGIT_MAN_PATH="$(mandir_relative_SQ)"' \
2233 '-DGIT_INFO_PATH="$(infodir_relative_SQ)"'
Junio C Hamano334d28a2007-06-13 01:28:21 -07002234
Fredrik Kuivinend9a25fc2011-06-22 12:50:56 +02002235git$X: git.o GIT-LDFLAGS $(BUILTIN_OBJS) $(GITLIBS)
Jeff King3f2e2292016-07-01 01:58:58 -04002236 $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) \
2237 $(filter %.o,$^) $(LIBS)
Junio C Hamano6a2e50f2005-09-07 21:26:52 -07002238
Nguyễn Thái Ngọc Duy60f487a2018-05-10 10:46:43 +02002239help.sp help.s help.o: command-list.h
Erik Faye-Lund6612b9e2010-11-26 17:00:39 +01002240
Emily Shaffer709df952020-04-16 14:18:03 -07002241builtin/help.sp builtin/help.s builtin/help.o: config-list.h GIT-PREFIX
Ramsay Jones0bcd9ae2011-04-21 20:14:42 +01002242builtin/help.sp builtin/help.s builtin/help.o: EXTRA_CPPFLAGS = \
John Keeping971f8532013-02-24 19:55:01 +00002243 '-DGIT_HTML_PATH="$(htmldir_relative_SQ)"' \
2244 '-DGIT_MAN_PATH="$(mandir_relative_SQ)"' \
2245 '-DGIT_INFO_PATH="$(infodir_relative_SQ)"'
Junio C Hamano08df6172006-04-21 21:56:13 -07002246
Jeff King520a6cd2012-06-20 14:32:22 -04002247version.sp version.s version.o: GIT-VERSION-FILE GIT-USER-AGENT
Jeff King816fb462012-06-02 14:51:42 -04002248version.sp version.s version.o: EXTRA_CPPFLAGS = \
Jeff King620c2932012-06-20 14:31:51 -04002249 '-DGIT_VERSION="$(GIT_VERSION)"' \
Johannes Schindelined32b782017-12-15 00:34:38 +01002250 '-DGIT_USER_AGENT=$(GIT_USER_AGENT_CQ_SQ)' \
Johannes Schindelin5cf8e062018-06-27 21:35:23 +02002251 '-DGIT_BUILT_FROM_COMMIT="$(shell \
2252 GIT_CEILING_DIRECTORIES="$(CURDIR)/.." \
2253 git rev-parse -q --verify HEAD 2>/dev/null)"'
Jeff King816fb462012-06-02 14:51:42 -04002254
Junio C Hamano91730802006-04-10 17:37:58 -07002255$(BUILT_INS): git$X
Andreas Färber3e073dc2008-08-25 17:33:03 +02002256 $(QUIET_BUILT_IN)$(RM) $@ && \
Felipe Contrerasf530aa92013-05-24 21:41:03 -05002257 ln $< $@ 2>/dev/null || \
2258 ln -s $< $@ 2>/dev/null || \
2259 cp $< $@
Junio C Hamano91730802006-04-10 17:37:58 -07002260
Emily Shaffer709df952020-04-16 14:18:03 -07002261config-list.h: generate-configlist.sh
2262
SZEDER Gábor56550ea2021-04-08 23:29:15 +02002263config-list.h: Documentation/*config.txt Documentation/config/*.txt
Emily Shaffer709df952020-04-16 14:18:03 -07002264 $(QUIET_GEN)$(SHELL_PATH) ./generate-configlist.sh \
2265 >$@+ && mv $@+ $@
2266
Nguyễn Thái Ngọc Duyf318d732018-05-10 10:46:41 +02002267command-list.h: generate-cmdlist.sh command-list.txt
Junio C Hamano48dd1da2007-06-13 02:00:01 -07002268
SZEDER Gábor56550ea2021-04-08 23:29:15 +02002269command-list.h: $(wildcard Documentation/git*.txt)
Johannes Schindelin724d6352019-04-18 06:16:40 -07002270 $(QUIET_GEN)$(SHELL_PATH) ./generate-cmdlist.sh \
2271 $(patsubst %,--exclude-program %,$(EXCLUDED_PROGRAMS)) \
2272 command-list.txt >$@+ && mv $@+ $@
Fredrik Kuivinena87cd022006-03-09 17:24:19 +01002273
Jeff Kinge4dd89a2012-06-20 14:32:16 -04002274SCRIPT_DEFINES = $(SHELL_PATH_SQ):$(DIFF_SQ):$(GIT_VERSION):\
Jeff Kingb5295f32012-06-20 14:32:19 -04002275 $(localedir_SQ):$(NO_CURL):$(USE_GETTEXT_SCHEME):$(SANE_TOOL_PATH_SQ):\
Ævar Arnfjörð Bjarmason20d2a302017-12-10 21:13:33 +00002276 $(gitwebdir_SQ):$(PERL_PATH_SQ):$(SANE_TEXT_GREP):$(PAGER_ENV):\
2277 $(perllibdir_SQ)
Jonathan Nieder46bac902010-01-31 11:46:53 -08002278define cmd_munge_script
Jonathan Nieder46bac902010-01-31 11:46:53 -08002279sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \
2280 -e 's|@SHELL_PATH@|$(SHELL_PATH_SQ)|' \
Junio C Hamano09ce4bb2010-06-05 09:36:13 -07002281 -e 's|@@DIFF@@|$(DIFF_SQ)|' \
Ævar Arnfjörð Bjarmason5e9637c2011-11-18 00:14:42 +01002282 -e 's|@@LOCALEDIR@@|$(localedir_SQ)|g' \
Jonathan Nieder46bac902010-01-31 11:46:53 -08002283 -e 's/@@NO_CURL@@/$(NO_CURL)/g' \
Alex Riesenad17ea72012-01-23 14:04:29 -08002284 -e 's/@@USE_GETTEXT_SCHEME@@/$(USE_GETTEXT_SCHEME)/g' \
Jonathan Nieder46bac902010-01-31 11:46:53 -08002285 -e $(BROKEN_PATH_FIX) \
Jeff Kingb5295f32012-06-20 14:32:19 -04002286 -e 's|@@GITWEBDIR@@|$(gitwebdir_SQ)|g' \
2287 -e 's|@@PERL@@|$(PERL_PATH_SQ)|g' \
Junio C Hamano71b40102016-03-08 15:47:57 -08002288 -e 's|@@SANE_TEXT_GREP@@|$(SANE_TEXT_GREP)|g' \
Eric Wong995bc222016-08-04 11:40:25 +00002289 -e 's|@@PAGER_ENV@@|$(PAGER_ENV_SQ)|g' \
Jonathan Nieder46bac902010-01-31 11:46:53 -08002290 $@.sh >$@+
2291endef
2292
Jeff Kinge4dd89a2012-06-20 14:32:16 -04002293GIT-SCRIPT-DEFINES: FORCE
2294 @FLAGS='$(SCRIPT_DEFINES)'; \
2295 if test x"$$FLAGS" != x"`cat $@ 2>/dev/null`" ; then \
Christian Couder1a59d882012-12-18 16:26:39 +01002296 echo >&2 " * new script parameters"; \
Jeff Kinge4dd89a2012-06-20 14:32:16 -04002297 echo "$$FLAGS" >$@; \
2298 fi
2299
2300
Jonathan Nieder64c07db2014-11-18 10:38:38 -08002301$(SCRIPT_SH_GEN) : % : %.sh GIT-SCRIPT-DEFINES
Jonathan Nieder46bac902010-01-31 11:46:53 -08002302 $(QUIET_GEN)$(cmd_munge_script) && \
Shawn O. Pearce74f2b2a2007-03-06 01:35:01 -05002303 chmod +x $@+ && \
Jim Meyeringfc36f6a2006-05-25 18:52:01 +02002304 mv $@+ $@
Junio C Hamanobc6146d2005-09-08 18:50:33 -07002305
Jeff Kinge4dd89a2012-06-20 14:32:16 -04002306$(SCRIPT_LIB) : % : %.sh GIT-SCRIPT-DEFINES
Jonathan Nieder46bac902010-01-31 11:46:53 -08002307 $(QUIET_GEN)$(cmd_munge_script) && \
2308 mv $@+ $@
2309
Johannes Schindelinadb59de2018-11-06 06:55:50 -08002310git.res: git.rc GIT-VERSION-FILE GIT-PREFIX
Pat Thoytsce39c2e2012-05-24 00:56:24 +01002311 $(QUIET_RC)$(RC) \
Johannes Schindelin39bb86b2017-10-30 18:19:42 +01002312 $(join -DMAJOR= -DMINOR= -DMICRO= -DPATCHLEVEL=, $(wordlist 1, 4, \
2313 $(shell echo $(GIT_VERSION) 0 0 0 0 | tr '.a-zA-Z-' ' '))) \
Steven Penny7c44b332017-01-07 15:41:10 -06002314 -DGIT_VERSION="\\\"$(GIT_VERSION)\\\"" -i $< -o $@
Pat Thoytsce39c2e2012-05-24 00:56:24 +01002315
Jeff Kinge204b002014-11-18 12:43:09 -05002316# This makes sure we depend on the NO_PERL setting itself.
Jonathan Nieder64c07db2014-11-18 10:38:38 -08002317$(SCRIPT_PERL_GEN): GIT-BUILD-OPTIONS
Jeff Kinge204b002014-11-18 12:43:09 -05002318
Dan Jacques07d90ea2018-04-10 11:05:43 -04002319# Used for substitution in Perl modules. Disabled when using RUNTIME_PREFIX
2320# since the locale directory is injected.
2321perl_localedir_SQ = $(localedir_SQ)
Alex Riesenf8487182006-12-04 10:50:04 +01002322
Junio C Hamanobc6146d2005-09-08 18:50:33 -07002323ifndef NO_PERL
Dan Jacquesf6a0ad42018-04-10 11:05:42 -04002324PERL_HEADER_TEMPLATE = perl/header_templates/fixed_prefix.template.pl
Ævar Arnfjörð Bjarmason8c557532021-05-12 11:49:44 +02002325PERL_DEFINES =
Ævar Arnfjörð Bjarmason4070c9e2021-05-05 14:21:38 +02002326PERL_DEFINES += $(PERL_PATH_SQ)
2327PERL_DEFINES += $(PERLLIB_EXTRA_SQ)
2328PERL_DEFINES += $(perllibdir_SQ)
Dan Jacques07d90ea2018-04-10 11:05:43 -04002329PERL_DEFINES += $(RUNTIME_PREFIX)
Ævar Arnfjörð Bjarmason368a50d2021-05-05 14:21:40 +02002330PERL_DEFINES += $(NO_PERL_CPAN_FALLBACKS)
Ævar Arnfjörð Bjarmason256c2dc2021-05-05 14:21:41 +02002331PERL_DEFINES += $(NO_GETTEXT)
Dan Jacques07d90ea2018-04-10 11:05:43 -04002332
2333# Support Perl runtime prefix. In this mode, a different header is installed
2334# into Perl scripts.
2335ifdef RUNTIME_PREFIX
2336
2337PERL_HEADER_TEMPLATE = perl/header_templates/runtime_prefix.template.pl
2338
2339# Don't export a fixed $(localedir) path; it will be resolved by the Perl header
2340# at runtime.
2341perl_localedir_SQ =
2342
2343endif
2344
2345PERL_DEFINES += $(gitexecdir) $(perllibdir) $(localedir)
2346
Dan Jacquesf6a0ad42018-04-10 11:05:42 -04002347$(SCRIPT_PERL_GEN): % : %.perl GIT-PERL-DEFINES GIT-PERL-HEADER GIT-VERSION-FILE
Ævar Arnfjörð Bjarmason7b76d6b2021-06-29 10:44:50 +02002348 $(QUIET_GEN) \
Junio C Hamano998c4da2006-07-07 13:04:35 -07002349 sed -e '1{' \
2350 -e ' s|#!.*perl|#!$(PERL_PATH_SQ)|' \
Alejandro R. Sedeño66000542018-06-25 15:13:25 -04002351 -e ' r GIT-PERL-HEADER' \
Dan Jacquesf6a0ad42018-04-10 11:05:42 -04002352 -e ' G' \
Junio C Hamano998c4da2006-07-07 13:04:35 -07002353 -e '}' \
Junio C Hamano3ff8cbe2005-10-04 12:41:35 -07002354 -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \
Felipe Contrerasf530aa92013-05-24 21:41:03 -05002355 $< >$@+ && \
Shawn O. Pearce74f2b2a2007-03-06 01:35:01 -05002356 chmod +x $@+ && \
Jim Meyeringfc36f6a2006-05-25 18:52:01 +02002357 mv $@+ $@
Junio C Hamanobc6146d2005-09-08 18:50:33 -07002358
Dan Jacques07d90ea2018-04-10 11:05:43 -04002359PERL_DEFINES := $(subst $(space),:,$(PERL_DEFINES))
Jonathan Nieder07981dc2013-11-18 14:23:11 -08002360GIT-PERL-DEFINES: FORCE
2361 @FLAGS='$(PERL_DEFINES)'; \
2362 if test x"$$FLAGS" != x"`cat $@ 2>/dev/null`" ; then \
2363 echo >&2 " * new perl-specific parameters"; \
2364 echo "$$FLAGS" >$@; \
2365 fi
2366
Dan Jacquesf6a0ad42018-04-10 11:05:42 -04002367GIT-PERL-HEADER: $(PERL_HEADER_TEMPLATE) GIT-PERL-DEFINES Makefile
Ævar Arnfjörð Bjarmason7b76d6b2021-06-29 10:44:50 +02002368 $(QUIET_GEN) \
Dan Jacquesf6a0ad42018-04-10 11:05:42 -04002369 INSTLIBDIR='$(perllibdir_SQ)' && \
2370 INSTLIBDIR_EXTRA='$(PERLLIB_EXTRA_SQ)' && \
2371 INSTLIBDIR="$$INSTLIBDIR$${INSTLIBDIR_EXTRA:+:$$INSTLIBDIR_EXTRA}" && \
2372 sed -e 's=@@PATHSEP@@=$(pathsep)=g' \
Jonathan Nieder64f982b2018-04-23 16:25:35 -07002373 -e "s=@@INSTLIBDIR@@=$$INSTLIBDIR=g" \
Dan Jacques07d90ea2018-04-10 11:05:43 -04002374 -e 's=@@PERLLIBDIR_REL@@=$(perllibdir_relative_SQ)=g' \
2375 -e 's=@@GITEXECDIR_REL@@=$(gitexecdir_relative_SQ)=g' \
2376 -e 's=@@LOCALEDIR_REL@@=$(localedir_relative_SQ)=g' \
Dan Jacquesf6a0ad42018-04-10 11:05:42 -04002377 $< >$@+ && \
2378 mv $@+ $@
John 'Warthog9' Hawley62331ef2010-01-30 23:30:40 +01002379
Christian Hessed8698982018-04-19 06:44:40 +09002380.PHONY: perllibdir
Christian Hessecfb3a472018-04-10 15:36:41 +02002381perllibdir:
2382 @echo '$(perllibdir_SQ)'
John 'Warthog9' Hawley62331ef2010-01-30 23:30:40 +01002383
2384.PHONY: gitweb
2385gitweb:
2386 $(QUIET_SUBDIR0)gitweb $(QUIET_SUBDIR1) all
2387
Jeff Kinge25c7cc2015-05-29 03:25:45 -04002388git-instaweb: git-instaweb.sh GIT-SCRIPT-DEFINES
Jeff Kingb5295f32012-06-20 14:32:19 -04002389 $(QUIET_GEN)$(cmd_munge_script) && \
Shawn O. Pearce74f2b2a2007-03-06 01:35:01 -05002390 chmod +x $@+ && \
Eric Wonga51d37c2006-07-01 15:14:14 -07002391 mv $@+ $@
Jeff King499c2932009-04-03 15:32:20 -04002392else # NO_PERL
Jonathan Nieder64c07db2014-11-18 10:38:38 -08002393$(SCRIPT_PERL_GEN) git-instaweb: % : unimplemented.sh
Ævar Arnfjörð Bjarmason7b76d6b2021-06-29 10:44:50 +02002394 $(QUIET_GEN) \
Jeff King499c2932009-04-03 15:32:20 -04002395 sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \
2396 -e 's|@@REASON@@|NO_PERL=$(NO_PERL)|g' \
2397 unimplemented.sh >$@+ && \
2398 chmod +x $@+ && \
2399 mv $@+ $@
2400endif # NO_PERL
Eric Wonga51d37c2006-07-01 15:14:14 -07002401
Jonathan Niederca2051d2014-11-18 10:43:47 -08002402# This makes sure we depend on the NO_PYTHON setting itself.
2403$(SCRIPT_PYTHON_GEN): GIT-BUILD-OPTIONS
2404
Sverre Rabbelier2fe40b62009-11-18 02:42:32 +01002405ifndef NO_PYTHON
Felipe Contreras1b0a0f82013-05-24 21:41:01 -05002406$(SCRIPT_PYTHON_GEN): GIT-CFLAGS GIT-PREFIX GIT-PYTHON-VARS
2407$(SCRIPT_PYTHON_GEN): % : %.py
Ævar Arnfjörð Bjarmason7b76d6b2021-06-29 10:44:50 +02002408 $(QUIET_GEN) \
Brian Gernhardtf733f6a2010-04-09 11:57:45 -04002409 sed -e '1s|#!.*python|#!$(PYTHON_PATH_SQ)|' \
Felipe Contrerasf530aa92013-05-24 21:41:03 -05002410 $< >$@+ && \
Sverre Rabbelier2fe40b62009-11-18 02:42:32 +01002411 chmod +x $@+ && \
2412 mv $@+ $@
2413else # NO_PYTHON
Felipe Contreras1b0a0f82013-05-24 21:41:01 -05002414$(SCRIPT_PYTHON_GEN): % : unimplemented.sh
Ævar Arnfjörð Bjarmason7b76d6b2021-06-29 10:44:50 +02002415 $(QUIET_GEN) \
Sverre Rabbelier2fe40b62009-11-18 02:42:32 +01002416 sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \
2417 -e 's|@@REASON@@|NO_PYTHON=$(NO_PYTHON)|g' \
2418 unimplemented.sh >$@+ && \
2419 chmod +x $@+ && \
2420 mv $@+ $@
2421endif # NO_PYTHON
2422
Ævar Arnfjörð Bjarmason7b76d6b2021-06-29 10:44:50 +02002423CONFIGURE_RECIPE = sed -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \
Jeff King7f1b6972013-02-21 01:26:14 -05002424 configure.ac >configure.ac+ && \
2425 autoconf -o configure configure.ac+ && \
2426 $(RM) configure.ac+
2427
Jeff King520a6cd2012-06-20 14:32:22 -04002428configure: configure.ac GIT-VERSION-FILE
Jeff King7f1b6972013-02-21 01:26:14 -05002429 $(QUIET_GEN)$(CONFIGURE_RECIPE)
Jakub Narebski39001452006-08-08 18:35:23 +02002430
Stefano Lattarini8242ff42012-07-19 09:50:02 +02002431ifdef AUTOCONFIGURED
Jonathan Nieder12265042013-01-02 00:25:44 -08002432# We avoid depending on 'configure' here, because it gets rebuilt
2433# every time GIT-VERSION-FILE is modified, only to update the embedded
2434# version number string, which config.status does not care about. We
2435# do want to recheck when the platform/environment detection logic
2436# changes, hence this depends on configure.ac.
2437config.status: configure.ac
Jeff King7f1b6972013-02-21 01:26:14 -05002438 $(QUIET_GEN)$(CONFIGURE_RECIPE) && \
Jonathan Nieder12265042013-01-02 00:25:44 -08002439 if test -f config.status; then \
Stefano Lattarini8242ff42012-07-19 09:50:02 +02002440 ./config.status --recheck; \
2441 else \
2442 ./configure; \
2443 fi
2444reconfigure config.mak.autogen: config.status
2445 $(QUIET_GEN)./config.status
2446.PHONY: reconfigure # This is a convenience target.
2447endif
2448
Jonathan Nieder3371f9b2011-03-27 13:13:22 -05002449XDIFF_OBJS += xdiff/xdiffi.o
Jonathan Nieder3371f9b2011-03-27 13:13:22 -05002450XDIFF_OBJS += xdiff/xemit.o
Denton Liu805d9ea2020-03-21 05:21:20 -04002451XDIFF_OBJS += xdiff/xhistogram.o
Jonathan Nieder3371f9b2011-03-27 13:13:22 -05002452XDIFF_OBJS += xdiff/xmerge.o
2453XDIFF_OBJS += xdiff/xpatience.o
Denton Liu805d9ea2020-03-21 05:21:20 -04002454XDIFF_OBJS += xdiff/xprepare.o
2455XDIFF_OBJS += xdiff/xutils.o
Ævar Arnfjörð Bjarmason029bac02021-02-23 12:41:31 +01002456.PHONY: xdiff-objs
2457xdiff-objs: $(XDIFF_OBJS)
Jonathan Nieder3371f9b2011-03-27 13:13:22 -05002458
Han-Wen Nienhuysef8a6c62021-10-07 20:25:00 +00002459REFTABLE_OBJS += reftable/basics.o
2460REFTABLE_OBJS += reftable/error.o
Han-Wen Nienhuyse581fd72021-10-07 20:25:04 +00002461REFTABLE_OBJS += reftable/block.o
Han-Wen Nienhuys1214aa82021-10-07 20:25:01 +00002462REFTABLE_OBJS += reftable/blocksource.o
Han-Wen Nienhuysef8a6c62021-10-07 20:25:00 +00002463REFTABLE_OBJS += reftable/publicbasics.o
Han-Wen Nienhuyse303bf22021-10-07 20:25:02 +00002464REFTABLE_OBJS += reftable/record.o
Han-Wen Nienhuys35425d12021-10-07 20:25:05 +00002465REFTABLE_OBJS += reftable/tree.o
Han-Wen Nienhuysef8a6c62021-10-07 20:25:00 +00002466
Han-Wen Nienhuys35425d12021-10-07 20:25:05 +00002467REFTABLE_TEST_OBJS += reftable/basics_test.o
Han-Wen Nienhuyse581fd72021-10-07 20:25:04 +00002468REFTABLE_TEST_OBJS += reftable/block_test.o
Han-Wen Nienhuyse303bf22021-10-07 20:25:02 +00002469REFTABLE_TEST_OBJS += reftable/record_test.o
Han-Wen Nienhuysef8a6c62021-10-07 20:25:00 +00002470REFTABLE_TEST_OBJS += reftable/test_framework.o
Han-Wen Nienhuys35425d12021-10-07 20:25:05 +00002471REFTABLE_TEST_OBJS += reftable/tree_test.o
Han-Wen Nienhuysef8a6c62021-10-07 20:25:00 +00002472
Nguyễn Thái Ngọc Duyefd71f82018-03-24 08:44:30 +01002473TEST_OBJS := $(patsubst %$X,%.o,$(TEST_PROGRAMS)) $(patsubst %,t/helper/%,$(TEST_BUILTINS_OBJS))
Han-Wen Nienhuysef8a6c62021-10-07 20:25:00 +00002474
Ævar Arnfjörð Bjarmason029bac02021-02-23 12:41:31 +01002475.PHONY: test-objs
2476test-objs: $(TEST_OBJS)
Ævar Arnfjörð Bjarmason752b3ef2021-02-23 12:41:28 +01002477
Ævar Arnfjörð Bjarmasonabc3c872021-02-23 12:41:30 +01002478GIT_OBJS += $(LIB_OBJS)
2479GIT_OBJS += $(BUILTIN_OBJS)
2480GIT_OBJS += common-main.o
2481GIT_OBJS += git.o
Ævar Arnfjörð Bjarmason029bac02021-02-23 12:41:31 +01002482.PHONY: git-objs
2483git-objs: $(GIT_OBJS)
Ævar Arnfjörð Bjarmasonabc3c872021-02-23 12:41:30 +01002484
2485OBJECTS += $(GIT_OBJS)
Ævar Arnfjörð Bjarmason752b3ef2021-02-23 12:41:28 +01002486OBJECTS += $(PROGRAM_OBJS)
2487OBJECTS += $(TEST_OBJS)
2488OBJECTS += $(XDIFF_OBJS)
2489OBJECTS += $(FUZZ_OBJS)
Han-Wen Nienhuysef8a6c62021-10-07 20:25:00 +00002490OBJECTS += $(REFTABLE_OBJS) $(REFTABLE_TEST_OBJS)
2491
Jonathan Nieder60d24dd2012-07-06 22:39:18 -05002492ifndef NO_CURL
2493 OBJECTS += http.o http-walker.o remote-curl.o
2494endif
Ævar Arnfjörð Bjarmason029bac02021-02-23 12:41:31 +01002495.PHONY: objects
2496objects: $(OBJECTS)
Jonathan Niederc3739912010-01-26 09:52:11 -06002497
Jonathan Niederec5e0bb2010-01-31 15:23:53 -06002498dep_files := $(foreach f,$(OBJECTS),$(dir $f).depend/$(notdir $f).d)
Jonathan Nieder010acc12010-01-31 15:37:25 -06002499dep_dirs := $(addsuffix .depend,$(sort $(dir $(OBJECTS))))
Jonathan Niederbeeb4562010-01-26 09:49:33 -06002500
Jonathan Nieder024c8432011-11-18 03:58:21 -06002501ifeq ($(COMPUTE_HEADER_DEPENDENCIES),yes)
Jonathan Niederdfea5752010-01-26 09:52:49 -06002502$(dep_dirs):
Junio C Hamanoeb0e0dd2011-10-05 12:36:21 -07002503 @mkdir -p $@
Jonathan Niederdfea5752010-01-26 09:52:49 -06002504
2505missing_dep_dirs := $(filter-out $(wildcard $(dep_dirs)),$(dep_dirs))
Jonathan Niederec5e0bb2010-01-31 15:23:53 -06002506dep_file = $(dir $@).depend/$(notdir $@).d
Jonathan Nieder69789342011-11-18 17:23:24 -06002507dep_args = -MF $(dep_file) -MQ $@ -MMD -MP
Jonathan Niederf2fabbf2010-01-26 09:57:15 -06002508endif
2509
Jonathan Nieder024c8432011-11-18 03:58:21 -06002510ifneq ($(COMPUTE_HEADER_DEPENDENCIES),yes)
Jonathan Niederdfea5752010-01-26 09:52:49 -06002511dep_dirs =
2512missing_dep_dirs =
Jonathan Niederf2fabbf2010-01-26 09:57:15 -06002513dep_args =
Jonathan Niederdfea5752010-01-26 09:52:49 -06002514endif
Jonathan Niederf2fabbf2010-01-26 09:57:15 -06002515
Philippe Blain3821c382020-09-03 22:13:38 +00002516compdb_dir = compile_commands
2517
2518ifeq ($(GENERATE_COMPILATION_DATABASE),yes)
2519missing_compdb_dir = $(compdb_dir)
2520$(missing_compdb_dir):
2521 @mkdir -p $@
2522
2523compdb_file = $(compdb_dir)/$(subst /,-,$@.json)
2524compdb_args = -MJ $(compdb_file)
2525else
2526missing_compdb_dir =
2527compdb_args =
2528endif
2529
Jonathan Niederf2fabbf2010-01-26 09:57:15 -06002530ASM_SRC := $(wildcard $(OBJECTS:o=S))
2531ASM_OBJ := $(ASM_SRC:S=o)
2532C_OBJ := $(filter-out $(ASM_OBJ),$(OBJECTS))
Jonathan Niederdfea5752010-01-26 09:52:49 -06002533
Jonathan Nieder30248882010-01-26 09:51:24 -06002534.SUFFIXES:
2535
Philippe Blain3821c382020-09-03 22:13:38 +00002536$(C_OBJ): %.o: %.c GIT-CFLAGS $(missing_dep_dirs) $(missing_compdb_dir)
2537 $(QUIET_CC)$(CC) -o $*.o -c $(dep_args) $(compdb_args) $(ALL_CFLAGS) $(EXTRA_CPPFLAGS) $<
2538$(ASM_OBJ): %.o: %.S GIT-CFLAGS $(missing_dep_dirs) $(missing_compdb_dir)
2539 $(QUIET_CC)$(CC) -o $*.o -c $(dep_args) $(compdb_args) $(ALL_CFLAGS) $(EXTRA_CPPFLAGS) $<
Jonathan Niederf2fabbf2010-01-26 09:57:15 -06002540
Jonathan Nieder13fca9f2010-01-06 02:06:58 -06002541%.s: %.c GIT-CFLAGS FORCE
Jonathan Nieder1015cc42012-07-22 18:47:26 -05002542 $(QUIET_CC)$(CC) -o $@ -S $(ALL_CFLAGS) $(EXTRA_CPPFLAGS) $<
Jonathan Niederf2fabbf2010-01-26 09:57:15 -06002543
2544ifdef USE_COMPUTED_HEADER_DEPENDENCIES
2545# Take advantage of gcc's on-the-fly dependency generation
2546# See <http://gcc.gnu.org/gcc-3.0/features.html>.
2547dep_files_present := $(wildcard $(dep_files))
2548ifneq ($(dep_files_present),)
2549include $(dep_files_present)
2550endif
2551else
Jonathan Niederdfea5752010-01-26 09:52:49 -06002552# Dependencies on header files, for platforms that do not support
2553# the gcc -MMD option.
2554#
Nguyễn Thái Ngọc Duy60f487a2018-05-10 10:46:43 +02002555# Dependencies on automatically generated headers such as command-list.h
Jonathan Niederdfea5752010-01-26 09:52:49 -06002556# should _not_ be included here, since they are necessary even when
2557# building an object for the first time.
Pavel Roskinb05701c2005-08-06 01:36:15 -04002558
Johannes Schindelin92b88eb2019-03-04 05:47:06 -08002559$(OBJECTS): $(LIB_H) $(GENERATED_H)
Jonathan Niederdfea5752010-01-26 09:52:49 -06002560endif
Junio C Hamano7a590132005-08-06 13:10:43 -07002561
Philippe Blain3821c382020-09-03 22:13:38 +00002562ifeq ($(GENERATE_COMPILATION_DATABASE),yes)
2563all:: compile_commands.json
2564compile_commands.json:
Philippe Blain3821c382020-09-03 22:13:38 +00002565 $(QUIET_GEN)sed -e '1s/^/[/' -e '$$s/,$$/]/' $(compdb_dir)/*.o.json > $@+
2566 @if test -s $@+; then mv $@+ $@; else $(RM) $@+; fi
2567endif
2568
Stefan Bellerd807c4a2018-04-10 14:26:18 -07002569exec-cmd.sp exec-cmd.s exec-cmd.o: GIT-PREFIX
2570exec-cmd.sp exec-cmd.s exec-cmd.o: EXTRA_CPPFLAGS = \
Jonathan Nieder373a5ed2010-01-06 02:05:04 -06002571 '-DGIT_EXEC_PATH="$(gitexecdir_SQ)"' \
Dan Jacques226c0dd2018-04-10 11:05:44 -04002572 '-DGIT_LOCALE_PATH="$(localedir_relative_SQ)"' \
Jonathan Nieder373a5ed2010-01-06 02:05:04 -06002573 '-DBINDIR="$(bindir_relative_SQ)"' \
Philip Oakley4d5b4c22018-04-21 13:18:42 +02002574 '-DFALLBACK_RUNTIME_PREFIX="$(prefix_SQ)"'
Steffen Prohaska026fa0d2009-01-18 13:00:09 +01002575
Jeff Kingbe1dbd02012-06-20 14:31:55 -04002576builtin/init-db.sp builtin/init-db.s builtin/init-db.o: GIT-PREFIX
Ramsay Jones0bcd9ae2011-04-21 20:14:42 +01002577builtin/init-db.sp builtin/init-db.s builtin/init-db.o: EXTRA_CPPFLAGS = \
Jonathan Nieder373a5ed2010-01-06 02:05:04 -06002578 -DDEFAULT_GIT_TEMPLATE_DIR='"$(template_dir_SQ)"'
Michal Ostrowski77cb17e2006-01-10 21:12:17 -05002579
Jeff Kingbe1dbd02012-06-20 14:31:55 -04002580config.sp config.s config.o: GIT-PREFIX
Ramsay Jones0bcd9ae2011-04-21 20:14:42 +01002581config.sp config.s config.o: EXTRA_CPPFLAGS = \
2582 -DETC_GITCONFIG='"$(ETC_GITCONFIG_SQ)"'
Johannes Sixt506b17b2007-11-13 21:05:05 +01002583
Jeff Kingbe1dbd02012-06-20 14:31:55 -04002584attr.sp attr.s attr.o: GIT-PREFIX
Ramsay Jones0bcd9ae2011-04-21 20:14:42 +01002585attr.sp attr.s attr.o: EXTRA_CPPFLAGS = \
2586 -DETC_GITATTRIBUTES='"$(ETC_GITATTRIBUTES_SQ)"'
Petr Onderka6df42ab2010-09-01 00:42:43 +02002587
Jeff Kingbe1dbd02012-06-20 14:31:55 -04002588gettext.sp gettext.s gettext.o: GIT-PREFIX
Ævar Arnfjörð Bjarmason5e9637c2011-11-18 00:14:42 +01002589gettext.sp gettext.s gettext.o: EXTRA_CPPFLAGS = \
Dan Jacques226c0dd2018-04-10 11:05:44 -04002590 -DGIT_LOCALE_PATH='"$(localedir_relative_SQ)"'
Ævar Arnfjörð Bjarmason5e9637c2011-11-18 00:14:42 +01002591
Ramsay Jones15caca22019-02-05 02:27:48 +00002592http-push.sp http.sp http-walker.sp remote-curl.sp imap-send.sp: SP_EXTRA_FLAGS += \
Ramsay Jones93713222013-10-06 21:52:21 +01002593 -DCURL_DISABLE_TYPECHECK
2594
Ramsay Jones15caca22019-02-05 02:27:48 +00002595pack-revindex.sp: SP_EXTRA_FLAGS += -Wno-memcpy-max-count
Ramsay Jones54360a12018-02-12 00:21:02 +00002596
Nick Hengeveld8d9fbe52006-04-04 05:33:18 -07002597ifdef NO_EXPAT
Ramsay Jones0bcd9ae2011-04-21 20:14:42 +01002598http-walker.sp http-walker.s http-walker.o: EXTRA_CPPFLAGS = -DNO_EXPAT
Nick Hengeveld8d9fbe52006-04-04 05:33:18 -07002599endif
2600
Ævar Arnfjörð Bjarmasona997bf42010-08-17 09:24:39 +00002601ifdef NO_REGEX
Ramsay Jones0bcd9ae2011-04-21 20:14:42 +01002602compat/regex/regex.sp compat/regex/regex.o: EXTRA_CPPFLAGS = \
2603 -DGAWK -DNO_MBSUPPORT
Ævar Arnfjörð Bjarmasona997bf42010-08-17 09:24:39 +00002604endif
2605
René Scharfed555ff52010-09-11 11:59:18 +02002606ifdef USE_NED_ALLOCATOR
Ramsay Jones0bcd9ae2011-04-21 20:14:42 +01002607compat/nedmalloc/nedmalloc.sp compat/nedmalloc/nedmalloc.o: EXTRA_CPPFLAGS = \
René Scharfeca2baa32016-09-03 17:59:15 +02002608 -DNDEBUG -DREPLACE_SYSTEM_ALLOCATOR
Ramsay Jones15caca22019-02-05 02:27:48 +00002609compat/nedmalloc/nedmalloc.sp: SP_EXTRA_FLAGS += -Wno-non-pointer-null
René Scharfed555ff52010-09-11 11:59:18 +02002610endif
2611
Fredrik Kuivinend9a25fc2011-06-22 12:50:56 +02002612git-%$X: %.o GIT-LDFLAGS $(GITLIBS)
Shawn O. Pearce74f2b2a2007-03-06 01:35:01 -05002613 $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS)
Daniel Barkalow6eb7ed52005-04-23 18:47:23 -07002614
Bernhard Reiter1e16b252014-11-09 15:55:53 +01002615git-imap-send$X: imap-send.o $(IMAP_SEND_BUILDDEPS) GIT-LDFLAGS $(GITLIBS)
Robert Shearman684ec6c2008-07-09 22:29:00 +01002616 $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
Steven Pennyaa38ad22017-01-08 00:12:38 -06002617 $(IMAP_SEND_LDFLAGS) $(LIBS)
Mike McCormackf2561fd2006-03-10 14:32:50 +09002618
John Keepingfd78ced2014-01-25 13:11:44 +00002619git-http-fetch$X: http.o http-walker.o http-fetch.o GIT-LDFLAGS $(GITLIBS)
Linus Torvalds10882612009-08-05 01:01:59 -04002620 $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
Remi Pommarel9eaa78b2015-10-21 19:01:13 +02002621 $(CURL_LIBCURL) $(LIBS)
John Keepingfd78ced2014-01-25 13:11:44 +00002622git-http-push$X: http.o http-push.o GIT-LDFLAGS $(GITLIBS)
Shawn O. Pearce74f2b2a2007-03-06 01:35:01 -05002623 $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
Remi Pommarel9eaa78b2015-10-21 19:01:13 +02002624 $(CURL_LIBCURL) $(EXPAT_LIBEXPAT) $(LIBS)
Johannes Schindelin39c015c2006-02-18 12:40:22 +01002625
Ilari Liusvaara28ca0c92009-12-09 17:26:34 +02002626$(REMOTE_CURL_ALIASES): $(REMOTE_CURL_PRIMARY)
2627 $(QUIET_LNCP)$(RM) $@ && \
2628 ln $< $@ 2>/dev/null || \
2629 ln -s $< $@ 2>/dev/null || \
2630 cp $< $@
2631
Fredrik Kuivinend9a25fc2011-06-22 12:50:56 +02002632$(REMOTE_CURL_PRIMARY): remote-curl.o http.o http-walker.o GIT-LDFLAGS $(GITLIBS)
Daniel Barkalowa2d725b2009-08-05 01:01:56 -04002633 $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
Remi Pommarel9eaa78b2015-10-21 19:01:13 +02002634 $(CURL_LIBCURL) $(EXPAT_LIBEXPAT) $(LIBS)
Daniel Barkalowa2d725b2009-08-05 01:01:56 -04002635
Petr Baudis28818ff2005-07-29 17:50:24 +02002636$(LIB_FILE): $(LIB_OBJS)
Ævar Arnfjörð Bjarmason7b76d6b2021-06-29 10:44:50 +02002637 $(QUIET_AR)$(AR) $(ARFLAGS) $@ $^
Petr Baudis28818ff2005-07-29 17:50:24 +02002638
Linus Torvalds34435462006-03-24 20:13:22 -08002639$(XDIFF_LIB): $(XDIFF_OBJS)
Ævar Arnfjörð Bjarmason7b76d6b2021-06-29 10:44:50 +02002640 $(QUIET_AR)$(AR) $(ARFLAGS) $@ $^
Linus Torvalds34435462006-03-24 20:13:22 -08002641
Han-Wen Nienhuysef8a6c62021-10-07 20:25:00 +00002642$(REFTABLE_LIB): $(REFTABLE_OBJS)
2643 $(QUIET_AR)$(RM) $@ && $(AR) $(ARFLAGS) $@ $^
2644
2645$(REFTABLE_TEST_LIB): $(REFTABLE_TEST_OBJS)
2646 $(QUIET_AR)$(RM) $@ && $(AR) $(ARFLAGS) $@ $^
2647
Jonathan Nieder5b586192012-03-31 03:44:53 -05002648export DEFAULT_EDITOR DEFAULT_PAGER
2649
Johannes Schindelinfaa7a092019-04-18 06:16:44 -07002650Documentation/GIT-EXCLUDED-PROGRAMS: FORCE
2651 @EXCLUDED='EXCLUDED_PROGRAMS := $(EXCLUDED_PROGRAMS)'; \
2652 if test x"$$EXCLUDED" != \
2653 x"`cat Documentation/GIT-EXCLUDED-PROGRAMS 2>/dev/null`" ; then \
2654 echo >&2 " * new documentation flags"; \
2655 echo "$$EXCLUDED" >Documentation/GIT-EXCLUDED-PROGRAMS; \
2656 fi
2657
SZEDER Gábor2530afd2018-02-15 03:14:10 +01002658.PHONY: doc man man-perl html info pdf
2659doc: man-perl
Petr Baudis28818ff2005-07-29 17:50:24 +02002660 $(MAKE) -C Documentation all
2661
SZEDER Gábor2530afd2018-02-15 03:14:10 +01002662man: man-perl
Michael J Gruber414851a2008-09-10 10:19:34 +02002663 $(MAKE) -C Documentation man
2664
SZEDER Gábor2530afd2018-02-15 03:14:10 +01002665man-perl: perl/build/man/man3/Git.3pm
2666
Michael J Gruber414851a2008-09-10 10:19:34 +02002667html:
2668 $(MAKE) -C Documentation html
2669
David Kastrup47398092007-08-06 12:22:57 +02002670info:
2671 $(MAKE) -C Documentation info
2672
Miklos Vajnaa325a1a2008-12-10 23:44:50 +01002673pdf:
2674 $(MAKE) -C Documentation pdf
2675
Ævar Arnfjörð Bjarmasoncd5513a2011-02-22 23:41:23 +00002676XGETTEXT_FLAGS = \
2677 --force-po \
Jiang Xin47fbfde2014-04-17 13:37:18 +08002678 --add-comments=TRANSLATORS: \
Ævar Arnfjörð Bjarmasoncd5513a2011-02-22 23:41:23 +00002679 --msgid-bugs-address="Git Mailing List <git@vger.kernel.org>" \
2680 --from-code=UTF-8
Ævar Arnfjörð Bjarmasonff46a492011-04-10 19:37:01 +00002681XGETTEXT_FLAGS_C = $(XGETTEXT_FLAGS) --language=C \
2682 --keyword=_ --keyword=N_ --keyword="Q_:1,2"
Jiang Xinc2d140d2012-07-25 22:53:07 +08002683XGETTEXT_FLAGS_SH = $(XGETTEXT_FLAGS) --language=Shell \
2684 --keyword=gettextln --keyword=eval_gettextln
Vasco Almeidac4a85c32016-12-14 11:54:29 -01002685XGETTEXT_FLAGS_PERL = $(XGETTEXT_FLAGS) --language=Perl \
Vasco Almeida0539d5e2016-12-14 11:54:30 -01002686 --keyword=__ --keyword=N__ --keyword="__n:1,2"
Jeff Kingd85b0df2014-08-25 16:00:42 -04002687LOCALIZED_C = $(C_OBJ:o=c) $(LIB_H) $(GENERATED_H)
Vasco Almeidad323c6b2016-06-17 20:21:02 +00002688LOCALIZED_SH = $(SCRIPT_SH)
Alban Gruinc42abfe2018-05-28 14:34:19 +02002689LOCALIZED_SH += git-rebase--preserve-merges.sh
Vasco Almeidad323c6b2016-06-17 20:21:02 +00002690LOCALIZED_SH += git-sh-setup.sh
Jeff Kingd85b0df2014-08-25 16:00:42 -04002691LOCALIZED_PERL = $(SCRIPT_PERL)
Ævar Arnfjörð Bjarmason5e9637c2011-11-18 00:14:42 +01002692
2693ifdef XGETTEXT_INCLUDE_TESTS
2694LOCALIZED_C += t/t0200/test.c
2695LOCALIZED_SH += t/t0200/test.sh
2696LOCALIZED_PERL += t/t0200/test.perl
2697endif
Ævar Arnfjörð Bjarmasoncd5513a2011-02-22 23:41:23 +00002698
Junio C Hamanofc0fd5b2017-07-20 11:57:01 -07002699## Note that this is meant to be run only by the localization coordinator
2700## under a very controlled condition, i.e. (1) it is to be run in a
2701## Git repository (not a tarball extract), (2) any local modifications
2702## will be lost.
2703## Gettext tools cannot work with our own custom PRItime type, so
2704## we replace PRItime with PRIuMAX. We need to update this to
2705## PRIdMAX if we switch to a signed type later.
2706
Jonathan Nieder1f319632014-08-22 00:32:08 -04002707po/git.pot: $(GENERATED_H) FORCE
Junio C Hamanofc0fd5b2017-07-20 11:57:01 -07002708 # All modifications will be reverted at the end, so we do not
2709 # want to have any local change.
2710 git diff --quiet HEAD && git diff --quiet --cached
2711
2712 @for s in $(LOCALIZED_C) $(LOCALIZED_SH) $(LOCALIZED_PERL); \
2713 do \
2714 sed -e 's|PRItime|PRIuMAX|g' <"$$s" >"$$s+" && \
2715 cat "$$s+" >"$$s" && rm "$$s+"; \
2716 done
2717
Ævar Arnfjörð Bjarmasonadc3b2b2011-05-14 13:47:45 +00002718 $(QUIET_XGETTEXT)$(XGETTEXT) -o$@+ $(XGETTEXT_FLAGS_C) $(LOCALIZED_C)
2719 $(QUIET_XGETTEXT)$(XGETTEXT) -o$@+ --join-existing $(XGETTEXT_FLAGS_SH) \
2720 $(LOCALIZED_SH)
Ævar Arnfjörð Bjarmason5e9637c2011-11-18 00:14:42 +01002721 $(QUIET_XGETTEXT)$(XGETTEXT) -o$@+ --join-existing $(XGETTEXT_FLAGS_PERL) \
2722 $(LOCALIZED_PERL)
Junio C Hamanofc0fd5b2017-07-20 11:57:01 -07002723
2724 # Reverting the munged source, leaving only the updated $@
2725 git reset --hard
Ævar Arnfjörð Bjarmasoncd5513a2011-02-22 23:41:23 +00002726 mv $@+ $@
2727
Elia Pintoe6be2652015-12-15 15:21:00 +00002728.PHONY: pot
Ævar Arnfjörð Bjarmasoncd5513a2011-02-22 23:41:23 +00002729pot: po/git.pot
2730
Johannes Schindelin43488242021-07-04 22:55:12 +00002731ifdef NO_GETTEXT
2732POFILES :=
2733MOFILES :=
2734else
Ævar Arnfjörð Bjarmason5e9637c2011-11-18 00:14:42 +01002735POFILES := $(wildcard po/*.po)
2736MOFILES := $(patsubst po/%.po,po/build/locale/%/LC_MESSAGES/git.mo,$(POFILES))
2737
Ævar Arnfjörð Bjarmason5e9637c2011-11-18 00:14:42 +01002738all:: $(MOFILES)
2739endif
2740
2741po/build/locale/%/LC_MESSAGES/git.mo: po/%.po
2742 $(QUIET_MSGFMT)mkdir -p $(dir $@) && $(MSGFMT) -o $@ $<
2743
Ævar Arnfjörð Bjarmason805a3782017-12-22 11:07:21 -08002744LIB_PERL := $(wildcard perl/Git.pm perl/Git/*.pm perl/Git/*/*.pm perl/Git/*/*/*.pm)
2745LIB_PERL_GEN := $(patsubst perl/%.pm,perl/build/lib/%.pm,$(LIB_PERL))
Ævar Arnfjörð Bjarmason382029f2018-03-03 15:38:15 +00002746LIB_CPAN := $(wildcard perl/FromCPAN/*.pm perl/FromCPAN/*/*.pm)
2747LIB_CPAN_GEN := $(patsubst perl/%.pm,perl/build/lib/%.pm,$(LIB_CPAN))
Ævar Arnfjörð Bjarmason20d2a302017-12-10 21:13:33 +00002748
2749ifndef NO_PERL
Ævar Arnfjörð Bjarmason805a3782017-12-22 11:07:21 -08002750all:: $(LIB_PERL_GEN)
Todd Zullinger075321c2018-03-03 15:38:16 +00002751ifndef NO_PERL_CPAN_FALLBACKS
Ævar Arnfjörð Bjarmason382029f2018-03-03 15:38:15 +00002752all:: $(LIB_CPAN_GEN)
Ævar Arnfjörð Bjarmason20d2a302017-12-10 21:13:33 +00002753endif
Ævar Arnfjörð Bjarmason1aca69c2018-03-03 15:38:17 +00002754NO_PERL_CPAN_FALLBACKS_SQ = $(subst ','\'',$(NO_PERL_CPAN_FALLBACKS))
Ævar Arnfjörð Bjarmason20d2a302017-12-10 21:13:33 +00002755endif
2756
Ævar Arnfjörð Bjarmason3d49f722021-05-05 14:21:39 +02002757perl/build/lib/%.pm: perl/%.pm GIT-PERL-DEFINES
Ævar Arnfjörð Bjarmason20d2a302017-12-10 21:13:33 +00002758 $(QUIET_GEN)mkdir -p $(dir $@) && \
Dan Jacques07d90ea2018-04-10 11:05:43 -04002759 sed -e 's|@@LOCALEDIR@@|$(perl_localedir_SQ)|g' \
Ævar Arnfjörð Bjarmason256c2dc2021-05-05 14:21:41 +02002760 -e 's|@@NO_GETTEXT@@|$(NO_GETTEXT_SQ)|g' \
Ævar Arnfjörð Bjarmason1aca69c2018-03-03 15:38:17 +00002761 -e 's|@@NO_PERL_CPAN_FALLBACKS@@|$(NO_PERL_CPAN_FALLBACKS_SQ)|g' \
2762 < $< > $@
Ævar Arnfjörð Bjarmason20d2a302017-12-10 21:13:33 +00002763
2764perl/build/man/man3/Git.3pm: perl/Git.pm
2765 $(QUIET_GEN)mkdir -p $(dir $@) && \
2766 pod2man $< $@
2767
Jeff Kinge951ebc2016-12-14 09:26:55 -05002768FIND_SOURCE_FILES = ( \
Jeff Kinge6fc85b2016-12-14 09:28:04 -05002769 git ls-files \
2770 '*.[hcS]' \
Jeff King8fa20432016-12-14 09:29:44 -05002771 '*.sh' \
Jeff Kinge6fc85b2016-12-14 09:28:04 -05002772 ':!*[tp][0-9][0-9][0-9][0-9]*' \
Jeff King046e4c12016-12-14 09:32:35 -05002773 ':!contrib' \
Jeff Kinge6fc85b2016-12-14 09:28:04 -05002774 2>/dev/null || \
Jeff Kinge951ebc2016-12-14 09:26:55 -05002775 $(FIND) . \
2776 \( -name .git -type d -prune \) \
Jeff King8fa20432016-12-14 09:29:44 -05002777 -o \( -name '[tp][0-9][0-9][0-9][0-9]*' -prune \) \
Jeff King046e4c12016-12-14 09:32:35 -05002778 -o \( -name contrib -type d -prune \) \
Jeff Kinge6fc85b2016-12-14 09:28:04 -05002779 -o \( -name build -type d -prune \) \
2780 -o \( -name 'trash*' -type d -prune \) \
Jeff Kinge951ebc2016-12-14 09:26:55 -05002781 -o \( -name '*.[hcS]' -type f -print \) \
Jeff King8fa20432016-12-14 09:29:44 -05002782 -o \( -name '*.sh' -type f -print \) \
Denton Liu43f8c892019-09-16 12:23:14 -07002783 | sed -e 's|^\./||' \
Jeff Kinge951ebc2016-12-14 09:26:55 -05002784 )
Junio C Hamano33533972011-10-18 00:26:18 -07002785
Junio C Hamano2f769192010-09-28 16:08:38 -05002786$(ETAGS_TARGET): FORCE
Ævar Arnfjörð Bjarmason3c80fcb2021-03-28 04:18:34 +02002787 $(QUIET_GEN)$(RM) "$(ETAGS_TARGET)+" && \
2788 $(FIND_SOURCE_FILES) | xargs etags -a -o "$(ETAGS_TARGET)+" && \
2789 mv "$(ETAGS_TARGET)+" "$(ETAGS_TARGET)"
Fredrik Kuivinenf81e7c62006-03-18 11:07:12 +01002790
Junio C Hamano2f769192010-09-28 16:08:38 -05002791tags: FORCE
Ævar Arnfjörð Bjarmason3c80fcb2021-03-28 04:18:34 +02002792 $(QUIET_GEN)$(RM) tags+ && \
2793 $(FIND_SOURCE_FILES) | xargs ctags -a -o tags+ && \
2794 mv tags+ tags
Petr Baudis28818ff2005-07-29 17:50:24 +02002795
Kristof Provosta2a91502007-10-06 16:24:42 +02002796cscope:
2797 $(RM) cscope*
Junio C Hamano33533972011-10-18 00:26:18 -07002798 $(FIND_SOURCE_FILES) | xargs cscope -b
Kristof Provosta2a91502007-10-06 16:24:42 +02002799
Yakov Lernerca3bcab2006-06-15 01:36:00 +03002800### Detect prefix changes
Jeff Kingbe1dbd02012-06-20 14:31:55 -04002801TRACK_PREFIX = $(bindir_SQ):$(gitexecdir_SQ):$(template_dir_SQ):$(prefix_SQ):\
2802 $(localedir_SQ)
2803
2804GIT-PREFIX: FORCE
2805 @FLAGS='$(TRACK_PREFIX)'; \
2806 if test x"$$FLAGS" != x"`cat GIT-PREFIX 2>/dev/null`" ; then \
Christian Couder1a59d882012-12-18 16:26:39 +01002807 echo >&2 " * new prefix flags"; \
Jeff Kingbe1dbd02012-06-20 14:31:55 -04002808 echo "$$FLAGS" >GIT-PREFIX; \
2809 fi
2810
2811TRACK_CFLAGS = $(CC):$(subst ','\'',$(ALL_CFLAGS)):$(USE_GETTEXT_SCHEME)
Yakov Lernerca3bcab2006-06-15 01:36:00 +03002812
Jonathan Nieder13fca9f2010-01-06 02:06:58 -06002813GIT-CFLAGS: FORCE
Yakov Lernerca3bcab2006-06-15 01:36:00 +03002814 @FLAGS='$(TRACK_CFLAGS)'; \
2815 if test x"$$FLAGS" != x"`cat GIT-CFLAGS 2>/dev/null`" ; then \
Christian Couder1a59d882012-12-18 16:26:39 +01002816 echo >&2 " * new build flags"; \
Yakov Lernerca3bcab2006-06-15 01:36:00 +03002817 echo "$$FLAGS" >GIT-CFLAGS; \
2818 fi
2819
Fredrik Kuivinend9a25fc2011-06-22 12:50:56 +02002820TRACK_LDFLAGS = $(subst ','\'',$(ALL_LDFLAGS))
2821
2822GIT-LDFLAGS: FORCE
2823 @FLAGS='$(TRACK_LDFLAGS)'; \
2824 if test x"$$FLAGS" != x"`cat GIT-LDFLAGS 2>/dev/null`" ; then \
Christian Couder1a59d882012-12-18 16:26:39 +01002825 echo >&2 " * new link flags"; \
Fredrik Kuivinend9a25fc2011-06-22 12:50:56 +02002826 echo "$$FLAGS" >GIT-LDFLAGS; \
2827 fi
2828
Junio C Hamanobfce5082008-07-25 12:35:10 -07002829# We need to apply sq twice, once to protect from the shell
2830# that runs GIT-BUILD-OPTIONS, and then again to protect it
2831# and the first level quoting from the shell that runs "echo".
Jonathan Nieder13fca9f2010-01-06 02:06:58 -06002832GIT-BUILD-OPTIONS: FORCE
Jeff Kinga2d25ef2015-05-29 03:26:30 -04002833 @echo SHELL_PATH=\''$(subst ','\'',$(SHELL_PATH_SQ))'\' >$@+
Jeff King3f824e92017-12-08 05:47:22 -05002834 @echo TEST_SHELL_PATH=\''$(subst ','\'',$(TEST_SHELL_PATH_SQ))'\' >>$@+
Jeff Kinga2d25ef2015-05-29 03:26:30 -04002835 @echo PERL_PATH=\''$(subst ','\'',$(PERL_PATH_SQ))'\' >>$@+
2836 @echo DIFF=\''$(subst ','\'',$(subst ','\'',$(DIFF)))'\' >>$@+
2837 @echo PYTHON_PATH=\''$(subst ','\'',$(PYTHON_PATH_SQ))'\' >>$@+
2838 @echo TAR=\''$(subst ','\'',$(subst ','\'',$(TAR)))'\' >>$@+
2839 @echo NO_CURL=\''$(subst ','\'',$(subst ','\'',$(NO_CURL)))'\' >>$@+
Junio C Hamano0d5d7db2015-06-16 14:27:06 -07002840 @echo NO_EXPAT=\''$(subst ','\'',$(subst ','\'',$(NO_EXPAT)))'\' >>$@+
Ævar Arnfjörð Bjarmason94da9192017-06-01 18:20:56 +00002841 @echo USE_LIBPCRE2=\''$(subst ','\'',$(subst ','\'',$(USE_LIBPCRE2)))'\' >>$@+
Jeff Kinga2d25ef2015-05-29 03:26:30 -04002842 @echo NO_PERL=\''$(subst ','\'',$(subst ','\'',$(NO_PERL)))'\' >>$@+
Ævar Arnfjörð Bjarmason68c7d272017-05-25 19:45:31 +00002843 @echo NO_PTHREADS=\''$(subst ','\'',$(subst ','\'',$(NO_PTHREADS)))'\' >>$@+
Jeff Kinga2d25ef2015-05-29 03:26:30 -04002844 @echo NO_PYTHON=\''$(subst ','\'',$(subst ','\'',$(NO_PYTHON)))'\' >>$@+
2845 @echo NO_UNIX_SOCKETS=\''$(subst ','\'',$(subst ','\'',$(NO_UNIX_SOCKETS)))'\' >>$@+
Eric Wong995bc222016-08-04 11:40:25 +00002846 @echo PAGER_ENV=\''$(subst ','\'',$(subst ','\'',$(PAGER_ENV)))'\' >>$@+
Jeff Kingf5f5e7f2017-03-16 18:09:36 -04002847 @echo DC_SHA1=\''$(subst ','\'',$(subst ','\'',$(DC_SHA1)))'\' >>$@+
Johannes Schindelin8abfdf42018-11-14 08:32:11 -08002848 @echo X=\'$(X)\' >>$@+
John Keeping2d14e132013-04-29 19:16:21 +01002849ifdef TEST_OUTPUT_DIRECTORY
Jeff Kinga2d25ef2015-05-29 03:26:30 -04002850 @echo TEST_OUTPUT_DIRECTORY=\''$(subst ','\'',$(subst ','\'',$(TEST_OUTPUT_DIRECTORY)))'\' >>$@+
John Keeping2d14e132013-04-29 19:16:21 +01002851endif
Thomas Rast342e9ef2012-02-17 11:25:09 +01002852ifdef GIT_TEST_OPTS
Jeff Kinga2d25ef2015-05-29 03:26:30 -04002853 @echo GIT_TEST_OPTS=\''$(subst ','\'',$(subst ','\'',$(GIT_TEST_OPTS)))'\' >>$@+
Thomas Rast342e9ef2012-02-17 11:25:09 +01002854endif
Junio C Hamano5e87eae2010-06-11 09:40:25 -07002855ifdef GIT_TEST_CMP
Jeff Kinga2d25ef2015-05-29 03:26:30 -04002856 @echo GIT_TEST_CMP=\''$(subst ','\'',$(subst ','\'',$(GIT_TEST_CMP)))'\' >>$@+
Junio C Hamano5e87eae2010-06-11 09:40:25 -07002857endif
2858ifdef GIT_TEST_CMP_USE_COPIED_CONTEXT
Jeff Kinga2d25ef2015-05-29 03:26:30 -04002859 @echo GIT_TEST_CMP_USE_COPIED_CONTEXT=YesPlease >>$@+
Junio C Hamano5e87eae2010-06-11 09:40:25 -07002860endif
Đoàn Trần Công Danh482c9622021-06-08 13:56:28 +07002861ifdef GIT_TEST_UTF8_LOCALE
2862 @echo GIT_TEST_UTF8_LOCALE=\''$(subst ','\'',$(subst ','\'',$(GIT_TEST_UTF8_LOCALE)))'\' >>$@+
2863endif
Jeff Kinga2d25ef2015-05-29 03:26:30 -04002864 @echo NO_GETTEXT=\''$(subst ','\'',$(subst ','\'',$(NO_GETTEXT)))'\' >>$@+
Thomas Rast342e9ef2012-02-17 11:25:09 +01002865ifdef GIT_PERF_REPEAT_COUNT
Jeff Kinga2d25ef2015-05-29 03:26:30 -04002866 @echo GIT_PERF_REPEAT_COUNT=\''$(subst ','\'',$(subst ','\'',$(GIT_PERF_REPEAT_COUNT)))'\' >>$@+
Thomas Rast342e9ef2012-02-17 11:25:09 +01002867endif
2868ifdef GIT_PERF_REPO
Jeff Kinga2d25ef2015-05-29 03:26:30 -04002869 @echo GIT_PERF_REPO=\''$(subst ','\'',$(subst ','\'',$(GIT_PERF_REPO)))'\' >>$@+
Thomas Rast342e9ef2012-02-17 11:25:09 +01002870endif
2871ifdef GIT_PERF_LARGE_REPO
Jeff Kinga2d25ef2015-05-29 03:26:30 -04002872 @echo GIT_PERF_LARGE_REPO=\''$(subst ','\'',$(subst ','\'',$(GIT_PERF_LARGE_REPO)))'\' >>$@+
Thomas Rast342e9ef2012-02-17 11:25:09 +01002873endif
2874ifdef GIT_PERF_MAKE_OPTS
Jeff Kinga2d25ef2015-05-29 03:26:30 -04002875 @echo GIT_PERF_MAKE_OPTS=\''$(subst ','\'',$(subst ','\'',$(GIT_PERF_MAKE_OPTS)))'\' >>$@+
Thomas Rast342e9ef2012-02-17 11:25:09 +01002876endif
Ævar Arnfjörð Bjarmason88b61972017-05-20 21:42:18 +00002877ifdef GIT_PERF_MAKE_COMMAND
2878 @echo GIT_PERF_MAKE_COMMAND=\''$(subst ','\'',$(subst ','\'',$(GIT_PERF_MAKE_COMMAND)))'\' >>$@+
2879endif
Jeff King3d893612017-02-25 04:37:07 -05002880ifdef GIT_INTEROP_MAKE_OPTS
2881 @echo GIT_INTEROP_MAKE_OPTS=\''$(subst ','\'',$(subst ','\'',$(GIT_INTEROP_MAKE_OPTS)))'\' >>$@+
2882endif
Ben Peart1f357b02018-09-18 23:29:36 +00002883ifdef GIT_TEST_INDEX_VERSION
2884 @echo GIT_TEST_INDEX_VERSION=\''$(subst ','\'',$(subst ','\'',$(GIT_TEST_INDEX_VERSION)))'\' >>$@+
Thomas Gummerer5d9fc882014-02-23 21:49:58 +01002885endif
Jeff King5338ed22020-10-21 23:24:00 -04002886ifdef GIT_TEST_PERL_FATAL_WARNINGS
2887 @echo GIT_TEST_PERL_FATAL_WARNINGS=\''$(subst ','\'',$(subst ','\'',$(GIT_TEST_PERL_FATAL_WARNINGS)))'\' >>$@+
2888endif
Johannes Schindelinb7d11a02021-07-24 22:06:49 +00002889ifdef RUNTIME_PREFIX
2890 @echo RUNTIME_PREFIX=\'true\' >>$@+
2891else
2892 @echo RUNTIME_PREFIX=\'false\' >>$@+
2893endif
Jeff Kinga2d25ef2015-05-29 03:26:30 -04002894 @if cmp $@+ $@ >/dev/null 2>&1; then $(RM) $@+; else mv $@+ $@; fi
Jeff King7cf7f542008-02-24 14:40:45 -05002895
Christian Couder96a46472012-12-18 16:26:38 +01002896### Detect Python interpreter path changes
2897ifndef NO_PYTHON
2898TRACK_PYTHON = $(subst ','\'',-DPYTHON_PATH='$(PYTHON_PATH_SQ)')
Eygene Ryabinkin6bdb18a2007-03-28 04:22:02 -07002899
Christian Couder96a46472012-12-18 16:26:38 +01002900GIT-PYTHON-VARS: FORCE
2901 @VARS='$(TRACK_PYTHON)'; \
Eygene Ryabinkin6bdb18a2007-03-28 04:22:02 -07002902 if test x"$$VARS" != x"`cat $@ 2>/dev/null`" ; then \
Christian Couder1a59d882012-12-18 16:26:39 +01002903 echo >&2 " * new Python interpreter location"; \
Eygene Ryabinkin6bdb18a2007-03-28 04:22:02 -07002904 echo "$$VARS" >$@; \
2905 fi
Eygene Ryabinkin6bdb18a2007-03-28 04:22:02 -07002906endif
2907
Matthew Ogilvieea925192009-12-02 22:14:05 -07002908test_bindir_programs := $(patsubst %,bin-wrappers/%,$(BINDIR_PROGRAMS_NEED_X) $(BINDIR_PROGRAMS_NO_X) $(TEST_PROGRAMS_NEED_X))
2909
2910all:: $(TEST_PROGRAMS) $(test_bindir_programs)
2911
2912bin-wrappers/%: wrap-for-bin.sh
2913 @mkdir -p bin-wrappers
2914 $(QUIET_GEN)sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \
2915 -e 's|@@BUILD_DIR@@|$(shell pwd)|' \
Johannes Schindelin3a94cb32019-07-29 13:08:16 -07002916 -e 's|@@PROG@@|$(patsubst test-%,t/helper/test-%$(X),$(@F))$(patsubst git%,$(X),$(filter $(@F),$(BINDIR_PROGRAMS_NEED_X)))|' < $< > $@ && \
Matthew Ogilvieea925192009-12-02 22:14:05 -07002917 chmod +x $@
Junio C Hamano96651ef2007-04-28 15:32:49 -07002918
Johannes Schindelinabb7c7b2006-02-18 13:01:18 +01002919# GNU make supports exporting all variables by "export" without parameters.
2920# However, the environment gets quite big, and some programs have problems
2921# with that.
2922
Johannes Schindelin140245b2006-07-07 13:26:31 +02002923export NO_SVN_TESTS
Ramsay Jones12666862012-10-06 18:33:08 +01002924export TEST_NO_MALLOC_CHECK
Johannes Schindelinabb7c7b2006-02-18 13:01:18 +01002925
Jonathan Nieder225f78c2010-01-26 10:08:44 -06002926### Testing rules
2927
Junio C Hamano96651ef2007-04-28 15:32:49 -07002928test: all
Petr Baudis28818ff2005-07-29 17:50:24 +02002929 $(MAKE) -C t/ all
2930
Thomas Rast342e9ef2012-02-17 11:25:09 +01002931perf: all
2932 $(MAKE) -C t/perf/ all
2933
2934.PHONY: test perf
2935
Jonathan Niederdaa99a92010-01-26 09:45:54 -06002936.PRECIOUS: $(TEST_OBJS)
Junio C Hamanofa8fe282007-08-30 19:14:31 -07002937
Nguyễn Thái Ngọc Duyefd71f82018-03-24 08:44:30 +01002938t/helper/test-tool$X: $(patsubst %,t/helper/%,$(TEST_BUILTINS_OBJS))
2939
Han-Wen Nienhuysef8a6c62021-10-07 20:25:00 +00002940t/helper/test-%$X: t/helper/test-%.o GIT-LDFLAGS $(GITLIBS) $(REFTABLE_TEST_LIB)
David Barr1d73b522010-08-09 17:34:42 -05002941 $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(filter %.a,$^) $(LIBS)
Nicolas Pitre2dca1af2007-04-11 13:59:51 -04002942
Nguyễn Thái Ngọc Duydae2ff92018-03-24 08:44:32 +01002943check-sha1:: t/helper/test-tool$X
Nguyễn Thái Ngọc Duye6e75302016-04-13 20:22:42 +07002944 t/helper/test-sha1.sh
Junio C Hamanob65bc212006-06-24 00:59:49 -07002945
Ramsay Jones0bcd9ae2011-04-21 20:14:42 +01002946SP_OBJ = $(patsubst %.o,%.sp,$(C_OBJ))
2947
2948$(SP_OBJ): %.sp: %.c GIT-CFLAGS FORCE
2949 $(QUIET_SP)cgcc -no-compile $(ALL_CFLAGS) $(EXTRA_CPPFLAGS) \
Ramsay Jones15caca22019-02-05 02:27:48 +00002950 $(SPARSE_FLAGS) $(SP_EXTRA_FLAGS) $<
Ramsay Jones0bcd9ae2011-04-21 20:14:42 +01002951
2952.PHONY: sparse $(SP_OBJ)
2953sparse: $(SP_OBJ)
2954
Emily Shaffer709df952020-04-16 14:18:03 -07002955EXCEPT_HDRS := command-list.h config-list.h unicode-width.h compat/% xdiff/%
Ramsay Jonesf23aa182019-03-06 00:11:13 +00002956ifndef GCRYPT_SHA256
2957 EXCEPT_HDRS += sha256/gcrypt.h
2958endif
Denton Liucf6a2d22019-09-16 12:23:08 -07002959CHK_HDRS = $(filter-out $(EXCEPT_HDRS),$(LIB_H))
Ramsay Jonesebb7baf2018-09-19 01:07:08 +01002960HCO = $(patsubst %.h,%.hco,$(CHK_HDRS))
Denton Liub503a2d2019-09-25 01:21:01 -07002961HCC = $(HCO:hco=hcc)
Ramsay Jonesebb7baf2018-09-19 01:07:08 +01002962
Denton Liub503a2d2019-09-25 01:21:01 -07002963%.hcc: %.h
2964 @echo '#include "git-compat-util.h"' >$@
2965 @echo '#include "$<"' >>$@
2966
2967$(HCO): %.hco: %.hcc FORCE
2968 $(QUIET_HDR)$(CC) $(ALL_CFLAGS) -o /dev/null -c -xc $<
Ramsay Jonesebb7baf2018-09-19 01:07:08 +01002969
2970.PHONY: hdr-check $(HCO)
2971hdr-check: $(HCO)
2972
Brandon Williams21188052017-08-14 14:30:46 -07002973.PHONY: style
2974style:
2975 git clang-format --style file --diff --extensions c,h
2976
Emily Shaffer709df952020-04-16 14:18:03 -07002977check: config-list.h command-list.h
Ramsay Jonesf228d1f2011-04-07 19:22:18 +01002978 @if sparse; \
Junio C Hamano912f9982008-11-11 13:12:17 -08002979 then \
Junio C Hamanod55de702016-04-05 00:02:14 -07002980 echo >&2 "Use 'make sparse' instead"; \
Ramsay Jones0bcd9ae2011-04-21 20:14:42 +01002981 $(MAKE) --no-print-directory sparse; \
Junio C Hamano912f9982008-11-11 13:12:17 -08002982 else \
Junio C Hamanod55de702016-04-05 00:02:14 -07002983 echo >&2 "Did you mean 'make test'?"; \
Junio C Hamano912f9982008-11-11 13:12:17 -08002984 exit 1; \
2985 fi
Petr Baudis28818ff2005-07-29 17:50:24 +02002986
Denton Liu9027af52019-09-16 12:23:16 -07002987FOUND_C_SOURCES = $(filter %.c,$(shell $(FIND_SOURCE_FILES)))
2988COCCI_SOURCES = $(filter-out $(THIRD_PARTY_SOURCES),$(FOUND_C_SOURCES))
SZEDER Gáborac1e31d2018-07-23 15:50:58 +02002989
2990%.cocci.patch: %.cocci $(COCCI_SOURCES)
Denton Liu4f3c1dc2019-10-09 13:43:46 -07002991 $(QUIET_SPATCH) \
Jeff Kingbcb4edf2019-05-08 03:07:54 -04002992 if test $(SPATCH_BATCH_SIZE) = 0; then \
2993 limit=; \
2994 else \
2995 limit='-n $(SPATCH_BATCH_SIZE)'; \
2996 fi; \
2997 if ! echo $(COCCI_SOURCES) | xargs $$limit \
Jeff King960154b2019-05-06 19:43:34 -04002998 $(SPATCH) --sp-file $< $(SPATCH_FLAGS) \
2999 >$@+ 2>$@.log; \
Jeff Kingf5c2bc22017-03-10 03:31:18 -05003000 then \
3001 cat $@.log; \
3002 exit 1; \
3003 fi; \
3004 mv $@+ $@; \
René Scharfe63f0a752016-09-15 20:30:56 +02003005 if test -s $@; \
3006 then \
3007 echo ' ' SPATCH result: $@; \
3008 fi
SZEDER Gábordd5d0522018-11-09 16:10:52 -08003009coccicheck: $(addsuffix .patch,$(filter-out %.pending.cocci,$(wildcard contrib/coccinelle/*.cocci)))
René Scharfe63f0a752016-09-15 20:30:56 +02003010
SZEDER Gábordd5d0522018-11-09 16:10:52 -08003011# See contrib/coccinelle/README
3012coccicheck-pending: $(addsuffix .patch,$(wildcard contrib/coccinelle/*.pending.cocci))
3013
3014.PHONY: coccicheck coccicheck-pending
Petr Baudis28818ff2005-07-29 17:50:24 +02003015
Petr Baudis28818ff2005-07-29 17:50:24 +02003016### Installation rules
3017
Junio C Hamano0c0ead72009-02-05 00:04:17 -08003018ifneq ($(filter /%,$(firstword $(template_dir))),)
Johannes Sixt0b50b862008-01-01 22:15:21 +01003019template_instdir = $(template_dir)
Steffen Prohaska026fa0d2009-01-18 13:00:09 +01003020else
3021template_instdir = $(prefix)/$(template_dir)
Johannes Sixt0b50b862008-01-01 22:15:21 +01003022endif
3023export template_instdir
3024
Junio C Hamano0c0ead72009-02-05 00:04:17 -08003025ifneq ($(filter /%,$(firstword $(gitexecdir))),)
Johannes Sixt49fa65a2008-07-23 21:12:18 +02003026gitexec_instdir = $(gitexecdir)
Steffen Prohaska026fa0d2009-01-18 13:00:09 +01003027else
3028gitexec_instdir = $(prefix)/$(gitexecdir)
Johannes Sixt49fa65a2008-07-23 21:12:18 +02003029endif
3030gitexec_instdir_SQ = $(subst ','\'',$(gitexec_instdir))
3031export gitexec_instdir
3032
David Aguilarbc7a96a2011-08-18 00:23:46 -07003033ifneq ($(filter /%,$(firstword $(mergetoolsdir))),)
3034mergetools_instdir = $(mergetoolsdir)
3035else
3036mergetools_instdir = $(prefix)/$(mergetoolsdir)
3037endif
3038mergetools_instdir_SQ = $(subst ','\'',$(mergetools_instdir))
3039
Matthew Ogilvieea925192009-12-02 22:14:05 -07003040install_bindir_programs := $(patsubst %,%$X,$(BINDIR_PROGRAMS_NEED_X)) $(BINDIR_PROGRAMS_NO_X)
3041
Elia Pintoe6be2652015-12-15 15:21:00 +00003042.PHONY: profile-install profile-fast-install
Andi Kleen066dd262014-07-07 23:35:11 -07003043profile-install: profile
3044 $(MAKE) install
3045
3046profile-fast-install: profile-fast
3047 $(MAKE) install
3048
Andreas Ericssond6ebd252005-11-22 00:44:15 +01003049install: all
Robert Schiele41650762007-12-01 18:05:40 +01003050 $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(bindir_SQ)'
Johannes Sixt49fa65a2008-07-23 21:12:18 +02003051 $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(gitexec_instdir_SQ)'
3052 $(INSTALL) $(ALL_PROGRAMS) '$(DESTDIR_SQ)$(gitexec_instdir_SQ)'
Jonathan Nieder46bac902010-01-31 11:46:53 -08003053 $(INSTALL) -m 644 $(SCRIPT_LIB) '$(DESTDIR_SQ)$(gitexec_instdir_SQ)'
Matthew Ogilvieea925192009-12-02 22:14:05 -07003054 $(INSTALL) $(install_bindir_programs) '$(DESTDIR_SQ)$(bindir_SQ)'
Jeff Hostetlerdce7d292019-06-25 07:49:39 -07003055ifdef MSVC
3056 # We DO NOT install the individual foo.o.pdb files because they
3057 # have already been rolled up into the exe's pdb file.
3058 # We DO NOT have pdb files for the builtin commands (like git-status.exe)
3059 # because it is just a copy/hardlink of git.exe, rather than a unique binary.
Johannes Schindelina8b53552020-09-21 22:28:15 +00003060 $(INSTALL) $(patsubst %.exe,%.pdb,$(filter-out $(BUILT_INS),$(patsubst %,%$X,$(BINDIR_PROGRAMS_NEED_X)))) '$(DESTDIR_SQ)$(bindir_SQ)'
3061 $(INSTALL) $(patsubst %.exe,%.pdb,$(filter-out $(BUILT_INS) $(REMOTE_CURL_ALIASES),$(PROGRAMS))) '$(DESTDIR_SQ)$(gitexec_instdir_SQ)'
Jeff Hostetlerdce7d292019-06-25 07:49:39 -07003062ifndef DEBUG
3063 $(INSTALL) $(vcpkg_rel_bin)/*.dll '$(DESTDIR_SQ)$(bindir_SQ)'
3064 $(INSTALL) $(vcpkg_rel_bin)/*.pdb '$(DESTDIR_SQ)$(bindir_SQ)'
3065else
3066 $(INSTALL) $(vcpkg_dbg_bin)/*.dll '$(DESTDIR_SQ)$(bindir_SQ)'
3067 $(INSTALL) $(vcpkg_dbg_bin)/*.pdb '$(DESTDIR_SQ)$(bindir_SQ)'
3068endif
3069endif
Ramsay Allan Jones7ffe7092006-07-29 17:25:03 +01003070 $(MAKE) -C templates DESTDIR='$(DESTDIR_SQ)' install
David Aguilarbc7a96a2011-08-18 00:23:46 -07003071 $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(mergetools_instdir_SQ)'
Jonathan Nieder53b74252011-10-09 04:17:07 -05003072 $(INSTALL) -m 644 mergetools/* '$(DESTDIR_SQ)$(mergetools_instdir_SQ)'
Ævar Arnfjörð Bjarmason5e9637c2011-11-18 00:14:42 +01003073ifndef NO_GETTEXT
3074 $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(localedir_SQ)'
3075 (cd po/build/locale && $(TAR) cf - .) | \
3076 (cd '$(DESTDIR_SQ)$(localedir_SQ)' && umask 022 && $(TAR) xof -)
3077endif
Junio C Hamano5be3b172009-04-22 22:42:28 -07003078ifndef NO_PERL
Ævar Arnfjörð Bjarmason20d2a302017-12-10 21:13:33 +00003079 $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perllibdir_SQ)'
3080 (cd perl/build/lib && $(TAR) cf - .) | \
3081 (cd '$(DESTDIR_SQ)$(perllibdir_SQ)' && umask 022 && $(TAR) xof -)
Junio C Hamano8d676d82010-06-21 06:02:44 -07003082 $(MAKE) -C gitweb install
Junio C Hamano5be3b172009-04-22 22:42:28 -07003083endif
Eygene Ryabinkin3cfaf112007-03-28 04:00:23 -07003084ifndef NO_TCLTK
Junio C Hamano62ba5142007-11-17 10:51:16 -08003085 $(MAKE) -C gitk-git install
Johannes Sixt49fa65a2008-07-23 21:12:18 +02003086 $(MAKE) -C git-gui gitexecdir='$(gitexec_instdir_SQ)' install
Eygene Ryabinkin3cfaf112007-03-28 04:00:23 -07003087endif
Junio C Hamano6fc301b2007-01-10 12:24:54 -08003088ifneq (,$X)
Johannes Schindelin179227d2020-09-21 22:28:16 +00003089 $(foreach p,$(patsubst %$X,%,$(filter %$X,$(ALL_COMMANDS_TO_INSTALL) git$X)), test '$(DESTDIR_SQ)$(gitexec_instdir_SQ)/$p' -ef '$(DESTDIR_SQ)$(gitexec_instdir_SQ)/$p$X' || $(RM) '$(DESTDIR_SQ)$(gitexec_instdir_SQ)/$p';)
Junio C Hamano6fc301b2007-01-10 12:24:54 -08003090endif
Ilari Liusvaara28ca0c92009-12-09 17:26:34 +02003091
Johannes Sixt46beb552008-07-21 21:19:51 +02003092 bindir=$$(cd '$(DESTDIR_SQ)$(bindir_SQ)' && pwd) && \
Johannes Sixt49fa65a2008-07-23 21:12:18 +02003093 execdir=$$(cd '$(DESTDIR_SQ)$(gitexec_instdir_SQ)' && pwd) && \
Ævar Arnfjörð Bjarmasonad874602018-03-13 20:39:35 +00003094 destdir_from_execdir_SQ=$$(echo '$(gitexecdir_relative_SQ)' | sed -e 's|[^/][^/]*|..|g') && \
Junio C Hamano6edd1492009-07-10 20:17:33 -07003095 { test "$$bindir/" = "$$execdir/" || \
Brandon Casey76d079a2010-07-23 12:50:45 -05003096 for p in git$X $(filter $(install_bindir_programs),$(ALL_PROGRAMS)); do \
3097 $(RM) "$$execdir/$$p" && \
Ævar Arnfjörð Bjarmasonad874602018-03-13 20:39:35 +00003098 test -n "$(INSTALL_SYMLINKS)" && \
3099 ln -s "$$destdir_from_execdir_SQ/$(bindir_relative_SQ)/$$p" "$$execdir/$$p" || \
3100 { test -z "$(NO_INSTALL_HARDLINKS)$(NO_CROSS_DIRECTORY_HARDLINKS)" && \
3101 ln "$$bindir/$$p" "$$execdir/$$p" 2>/dev/null || \
3102 cp "$$bindir/$$p" "$$execdir/$$p" || exit; } \
Brandon Casey76d079a2010-07-23 12:50:45 -05003103 done; \
3104 } && \
Brandon Casey40919c42010-07-23 12:50:44 -05003105 for p in $(filter $(install_bindir_programs),$(BUILT_INS)); do \
3106 $(RM) "$$bindir/$$p" && \
Johannes Schindelin907e6372020-10-21 15:13:31 +00003107 test -n "$(INSTALL_SYMLINKS)" && \
3108 ln -s "git$X" "$$bindir/$$p" || \
3109 { test -z "$(NO_INSTALL_HARDLINKS)" && \
3110 ln "$$bindir/git$X" "$$bindir/$$p" 2>/dev/null || \
3111 ln -s "git$X" "$$bindir/$$p" 2>/dev/null || \
3112 cp "$$bindir/git$X" "$$bindir/$$p" || exit; }; \
Brandon Casey40919c42010-07-23 12:50:44 -05003113 done && \
Brandon Caseyba2b4d72010-07-02 11:50:28 -07003114 for p in $(BUILT_INS); do \
Brandon Caseyb56c79c2009-01-19 19:44:03 -06003115 $(RM) "$$execdir/$$p" && \
Johannes Schindelin179227d2020-09-21 22:28:16 +00003116 if test -z "$(SKIP_DASHED_BUILT_INS)"; \
3117 then \
3118 test -n "$(INSTALL_SYMLINKS)" && \
3119 ln -s "$$destdir_from_execdir_SQ/$(bindir_relative_SQ)/git$X" "$$execdir/$$p" || \
3120 { test -z "$(NO_INSTALL_HARDLINKS)" && \
3121 ln "$$execdir/git$X" "$$execdir/$$p" 2>/dev/null || \
3122 ln -s "git$X" "$$execdir/$$p" 2>/dev/null || \
3123 cp "$$execdir/git$X" "$$execdir/$$p" || exit; }; \
3124 fi \
Brandon Caseyba2b4d72010-07-02 11:50:28 -07003125 done && \
Brandon Casey49a43f52010-07-06 14:56:51 -07003126 remote_curl_aliases="$(REMOTE_CURL_ALIASES)" && \
3127 for p in $$remote_curl_aliases; do \
Ilari Liusvaara28ca0c92009-12-09 17:26:34 +02003128 $(RM) "$$execdir/$$p" && \
Ævar Arnfjörð Bjarmasonad874602018-03-13 20:39:35 +00003129 test -n "$(INSTALL_SYMLINKS)" && \
3130 ln -s "git-remote-http$X" "$$execdir/$$p" || \
3131 { test -z "$(NO_INSTALL_HARDLINKS)" && \
3132 ln "$$execdir/git-remote-http$X" "$$execdir/$$p" 2>/dev/null || \
3133 ln -s "git-remote-http$X" "$$execdir/$$p" 2>/dev/null || \
3134 cp "$$execdir/git-remote-http$X" "$$execdir/$$p" || exit; } \
Brandon Casey49a43f52010-07-06 14:56:51 -07003135 done && \
Johannes Sixt7b4b59a2008-07-21 21:19:58 +02003136 ./check_bindir "z$$bindir" "z$$execdir" "$$bindir/git-add$X"
Petr Baudis28818ff2005-07-29 17:50:24 +02003137
SZEDER Gábor2530afd2018-02-15 03:14:10 +01003138.PHONY: install-gitweb install-doc install-man install-man-perl install-html install-info install-pdf
Elia Pintoe6be2652015-12-15 15:21:00 +00003139.PHONY: quick-install-doc quick-install-man quick-install-html
Jakub Narebski152d9432010-05-01 22:36:15 +02003140install-gitweb:
3141 $(MAKE) -C gitweb install
3142
Ævar Arnfjörð Bjarmason20d2a302017-12-10 21:13:33 +00003143install-doc: install-man-perl
Petr Baudis28818ff2005-07-29 17:50:24 +02003144 $(MAKE) -C Documentation install
3145
Ævar Arnfjörð Bjarmason20d2a302017-12-10 21:13:33 +00003146install-man: install-man-perl
Markus Heidelbergb1a46b72008-11-02 18:53:03 +01003147 $(MAKE) -C Documentation install-man
3148
SZEDER Gábor2530afd2018-02-15 03:14:10 +01003149install-man-perl: man-perl
Ævar Arnfjörð Bjarmason20d2a302017-12-10 21:13:33 +00003150 $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(mandir_SQ)/man3'
3151 (cd perl/build/man/man3 && $(TAR) cf - .) | \
3152 (cd '$(DESTDIR_SQ)$(mandir_SQ)/man3' && umask 022 && $(TAR) xof -)
3153
Teemu Likonenae081f32008-06-10 11:34:25 +03003154install-html:
3155 $(MAKE) -C Documentation install-html
3156
David Kastrup47398092007-08-06 12:22:57 +02003157install-info:
3158 $(MAKE) -C Documentation install-info
3159
Miklos Vajnaa325a1a2008-12-10 23:44:50 +01003160install-pdf:
3161 $(MAKE) -C Documentation install-pdf
3162
Eric Wong6538d1e2006-12-23 08:26:09 -08003163quick-install-doc:
3164 $(MAKE) -C Documentation quick-install
Petr Baudis28818ff2005-07-29 17:50:24 +02003165
Markus Heidelbergb1a46b72008-11-02 18:53:03 +01003166quick-install-man:
3167 $(MAKE) -C Documentation quick-install-man
3168
Michael J Gruber6fe570d2008-09-09 22:44:17 +02003169quick-install-html:
3170 $(MAKE) -C Documentation quick-install-html
3171
Petr Baudis28818ff2005-07-29 17:50:24 +02003172
3173
3174### Maintainer's dist rules
3175
Stefano Lattarinidd6fc7c2012-12-09 11:36:17 +01003176GIT_TARNAME = git-$(GIT_VERSION)
René Scharfedf368fa2020-09-19 23:23:50 +02003177GIT_ARCHIVE_EXTRA_FILES = \
3178 --prefix=$(GIT_TARNAME)/ \
3179 --add-file=configure \
Ramsay Jonesc5312032020-12-08 22:36:33 +00003180 --add-file=.dist-tmp-dir/version \
René Scharfedf368fa2020-09-19 23:23:50 +02003181 --prefix=$(GIT_TARNAME)/git-gui/ \
Ramsay Jonesc5312032020-12-08 22:36:33 +00003182 --add-file=.dist-tmp-dir/git-gui/version
René Scharfedf368fa2020-09-19 23:23:50 +02003183ifdef DC_SHA1_SUBMODULE
3184GIT_ARCHIVE_EXTRA_FILES += \
3185 --prefix=$(GIT_TARNAME)/sha1collisiondetection/ \
3186 --add-file=sha1collisiondetection/LICENSE.txt \
3187 --prefix=$(GIT_TARNAME)/sha1collisiondetection/lib/ \
3188 --add-file=sha1collisiondetection/lib/sha1.c \
3189 --add-file=sha1collisiondetection/lib/sha1.h \
3190 --add-file=sha1collisiondetection/lib/ubc_check.c \
3191 --add-file=sha1collisiondetection/lib/ubc_check.h
3192endif
Dennis Kaarsemakeref642ff2016-04-27 19:54:35 +02003193dist: git-archive$(X) configure
Ramsay Jonesc5312032020-12-08 22:36:33 +00003194 @$(RM) -r .dist-tmp-dir
3195 @mkdir .dist-tmp-dir
3196 @echo $(GIT_VERSION) > .dist-tmp-dir/version
3197 @$(MAKE) -C git-gui TARDIR=../.dist-tmp-dir/git-gui dist-version
René Scharfedf368fa2020-09-19 23:23:50 +02003198 ./git-archive --format=tar \
3199 $(GIT_ARCHIVE_EXTRA_FILES) \
3200 --prefix=$(GIT_TARNAME)/ HEAD^{tree} > $(GIT_TARNAME).tar
Ramsay Jonesc5312032020-12-08 22:36:33 +00003201 @$(RM) -r .dist-tmp-dir
Eric W. Biederman9dce3c02005-07-14 19:20:50 -06003202 gzip -f -9 $(GIT_TARNAME).tar
Chris Wrighta9db2972005-07-07 13:09:50 -07003203
Junio C Hamanoab214332016-04-04 23:42:41 -07003204rpm::
3205 @echo >&2 "Use distro packaged sources to run rpmbuild"
3206 @false
3207.PHONY: rpm
Chris Wrighta9db2972005-07-07 13:09:50 -07003208
Johannes Schindelin46689312019-10-04 08:09:36 -07003209ifneq ($(INCLUDE_DLLS_IN_ARTIFACTS),)
3210OTHER_PROGRAMS += $(shell echo *.dll t/helper/*.dll)
3211endif
3212
Johannes Schindelin179227d2020-09-21 22:28:16 +00003213artifacts-tar:: $(ALL_COMMANDS_TO_INSTALL) $(SCRIPT_LIB) $(OTHER_PROGRAMS) \
Johannes Schindelinb819f1d2019-01-29 06:19:38 -08003214 GIT-BUILD-OPTIONS $(TEST_PROGRAMS) $(test_bindir_programs) \
Johannes Schindelin0b64e212019-04-18 06:16:39 -07003215 $(MOFILES)
Johannes Schindelinb819f1d2019-01-29 06:19:38 -08003216 $(QUIET_SUBDIR0)templates $(QUIET_SUBDIR1) \
3217 SHELL_PATH='$(SHELL_PATH_SQ)' PERL_PATH='$(PERL_PATH_SQ)'
3218 test -n "$(ARTIFACTS_DIRECTORY)"
3219 mkdir -p "$(ARTIFACTS_DIRECTORY)"
3220 $(TAR) czf "$(ARTIFACTS_DIRECTORY)/artifacts.tar.gz" $^ templates/blt/
3221.PHONY: artifacts-tar
3222
Tilman Sauerbeck52db0492006-05-18 12:57:04 +02003223htmldocs = git-htmldocs-$(GIT_VERSION)
3224manpages = git-manpages-$(GIT_VERSION)
Elia Pintoe6be2652015-12-15 15:21:00 +00003225.PHONY: dist-doc distclean
René Scharfe93e70312020-10-10 18:45:18 +02003226dist-doc: git$X
Emil Medve4cb08df2007-07-14 12:51:44 -05003227 $(RM) -r .doc-tmp-dir
Tilman Sauerbeck52db0492006-05-18 12:57:04 +02003228 mkdir .doc-tmp-dir
3229 $(MAKE) -C Documentation WEBDOC_DEST=../.doc-tmp-dir install-webdoc
René Scharfe93e70312020-10-10 18:45:18 +02003230 ./git -C .doc-tmp-dir init
3231 ./git -C .doc-tmp-dir add .
3232 ./git -C .doc-tmp-dir commit -m htmldocs
3233 ./git -C .doc-tmp-dir archive --format=tar --prefix=./ HEAD^{tree} \
3234 > $(htmldocs).tar
Tilman Sauerbeck52db0492006-05-18 12:57:04 +02003235 gzip -n -9 -f $(htmldocs).tar
3236 :
Emil Medve4cb08df2007-07-14 12:51:44 -05003237 $(RM) -r .doc-tmp-dir
Junio C Hamano4392da42007-04-19 20:47:04 -07003238 mkdir -p .doc-tmp-dir/man1 .doc-tmp-dir/man5 .doc-tmp-dir/man7
Martin Waitzc5360322006-05-25 14:37:46 +02003239 $(MAKE) -C Documentation DESTDIR=./ \
Jakub Narebski7b8cf0c2006-06-29 23:26:54 +02003240 man1dir=../.doc-tmp-dir/man1 \
Junio C Hamano4392da42007-04-19 20:47:04 -07003241 man5dir=../.doc-tmp-dir/man5 \
Jakub Narebski7b8cf0c2006-06-29 23:26:54 +02003242 man7dir=../.doc-tmp-dir/man7 \
Tilman Sauerbeck52db0492006-05-18 12:57:04 +02003243 install
René Scharfe93e70312020-10-10 18:45:18 +02003244 ./git -C .doc-tmp-dir init
3245 ./git -C .doc-tmp-dir add .
3246 ./git -C .doc-tmp-dir commit -m manpages
3247 ./git -C .doc-tmp-dir archive --format=tar --prefix=./ HEAD^{tree} \
3248 > $(manpages).tar
Tilman Sauerbeck52db0492006-05-18 12:57:04 +02003249 gzip -n -9 -f $(manpages).tar
Emil Medve4cb08df2007-07-14 12:51:44 -05003250 $(RM) -r .doc-tmp-dir
Tilman Sauerbeck52db0492006-05-18 12:57:04 +02003251
Petr Baudis28818ff2005-07-29 17:50:24 +02003252### Cleaning rules
Eric W. Biederman87a81c82005-07-14 19:21:57 -06003253
Mathias Megyei922aa802007-10-04 23:49:19 +02003254distclean: clean
3255 $(RM) configure
Stefano Lattarinidc7ace52012-07-19 09:50:01 +02003256 $(RM) config.log config.status config.cache
3257 $(RM) config.mak.autogen config.mak.append
3258 $(RM) -r autom4te.cache
Mathias Megyei922aa802007-10-04 23:49:19 +02003259
Theodore Ts'of2d713f2012-02-06 01:00:17 -05003260profile-clean:
3261 $(RM) $(addsuffix *.gcda,$(addprefix $(PROFILE_DIR)/, $(object_dirs)))
3262 $(RM) $(addsuffix *.gcno,$(addprefix $(PROFILE_DIR)/, $(object_dirs)))
3263
SZEDER Gábor1a966382018-07-23 15:51:00 +02003264cocciclean:
3265 $(RM) contrib/coccinelle/*.cocci.patch*
3266
3267clean: profile-clean coverage-clean cocciclean
Junio C Hamano7897d842016-04-15 10:06:52 -07003268 $(RM) *.res
3269 $(RM) $(OBJECTS)
Han-Wen Nienhuysef8a6c62021-10-07 20:25:00 +00003270 $(RM) $(LIB_FILE) $(XDIFF_LIB) $(REFTABLE_LIB) $(REFTABLE_TEST_LIB)
Jonathan Nieder46bac902010-01-31 11:46:53 -08003271 $(RM) $(ALL_PROGRAMS) $(SCRIPT_LIB) $(BUILT_INS) git$X
Johannes Schindelin0b64e212019-04-18 06:16:39 -07003272 $(RM) $(TEST_PROGRAMS)
Josh Steadmon5e472152018-10-12 17:58:40 -07003273 $(RM) $(FUZZ_PROGRAMS)
Denton Liub503a2d2019-09-25 01:21:01 -07003274 $(RM) $(HCC)
Philippe Blain3821c382020-09-03 22:13:38 +00003275 $(RM) -r bin-wrappers $(dep_dirs) $(compdb_dir) compile_commands.json
Ævar Arnfjörð Bjarmason5e9637c2011-11-18 00:14:42 +01003276 $(RM) -r po/build/
Junio C Hamanof3719842019-12-13 15:15:34 -08003277 $(RM) *.pyc *.pyo */*.pyc */*.pyo $(GENERATED_H) $(ETAGS_TARGET) tags cscope*
Ramsay Jonesc5312032020-12-08 22:36:33 +00003278 $(RM) -r .dist-tmp-dir .doc-tmp-dir
Ramsay Jones98836a82020-12-08 22:35:27 +00003279 $(RM) $(GIT_TARNAME).tar.gz
Emil Medve4cb08df2007-07-14 12:51:44 -05003280 $(RM) $(htmldocs).tar.gz $(manpages).tar.gz
Thomas Glanzmannca67f002005-05-22 20:27:28 +02003281 $(MAKE) -C Documentation/ clean
Johannes Schindelinfaa7a092019-04-18 06:16:44 -07003282 $(RM) Documentation/GIT-EXCLUDED-PROGRAMS
Jeff King499c2932009-04-03 15:32:20 -04003283ifndef NO_PERL
Ramsay Jonese5bd0a12010-05-08 18:36:15 +01003284 $(MAKE) -C gitweb clean
Ævar Arnfjörð Bjarmason20d2a302017-12-10 21:13:33 +00003285 $(RM) -r perl/build/
Jeff King499c2932009-04-03 15:32:20 -04003286endif
Petr Baudisb1edc532006-06-24 04:34:29 +02003287 $(MAKE) -C templates/ clean
Junio C Hamano4b7581f2005-08-02 17:24:11 -07003288 $(MAKE) -C t/ clean
Eygene Ryabinkin3cfaf112007-03-28 04:00:23 -07003289ifndef NO_TCLTK
Junio C Hamano62ba5142007-11-17 10:51:16 -08003290 $(MAKE) -C gitk-git clean
Eygene Ryabinkin3cfaf112007-03-28 04:00:23 -07003291 $(MAKE) -C git-gui clean
3292endif
Christian Couder8f26aa42012-12-18 16:26:37 +01003293 $(RM) GIT-VERSION-FILE GIT-CFLAGS GIT-LDFLAGS GIT-BUILD-OPTIONS
Jonathan Nieder07981dc2013-11-18 14:23:11 -08003294 $(RM) GIT-USER-AGENT GIT-PREFIX
Dan Jacquesf6a0ad42018-04-10 11:05:42 -04003295 $(RM) GIT-SCRIPT-DEFINES GIT-PERL-DEFINES GIT-PERL-HEADER GIT-PYTHON-VARS
Jeff Hostetlerdce7d292019-06-25 07:49:39 -07003296ifdef MSVC
3297 $(RM) $(patsubst %.o,%.o.pdb,$(OBJECTS))
3298 $(RM) $(patsubst %.exe,%.pdb,$(OTHER_PROGRAMS))
3299 $(RM) $(patsubst %.exe,%.iobj,$(OTHER_PROGRAMS))
3300 $(RM) $(patsubst %.exe,%.ipdb,$(OTHER_PROGRAMS))
3301 $(RM) $(patsubst %.exe,%.pdb,$(PROGRAMS))
3302 $(RM) $(patsubst %.exe,%.iobj,$(PROGRAMS))
3303 $(RM) $(patsubst %.exe,%.ipdb,$(PROGRAMS))
3304 $(RM) $(patsubst %.exe,%.pdb,$(TEST_PROGRAMS))
3305 $(RM) $(patsubst %.exe,%.iobj,$(TEST_PROGRAMS))
3306 $(RM) $(patsubst %.exe,%.ipdb,$(TEST_PROGRAMS))
3307 $(RM) compat/vcbuild/MSVC-DEFS-GEN
3308endif
Junio C Hamano9b88fce2005-12-27 14:40:17 -08003309
SZEDER Gábor1a966382018-07-23 15:51:00 +02003310.PHONY: all install profile-clean cocciclean clean strip
Brandon Casey6dc46272008-08-07 14:06:26 -05003311.PHONY: shell_compatibility_test please_set_SHELL_PATH_to_a_more_modern_shell
Junio C Hamano2f769192010-09-28 16:08:38 -05003312.PHONY: FORCE cscope
Junio C Hamanod89056c2005-12-19 17:59:58 -08003313
Junio C Hamano8c989ec2006-04-13 00:17:19 -07003314### Check documentation
3315#
Johannes Schindelin179227d2020-09-21 22:28:16 +00003316ALL_COMMANDS = $(ALL_COMMANDS_TO_INSTALL) $(SCRIPT_LIB)
Jeff Kingcf6aaff2012-08-08 16:56:04 -04003317ALL_COMMANDS += git
Denton Liu805d9ea2020-03-21 05:21:20 -04003318ALL_COMMANDS += git-citool
3319ALL_COMMANDS += git-gui
Jeff Kingcf6aaff2012-08-08 16:56:04 -04003320ALL_COMMANDS += gitk
3321ALL_COMMANDS += gitweb
Elia Pintoe6be2652015-12-15 15:21:00 +00003322
3323.PHONY: check-docs
Junio C Hamano8c989ec2006-04-13 00:17:19 -07003324check-docs::
Junio C Hamanoab814112016-05-04 14:34:23 -07003325 $(MAKE) -C Documentation lint-docs
Johannes Schindelin5ee42462019-03-25 14:41:39 -07003326 @(for v in $(patsubst %$X,%,$(ALL_COMMANDS)); \
Junio C Hamano8c989ec2006-04-13 00:17:19 -07003327 do \
3328 case "$$v" in \
Junio C Hamano8c989ec2006-04-13 00:17:19 -07003329 git-merge-octopus | git-merge-ours | git-merge-recursive | \
Miklos Vajna51add762008-07-05 16:43:51 +02003330 git-merge-resolve | git-merge-subtree | \
Junio C Hamano5c66d0d2008-01-17 22:52:40 -08003331 git-fsck-objects | git-init-db | \
Johannes Schindelin31cf4a62019-04-18 06:16:46 -07003332 git-remote-* | git-stage | git-legacy-* | \
Junio C Hamano5b4617c2007-12-14 22:02:57 -08003333 git-?*--?* ) continue ;; \
Junio C Hamano8c989ec2006-04-13 00:17:19 -07003334 esac ; \
3335 test -f "Documentation/$$v.txt" || \
3336 echo "no doc: $$v"; \
Eric Sunshine11c66592015-05-21 19:39:18 +02003337 sed -e '1,/^### command list/d' -e '/^#/d' command-list.txt | \
Junio C Hamano4b02c522007-02-13 22:45:22 -08003338 grep -q "^$$v[ ]" || \
Junio C Hamano8c989ec2006-04-13 00:17:19 -07003339 case "$$v" in \
3340 git) ;; \
3341 *) echo "no link: $$v";; \
3342 esac ; \
Junio C Hamano3f7ce642007-11-08 18:38:27 -08003343 done; \
3344 ( \
Eric Sunshine11c66592015-05-21 19:39:18 +02003345 sed -e '1,/^### command list/d' \
3346 -e '/^#/d' \
Johannes Schindelin8e6d6952019-03-25 14:41:38 -07003347 -e '/guide$$/d' \
Junio C Hamano3f7ce642007-11-08 18:38:27 -08003348 -e 's/[ ].*//' \
Junio C Hamano79d30662007-12-01 23:39:19 -08003349 -e 's/^/listed /' command-list.txt; \
Jeff King5fafce02012-08-08 16:57:52 -04003350 $(MAKE) -C Documentation print-man1 | \
3351 grep '\.txt$$' | \
Johannes Schindelin057ccba2019-03-25 14:41:37 -07003352 sed -e 's|^|documented |' \
Junio C Hamano3f7ce642007-11-08 18:38:27 -08003353 -e 's/\.txt//'; \
3354 ) | while read how cmd; \
3355 do \
Johannes Schindelin179227d2020-09-21 22:28:16 +00003356 case " $(patsubst %$X,%,$(ALL_COMMANDS) $(BUILT_INS) $(EXCLUDED_PROGRAMS)) " in \
Junio C Hamano3f7ce642007-11-08 18:38:27 -08003357 *" $$cmd "*) ;; \
3358 *) echo "removed but $$how: $$cmd" ;; \
3359 esac; \
3360 done ) | sort
Junio C Hamanoc74390e2006-11-05 11:26:21 -08003361
3362### Make sure built-ins do not have dups and listed in git.c
3363#
3364check-builtins::
3365 ./check-builtins.sh
Junio C Hamano11c57e62008-01-14 15:10:38 -08003366
Thomas Rast901c3692009-02-19 12:13:35 +01003367### Test suite coverage testing
3368#
Thomas Rast0c38a952013-05-13 23:27:25 +02003369.PHONY: coverage coverage-clean coverage-compile coverage-test coverage-report
Elia Pintoe6be2652015-12-15 15:21:00 +00003370.PHONY: coverage-untested-functions cover_db cover_db_html
Thomas Rastdcbe7f12013-05-13 23:27:26 +02003371.PHONY: coverage-clean-results
Thomas Rast901c3692009-02-19 12:13:35 +01003372
3373coverage:
Thomas Rast0c38a952013-05-13 23:27:25 +02003374 $(MAKE) coverage-test
Thomas Rast5ce43672013-05-13 23:27:28 +02003375 $(MAKE) coverage-untested-functions
Thomas Rast901c3692009-02-19 12:13:35 +01003376
Ævar Arnfjörð Bjarmasonbc548ef2010-07-25 19:52:40 +00003377object_dirs := $(sort $(dir $(OBJECTS)))
Thomas Rastdcbe7f12013-05-13 23:27:26 +02003378coverage-clean-results:
Ævar Arnfjörð Bjarmasonbc548ef2010-07-25 19:52:40 +00003379 $(RM) $(addsuffix *.gcov,$(object_dirs))
3380 $(RM) $(addsuffix *.gcda,$(object_dirs))
Ævar Arnfjörð Bjarmasonbc548ef2010-07-25 19:52:40 +00003381 $(RM) coverage-untested-functions
Ævar Arnfjörð Bjarmason7432bd52010-07-25 19:52:42 +00003382 $(RM) -r cover_db/
Ævar Arnfjörð Bjarmasondf07acf2010-07-25 19:52:43 +00003383 $(RM) -r cover_db_html/
Thomas Rast901c3692009-02-19 12:13:35 +01003384
Thomas Rastdcbe7f12013-05-13 23:27:26 +02003385coverage-clean: coverage-clean-results
3386 $(RM) $(addsuffix *.gcno,$(object_dirs))
3387
Thomas Rast901c3692009-02-19 12:13:35 +01003388COVERAGE_CFLAGS = $(CFLAGS) -O0 -ftest-coverage -fprofile-arcs
3389COVERAGE_LDFLAGS = $(CFLAGS) -O0 -lgcov
Ævar Arnfjörð Bjarmasonbc548ef2010-07-25 19:52:40 +00003390GCOVFLAGS = --preserve-paths --branch-probabilities --all-blocks
Thomas Rast901c3692009-02-19 12:13:35 +01003391
Thomas Rast0c38a952013-05-13 23:27:25 +02003392coverage-compile:
Thomas Rast901c3692009-02-19 12:13:35 +01003393 $(MAKE) CFLAGS="$(COVERAGE_CFLAGS)" LDFLAGS="$(COVERAGE_LDFLAGS)" all
Thomas Rast0c38a952013-05-13 23:27:25 +02003394
3395coverage-test: coverage-clean-results coverage-compile
Thomas Rast901c3692009-02-19 12:13:35 +01003396 $(MAKE) CFLAGS="$(COVERAGE_CFLAGS)" LDFLAGS="$(COVERAGE_LDFLAGS)" \
Thomas Rastc14cc772013-05-13 23:27:27 +02003397 DEFAULT_TEST_TARGET=test -j1 test
Thomas Rast901c3692009-02-19 12:13:35 +01003398
Derrick Stolee22991202019-01-29 09:05:18 -08003399coverage-prove: coverage-clean-results coverage-compile
3400 $(MAKE) CFLAGS="$(COVERAGE_CFLAGS)" LDFLAGS="$(COVERAGE_LDFLAGS)" \
3401 DEFAULT_TEST_TARGET=prove GIT_PROVE_OPTS="$(GIT_PROVE_OPTS) -j1" \
3402 -j1 test
3403
Thomas Rast901c3692009-02-19 12:13:35 +01003404coverage-report:
Ævar Arnfjörð Bjarmasonbc548ef2010-07-25 19:52:40 +00003405 $(QUIET_GCOV)for dir in $(object_dirs); do \
Thomas Raste146d172010-07-26 09:43:41 +02003406 $(GCOV) $(GCOVFLAGS) --object-directory=$$dir $$dir*.c || exit; \
Ævar Arnfjörð Bjarmasonbc548ef2010-07-25 19:52:40 +00003407 done
Ævar Arnfjörð Bjarmasonb5eed982010-07-25 19:52:41 +00003408
3409coverage-untested-functions: coverage-report
Thomas Rast901c3692009-02-19 12:13:35 +01003410 grep '^function.*called 0 ' *.c.gcov \
3411 | sed -e 's/\([^:]*\)\.gcov: *function \([^ ]*\) called.*/\1: \2/' \
Ævar Arnfjörð Bjarmasonbc548ef2010-07-25 19:52:40 +00003412 > coverage-untested-functions
Ævar Arnfjörð Bjarmason7432bd52010-07-25 19:52:42 +00003413
3414cover_db: coverage-report
3415 gcov2perl -db cover_db *.gcov
Ævar Arnfjörð Bjarmasondf07acf2010-07-25 19:52:43 +00003416
3417cover_db_html: cover_db
3418 cover -report html -outputdir cover_db_html cover_db
Andi Kleen7ddc2712011-06-18 18:07:05 -07003419
Josh Steadmon5e472152018-10-12 17:58:40 -07003420
3421### Fuzz testing
3422#
3423# Building fuzz targets generally requires a special set of compiler flags that
3424# are not necessarily appropriate for general builds, and that vary greatly
3425# depending on the compiler version used.
3426#
Andrzej Hunt68b5c3a2021-03-08 17:14:42 +00003427# An example command to build against libFuzzer from LLVM 11.0.0:
Josh Steadmon5e472152018-10-12 17:58:40 -07003428#
3429# make CC=clang CXX=clang++ \
Andrzej Hunt68b5c3a2021-03-08 17:14:42 +00003430# CFLAGS="-fsanitize=fuzzer-no-link,address" \
3431# LIB_FUZZING_ENGINE="-fsanitize=fuzzer" \
Josh Steadmon5e472152018-10-12 17:58:40 -07003432# fuzz-all
3433#
Josh Steadmon927c77e2018-11-14 11:41:47 -08003434FUZZ_CXXFLAGS ?= $(CFLAGS)
3435
Josh Steadmon5e472152018-10-12 17:58:40 -07003436.PHONY: fuzz-all
3437
3438$(FUZZ_PROGRAMS): all
Josh Steadmon927c77e2018-11-14 11:41:47 -08003439 $(QUIET_LINK)$(CXX) $(FUZZ_CXXFLAGS) $(LIB_OBJS) $(BUILTIN_OBJS) \
Josh Steadmon5e472152018-10-12 17:58:40 -07003440 $(XDIFF_OBJS) $(EXTLIBS) git.o $@.o $(LIB_FUZZING_ENGINE) -o $@
3441
3442fuzz-all: $(FUZZ_PROGRAMS)