Junio C Hamano | 2731d04 | 2005-12-01 12:26:41 -0800 | [diff] [blame] | 1 | # The default target of this Makefile is... |
Junio C Hamano | 6fc301b | 2007-01-10 12:24:54 -0800 | [diff] [blame] | 2 | all:: |
Junio C Hamano | 2731d04 | 2005-12-01 12:26:41 -0800 | [diff] [blame] | 3 | |
Shawn O. Pearce | 2314c94 | 2007-03-06 02:09:14 -0500 | [diff] [blame] | 4 | # Define V=1 to have a more verbose compile. |
Shawn O. Pearce | 74f2b2a | 2007-03-06 01:35:01 -0500 | [diff] [blame] | 5 | # |
Junio C Hamano | 0e0aea5 | 2009-06-05 18:36:15 -0500 | [diff] [blame] | 6 | # 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. Vaughan | e88a135 | 2010-05-14 09:31:42 +0000 | [diff] [blame] | 11 | # 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. Vaughan | f9f33cd | 2010-05-14 09:31:43 +0000 | [diff] [blame] | 14 | # 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 Rodrigues | 3b2c541 | 2014-09-13 11:20:22 -0300 | [diff] [blame] | 17 | # Define SNPRINTF_RETURNS_BOGUS if you are on a system which snprintf() |
Michal Rokos | c4582f9 | 2008-03-05 16:46:13 +0100 | [diff] [blame] | 18 | # 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 Rodrigues | 3b2c541 | 2014-09-13 11:20:22 -0300 | [diff] [blame] | 21 | # Define FREAD_READS_DIRECTORIES if you are on a system which succeeds |
Jeff King | 3adf9fd | 2017-06-14 01:30:18 -0400 | [diff] [blame] | 22 | # when attempting to read from an fopen'ed directory (or even to fopen |
| 23 | # it at all). |
Brandon Casey | cba2252 | 2008-02-08 20:32:47 -0600 | [diff] [blame] | 24 | # |
Linus Torvalds | 765ac8e | 2006-02-28 15:07:20 -0800 | [diff] [blame] | 25 | # Define NO_OPENSSL environment variable if you do not have OpenSSL. |
Petr Baudis | 5bdac8b | 2005-07-29 17:48:26 +0200 | [diff] [blame] | 26 | # |
Ævar Arnfjörð Bjarmason | 072473e | 2017-05-20 21:42:04 +0000 | [diff] [blame] | 27 | # Define USE_LIBPCRE if you have and want to use libpcre. Various |
| 28 | # commands such as log and grep offer runtime options to use |
| 29 | # Perl-compatible regular expressions instead of standard or extended |
| 30 | # POSIX regular expressions. |
Michał Kiedrowicz | 63e7e9d | 2011-05-09 23:52:05 +0200 | [diff] [blame] | 31 | # |
Ævar Arnfjörð Bjarmason | 94da919 | 2017-06-01 18:20:56 +0000 | [diff] [blame] | 32 | # Currently USE_LIBPCRE is a synonym for USE_LIBPCRE1, define |
| 33 | # USE_LIBPCRE2 instead if you'd like to use version 2 of the PCRE |
| 34 | # library. The USE_LIBPCRE flag will likely be changed to mean v2 by |
| 35 | # default in future releases. |
| 36 | # |
Ævar Arnfjörð Bjarmason | fb95e2e | 2017-06-01 18:20:55 +0000 | [diff] [blame] | 37 | # When using USE_LIBPCRE1, define NO_LIBPCRE1_JIT if the PCRE v1 |
| 38 | # library is compiled without --enable-jit. We will auto-detect |
| 39 | # whether the version of the PCRE v1 library in use has JIT support at |
| 40 | # all, but we unfortunately can't auto-detect whether JIT support |
| 41 | # hasn't been compiled in in an otherwise JIT-supporting version. If |
| 42 | # you have link-time errors about a missing `pcre_jit_exec` define |
| 43 | # this, or recompile PCRE v1 with --enable-jit. |
| 44 | # |
Ævar Arnfjörð Bjarmason | 94da919 | 2017-06-01 18:20:56 +0000 | [diff] [blame] | 45 | # Define LIBPCREDIR=/foo/bar if your PCRE header and library files are |
| 46 | # in /foo/bar/include and /foo/bar/lib directories. Which version of |
| 47 | # PCRE this points to determined by the USE_LIBPCRE1 and USE_LIBPCRE2 |
| 48 | # variables. |
Michał Kiedrowicz | 63e7e9d | 2011-05-09 23:52:05 +0200 | [diff] [blame] | 49 | # |
Kirill Smelkov | 61f76a3 | 2014-03-27 18:22:50 +0400 | [diff] [blame] | 50 | # Define HAVE_ALLOCA_H if you have working alloca(3) defined in that header. |
| 51 | # |
Tay Ray Chuan | d24d905 | 2011-08-03 20:07:57 +0800 | [diff] [blame] | 52 | # Define NO_CURL if you do not have libcurl installed. git-http-fetch and |
Nick Hengeveld | 58e60dd | 2005-11-02 11:19:24 -0800 | [diff] [blame] | 53 | # git-http-push are not built, and you cannot use http:// and https:// |
Tay Ray Chuan | d24d905 | 2011-08-03 20:07:57 +0800 | [diff] [blame] | 54 | # transports (neither smart nor dumb). |
Johannes Schindelin | b2c0bd6 | 2005-07-31 02:14:23 +0200 | [diff] [blame] | 55 | # |
Patrick Mauritz | 6d9bbc5 | 2005-09-19 16:11:19 +0200 | [diff] [blame] | 56 | # Define CURLDIR=/foo/bar if your curl header and library files are in |
Junio C Hamano | b2feb64 | 2014-04-30 10:58:10 -0700 | [diff] [blame] | 57 | # /foo/bar/include and /foo/bar/lib directories. |
Patrick Mauritz | 6d9bbc5 | 2005-09-19 16:11:19 +0200 | [diff] [blame] | 58 | # |
Remi Pommarel | f891587 | 2015-10-21 19:10:46 +0200 | [diff] [blame] | 59 | # Define CURL_CONFIG to curl's configuration program that prints information |
| 60 | # about the library (e.g., its version number). The default is 'curl-config'. |
| 61 | # |
Nick Hengeveld | 58e60dd | 2005-11-02 11:19:24 -0800 | [diff] [blame] | 62 | # Define NO_EXPAT if you do not have expat installed. git-http-push is |
Tay Ray Chuan | d24d905 | 2011-08-03 20:07:57 +0800 | [diff] [blame] | 63 | # not built, and you cannot push using http:// and https:// transports (dumb). |
Nick Hengeveld | 58e60dd | 2005-11-02 11:19:24 -0800 | [diff] [blame] | 64 | # |
Serge van den Boom | 85b4518 | 2009-01-28 21:43:57 +0100 | [diff] [blame] | 65 | # Define EXPATDIR=/foo/bar if your expat header and library files are in |
| 66 | # /foo/bar/include and /foo/bar/lib directories. |
| 67 | # |
Matt Kraai | 081fd8d | 2013-02-11 14:03:45 -0800 | [diff] [blame] | 68 | # Define EXPAT_NEEDS_XMLPARSE_H if you have an old version of expat (e.g., |
| 69 | # 1.1 or 1.2) that provides xmlparse.h instead of expat.h. |
| 70 | # |
Ævar Arnfjörð Bjarmason | 5e9637c | 2011-11-18 00:14:42 +0100 | [diff] [blame] | 71 | # Define NO_GETTEXT if you don't want Git output to be translated. |
| 72 | # A translated Git requires GNU libintl or another gettext implementation, |
| 73 | # plus libintl-perl at runtime. |
| 74 | # |
Alex Riesen | ad17ea7 | 2012-01-23 14:04:29 -0800 | [diff] [blame] | 75 | # Define USE_GETTEXT_SCHEME and set it to 'fallthrough', if you don't trust |
| 76 | # the installed gettext translation of the shell scripts output. |
| 77 | # |
Ævar Arnfjörð Bjarmason | 5e9637c | 2011-11-18 00:14:42 +0100 | [diff] [blame] | 78 | # Define HAVE_LIBCHARSET_H if you haven't set NO_GETTEXT and you can't |
| 79 | # trust the langinfo.h's nl_langinfo(CODESET) function to return the |
| 80 | # current character set. GNU and Solaris have a nl_langinfo(CODESET), |
| 81 | # FreeBSD can use either, but MinGW and some others need to use |
| 82 | # libcharset.h's locale_charset() instead. |
| 83 | # |
Дилян Палаузов | 3064b13 | 2014-03-11 23:37:33 +0100 | [diff] [blame] | 84 | # Define CHARSET_LIB to the library you need to link with in order to |
Дилян Палаузов | b522528 | 2012-02-12 17:23:36 +0100 | [diff] [blame] | 85 | # use locale_charset() function. On some platforms this needs to set to |
Дилян Палаузов | 3064b13 | 2014-03-11 23:37:33 +0100 | [diff] [blame] | 86 | # -lcharset, on others to -liconv . |
Дилян Палаузов | b522528 | 2012-02-12 17:23:36 +0100 | [diff] [blame] | 87 | # |
Ævar Arnfjörð Bjarmason | 5e9637c | 2011-11-18 00:14:42 +0100 | [diff] [blame] | 88 | # Define LIBC_CONTAINS_LIBINTL if your gettext implementation doesn't |
| 89 | # need -lintl when linking. |
| 90 | # |
| 91 | # Define NO_MSGFMT_EXTENDED_OPTIONS if your implementation of msgfmt |
| 92 | # doesn't support GNU extensions like --check and --statistics |
| 93 | # |
Chris Webb | cb6a22c | 2010-04-13 10:07:13 +0100 | [diff] [blame] | 94 | # Define HAVE_PATHS_H if you have paths.h and want to use the default PATH |
| 95 | # it specifies. |
| 96 | # |
Junio C Hamano | 63be37b | 2006-01-19 17:13:57 -0800 | [diff] [blame] | 97 | # Define NO_D_TYPE_IN_DIRENT if your platform defines DT_UNKNOWN but lacks |
Eric Blake | a50dec2 | 2010-04-01 16:43:54 -0600 | [diff] [blame] | 98 | # d_type in struct dirent (Cygwin 1.5, fixed in Cygwin 1.7). |
Junio C Hamano | 63be37b | 2006-01-19 17:13:57 -0800 | [diff] [blame] | 99 | # |
David Michael | b3e103d | 2012-12-14 14:57:01 -0500 | [diff] [blame] | 100 | # Define HAVE_STRINGS_H if you have strings.h and need it for strcasecmp. |
| 101 | # |
Linus Torvalds | ef34af2 | 2005-09-18 18:30:50 -0700 | [diff] [blame] | 102 | # Define NO_STRCASESTR if you don't have strcasestr. |
| 103 | # |
René Scharfe | b21b9f1 | 2007-09-07 00:32:54 +0200 | [diff] [blame] | 104 | # Define NO_MEMMEM if you don't have memmem. |
| 105 | # |
Matt Kraai | 40036be | 2012-12-18 14:03:55 -0800 | [diff] [blame] | 106 | # Define NO_GETPAGESIZE if you don't have getpagesize. |
| 107 | # |
Peter Eriksen | 817151e | 2006-06-24 16:01:25 +0200 | [diff] [blame] | 108 | # Define NO_STRLCPY if you don't have strlcpy. |
| 109 | # |
Nick Alcock | e3eed7f | 2011-11-02 15:46:22 +0000 | [diff] [blame] | 110 | # Define NO_STRTOUMAX if you don't have both strtoimax and strtoumax in the |
| 111 | # C library. If your compiler also does not support long long or does not have |
Jason Riedy | bc6b4f5 | 2007-02-19 16:22:56 -0800 | [diff] [blame] | 112 | # strtoull, define NO_STRTOULL. |
| 113 | # |
Jason Riedy | e40b61f | 2005-12-02 15:08:28 -0800 | [diff] [blame] | 114 | # Define NO_SETENV if you don't have setenv in the C library. |
| 115 | # |
Jakub Narebski | bfa8fcc | 2008-01-18 02:03:51 +0100 | [diff] [blame] | 116 | # Define NO_UNSETENV if you don't have unsetenv in the C library. |
| 117 | # |
Shawn O. Pearce | ca5bb5d | 2007-10-20 16:03:49 -0400 | [diff] [blame] | 118 | # Define NO_MKDTEMP if you don't have mkdtemp in the C library. |
| 119 | # |
Joachim Schmitz | dc9f462 | 2012-09-08 19:01:31 +0200 | [diff] [blame] | 120 | # Define MKDIR_WO_TRAILING_SLASH if your mkdir() can't deal with trailing slash. |
| 121 | # |
Rafael Gieschke | 590e081 | 2011-05-19 13:37:55 +0200 | [diff] [blame] | 122 | # Define NO_GECOS_IN_PWENT if you don't have pw_gecos in struct passwd |
| 123 | # in the C library. |
| 124 | # |
David Aguilar | e1c0688 | 2009-05-31 01:35:51 -0700 | [diff] [blame] | 125 | # Define NO_LIBGEN_H if you don't have libgen.h. |
| 126 | # |
Brandon Casey | ecc395c | 2009-07-10 12:10:45 -0500 | [diff] [blame] | 127 | # Define NEEDS_LIBGEN if your libgen needs -lgen when linking |
| 128 | # |
Robert Schiele | 2600973 | 2008-01-24 19:34:46 +0100 | [diff] [blame] | 129 | # Define NO_SYS_SELECT_H if you don't have sys/select.h. |
| 130 | # |
Junio C Hamano | 9f0bb90 | 2006-05-02 00:40:24 -0700 | [diff] [blame] | 131 | # Define NO_SYMLINK_HEAD if you never want .git/HEAD to be a symbolic link. |
| 132 | # Enable it on Windows. By default, symrefs are still used. |
Pavel Roskin | 2fabd21 | 2005-11-15 00:59:50 -0500 | [diff] [blame] | 133 | # |
Pavel Roskin | 0285358 | 2006-07-09 02:44:58 -0700 | [diff] [blame] | 134 | # Define NO_SVN_TESTS if you want to skip time-consuming SVN interoperability |
Eric Wong | 60d02cc | 2006-07-06 00:14:16 -0700 | [diff] [blame] | 135 | # tests. These tests take up a significant amount of the total test time |
| 136 | # but are not needed unless you plan to talk to SVN repos. |
| 137 | # |
Shawn Pearce | 8eb38ca | 2006-07-24 00:28:28 -0400 | [diff] [blame] | 138 | # Define NO_FINK if you are building on Darwin/Mac OS X, have Fink |
| 139 | # installed in /sw, but don't want GIT to link against any libraries |
| 140 | # installed there. If defined you may specify your own (or Fink's) |
| 141 | # include directories and library directories by defining CFLAGS |
| 142 | # and LDFLAGS appropriately. |
| 143 | # |
| 144 | # Define NO_DARWIN_PORTS if you are building on Darwin/Mac OS X, |
| 145 | # have DarwinPorts installed in /opt/local, but don't want GIT to |
| 146 | # link against any libraries installed there. If defined you may |
| 147 | # specify your own (or DarwinPort's) include directories and |
| 148 | # library directories by defining CFLAGS and LDFLAGS appropriately. |
| 149 | # |
David Aguilar | 4dcd773 | 2013-05-19 06:23:34 -0400 | [diff] [blame] | 150 | # Define NO_APPLE_COMMON_CRYPTO if you are building on Darwin/Mac OS X |
| 151 | # and do not want to use Apple's CommonCrypto library. This allows you |
| 152 | # to provide your own OpenSSL library, for example from MacPorts. |
| 153 | # |
Jonathan Nieder | f200197 | 2012-07-23 01:29:14 -0500 | [diff] [blame] | 154 | # Define BLK_SHA1 environment variable to make use of the bundled |
| 155 | # optimized C SHA1 routine. |
Linus Torvalds | d7c208a | 2009-08-05 16:13:20 -0700 | [diff] [blame] | 156 | # |
Petr Baudis | 5bdac8b | 2005-07-29 17:48:26 +0200 | [diff] [blame] | 157 | # Define PPC_SHA1 environment variable when running make to make use of |
| 158 | # a bundled SHA1 routine optimized for PowerPC. |
Junio C Hamano | 597c9cc | 2005-09-07 12:22:56 -0700 | [diff] [blame] | 159 | # |
Jeff King | 8325e43 | 2017-03-16 18:09:12 -0400 | [diff] [blame] | 160 | # Define DC_SHA1 to unconditionally enable the collision-detecting sha1 |
| 161 | # algorithm. This is slower, but may detect attempted collision attacks. |
| 162 | # Takes priority over other *_SHA1 knobs. |
| 163 | # |
Takashi Iwai | 3964cbb | 2017-08-15 14:04:17 +0200 | [diff] [blame] | 164 | # Define DC_SHA1_EXTERNAL in addition to DC_SHA1 if you want to build / link |
| 165 | # git with the external SHA1 collision-detect library. |
| 166 | # Without this option, i.e. the default behavior is to build git with its |
| 167 | # own built-in code (or submodule). |
| 168 | # |
Ævar Arnfjörð Bjarmason | 86cfd61 | 2017-07-01 22:05:46 +0000 | [diff] [blame] | 169 | # Define DC_SHA1_SUBMODULE in addition to DC_SHA1 to use the |
| 170 | # sha1collisiondetection shipped as a submodule instead of the |
| 171 | # non-submodule copy in sha1dc/. This is an experimental option used |
| 172 | # by the git project to migrate to using sha1collisiondetection as a |
| 173 | # submodule. |
| 174 | # |
Junio C Hamano | e6b07da | 2017-03-17 10:00:15 -0700 | [diff] [blame] | 175 | # Define OPENSSL_SHA1 environment variable when running make to link |
| 176 | # with the SHA1 routine from openssl library. |
| 177 | # |
Atousa Pahlevan Duprat | 001fd7a | 2015-11-04 22:38:42 -0800 | [diff] [blame] | 178 | # Define SHA1_MAX_BLOCK_SIZE to limit the amount of data that will be hashed |
| 179 | # in one call to the platform's SHA1_Update(). e.g. APPLE_COMMON_CRYPTO |
| 180 | # wants 'SHA1_MAX_BLOCK_SIZE=1024L*1024L*1024L' defined. |
| 181 | # |
Brian Gernhardt | 0460dba | 2009-09-08 09:54:38 -0400 | [diff] [blame] | 182 | # Define NEEDS_CRYPTO_WITH_SSL if you need -lcrypto when using -lssl (Darwin). |
| 183 | # |
| 184 | # Define NEEDS_SSL_WITH_CRYPTO if you need -lssl when using -lcrypto (Darwin). |
Patrick Mauritz | f0ebff0 | 2005-09-06 01:24:03 +0200 | [diff] [blame] | 185 | # |
Junio C Hamano | b2feb64 | 2014-04-30 10:58:10 -0700 | [diff] [blame] | 186 | # Define NEEDS_SSL_WITH_CURL if you need -lssl with -lcurl (Minix). |
Thomas Cort | bc5f813 | 2011-07-19 18:55:47 -0400 | [diff] [blame] | 187 | # |
Junio C Hamano | b2feb64 | 2014-04-30 10:58:10 -0700 | [diff] [blame] | 188 | # Define NEEDS_IDN_WITH_CURL if you need -lidn when using -lcurl (Minix). |
Thomas Cort | bc5f813 | 2011-07-19 18:55:47 -0400 | [diff] [blame] | 189 | # |
Junio C Hamano | 597c9cc | 2005-09-07 12:22:56 -0700 | [diff] [blame] | 190 | # Define NEEDS_LIBICONV if linking with libc is not enough (Darwin). |
Patrick Mauritz | f0ebff0 | 2005-09-06 01:24:03 +0200 | [diff] [blame] | 191 | # |
Joachim Schmitz | 6c10990 | 2012-09-19 12:03:30 +0200 | [diff] [blame] | 192 | # Define NEEDS_LIBINTL_BEFORE_LIBICONV if you need libintl before libiconv. |
| 193 | # |
Justin Lebar | 0168990 | 2014-03-31 15:11:46 -0700 | [diff] [blame] | 194 | # Define NO_INTPTR_T if you don't have intptr_t or uintptr_t. |
Joachim Schmitz | 6c10990 | 2012-09-19 12:03:30 +0200 | [diff] [blame] | 195 | # |
| 196 | # Define NO_UINTMAX_T if you don't have uintmax_t. |
| 197 | # |
Patrick Mauritz | f0ebff0 | 2005-09-06 01:24:03 +0200 | [diff] [blame] | 198 | # Define NEEDS_SOCKET if linking with libc is not enough (SunOS, |
| 199 | # Patrick Mauritz). |
| 200 | # |
Brandon Casey | 70cf991 | 2009-06-05 18:36:10 -0500 | [diff] [blame] | 201 | # 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 Schindelin | 730d48a | 2005-10-08 15:54:36 -0700 | [diff] [blame] | 205 | # Define NO_MMAP if you want to avoid mmap. |
| 206 | # |
Michael Haggerty | 5b63361 | 2017-09-25 10:00:10 +0200 | [diff] [blame] | 207 | # Define MMAP_PREVENTS_DELETE if a file that is currently mmapped cannot be |
| 208 | # deleted or cannot be replaced using rename(). |
| 209 | # |
Joachim Schmitz | 6d45eb1 | 2012-09-17 23:16:39 +0200 | [diff] [blame] | 210 | # Define NO_SYS_POLL_H if you don't have sys/poll.h. |
| 211 | # |
| 212 | # Define NO_POLL if you do not have or don't want to use poll(). |
| 213 | # This also implies NO_SYS_POLL_H. |
| 214 | # |
Junio C Hamano | b2d05e0 | 2012-12-18 09:35:33 -0800 | [diff] [blame] | 215 | # Define NEEDS_SYS_PARAM_H if you need to include sys/param.h to compile, |
| 216 | # *PLEASE* REPORT to git@vger.kernel.org if your platform needs this; |
| 217 | # we want to know more about the issue. |
David Michael | 6ede720 | 2012-12-14 14:56:58 -0500 | [diff] [blame] | 218 | # |
Junio C Hamano | 46059cc | 2008-11-15 04:08:14 -0800 | [diff] [blame] | 219 | # Define NO_PTHREADS if you do not have or do not want to use Pthreads. |
| 220 | # |
Stefan-W. Hahn | 6900679 | 2007-01-09 22:04:12 +0100 | [diff] [blame] | 221 | # Define NO_PREAD if you have a problem with pread() system call (e.g. |
Eric Blake | a50dec2 | 2010-04-01 16:43:54 -0600 | [diff] [blame] | 222 | # cygwin1.dll before v1.5.22). |
Stefan-W. Hahn | 6900679 | 2007-01-09 22:04:12 +0100 | [diff] [blame] | 223 | # |
Joachim Schmitz | 7f9e848 | 2012-09-08 18:54:34 +0200 | [diff] [blame] | 224 | # Define NO_SETITIMER if you don't have setitimer() |
| 225 | # |
| 226 | # Define NO_STRUCT_ITIMERVAL if you don't have struct itimerval |
| 227 | # This also implies NO_SETITIMER |
| 228 | # |
Shawn O. Pearce | 1510fea | 2006-12-14 06:15:57 -0500 | [diff] [blame] | 229 | # Define NO_FAST_WORKING_DIRECTORY if accessing objects in pack files is |
| 230 | # generally faster on your platform than accessing the working directory. |
| 231 | # |
Shawn O. Pearce | c869753 | 2006-12-30 23:53:55 -0500 | [diff] [blame] | 232 | # Define NO_TRUSTABLE_FILEMODE if your filesystem may claim to support |
| 233 | # the executable mode bit, but doesn't really do so. |
| 234 | # |
David Michael | d543d9c | 2014-12-03 21:24:17 -0500 | [diff] [blame] | 235 | # Define NEEDS_MODE_TRANSLATION if your OS strays from the typical file type |
| 236 | # bits in mode values (e.g. z/OS defines I_SFMT to 0xFF000000 as opposed to the |
| 237 | # usual 0xF000). |
| 238 | # |
hpa | 49744d6 | 2005-09-28 16:52:21 -0700 | [diff] [blame] | 239 | # Define NO_IPV6 if you lack IPv6 support and getaddrinfo(). |
| 240 | # |
Johannes Sixt | 6320358 | 2011-12-12 22:12:56 +0100 | [diff] [blame] | 241 | # Define NO_UNIX_SOCKETS if your system does not offer unix sockets. |
| 242 | # |
Junio C Hamano | bdc37f5 | 2006-01-19 17:13:32 -0800 | [diff] [blame] | 243 | # Define NO_SOCKADDR_STORAGE if your platform does not have struct |
| 244 | # sockaddr_storage. |
| 245 | # |
Fernando J. Pereda | b6e56ec | 2006-02-16 09:38:01 +0100 | [diff] [blame] | 246 | # Define NO_ICONV if your libc does not properly support iconv. |
| 247 | # |
Ramsay Jones | fd547a9 | 2007-03-03 18:29:03 +0000 | [diff] [blame] | 248 | # Define OLD_ICONV if your library has an old iconv(), where the second |
| 249 | # (input buffer pointer) parameter is declared with type (const char **). |
| 250 | # |
David Symonds | 609a228 | 2007-11-07 14:24:28 +1100 | [diff] [blame] | 251 | # Define NO_DEFLATE_BOUND if your zlib does not have deflateBound. |
| 252 | # |
Matt Kraai | 2064887 | 2007-06-30 10:05:03 -0700 | [diff] [blame] | 253 | # Define NO_R_TO_GCC_LINKER if your gcc does not like "-R/path/lib" |
| 254 | # that tells runtime paths to dynamic libraries; |
| 255 | # "-Wl,-rpath=/path/lib" is used instead. |
Junio C Hamano | bbfc63d | 2006-12-27 14:17:35 -0800 | [diff] [blame] | 256 | # |
Junio C Hamano | 6520c84 | 2011-06-18 18:07:03 -0700 | [diff] [blame] | 257 | # Define NO_NORETURN if using buggy versions of gcc 4.6+ and profile feedback, |
| 258 | # as the compiler can crash (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49299) |
| 259 | # |
Petr Baudis | 5bdac8b | 2005-07-29 17:48:26 +0200 | [diff] [blame] | 260 | # Define USE_NSEC below if you want git to care about sub-second file mtimes |
Karsten Blees | b1ffafa | 2015-07-01 21:10:52 +0200 | [diff] [blame] | 261 | # and ctimes. Note that you need recent glibc (at least 2.2.4) for this. On |
| 262 | # Linux, kernel 2.6.11 or newer is required for reliable sub-second file times |
| 263 | # on file systems with exactly 1 ns or 1 s resolution. If you intend to use Git |
| 264 | # on other file systems (e.g. CEPH, CIFS, NTFS, UDF), don't enable USE_NSEC. See |
| 265 | # Documentation/technical/racy-git.txt for details. |
Junio C Hamano | f6af75d | 2006-06-23 17:57:48 -0700 | [diff] [blame] | 266 | # |
Brian Gernhardt | c567383 | 2009-03-08 16:04:28 -0400 | [diff] [blame] | 267 | # Define USE_ST_TIMESPEC if your "struct stat" uses "st_ctimespec" instead of |
| 268 | # "st_ctim" |
| 269 | # |
Kjetil Barvik | c06ff49 | 2009-03-04 18:47:40 +0100 | [diff] [blame] | 270 | # Define NO_NSEC if your "struct stat" does not have "st_ctim.tv_nsec" |
| 271 | # available. This automatically turns USE_NSEC off. |
| 272 | # |
Petr Baudis | 5bdac8b | 2005-07-29 17:48:26 +0200 | [diff] [blame] | 273 | # Define USE_STDEV below if you want git to care about the underlying device |
Johannes Schindelin | 10455d2 | 2007-11-30 11:35:23 +0000 | [diff] [blame] | 274 | # change being considered an inode change from the update-index perspective. |
Alex Riesen | f848718 | 2006-12-04 10:50:04 +0100 | [diff] [blame] | 275 | # |
Junio C Hamano | fdb2a2a | 2008-08-18 21:57:16 +0200 | [diff] [blame] | 276 | # Define NO_ST_BLOCKS_IN_STRUCT_STAT if your platform does not have st_blocks |
| 277 | # field that counts the on-disk footprint in 512-byte blocks. |
| 278 | # |
Jonathan Nieder | 162213d | 2009-10-09 05:15:29 -0500 | [diff] [blame] | 279 | # Define DOCBOOK_XSL_172 if you want to format man pages with DocBook XSL v1.72 |
| 280 | # (not v1.73 or v1.71). |
| 281 | # |
Jeff King | 79c461d | 2010-11-19 12:54:24 -0500 | [diff] [blame] | 282 | # Define ASCIIDOC_ROFF if your DocBook XSL does not escape raw roff directives |
| 283 | # (versions 1.68.1 through v1.72). |
Jonas Fonseca | 7f55cf4 | 2007-11-14 10:38:46 +0100 | [diff] [blame] | 284 | # |
Thomas Rast | 204d363 | 2009-10-22 10:19:06 +0200 | [diff] [blame] | 285 | # Define GNU_ROFF if your target system uses GNU groff. This forces |
| 286 | # apostrophes to be ASCII so that cut&pasting examples to the shell |
| 287 | # will work. |
| 288 | # |
brian m. carlson | ec3366e | 2017-01-22 02:41:56 +0000 | [diff] [blame] | 289 | # Define USE_ASCIIDOCTOR to use Asciidoctor instead of AsciiDoc to build the |
| 290 | # documentation. |
| 291 | # |
| 292 | # Define ASCIIDOCTOR_EXTENSIONS_LAB to point to the location of the Asciidoctor |
| 293 | # Extensions Lab if you have it available. |
| 294 | # |
Junio C Hamano | cdbada7 | 2013-01-13 22:48:07 -0800 | [diff] [blame] | 295 | # Define PERL_PATH to the path of your Perl binary (usually /usr/bin/perl). |
| 296 | # |
Jeff King | 499c293 | 2009-04-03 15:32:20 -0400 | [diff] [blame] | 297 | # Define NO_PERL if you do not want Perl scripts or libraries at all. |
| 298 | # |
Todd Zullinger | 075321c | 2018-03-03 15:38:16 +0000 | [diff] [blame] | 299 | # Define NO_PERL_CPAN_FALLBACKS if you do not want to install bundled |
| 300 | # copies of CPAN modules that serve as a fallback in case the modules |
| 301 | # are not available on the system. This option is intended for |
| 302 | # distributions that want to use their packaged versions of Perl |
| 303 | # modules, instead of the fallbacks shipped with Git. |
| 304 | # |
Junio C Hamano | cdbada7 | 2013-01-13 22:48:07 -0800 | [diff] [blame] | 305 | # Define PYTHON_PATH to the path of your Python binary (often /usr/bin/python |
| 306 | # but /usr/bin/python2.7 on some platforms). |
| 307 | # |
Johan Herland | d4e1b47 | 2009-11-18 02:42:31 +0100 | [diff] [blame] | 308 | # Define NO_PYTHON if you do not want Python scripts or libraries at all. |
| 309 | # |
Eygene Ryabinkin | 3cfaf11 | 2007-03-28 04:00:23 -0700 | [diff] [blame] | 310 | # Define NO_TCLTK if you do not want Tcl/Tk GUI. |
| 311 | # |
Junio C Hamano | 71b4010 | 2016-03-08 15:47:57 -0800 | [diff] [blame] | 312 | # Define SANE_TEXT_GREP to "-a" if you use recent versions of GNU grep |
| 313 | # and egrep that are pickier when their input contains non-ASCII data. |
| 314 | # |
Shawn O. Pearce | 5f5dbd7 | 2007-05-07 23:36:31 -0400 | [diff] [blame] | 315 | # The TCL_PATH variable governs the location of the Tcl interpreter |
| 316 | # used to optimize git-gui for your system. Only used if NO_TCLTK |
| 317 | # is not set. Defaults to the bare 'tclsh'. |
| 318 | # |
| 319 | # The TCLTK_PATH variable governs the location of the Tcl/Tk interpreter. |
Eygene Ryabinkin | 81b63c7 | 2007-03-28 04:12:07 -0700 | [diff] [blame] | 320 | # If not set it defaults to the bare 'wish'. If it is set to the empty |
| 321 | # string then NO_TCLTK will be forced (this is used by configure script). |
| 322 | # |
Brian Downing | 43fe901 | 2008-02-05 15:10:44 -0600 | [diff] [blame] | 323 | # Define INTERNAL_QSORT to use Git's implementation of qsort(), which |
| 324 | # is a simplified version of the merge sort used in glibc. This is |
| 325 | # recommended if Git triggers O(n^2) behavior in your platform's qsort(). |
| 326 | # |
René Scharfe | 04ee8b8 | 2017-01-22 18:51:11 +0100 | [diff] [blame] | 327 | # Define HAVE_ISO_QSORT_S if your platform provides a qsort_s() that's |
| 328 | # compatible with the one described in C11 Annex K. |
| 329 | # |
Johannes Sixt | 34779c5 | 2009-04-20 10:17:00 +0200 | [diff] [blame] | 330 | # Define UNRELIABLE_FSTAT if your system's fstat does not return the same |
| 331 | # information on a not yet closed file that lstat would return for the same |
| 332 | # file after it was closed. |
Johannes Schindelin | be66a6c | 2009-04-25 11:57:14 +0200 | [diff] [blame] | 333 | # |
Johannes Schindelin | 348df16 | 2009-04-28 00:32:25 +0200 | [diff] [blame] | 334 | # Define OBJECT_CREATION_USES_RENAMES if your operating systems has problems |
| 335 | # when hardlinking a file to another name and unlinking the original file right |
Johannes Schindelin | be66a6c | 2009-04-25 11:57:14 +0200 | [diff] [blame] | 336 | # away (some NTFS drivers seem to zero the contents in that scenario). |
Junio C Hamano | 2c8f8b1 | 2009-05-23 01:43:08 -0700 | [diff] [blame] | 337 | # |
Johannes Schindelin | 3426e34 | 2009-05-11 13:02:18 +0200 | [diff] [blame] | 338 | # Define NO_CROSS_DIRECTORY_HARDLINKS if you plan to distribute the installed |
| 339 | # programs as a tar, where bin/ and libexec/ might be on different file systems. |
Marius Storm-Olsen | f0ed822 | 2009-05-31 18:15:23 +0200 | [diff] [blame] | 340 | # |
Junio C Hamano | 70de5e6 | 2012-05-02 15:12:10 -0700 | [diff] [blame] | 341 | # Define NO_INSTALL_HARDLINKS if you prefer to use either symbolic links or |
| 342 | # copies to install built-in git commands e.g. git-cat-file. |
| 343 | # |
Marius Storm-Olsen | f0ed822 | 2009-05-31 18:15:23 +0200 | [diff] [blame] | 344 | # Define USE_NED_ALLOCATOR if you want to replace the platforms default |
| 345 | # memory allocators with the nedmalloc allocator written by Niall Douglas. |
Jeff King | 02232ad | 2009-06-16 15:07:40 -0400 | [diff] [blame] | 346 | # |
René Scharfe | ca2baa3 | 2016-09-03 17:59:15 +0200 | [diff] [blame] | 347 | # Define OVERRIDE_STRDUP to override the libc version of strdup(3). |
| 348 | # This is necessary when using a custom allocator in order to avoid |
| 349 | # crashes due to allocation and free working on different 'heaps'. |
| 350 | # It's defined automatically if USE_NED_ALLOCATOR is set. |
| 351 | # |
Johannes Schindelin | 2f89522 | 2016-09-21 20:24:04 +0200 | [diff] [blame] | 352 | # Define NO_REGEX if your C library lacks regex support with REG_STARTEND |
| 353 | # feature. |
Jonathan Nieder | 8f4b576 | 2009-10-30 20:44:41 -0500 | [diff] [blame] | 354 | # |
Jeff King | 21aeafc | 2011-12-10 05:41:01 -0500 | [diff] [blame] | 355 | # Define HAVE_DEV_TTY if your system can open /dev/tty to interact with the |
| 356 | # user. |
| 357 | # |
Ævar Arnfjörð Bjarmason | bb946bb | 2011-02-22 23:41:21 +0000 | [diff] [blame] | 358 | # Define GETTEXT_POISON if you are debugging the choice of strings marked |
Jonathan Nieder | 3095522 | 2011-02-22 23:41:22 +0000 | [diff] [blame] | 359 | # for translation. In a GETTEXT_POISON build, you can turn all strings marked |
| 360 | # for translation into gibberish by setting the GIT_GETTEXT_POISON variable |
| 361 | # (to any value) in your environment. |
Ævar Arnfjörð Bjarmason | bb946bb | 2011-02-22 23:41:21 +0000 | [diff] [blame] | 362 | # |
Jakub Narebski | 63267de | 2009-09-01 13:39:20 +0200 | [diff] [blame] | 363 | # Define JSMIN to point to JavaScript minifier that functions as |
| 364 | # a filter to have gitweb.js minified. |
Junio C Hamano | 8678bc0 | 2009-12-01 11:28:15 -0800 | [diff] [blame] | 365 | # |
Mark Rada | 0e6ce21 | 2010-04-02 20:35:05 -0400 | [diff] [blame] | 366 | # Define CSSMIN to point to a CSS minifier in order to generate a minified |
| 367 | # version of gitweb.css |
| 368 | # |
Junio C Hamano | a3d023d | 2009-10-30 20:45:34 -0500 | [diff] [blame] | 369 | # Define DEFAULT_PAGER to a sensible pager command (defaults to "less") if |
| 370 | # you want to use something different. The value will be interpreted by the |
| 371 | # shell at runtime when it is used. |
| 372 | # |
Jonathan Nieder | 8f4b576 | 2009-10-30 20:44:41 -0500 | [diff] [blame] | 373 | # Define DEFAULT_EDITOR to a sensible editor command (defaults to "vi") if you |
| 374 | # want to use something different. The value will be interpreted by the shell |
| 375 | # if necessary when it is used. Examples: |
| 376 | # |
| 377 | # DEFAULT_EDITOR='~/bin/vi', |
| 378 | # DEFAULT_EDITOR='$GIT_FALLBACK_EDITOR', |
| 379 | # DEFAULT_EDITOR='"C:\Program Files\Vim\gvim.exe" --nofork' |
Jonathan Nieder | dfea575 | 2010-01-26 09:52:49 -0600 | [diff] [blame] | 380 | # |
Jonathan Nieder | 024c843 | 2011-11-18 03:58:21 -0600 | [diff] [blame] | 381 | # Define COMPUTE_HEADER_DEPENDENCIES to "yes" if you want dependencies on |
| 382 | # header files to be automatically computed, to avoid rebuilding objects when |
| 383 | # an unrelated header file changes. Define it to "no" to use the hard-coded |
| 384 | # dependency rules. The default is "auto", which means to use computed header |
| 385 | # dependencies if your compiler is detected to support it. |
| 386 | # |
Eyvind Bernhardsen | 942e774 | 2010-06-04 21:29:08 +0200 | [diff] [blame] | 387 | # Define NATIVE_CRLF if your platform uses CRLF for line endings. |
Thomas Rast | 6942efc | 2012-04-06 23:01:23 +0200 | [diff] [blame] | 388 | # |
Jeff King | 42dcbb7 | 2012-06-02 15:01:12 -0400 | [diff] [blame] | 389 | # Define GIT_USER_AGENT if you want to change how git identifies itself during |
| 390 | # network interactions. The default is "git/$(GIT_VERSION)". |
Junio C Hamano | a88d7aa | 2012-06-21 14:42:38 -0700 | [diff] [blame] | 391 | # |
Vincent van Ravesteijn | 1cc8af0 | 2012-06-06 20:28:16 +0000 | [diff] [blame] | 392 | # Define DEFAULT_HELP_FORMAT to "man", "info" or "html" |
| 393 | # (defaults to "man") if you want to have a different default when |
| 394 | # "git help" is called without a parameter specifying the format. |
Thomas Gummerer | 5d9fc88 | 2014-02-23 21:49:58 +0100 | [diff] [blame] | 395 | # |
| 396 | # Define TEST_GIT_INDEX_VERSION to 2, 3 or 4 to run the test suite |
| 397 | # with a different indexfile format version. If it isn't set the index |
| 398 | # file format used is index-v[23]. |
Junio C Hamano | bdb830c | 2014-04-08 11:59:05 -0700 | [diff] [blame] | 399 | # |
Jeff King | 6654754 | 2014-04-01 17:28:42 -0400 | [diff] [blame] | 400 | # Define GMTIME_UNRELIABLE_ERRORS if your gmtime() function does not |
| 401 | # return NULL when it receives a bogus time_t. |
Karsten Blees | 148d677 | 2014-07-12 02:05:42 +0200 | [diff] [blame] | 402 | # |
Ronald Wampler | d19e3a5 | 2016-07-07 16:45:54 -0400 | [diff] [blame] | 403 | # Define HAVE_CLOCK_GETTIME if your platform has clock_gettime. |
Reuben Hawkins | a6c3c63 | 2015-01-08 12:00:56 -0800 | [diff] [blame] | 404 | # |
Ronald Wampler | d19e3a5 | 2016-07-07 16:45:54 -0400 | [diff] [blame] | 405 | # Define HAVE_CLOCK_MONOTONIC if your platform has CLOCK_MONOTONIC. |
| 406 | # |
| 407 | # Define NEEDS_LIBRT if your platform requires linking with librt (glibc version |
| 408 | # before 2.17) for clock_gettime and CLOCK_MONOTONIC. |
Reuben Hawkins | 88e0118 | 2015-01-08 12:00:57 -0800 | [diff] [blame] | 409 | # |
Kyle J. McKay | 290c8e7 | 2015-01-11 12:09:22 -0800 | [diff] [blame] | 410 | # Define USE_PARENS_AROUND_GETTEXT_N to "yes" if your compiler happily |
| 411 | # compiles the following initialization: |
| 412 | # |
| 413 | # static const char s[] = ("FOO"); |
| 414 | # |
| 415 | # and define it to "no" if you need to remove the parentheses () around the |
| 416 | # constant. The default is "auto", which means to use parentheses if your |
| 417 | # compiler is detected to support it. |
Junio C Hamano | 551fc7a | 2015-03-20 13:11:49 -0700 | [diff] [blame] | 418 | # |
Kyle J. McKay | 9529080 | 2015-03-07 23:14:36 -0800 | [diff] [blame] | 419 | # Define HAVE_BSD_SYSCTL if your platform has a BSD-compatible sysctl function. |
Jeff King | 0cc30e0 | 2015-04-16 05:01:38 -0400 | [diff] [blame] | 420 | # |
| 421 | # Define HAVE_GETDELIM if your system has the getdelim() function. |
Eric Wong | 995bc22 | 2016-08-04 11:40:25 +0000 | [diff] [blame] | 422 | # |
| 423 | # Define PAGER_ENV to a SP separated VAR=VAL pairs to define |
| 424 | # default environment variables to be passed when a pager is spawned, e.g. |
| 425 | # |
| 426 | # PAGER_ENV = LESS=FRX LV=-c |
| 427 | # |
| 428 | # to say "export LESS=FRX (and LV=-c) if the environment variable |
| 429 | # LESS (and LV) is not set, respectively". |
Eric Sunshine | b228940 | 2017-12-15 00:34:34 +0100 | [diff] [blame] | 430 | # |
Jeff King | 3f824e9 | 2017-12-08 05:47:22 -0500 | [diff] [blame] | 431 | # Define TEST_SHELL_PATH if you want to use a shell besides SHELL_PATH for |
| 432 | # running the test scripts (e.g., bash has better support for "set -x" |
| 433 | # tracing). |
Junio C Hamano | 07b747d | 2018-01-05 13:28:09 -0800 | [diff] [blame] | 434 | # |
Eric Sunshine | b228940 | 2017-12-15 00:34:34 +0100 | [diff] [blame] | 435 | # When cross-compiling, define HOST_CPU as the canonical name of the CPU on |
| 436 | # which the built Git will run (for instance "x86_64"). |
Petr Baudis | 5bdac8b | 2005-07-29 17:48:26 +0200 | [diff] [blame] | 437 | |
Jonathan Nieder | 13fca9f | 2010-01-06 02:06:58 -0600 | [diff] [blame] | 438 | GIT-VERSION-FILE: FORCE |
Fredrik Kuivinen | 3654638 | 2006-02-14 00:15:14 +0100 | [diff] [blame] | 439 | @$(SHELL_PATH) ./GIT-VERSION-GEN |
Junio C Hamano | 9b88fce | 2005-12-27 14:40:17 -0800 | [diff] [blame] | 440 | -include GIT-VERSION-FILE |
Petr Baudis | 5bdac8b | 2005-07-29 17:48:26 +0200 | [diff] [blame] | 441 | |
Junio C Hamano | 94d2331 | 2005-11-13 01:46:13 -0800 | [diff] [blame] | 442 | # CFLAGS and LDFLAGS are for the users to override from the command line. |
Junio C Hamano | 12aa745 | 2005-11-04 23:50:09 -0800 | [diff] [blame] | 443 | |
Pavel Roskin | b05701c | 2005-08-06 01:36:15 -0400 | [diff] [blame] | 444 | CFLAGS = -g -O2 -Wall |
Matthieu Moy | 51dd3e8 | 2016-06-01 10:00:08 +0200 | [diff] [blame] | 445 | DEVELOPER_CFLAGS = -Werror \ |
Lars Schneider | 658df95 | 2016-02-25 09:42:22 +0100 | [diff] [blame] | 446 | -Wdeclaration-after-statement \ |
| 447 | -Wno-format-zero-length \ |
| 448 | -Wold-style-definition \ |
| 449 | -Woverflow \ |
| 450 | -Wpointer-arith \ |
| 451 | -Wstrict-prototypes \ |
| 452 | -Wunused \ |
| 453 | -Wvla |
Junio C Hamano | 94d2331 | 2005-11-13 01:46:13 -0800 | [diff] [blame] | 454 | LDFLAGS = |
Gary V. Vaughan | ebef827 | 2010-05-14 09:31:32 +0000 | [diff] [blame] | 455 | ALL_CFLAGS = $(CPPFLAGS) $(CFLAGS) |
Junio C Hamano | 94d2331 | 2005-11-13 01:46:13 -0800 | [diff] [blame] | 456 | ALL_LDFLAGS = $(LDFLAGS) |
Junio C Hamano | 4dc0002 | 2006-01-12 21:42:25 -0800 | [diff] [blame] | 457 | STRIP ?= strip |
Lars Schneider | 658df95 | 2016-02-25 09:42:22 +0100 | [diff] [blame] | 458 | |
Junio C Hamano | ac179b4 | 2015-09-10 14:27:21 -0700 | [diff] [blame] | 459 | # Create as necessary, replace existing, make ranlib unneeded. |
| 460 | ARFLAGS = rcs |
| 461 | |
Johannes Sixt | 49fa65a | 2008-07-23 21:12:18 +0200 | [diff] [blame] | 462 | # Among the variables below, these: |
| 463 | # gitexecdir |
| 464 | # template_dir |
Johannes Sixt | 9fb1e69 | 2011-05-09 10:24:55 +0200 | [diff] [blame] | 465 | # sysconfdir |
Steffen Prohaska | 026fa0d | 2009-01-18 13:00:09 +0100 | [diff] [blame] | 466 | # can be specified as a relative path some/where/else; |
| 467 | # this is interpreted as relative to $(prefix) and "git" at |
Johannes Sixt | 49fa65a | 2008-07-23 21:12:18 +0200 | [diff] [blame] | 468 | # runtime figures out where they are based on the path to the executable. |
John Keeping | 971f853 | 2013-02-24 19:55:01 +0000 | [diff] [blame] | 469 | # Additionally, the following will be treated as relative by "git" if they |
| 470 | # begin with "$(prefix)/": |
| 471 | # mandir |
| 472 | # infodir |
| 473 | # htmldir |
Johannes Sixt | 49fa65a | 2008-07-23 21:12:18 +0200 | [diff] [blame] | 474 | # This can help installing the suite in a relocatable way. |
| 475 | |
Pavel Roskin | b05701c | 2005-08-06 01:36:15 -0400 | [diff] [blame] | 476 | prefix = $(HOME) |
Steffen Prohaska | 026fa0d | 2009-01-18 13:00:09 +0100 | [diff] [blame] | 477 | bindir_relative = bin |
| 478 | bindir = $(prefix)/$(bindir_relative) |
John Keeping | 971f853 | 2013-02-24 19:55:01 +0000 | [diff] [blame] | 479 | mandir = $(prefix)/share/man |
| 480 | infodir = $(prefix)/share/info |
Steffen Prohaska | 026fa0d | 2009-01-18 13:00:09 +0100 | [diff] [blame] | 481 | gitexecdir = libexec/git-core |
David Aguilar | bc7a96a | 2011-08-18 00:23:46 -0700 | [diff] [blame] | 482 | mergetoolsdir = $(gitexecdir)/mergetools |
Johannes Sixt | 9354768 | 2007-06-11 10:02:17 +0200 | [diff] [blame] | 483 | sharedir = $(prefix)/share |
Pavan Kumar Sunkara | bc95196 | 2010-05-28 11:55:50 +0530 | [diff] [blame] | 484 | gitwebdir = $(sharedir)/gitweb |
Ævar Arnfjörð Bjarmason | 20d2a30 | 2017-12-10 21:13:33 +0000 | [diff] [blame] | 485 | perllibdir = $(sharedir)/perl5 |
Ævar Arnfjörð Bjarmason | 5e9637c | 2011-11-18 00:14:42 +0100 | [diff] [blame] | 486 | localedir = $(sharedir)/locale |
Steffen Prohaska | 026fa0d | 2009-01-18 13:00:09 +0100 | [diff] [blame] | 487 | template_dir = share/git-core/templates |
John Keeping | 971f853 | 2013-02-24 19:55:01 +0000 | [diff] [blame] | 488 | htmldir = $(prefix)/share/doc/git-doc |
Steffen Prohaska | 026fa0d | 2009-01-18 13:00:09 +0100 | [diff] [blame] | 489 | ETC_GITCONFIG = $(sysconfdir)/gitconfig |
Petr Onderka | 6df42ab | 2010-09-01 00:42:43 +0200 | [diff] [blame] | 490 | ETC_GITATTRIBUTES = $(sysconfdir)/gitattributes |
Robert Schiele | 10861be | 2007-08-01 06:30:35 +0200 | [diff] [blame] | 491 | lib = lib |
Stefano Lattarini | dd6fc7c | 2012-12-09 11:36:17 +0100 | [diff] [blame] | 492 | # DESTDIR = |
Johannes Schindelin | 352c811 | 2009-05-23 10:04:48 +0200 | [diff] [blame] | 493 | pathsep = : |
Petr Baudis | 5c2a7fb | 2005-04-13 02:14:06 -0700 | [diff] [blame] | 494 | |
John Keeping | 971f853 | 2013-02-24 19:55:01 +0000 | [diff] [blame] | 495 | mandir_relative = $(patsubst $(prefix)/%,%,$(mandir)) |
| 496 | infodir_relative = $(patsubst $(prefix)/%,%,$(infodir)) |
| 497 | htmldir_relative = $(patsubst $(prefix)/%,%,$(htmldir)) |
| 498 | |
Ævar Arnfjörð Bjarmason | 20d2a30 | 2017-12-10 21:13:33 +0000 | [diff] [blame] | 499 | export prefix bindir sharedir sysconfdir gitwebdir perllibdir localedir |
Jakub Narebski | e14421b | 2006-06-29 22:11:25 +0200 | [diff] [blame] | 500 | |
Ævar Arnfjörð Bjarmason | 6d62c98 | 2011-12-20 23:40:47 +0000 | [diff] [blame] | 501 | CC = cc |
Pavel Roskin | b05701c | 2005-08-06 01:36:15 -0400 | [diff] [blame] | 502 | AR = ar |
Emil Medve | 4cb08df | 2007-07-14 12:51:44 -0500 | [diff] [blame] | 503 | RM = rm -f |
Gary V. Vaughan | d1b1a91 | 2010-05-14 09:31:36 +0000 | [diff] [blame] | 504 | DIFF = diff |
Junio C Hamano | 229a7ed | 2005-09-23 10:41:40 -0700 | [diff] [blame] | 505 | TAR = tar |
David Kastrup | 89b2f19 | 2007-07-29 15:23:28 -0700 | [diff] [blame] | 506 | FIND = find |
Pavel Roskin | b05701c | 2005-08-06 01:36:15 -0400 | [diff] [blame] | 507 | INSTALL = install |
Shawn O. Pearce | 5f5dbd7 | 2007-05-07 23:36:31 -0400 | [diff] [blame] | 508 | TCL_PATH = tclsh |
Eygene Ryabinkin | 81b63c7 | 2007-03-28 04:12:07 -0700 | [diff] [blame] | 509 | TCLTK_PATH = wish |
Ævar Arnfjörð Bjarmason | cd5513a | 2011-02-22 23:41:23 +0000 | [diff] [blame] | 510 | XGETTEXT = xgettext |
Ævar Arnfjörð Bjarmason | 5e9637c | 2011-11-18 00:14:42 +0100 | [diff] [blame] | 511 | MSGFMT = msgfmt |
Remi Pommarel | f891587 | 2015-10-21 19:10:46 +0200 | [diff] [blame] | 512 | CURL_CONFIG = curl-config |
David M. Syzdek | 158629b | 2008-11-02 14:43:20 -0900 | [diff] [blame] | 513 | PTHREAD_LIBS = -lpthread |
Gary V. Vaughan | 48793cf | 2010-05-14 09:31:34 +0000 | [diff] [blame] | 514 | PTHREAD_CFLAGS = |
Thomas Rast | e146d17 | 2010-07-26 09:43:41 +0200 | [diff] [blame] | 515 | GCOV = gcov |
René Scharfe | 63f0a75 | 2016-09-15 20:30:56 +0200 | [diff] [blame] | 516 | SPATCH = spatch |
Linus Torvalds | e83c516 | 2005-04-07 15:13:13 -0700 | [diff] [blame] | 517 | |
Shawn O. Pearce | 5f5dbd7 | 2007-05-07 23:36:31 -0400 | [diff] [blame] | 518 | export TCL_PATH TCLTK_PATH |
| 519 | |
Ramsay Jones | f228d1f | 2011-04-07 19:22:18 +0100 | [diff] [blame] | 520 | SPARSE_FLAGS = |
René Scharfe | a9a884a | 2016-09-30 01:21:17 +0200 | [diff] [blame] | 521 | SPATCH_FLAGS = --all-includes |
Linus Torvalds | 44c9e85 | 2005-07-03 10:02:35 -0700 | [diff] [blame] | 522 | |
Petr Baudis | 28818ff | 2005-07-29 17:50:24 +0200 | [diff] [blame] | 523 | |
| 524 | |
| 525 | ### --- END CONFIGURATION SECTION --- |
| 526 | |
Petr Baudis | 8d7f586 | 2006-06-25 03:47:03 +0200 | [diff] [blame] | 527 | # Those must not be GNU-specific; they are shared with perl/ which may |
Petr Baudis | 18b0fc1 | 2006-09-23 20:20:47 +0200 | [diff] [blame] | 528 | # be built by a different compiler. (Note that this is an artifact now |
| 529 | # but it still might be nice to keep that distinction.) |
Linus Torvalds | 81b50f3 | 2010-02-22 08:42:18 -0800 | [diff] [blame] | 530 | BASIC_CFLAGS = -I. |
Petr Baudis | 18b0fc1 | 2006-09-23 20:20:47 +0200 | [diff] [blame] | 531 | BASIC_LDFLAGS = |
Petr Baudis | 8d7f586 | 2006-06-25 03:47:03 +0200 | [diff] [blame] | 532 | |
Johannes Schindelin | 5c928c0 | 2009-03-25 17:27:28 +0100 | [diff] [blame] | 533 | # Guard against environment variables |
| 534 | BUILTIN_OBJS = |
| 535 | BUILT_INS = |
| 536 | COMPAT_CFLAGS = |
| 537 | COMPAT_OBJS = |
Jonathan Nieder | 3371f9b | 2011-03-27 13:13:22 -0500 | [diff] [blame] | 538 | XDIFF_OBJS = |
Jonathan Nieder | 3371f9b | 2011-03-27 13:13:22 -0500 | [diff] [blame] | 539 | VCSSVN_OBJS = |
Jeff King | b8ba629 | 2012-06-20 14:30:56 -0400 | [diff] [blame] | 540 | GENERATED_H = |
Jonathan Nieder | a673cfe | 2010-03-19 22:20:12 -0500 | [diff] [blame] | 541 | EXTRA_CPPFLAGS = |
Johannes Schindelin | 5c928c0 | 2009-03-25 17:27:28 +0100 | [diff] [blame] | 542 | LIB_OBJS = |
Jonathan Nieder | 1b22c99 | 2010-01-26 09:54:23 -0600 | [diff] [blame] | 543 | PROGRAM_OBJS = |
Johannes Schindelin | 5c928c0 | 2009-03-25 17:27:28 +0100 | [diff] [blame] | 544 | PROGRAMS = |
| 545 | SCRIPT_PERL = |
Johan Herland | d4e1b47 | 2009-11-18 02:42:31 +0100 | [diff] [blame] | 546 | SCRIPT_PYTHON = |
Johannes Schindelin | 5c928c0 | 2009-03-25 17:27:28 +0100 | [diff] [blame] | 547 | SCRIPT_SH = |
Jonathan Nieder | 46bac90 | 2010-01-31 11:46:53 -0800 | [diff] [blame] | 548 | SCRIPT_LIB = |
Nguyễn Thái Ngọc Duy | efd71f8 | 2018-03-24 08:44:30 +0100 | [diff] [blame] | 549 | TEST_BUILTINS_OBJS = |
Jonathan Nieder | 225f78c | 2010-01-26 10:08:44 -0600 | [diff] [blame] | 550 | TEST_PROGRAMS_NEED_X = |
Johannes Schindelin | 5c928c0 | 2009-03-25 17:27:28 +0100 | [diff] [blame] | 551 | |
Jonathan Nieder | c40d92e | 2010-03-19 19:06:15 -0500 | [diff] [blame] | 552 | # Having this variable in your environment would break pipelines because |
| 553 | # you cause "cd" to echo its destination to stdout. It can also take |
| 554 | # scripts to unexpected places. If you like CDPATH, define it for your |
| 555 | # interactive shell sessions without exporting it. |
| 556 | unexport CDPATH |
| 557 | |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 558 | SCRIPT_SH += git-bisect.sh |
David Aguilar | afcbc8e | 2009-04-07 01:21:20 -0700 | [diff] [blame] | 559 | SCRIPT_SH += git-difftool--helper.sh |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 560 | SCRIPT_SH += git-filter-branch.sh |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 561 | SCRIPT_SH += git-merge-octopus.sh |
| 562 | SCRIPT_SH += git-merge-one-file.sh |
| 563 | SCRIPT_SH += git-merge-resolve.sh |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 564 | SCRIPT_SH += git-mergetool.sh |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 565 | SCRIPT_SH += git-quiltimport.sh |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 566 | SCRIPT_SH += git-rebase.sh |
Junio C Hamano | 709a957 | 2013-04-26 16:30:40 -0700 | [diff] [blame] | 567 | SCRIPT_SH += git-remote-testgit.sh |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 568 | SCRIPT_SH += git-request-pull.sh |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 569 | SCRIPT_SH += git-stash.sh |
| 570 | SCRIPT_SH += git-submodule.sh |
| 571 | SCRIPT_SH += git-web--browse.sh |
Petr Baudis | 28818ff | 2005-07-29 17:50:24 +0200 | [diff] [blame] | 572 | |
Jonathan Nieder | 46bac90 | 2010-01-31 11:46:53 -0800 | [diff] [blame] | 573 | SCRIPT_LIB += git-mergetool--lib |
| 574 | SCRIPT_LIB += git-parse-remote |
Martin von Zweigbergk | fdb76c1 | 2011-02-24 22:32:06 -0500 | [diff] [blame] | 575 | SCRIPT_LIB += git-rebase--am |
| 576 | SCRIPT_LIB += git-rebase--interactive |
| 577 | SCRIPT_LIB += git-rebase--merge |
Jonathan Nieder | 46bac90 | 2010-01-31 11:46:53 -0800 | [diff] [blame] | 578 | SCRIPT_LIB += git-sh-setup |
Ævar Arnfjörð Bjarmason | e00cf07 | 2011-05-14 13:47:43 +0000 | [diff] [blame] | 579 | SCRIPT_LIB += git-sh-i18n |
Jonathan Nieder | 46bac90 | 2010-01-31 11:46:53 -0800 | [diff] [blame] | 580 | |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 581 | SCRIPT_PERL += git-add--interactive.perl |
| 582 | SCRIPT_PERL += git-archimport.perl |
| 583 | SCRIPT_PERL += git-cvsexportcommit.perl |
| 584 | SCRIPT_PERL += git-cvsimport.perl |
| 585 | SCRIPT_PERL += git-cvsserver.perl |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 586 | SCRIPT_PERL += git-send-email.perl |
| 587 | SCRIPT_PERL += git-svn.perl |
Junio C Hamano | 60036a4 | 2005-07-30 17:31:47 -0700 | [diff] [blame] | 588 | |
Pete Wyckoff | b6f9305 | 2012-04-08 20:18:00 -0400 | [diff] [blame] | 589 | SCRIPT_PYTHON += git-p4.py |
Sverre Rabbelier | 7aeaa2f | 2010-03-29 11:48:28 -0500 | [diff] [blame] | 590 | |
Felipe Contreras | 7ded055 | 2013-06-07 17:03:07 -0500 | [diff] [blame] | 591 | NO_INSTALL += git-remote-testgit |
Felipe Contreras | 416fda6 | 2013-05-24 21:41:06 -0500 | [diff] [blame] | 592 | |
Matthieu Moy | 4c06b41 | 2013-02-08 18:31:16 +0100 | [diff] [blame] | 593 | # Generated files for scripts |
| 594 | SCRIPT_SH_GEN = $(patsubst %.sh,%,$(SCRIPT_SH)) |
| 595 | SCRIPT_PERL_GEN = $(patsubst %.perl,%,$(SCRIPT_PERL)) |
| 596 | SCRIPT_PYTHON_GEN = $(patsubst %.py,%,$(SCRIPT_PYTHON)) |
| 597 | |
Felipe Contreras | 4331ea8 | 2013-05-24 21:41:05 -0500 | [diff] [blame] | 598 | SCRIPT_SH_INS = $(filter-out $(NO_INSTALL),$(SCRIPT_SH_GEN)) |
| 599 | SCRIPT_PERL_INS = $(filter-out $(NO_INSTALL),$(SCRIPT_PERL_GEN)) |
| 600 | SCRIPT_PYTHON_INS = $(filter-out $(NO_INSTALL),$(SCRIPT_PYTHON_GEN)) |
| 601 | |
Matthieu Moy | 4c06b41 | 2013-02-08 18:31:16 +0100 | [diff] [blame] | 602 | # Individual rules to allow e.g. |
| 603 | # "make -C ../.. SCRIPT_PERL=contrib/foo/bar.perl build-perl-script" |
| 604 | # from subdirectories like contrib/*/ |
| 605 | .PHONY: build-perl-script build-sh-script build-python-script |
| 606 | build-perl-script: $(SCRIPT_PERL_GEN) |
| 607 | build-sh-script: $(SCRIPT_SH_GEN) |
| 608 | build-python-script: $(SCRIPT_PYTHON_GEN) |
| 609 | |
| 610 | .PHONY: install-perl-script install-sh-script install-python-script |
Felipe Contreras | 4331ea8 | 2013-05-24 21:41:05 -0500 | [diff] [blame] | 611 | install-sh-script: $(SCRIPT_SH_INS) |
Felipe Contreras | 654f23f | 2013-05-24 21:41:02 -0500 | [diff] [blame] | 612 | $(INSTALL) $^ '$(DESTDIR_SQ)$(gitexec_instdir_SQ)' |
Felipe Contreras | 4331ea8 | 2013-05-24 21:41:05 -0500 | [diff] [blame] | 613 | install-perl-script: $(SCRIPT_PERL_INS) |
Felipe Contreras | 654f23f | 2013-05-24 21:41:02 -0500 | [diff] [blame] | 614 | $(INSTALL) $^ '$(DESTDIR_SQ)$(gitexec_instdir_SQ)' |
Felipe Contreras | 4331ea8 | 2013-05-24 21:41:05 -0500 | [diff] [blame] | 615 | install-python-script: $(SCRIPT_PYTHON_INS) |
Felipe Contreras | 654f23f | 2013-05-24 21:41:02 -0500 | [diff] [blame] | 616 | $(INSTALL) $^ '$(DESTDIR_SQ)$(gitexec_instdir_SQ)' |
Matthieu Moy | 4c06b41 | 2013-02-08 18:31:16 +0100 | [diff] [blame] | 617 | |
| 618 | .PHONY: clean-perl-script clean-sh-script clean-python-script |
| 619 | clean-sh-script: |
| 620 | $(RM) $(SCRIPT_SH_GEN) |
| 621 | clean-perl-script: |
| 622 | $(RM) $(SCRIPT_PERL_GEN) |
| 623 | clean-python-script: |
| 624 | $(RM) $(SCRIPT_PYTHON_GEN) |
| 625 | |
Felipe Contreras | 4331ea8 | 2013-05-24 21:41:05 -0500 | [diff] [blame] | 626 | SCRIPTS = $(SCRIPT_SH_INS) \ |
| 627 | $(SCRIPT_PERL_INS) \ |
| 628 | $(SCRIPT_PYTHON_INS) \ |
Shawn O. Pearce | e475fe1 | 2007-11-23 15:35:08 -0500 | [diff] [blame] | 629 | git-instaweb |
Andreas Ericsson | d6ebd25 | 2005-11-22 00:44:15 +0100 | [diff] [blame] | 630 | |
Junio C Hamano | 2f76919 | 2010-09-28 16:08:38 -0500 | [diff] [blame] | 631 | ETAGS_TARGET = TAGS |
| 632 | |
Junio C Hamano | 42f7740 | 2006-08-15 21:38:07 -0700 | [diff] [blame] | 633 | # Empty... |
| 634 | EXTRA_PROGRAMS = |
Andreas Ericsson | d6ebd25 | 2005-11-22 00:44:15 +0100 | [diff] [blame] | 635 | |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 636 | # ... and all the rest that could be moved out of bindir to gitexecdir |
| 637 | PROGRAMS += $(EXTRA_PROGRAMS) |
Jonathan Nieder | 1b22c99 | 2010-01-26 09:54:23 -0600 | [diff] [blame] | 638 | |
Nguyễn Thái Ngọc Duy | 8275905 | 2012-05-04 20:52:36 +0700 | [diff] [blame] | 639 | PROGRAM_OBJS += credential-store.o |
Erik Faye-Lund | a666b47 | 2010-11-04 02:35:24 +0100 | [diff] [blame] | 640 | PROGRAM_OBJS += daemon.o |
Jonathan Nieder | 1b22c99 | 2010-01-26 09:54:23 -0600 | [diff] [blame] | 641 | PROGRAM_OBJS += fast-import.o |
Nguyễn Thái Ngọc Duy | 8275905 | 2012-05-04 20:52:36 +0700 | [diff] [blame] | 642 | PROGRAM_OBJS += http-backend.o |
Jonathan Nieder | 1b22c99 | 2010-01-26 09:54:23 -0600 | [diff] [blame] | 643 | PROGRAM_OBJS += imap-send.o |
Nguyễn Thái Ngọc Duy | 8275905 | 2012-05-04 20:52:36 +0700 | [diff] [blame] | 644 | PROGRAM_OBJS += sh-i18n--envsubst.o |
Jonathan Nieder | 1b22c99 | 2010-01-26 09:54:23 -0600 | [diff] [blame] | 645 | PROGRAM_OBJS += shell.o |
| 646 | PROGRAM_OBJS += show-index.o |
| 647 | PROGRAM_OBJS += upload-pack.o |
Florian Achleitner | 48ea9f9 | 2012-09-19 17:21:16 +0200 | [diff] [blame] | 648 | PROGRAM_OBJS += remote-testsvn.o |
Jonathan Nieder | 1b22c99 | 2010-01-26 09:54:23 -0600 | [diff] [blame] | 649 | |
Michael Palimaka | ace5e97 | 2012-02-08 21:59:04 +1100 | [diff] [blame] | 650 | # Binary suffix, set to .exe for Windows builds |
| 651 | X = |
| 652 | |
Jonathan Nieder | 1b22c99 | 2010-01-26 09:54:23 -0600 | [diff] [blame] | 653 | PROGRAMS += $(patsubst %.o,git-%$X,$(PROGRAM_OBJS)) |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 654 | |
Nguyễn Thái Ngọc Duy | 0e49649 | 2018-03-24 08:44:31 +0100 | [diff] [blame^] | 655 | TEST_BUILTINS_OBJS += test-chmtime.o |
| 656 | |
Jonathan Nieder | 225f78c | 2010-01-26 10:08:44 -0600 | [diff] [blame] | 657 | TEST_PROGRAMS_NEED_X += test-ctype |
Tanay Abhra | 4c715eb | 2014-07-28 03:10:39 -0700 | [diff] [blame] | 658 | TEST_PROGRAMS_NEED_X += test-config |
Jonathan Nieder | 225f78c | 2010-01-26 10:08:44 -0600 | [diff] [blame] | 659 | TEST_PROGRAMS_NEED_X += test-date |
| 660 | TEST_PROGRAMS_NEED_X += test-delta |
Ben Peart | 14527b3 | 2017-09-22 12:35:48 -0400 | [diff] [blame] | 661 | TEST_PROGRAMS_NEED_X += test-drop-caches |
Jonathan Nieder | 225f78c | 2010-01-26 10:08:44 -0600 | [diff] [blame] | 662 | TEST_PROGRAMS_NEED_X += test-dump-cache-tree |
Ben Peart | dd3551f | 2017-09-22 12:35:44 -0400 | [diff] [blame] | 663 | TEST_PROGRAMS_NEED_X += test-dump-fsmonitor |
Nguyễn Thái Ngọc Duy | 3e52f70 | 2014-06-13 19:19:51 +0700 | [diff] [blame] | 664 | TEST_PROGRAMS_NEED_X += test-dump-split-index |
Nguyễn Thái Ngọc Duy | a3ddcef | 2015-03-08 17:12:44 +0700 | [diff] [blame] | 665 | TEST_PROGRAMS_NEED_X += test-dump-untracked-cache |
Jonathan Tan | ddd3e31 | 2017-12-07 16:14:24 -0800 | [diff] [blame] | 666 | TEST_PROGRAMS_NEED_X += test-example-decorate |
Johannes Schindelin | 3064d5a | 2016-01-27 17:19:37 +0100 | [diff] [blame] | 667 | TEST_PROGRAMS_NEED_X += test-fake-ssh |
Jonathan Nieder | 225f78c | 2010-01-26 10:08:44 -0600 | [diff] [blame] | 668 | TEST_PROGRAMS_NEED_X += test-genrandom |
Karsten Blees | 6a364ce | 2013-11-14 20:17:54 +0100 | [diff] [blame] | 669 | TEST_PROGRAMS_NEED_X += test-hashmap |
Jeff King | d192508 | 2011-05-19 17:24:24 -0400 | [diff] [blame] | 670 | TEST_PROGRAMS_NEED_X += test-index-version |
Jeff Hostetler | ea19489 | 2017-03-23 13:47:04 +0000 | [diff] [blame] | 671 | TEST_PROGRAMS_NEED_X += test-lazy-init-name-hash |
David Barr | 3bbaec0 | 2010-08-09 17:39:43 -0500 | [diff] [blame] | 672 | TEST_PROGRAMS_NEED_X += test-line-buffer |
Jonathan Nieder | 225f78c | 2010-01-26 10:08:44 -0600 | [diff] [blame] | 673 | TEST_PROGRAMS_NEED_X += test-match-trees |
René Scharfe | 0db71e0 | 2012-04-01 00:10:11 +0200 | [diff] [blame] | 674 | TEST_PROGRAMS_NEED_X += test-mergesort |
Jeff King | d192508 | 2011-05-19 17:24:24 -0400 | [diff] [blame] | 675 | TEST_PROGRAMS_NEED_X += test-mktemp |
Jeff Hostetler | e3482cc | 2017-04-03 15:16:41 +0000 | [diff] [blame] | 676 | TEST_PROGRAMS_NEED_X += test-online-cpus |
Jonathan Nieder | 225f78c | 2010-01-26 10:08:44 -0600 | [diff] [blame] | 677 | TEST_PROGRAMS_NEED_X += test-parse-options |
| 678 | TEST_PROGRAMS_NEED_X += test-path-utils |
Junio C Hamano | b4b594a | 2013-06-06 19:13:50 -0700 | [diff] [blame] | 679 | TEST_PROGRAMS_NEED_X += test-prio-queue |
René Scharfe | 1ecb5ff | 2013-06-09 19:39:17 +0200 | [diff] [blame] | 680 | TEST_PROGRAMS_NEED_X += test-read-cache |
Kevin Willford | 3921a0b | 2017-08-21 15:24:30 -0600 | [diff] [blame] | 681 | TEST_PROGRAMS_NEED_X += test-write-cache |
Nguyễn Thái Ngọc Duy | 80f2a60 | 2017-03-26 09:42:38 +0700 | [diff] [blame] | 682 | TEST_PROGRAMS_NEED_X += test-ref-store |
Ramsay Jones | c918415 | 2012-09-01 18:46:54 +0100 | [diff] [blame] | 683 | TEST_PROGRAMS_NEED_X += test-regex |
Heiko Voigt | bcc0a3e | 2012-03-29 09:21:21 +0200 | [diff] [blame] | 684 | TEST_PROGRAMS_NEED_X += test-revision-walking |
Jonathan Nieder | 225f78c | 2010-01-26 10:08:44 -0600 | [diff] [blame] | 685 | TEST_PROGRAMS_NEED_X += test-run-command |
Nguyễn Thái Ngọc Duy | 8275905 | 2012-05-04 20:52:36 +0700 | [diff] [blame] | 686 | TEST_PROGRAMS_NEED_X += test-scrap-cache-tree |
Jonathan Nieder | 225f78c | 2010-01-26 10:08:44 -0600 | [diff] [blame] | 687 | TEST_PROGRAMS_NEED_X += test-sha1 |
René Scharfe | 38d905b | 2014-10-01 17:00:33 +0200 | [diff] [blame] | 688 | TEST_PROGRAMS_NEED_X += test-sha1-array |
Jonathan Nieder | 225f78c | 2010-01-26 10:08:44 -0600 | [diff] [blame] | 689 | TEST_PROGRAMS_NEED_X += test-sigchain |
Jeff Hostetler | a6db3fb | 2017-04-14 19:12:28 +0000 | [diff] [blame] | 690 | TEST_PROGRAMS_NEED_X += test-strcmp-offset |
Michael Haggerty | ff919f9 | 2012-09-12 16:04:43 +0200 | [diff] [blame] | 691 | TEST_PROGRAMS_NEED_X += test-string-list |
Heiko Voigt | 959b545 | 2015-08-17 17:21:57 -0700 | [diff] [blame] | 692 | TEST_PROGRAMS_NEED_X += test-submodule-config |
Nguyễn Thái Ngọc Duy | 0ed7481 | 2010-12-27 08:26:04 +0700 | [diff] [blame] | 693 | TEST_PROGRAMS_NEED_X += test-subprocess |
David Barr | 21746aa | 2010-08-09 17:55:00 -0500 | [diff] [blame] | 694 | TEST_PROGRAMS_NEED_X += test-svn-fe |
Nguyễn Thái Ngọc Duy | efd71f8 | 2018-03-24 08:44:30 +0100 | [diff] [blame] | 695 | TEST_PROGRAMS_NEED_X += test-tool |
Kyle J. McKay | 6a56993 | 2013-08-05 13:20:36 -0700 | [diff] [blame] | 696 | TEST_PROGRAMS_NEED_X += test-urlmatch-normalization |
Nguyễn Thái Ngọc Duy | feabcc1 | 2012-10-15 13:25:55 +0700 | [diff] [blame] | 697 | TEST_PROGRAMS_NEED_X += test-wildmatch |
Jonathan Nieder | 225f78c | 2010-01-26 10:08:44 -0600 | [diff] [blame] | 698 | |
Nguyễn Thái Ngọc Duy | e6e7530 | 2016-04-13 20:22:42 +0700 | [diff] [blame] | 699 | TEST_PROGRAMS = $(patsubst %,t/helper/%$X,$(TEST_PROGRAMS_NEED_X)) |
Andreas Ericsson | d6ebd25 | 2005-11-22 00:44:15 +0100 | [diff] [blame] | 700 | |
Junio C Hamano | 1736855 | 2008-02-23 11:08:25 -0800 | [diff] [blame] | 701 | # List built-in command $C whose implementation cmd_$C() is not in |
Linus Torvalds | 81b50f3 | 2010-02-22 08:42:18 -0800 | [diff] [blame] | 702 | # builtin/$C.o but is linked in as part of some other command. |
| 703 | BUILT_INS += $(patsubst builtin/%.o,git-%$X,$(BUILTIN_OBJS)) |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 704 | |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 705 | BUILT_INS += git-cherry$X |
Stephan Beyer | fcb6c07 | 2009-02-09 23:00:45 +0100 | [diff] [blame] | 706 | BUILT_INS += git-cherry-pick$X |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 707 | BUILT_INS += git-format-patch$X |
| 708 | BUILT_INS += git-fsck-objects$X |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 709 | BUILT_INS += git-init$X |
| 710 | BUILT_INS += git-merge-subtree$X |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 711 | BUILT_INS += git-show$X |
Junio C Hamano | 24b1f65 | 2008-12-03 00:30:34 -0800 | [diff] [blame] | 712 | BUILT_INS += git-stage$X |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 713 | BUILT_INS += git-status$X |
| 714 | BUILT_INS += git-whatchanged$X |
Junio C Hamano | 9173080 | 2006-04-10 17:37:58 -0700 | [diff] [blame] | 715 | |
Junio C Hamano | ad17f01 | 2009-08-07 12:09:29 -0700 | [diff] [blame] | 716 | # what 'all' will build and 'install' will install in gitexecdir, |
| 717 | # excluding programs for built-in commands |
Junio C Hamano | 6506e15 | 2007-02-06 21:27:09 -0800 | [diff] [blame] | 718 | ALL_PROGRAMS = $(PROGRAMS) $(SCRIPTS) |
Linus Torvalds | e83c516 | 2005-04-07 15:13:13 -0700 | [diff] [blame] | 719 | |
Eygene Ryabinkin | 3cfaf11 | 2007-03-28 04:00:23 -0700 | [diff] [blame] | 720 | # what 'all' will build but not install in gitexecdir |
Jeff King | 499c293 | 2009-04-03 15:32:20 -0400 | [diff] [blame] | 721 | OTHER_PROGRAMS = git$X |
Eygene Ryabinkin | 3cfaf11 | 2007-03-28 04:00:23 -0700 | [diff] [blame] | 722 | |
Matthew Ogilvie | ea92519 | 2009-12-02 22:14:05 -0700 | [diff] [blame] | 723 | # what test wrappers are needed and 'install' will install, in bindir |
| 724 | BINDIR_PROGRAMS_NEED_X += git |
| 725 | BINDIR_PROGRAMS_NEED_X += git-upload-pack |
| 726 | BINDIR_PROGRAMS_NEED_X += git-receive-pack |
| 727 | BINDIR_PROGRAMS_NEED_X += git-upload-archive |
| 728 | BINDIR_PROGRAMS_NEED_X += git-shell |
| 729 | |
| 730 | BINDIR_PROGRAMS_NO_X += git-cvsserver |
| 731 | |
Ryan Anderson | 3d32051 | 2005-11-21 00:11:22 -0500 | [diff] [blame] | 732 | # Set paths to tools early so that they can be used for version tests. |
| 733 | ifndef SHELL_PATH |
| 734 | SHELL_PATH = /bin/sh |
| 735 | endif |
| 736 | ifndef PERL_PATH |
| 737 | PERL_PATH = /usr/bin/perl |
| 738 | endif |
Johan Herland | d4e1b47 | 2009-11-18 02:42:31 +0100 | [diff] [blame] | 739 | ifndef PYTHON_PATH |
| 740 | PYTHON_PATH = /usr/bin/python |
| 741 | endif |
Junio C Hamano | 720d150 | 2005-09-10 17:46:27 -0700 | [diff] [blame] | 742 | |
Luben Tuikov | 3a79347 | 2006-12-14 23:03:03 -0800 | [diff] [blame] | 743 | export PERL_PATH |
Johan Herland | d4e1b47 | 2009-11-18 02:42:31 +0100 | [diff] [blame] | 744 | export PYTHON_PATH |
Luben Tuikov | 3a79347 | 2006-12-14 23:03:03 -0800 | [diff] [blame] | 745 | |
Jeff King | 3f824e9 | 2017-12-08 05:47:22 -0500 | [diff] [blame] | 746 | TEST_SHELL_PATH = $(SHELL_PATH) |
| 747 | |
Stefano Lattarini | dd6fc7c | 2012-12-09 11:36:17 +0100 | [diff] [blame] | 748 | LIB_FILE = libgit.a |
| 749 | XDIFF_LIB = xdiff/lib.a |
| 750 | VCSSVN_LIB = vcs-svn/lib.a |
Linus Torvalds | 0a02ce7 | 2005-04-18 12:49:39 -0700 | [diff] [blame] | 751 | |
Jeff King | b8ba629 | 2012-06-20 14:30:56 -0400 | [diff] [blame] | 752 | GENERATED_H += common-cmds.h |
Nguyễn Thái Ngọc Duy | 1b8b2e4 | 2012-04-23 19:30:21 +0700 | [diff] [blame] | 753 | |
Jeff King | d85b0df | 2014-08-25 16:00:42 -0400 | [diff] [blame] | 754 | LIB_H = $(shell $(FIND) . \ |
| 755 | -name .git -prune -o \ |
| 756 | -name t -prune -o \ |
| 757 | -name Documentation -prune -o \ |
| 758 | -name '*.h' -print) |
Junio C Hamano | 8f3f9b0 | 2005-07-23 17:54:41 -0700 | [diff] [blame] | 759 | |
Dmitry Potapov | 5b8e6f8 | 2008-06-28 00:46:42 +0400 | [diff] [blame] | 760 | LIB_OBJS += abspath.o |
Jeff King | 7519443 | 2009-09-09 07:38:58 -0400 | [diff] [blame] | 761 | LIB_OBJS += advice.o |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 762 | LIB_OBJS += alias.o |
| 763 | LIB_OBJS += alloc.o |
Christian Couder | bb493a5 | 2016-08-08 23:03:07 +0200 | [diff] [blame] | 764 | LIB_OBJS += apply.o |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 765 | LIB_OBJS += archive.o |
| 766 | LIB_OBJS += archive-tar.o |
| 767 | LIB_OBJS += archive-zip.o |
Jeff King | c1189ca | 2011-09-13 17:57:57 -0400 | [diff] [blame] | 768 | LIB_OBJS += argv-array.o |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 769 | LIB_OBJS += attr.o |
| 770 | LIB_OBJS += base85.o |
Christian Couder | a2ad79c | 2009-03-26 05:55:24 +0100 | [diff] [blame] | 771 | LIB_OBJS += bisect.o |
Jeff Smith | f5dd754 | 2017-05-24 00:15:33 -0500 | [diff] [blame] | 772 | LIB_OBJS += blame.o |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 773 | LIB_OBJS += blob.o |
| 774 | LIB_OBJS += branch.o |
Junio C Hamano | 568508e | 2011-10-28 14:48:40 -0700 | [diff] [blame] | 775 | LIB_OBJS += bulk-checkin.o |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 776 | LIB_OBJS += bundle.o |
| 777 | LIB_OBJS += cache-tree.o |
Thomas Gummerer | 7c85a87 | 2017-11-26 19:43:51 +0000 | [diff] [blame] | 778 | LIB_OBJS += checkout.o |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 779 | LIB_OBJS += color.o |
Nguyễn Thái Ngọc Duy | 7e29b82 | 2012-04-21 11:44:32 +0700 | [diff] [blame] | 780 | LIB_OBJS += column.o |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 781 | LIB_OBJS += combine-diff.o |
| 782 | LIB_OBJS += commit.o |
Fredrik Kuivinen | e831171 | 2011-08-21 00:40:40 +0200 | [diff] [blame] | 783 | LIB_OBJS += compat/obstack.o |
Jeff King | 21aeafc | 2011-12-10 05:41:01 -0500 | [diff] [blame] | 784 | LIB_OBJS += compat/terminal.o |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 785 | LIB_OBJS += config.o |
| 786 | LIB_OBJS += connect.o |
Junio C Hamano | f96400c | 2011-09-02 16:33:22 -0700 | [diff] [blame] | 787 | LIB_OBJS += connected.o |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 788 | LIB_OBJS += convert.o |
| 789 | LIB_OBJS += copy.o |
Jeff King | abca927 | 2011-12-10 05:31:11 -0500 | [diff] [blame] | 790 | LIB_OBJS += credential.o |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 791 | LIB_OBJS += csum-file.o |
| 792 | LIB_OBJS += ctype.o |
| 793 | LIB_OBJS += date.o |
| 794 | LIB_OBJS += decorate.o |
| 795 | LIB_OBJS += diffcore-break.o |
| 796 | LIB_OBJS += diffcore-delta.o |
| 797 | LIB_OBJS += diffcore-order.o |
| 798 | LIB_OBJS += diffcore-pickaxe.o |
| 799 | LIB_OBJS += diffcore-rename.o |
| 800 | LIB_OBJS += diff-delta.o |
| 801 | LIB_OBJS += diff-lib.o |
Stephan Beyer | fcb6c07 | 2009-02-09 23:00:45 +0100 | [diff] [blame] | 802 | LIB_OBJS += diff-no-index.o |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 803 | LIB_OBJS += diff.o |
| 804 | LIB_OBJS += dir.o |
Michael Haggerty | 0fe5043 | 2016-06-18 06:15:18 +0200 | [diff] [blame] | 805 | LIB_OBJS += dir-iterator.o |
Stephan Beyer | d82f33e | 2008-07-25 18:28:41 +0200 | [diff] [blame] | 806 | LIB_OBJS += editor.o |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 807 | LIB_OBJS += entry.o |
| 808 | LIB_OBJS += environment.o |
Vicent Marti | e127310 | 2013-11-14 07:43:51 -0500 | [diff] [blame] | 809 | LIB_OBJS += ewah/bitmap.o |
| 810 | LIB_OBJS += ewah/ewah_bitmap.o |
| 811 | LIB_OBJS += ewah/ewah_io.o |
| 812 | LIB_OBJS += ewah/ewah_rlw.o |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 813 | LIB_OBJS += exec_cmd.o |
Jonathan Tan | 88e2f9e | 2017-12-05 16:58:49 +0000 | [diff] [blame] | 814 | LIB_OBJS += fetch-object.o |
Nguyễn Thái Ngọc Duy | 745f7a8 | 2012-10-26 22:53:55 +0700 | [diff] [blame] | 815 | LIB_OBJS += fetch-pack.o |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 816 | LIB_OBJS += fsck.o |
Ben Peart | 883e248 | 2017-09-22 12:35:40 -0400 | [diff] [blame] | 817 | LIB_OBJS += fsmonitor.o |
Ævar Arnfjörð Bjarmason | 5e9637c | 2011-11-18 00:14:42 +0100 | [diff] [blame] | 818 | LIB_OBJS += gettext.o |
Nguyễn Thái Ngọc Duy | 8275905 | 2012-05-04 20:52:36 +0700 | [diff] [blame] | 819 | LIB_OBJS += gpg-interface.o |
Adam Simpkins | c12172d | 2008-05-04 03:36:53 -0700 | [diff] [blame] | 820 | LIB_OBJS += graph.o |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 821 | LIB_OBJS += grep.o |
Karsten Blees | 6a364ce | 2013-11-14 20:17:54 +0100 | [diff] [blame] | 822 | LIB_OBJS += hashmap.o |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 823 | LIB_OBJS += help.o |
Linus Torvalds | a503121 | 2010-01-21 15:25:19 -0800 | [diff] [blame] | 824 | LIB_OBJS += hex.o |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 825 | LIB_OBJS += ident.o |
Fredrik Kuivinen | b95c5ad | 2011-08-21 00:41:57 +0200 | [diff] [blame] | 826 | LIB_OBJS += kwset.o |
Johannes Schindelin | 8af84da | 2008-08-31 15:50:23 +0200 | [diff] [blame] | 827 | LIB_OBJS += levenshtein.o |
Thomas Rast | 12da1d1 | 2013-03-28 17:47:32 +0100 | [diff] [blame] | 828 | LIB_OBJS += line-log.o |
Bo Yang | 25ed341 | 2013-03-28 17:47:30 +0100 | [diff] [blame] | 829 | LIB_OBJS += line-range.o |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 830 | LIB_OBJS += list-objects.o |
Jeff Hostetler | 25ec7bc | 2017-11-21 20:58:50 +0000 | [diff] [blame] | 831 | LIB_OBJS += list-objects-filter.o |
| 832 | LIB_OBJS += list-objects-filter-options.o |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 833 | LIB_OBJS += ll-merge.o |
| 834 | LIB_OBJS += lockfile.o |
| 835 | LIB_OBJS += log-tree.o |
Junio C Hamano | c6905e4 | 2015-10-14 17:44:55 -0700 | [diff] [blame] | 836 | LIB_OBJS += mailinfo.o |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 837 | LIB_OBJS += mailmap.o |
| 838 | LIB_OBJS += match-trees.o |
Nguyễn Thái Ngọc Duy | db699a8 | 2012-10-26 22:53:49 +0700 | [diff] [blame] | 839 | LIB_OBJS += merge.o |
Junio C Hamano | fa2364e | 2012-12-06 15:08:01 -0800 | [diff] [blame] | 840 | LIB_OBJS += merge-blobs.o |
Miklos Vajna | 9047ebb | 2008-08-12 18:45:14 +0200 | [diff] [blame] | 841 | LIB_OBJS += merge-recursive.o |
René Scharfe | 0db71e0 | 2012-04-01 00:10:11 +0200 | [diff] [blame] | 842 | LIB_OBJS += mergesort.o |
Linus Torvalds | 96872bc | 2008-03-21 13:16:24 -0700 | [diff] [blame] | 843 | LIB_OBJS += name-hash.o |
Johannes Schindelin | a97a746 | 2009-10-09 12:21:57 +0200 | [diff] [blame] | 844 | LIB_OBJS += notes.o |
Jeff King | a941d5e | 2010-04-01 20:07:40 -0400 | [diff] [blame] | 845 | LIB_OBJS += notes-cache.o |
Johan Herland | 75ef3f4 | 2010-11-09 22:49:46 +0100 | [diff] [blame] | 846 | LIB_OBJS += notes-merge.o |
Johan Herland | 49c2470 | 2013-06-12 02:13:00 +0200 | [diff] [blame] | 847 | LIB_OBJS += notes-utils.o |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 848 | LIB_OBJS += object.o |
Jonathan Tan | 9e6fabde | 2017-09-29 15:54:22 -0700 | [diff] [blame] | 849 | LIB_OBJS += oidmap.o |
Jeff King | 29c2bd5 | 2017-02-08 15:53:07 -0500 | [diff] [blame] | 850 | LIB_OBJS += oidset.o |
Jonathan Tan | 4f39cd8 | 2017-08-18 15:20:16 -0700 | [diff] [blame] | 851 | LIB_OBJS += packfile.o |
Vicent Marti | fff4275 | 2013-12-21 09:00:01 -0500 | [diff] [blame] | 852 | LIB_OBJS += pack-bitmap.o |
Vicent Marti | 7cc8f97 | 2013-12-21 09:00:16 -0500 | [diff] [blame] | 853 | LIB_OBJS += pack-bitmap-write.o |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 854 | LIB_OBJS += pack-check.o |
Vicent Marti | 2834bc2 | 2013-10-24 14:01:06 -0400 | [diff] [blame] | 855 | LIB_OBJS += pack-objects.o |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 856 | LIB_OBJS += pack-revindex.o |
| 857 | LIB_OBJS += pack-write.o |
| 858 | LIB_OBJS += pager.o |
| 859 | LIB_OBJS += parse-options.o |
Dmitry Ivankov | 0687628 | 2011-08-11 15:15:38 +0600 | [diff] [blame] | 860 | LIB_OBJS += parse-options-cb.o |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 861 | LIB_OBJS += patch-delta.o |
| 862 | LIB_OBJS += patch-ids.o |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 863 | LIB_OBJS += path.o |
Adam Spiers | 6f525e7 | 2013-01-06 16:58:08 +0000 | [diff] [blame] | 864 | LIB_OBJS += pathspec.o |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 865 | LIB_OBJS += pkt-line.o |
Stephan Beyer | fcb6c07 | 2009-02-09 23:00:45 +0100 | [diff] [blame] | 866 | LIB_OBJS += preload-index.o |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 867 | LIB_OBJS += pretty.o |
Junio C Hamano | b4b594a | 2013-06-06 19:13:50 -0700 | [diff] [blame] | 868 | LIB_OBJS += prio-queue.o |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 869 | LIB_OBJS += progress.o |
Jeff King | d3c58b8 | 2011-12-10 05:40:54 -0500 | [diff] [blame] | 870 | LIB_OBJS += prompt.o |
Brandon Williams | 373d70e | 2017-10-16 10:55:24 -0700 | [diff] [blame] | 871 | LIB_OBJS += protocol.o |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 872 | LIB_OBJS += quote.o |
| 873 | LIB_OBJS += reachable.o |
| 874 | LIB_OBJS += read-cache.o |
| 875 | LIB_OBJS += reflog-walk.o |
| 876 | LIB_OBJS += refs.o |
Michael Haggerty | 7bd9bcf | 2015-11-09 14:34:01 +0100 | [diff] [blame] | 877 | LIB_OBJS += refs/files-backend.o |
Michael Haggerty | 3bc581b | 2016-06-18 06:15:15 +0200 | [diff] [blame] | 878 | LIB_OBJS += refs/iterator.o |
Michael Haggerty | 67be7c5 | 2017-06-23 09:01:37 +0200 | [diff] [blame] | 879 | LIB_OBJS += refs/packed-backend.o |
Michael Haggerty | 958f964 | 2017-04-16 08:41:31 +0200 | [diff] [blame] | 880 | LIB_OBJS += refs/ref-cache.o |
Karthik Nayak | c95b758 | 2015-06-14 01:07:27 +0530 | [diff] [blame] | 881 | LIB_OBJS += ref-filter.o |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 882 | LIB_OBJS += remote.o |
Christian Couder | 6809557 | 2009-01-23 10:06:53 +0100 | [diff] [blame] | 883 | LIB_OBJS += replace_object.o |
Brandon Williams | 359efef | 2017-06-22 11:43:32 -0700 | [diff] [blame] | 884 | LIB_OBJS += repository.o |
Stephan Beyer | 5b2fd95 | 2008-07-09 14:58:57 +0200 | [diff] [blame] | 885 | LIB_OBJS += rerere.o |
Junio C Hamano | cfc5789 | 2009-12-25 00:30:51 -0800 | [diff] [blame] | 886 | LIB_OBJS += resolve-undo.o |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 887 | LIB_OBJS += revision.o |
| 888 | LIB_OBJS += run-command.o |
Nguyễn Thái Ngọc Duy | f5d942e | 2012-10-26 22:53:53 +0700 | [diff] [blame] | 889 | LIB_OBJS += send-pack.o |
Nguyễn Thái Ngọc Duy | 8275905 | 2012-05-04 20:52:36 +0700 | [diff] [blame] | 890 | LIB_OBJS += sequencer.o |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 891 | LIB_OBJS += server-info.o |
| 892 | LIB_OBJS += setup.o |
Jeff King | 902bb36 | 2011-05-19 17:34:33 -0400 | [diff] [blame] | 893 | LIB_OBJS += sha1-array.o |
Junio C Hamano | 628522e | 2007-12-29 02:05:47 -0800 | [diff] [blame] | 894 | LIB_OBJS += sha1-lookup.o |
Stephan Beyer | fcb6c07 | 2009-02-09 23:00:45 +0100 | [diff] [blame] | 895 | LIB_OBJS += sha1_file.o |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 896 | LIB_OBJS += sha1_name.o |
| 897 | LIB_OBJS += shallow.o |
| 898 | LIB_OBJS += sideband.o |
Jeff King | 4a16d07 | 2009-01-22 01:02:35 -0500 | [diff] [blame] | 899 | LIB_OBJS += sigchain.o |
Nguyễn Thái Ngọc Duy | 5fc2fc8 | 2014-06-13 19:19:36 +0700 | [diff] [blame] | 900 | LIB_OBJS += split-index.o |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 901 | LIB_OBJS += strbuf.o |
Junio C Hamano | 46bf043 | 2011-05-11 19:30:25 -0700 | [diff] [blame] | 902 | LIB_OBJS += streaming.o |
Stephan Beyer | fcb6c07 | 2009-02-09 23:00:45 +0100 | [diff] [blame] | 903 | LIB_OBJS += string-list.o |
Johannes Schindelin | 752c0c2 | 2009-10-19 14:38:32 +0200 | [diff] [blame] | 904 | LIB_OBJS += submodule.o |
Heiko Voigt | 959b545 | 2015-08-17 17:21:57 -0700 | [diff] [blame] | 905 | LIB_OBJS += submodule-config.o |
Ben Peart | 99605d6 | 2017-05-05 11:28:01 -0400 | [diff] [blame] | 906 | LIB_OBJS += sub-process.o |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 907 | LIB_OBJS += symlinks.o |
| 908 | LIB_OBJS += tag.o |
Michael Haggerty | 1a9d15d | 2015-08-10 11:47:41 +0200 | [diff] [blame] | 909 | LIB_OBJS += tempfile.o |
Jeff King | 2564d99 | 2016-10-03 16:49:11 -0400 | [diff] [blame] | 910 | LIB_OBJS += tmp-objdir.o |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 911 | LIB_OBJS += trace.o |
Christian Couder | 9385b5d | 2014-10-13 20:16:23 +0200 | [diff] [blame] | 912 | LIB_OBJS += trailer.o |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 913 | LIB_OBJS += transport.o |
Daniel Barkalow | 6eb996b | 2009-08-05 01:01:53 -0400 | [diff] [blame] | 914 | LIB_OBJS += transport-helper.o |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 915 | LIB_OBJS += tree-diff.o |
| 916 | LIB_OBJS += tree.o |
| 917 | LIB_OBJS += tree-walk.o |
| 918 | LIB_OBJS += unpack-trees.o |
Jeff King | 638794c | 2010-05-23 05:17:55 -0400 | [diff] [blame] | 919 | LIB_OBJS += url.o |
Kyle J. McKay | 6a56993 | 2013-08-05 13:20:36 -0700 | [diff] [blame] | 920 | LIB_OBJS += urlmatch.o |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 921 | LIB_OBJS += usage.o |
Stephan Beyer | fcb6c07 | 2009-02-09 23:00:45 +0100 | [diff] [blame] | 922 | LIB_OBJS += userdiff.o |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 923 | LIB_OBJS += utf8.o |
Junio C Hamano | d2c1898 | 2012-04-03 15:53:08 -0700 | [diff] [blame] | 924 | LIB_OBJS += varint.o |
Jeff King | 816fb46 | 2012-06-02 14:51:42 -0400 | [diff] [blame] | 925 | LIB_OBJS += version.o |
Nguyễn Thái Ngọc Duy | 9ef176b | 2014-02-27 19:56:52 +0700 | [diff] [blame] | 926 | LIB_OBJS += versioncmp.o |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 927 | LIB_OBJS += walker.o |
Nguyễn Thái Ngọc Duy | feabcc1 | 2012-10-15 13:25:55 +0700 | [diff] [blame] | 928 | LIB_OBJS += wildmatch.o |
Michael Rappazzo | ac6c561 | 2015-10-02 07:55:31 -0400 | [diff] [blame] | 929 | LIB_OBJS += worktree.o |
Linus Torvalds | 112db55 | 2008-06-22 12:19:25 -0700 | [diff] [blame] | 930 | LIB_OBJS += wrapper.o |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 931 | LIB_OBJS += write_or_die.o |
| 932 | LIB_OBJS += ws.o |
| 933 | LIB_OBJS += wt-status.o |
| 934 | LIB_OBJS += xdiff-interface.o |
Jonathan Nieder | b0613ce | 2010-11-06 06:47:34 -0500 | [diff] [blame] | 935 | LIB_OBJS += zlib.o |
Josef Weidendorfer | b1bf95b | 2005-07-31 21:17:43 +0200 | [diff] [blame] | 936 | |
Linus Torvalds | 81b50f3 | 2010-02-22 08:42:18 -0800 | [diff] [blame] | 937 | BUILTIN_OBJS += builtin/add.o |
Paul Tan | 73c2779 | 2015-08-04 21:51:24 +0800 | [diff] [blame] | 938 | BUILTIN_OBJS += builtin/am.o |
Linus Torvalds | 81b50f3 | 2010-02-22 08:42:18 -0800 | [diff] [blame] | 939 | BUILTIN_OBJS += builtin/annotate.o |
| 940 | BUILTIN_OBJS += builtin/apply.o |
| 941 | BUILTIN_OBJS += builtin/archive.o |
| 942 | BUILTIN_OBJS += builtin/bisect--helper.o |
| 943 | BUILTIN_OBJS += builtin/blame.o |
| 944 | BUILTIN_OBJS += builtin/branch.o |
| 945 | BUILTIN_OBJS += builtin/bundle.o |
| 946 | BUILTIN_OBJS += builtin/cat-file.o |
| 947 | BUILTIN_OBJS += builtin/check-attr.o |
Adam Spiers | 368aa52 | 2013-01-06 16:58:13 +0000 | [diff] [blame] | 948 | BUILTIN_OBJS += builtin/check-ignore.o |
Eric Sunshine | 226ad34 | 2013-07-12 20:53:10 -0400 | [diff] [blame] | 949 | BUILTIN_OBJS += builtin/check-mailmap.o |
Linus Torvalds | 81b50f3 | 2010-02-22 08:42:18 -0800 | [diff] [blame] | 950 | BUILTIN_OBJS += builtin/check-ref-format.o |
| 951 | BUILTIN_OBJS += builtin/checkout-index.o |
| 952 | BUILTIN_OBJS += builtin/checkout.o |
| 953 | BUILTIN_OBJS += builtin/clean.o |
| 954 | BUILTIN_OBJS += builtin/clone.o |
Nguyễn Thái Ngọc Duy | 7e29b82 | 2012-04-21 11:44:32 +0700 | [diff] [blame] | 955 | BUILTIN_OBJS += builtin/column.o |
Linus Torvalds | 81b50f3 | 2010-02-22 08:42:18 -0800 | [diff] [blame] | 956 | BUILTIN_OBJS += builtin/commit-tree.o |
| 957 | BUILTIN_OBJS += builtin/commit.o |
| 958 | BUILTIN_OBJS += builtin/config.o |
| 959 | BUILTIN_OBJS += builtin/count-objects.o |
Javier Roucher Iglesias | e30b2fe | 2012-06-24 13:39:59 +0200 | [diff] [blame] | 960 | BUILTIN_OBJS += builtin/credential.o |
Linus Torvalds | 81b50f3 | 2010-02-22 08:42:18 -0800 | [diff] [blame] | 961 | BUILTIN_OBJS += builtin/describe.o |
| 962 | BUILTIN_OBJS += builtin/diff-files.o |
| 963 | BUILTIN_OBJS += builtin/diff-index.o |
| 964 | BUILTIN_OBJS += builtin/diff-tree.o |
| 965 | BUILTIN_OBJS += builtin/diff.o |
Johannes Schindelin | be8a90e | 2017-01-17 16:54:57 +0100 | [diff] [blame] | 966 | BUILTIN_OBJS += builtin/difftool.o |
Linus Torvalds | 81b50f3 | 2010-02-22 08:42:18 -0800 | [diff] [blame] | 967 | BUILTIN_OBJS += builtin/fast-export.o |
| 968 | BUILTIN_OBJS += builtin/fetch-pack.o |
| 969 | BUILTIN_OBJS += builtin/fetch.o |
| 970 | BUILTIN_OBJS += builtin/fmt-merge-msg.o |
| 971 | BUILTIN_OBJS += builtin/for-each-ref.o |
| 972 | BUILTIN_OBJS += builtin/fsck.o |
| 973 | BUILTIN_OBJS += builtin/gc.o |
Jonathan Nieder | bb5d531 | 2013-12-02 15:37:10 -0800 | [diff] [blame] | 974 | BUILTIN_OBJS += builtin/get-tar-commit-id.o |
Linus Torvalds | 81b50f3 | 2010-02-22 08:42:18 -0800 | [diff] [blame] | 975 | BUILTIN_OBJS += builtin/grep.o |
| 976 | BUILTIN_OBJS += builtin/hash-object.o |
| 977 | BUILTIN_OBJS += builtin/help.o |
| 978 | BUILTIN_OBJS += builtin/index-pack.o |
| 979 | BUILTIN_OBJS += builtin/init-db.o |
Christian Couder | 6634f05 | 2014-10-13 20:16:29 +0200 | [diff] [blame] | 980 | BUILTIN_OBJS += builtin/interpret-trailers.o |
Linus Torvalds | 81b50f3 | 2010-02-22 08:42:18 -0800 | [diff] [blame] | 981 | BUILTIN_OBJS += builtin/log.o |
| 982 | BUILTIN_OBJS += builtin/ls-files.o |
| 983 | BUILTIN_OBJS += builtin/ls-remote.o |
| 984 | BUILTIN_OBJS += builtin/ls-tree.o |
| 985 | BUILTIN_OBJS += builtin/mailinfo.o |
| 986 | BUILTIN_OBJS += builtin/mailsplit.o |
| 987 | BUILTIN_OBJS += builtin/merge.o |
| 988 | BUILTIN_OBJS += builtin/merge-base.o |
| 989 | BUILTIN_OBJS += builtin/merge-file.o |
| 990 | BUILTIN_OBJS += builtin/merge-index.o |
| 991 | BUILTIN_OBJS += builtin/merge-ours.o |
| 992 | BUILTIN_OBJS += builtin/merge-recursive.o |
| 993 | BUILTIN_OBJS += builtin/merge-tree.o |
| 994 | BUILTIN_OBJS += builtin/mktag.o |
| 995 | BUILTIN_OBJS += builtin/mktree.o |
| 996 | BUILTIN_OBJS += builtin/mv.o |
| 997 | BUILTIN_OBJS += builtin/name-rev.o |
Junio C Hamano | 2949151 | 2010-03-15 00:52:06 -0700 | [diff] [blame] | 998 | BUILTIN_OBJS += builtin/notes.o |
Linus Torvalds | 81b50f3 | 2010-02-22 08:42:18 -0800 | [diff] [blame] | 999 | BUILTIN_OBJS += builtin/pack-objects.o |
| 1000 | BUILTIN_OBJS += builtin/pack-redundant.o |
| 1001 | BUILTIN_OBJS += builtin/pack-refs.o |
| 1002 | BUILTIN_OBJS += builtin/patch-id.o |
| 1003 | BUILTIN_OBJS += builtin/prune-packed.o |
| 1004 | BUILTIN_OBJS += builtin/prune.o |
Paul Tan | 1e1ea69 | 2015-06-14 16:41:51 +0800 | [diff] [blame] | 1005 | BUILTIN_OBJS += builtin/pull.o |
Linus Torvalds | 81b50f3 | 2010-02-22 08:42:18 -0800 | [diff] [blame] | 1006 | BUILTIN_OBJS += builtin/push.o |
| 1007 | BUILTIN_OBJS += builtin/read-tree.o |
Johannes Schindelin | 4557f1a | 2017-02-09 23:23:06 +0100 | [diff] [blame] | 1008 | BUILTIN_OBJS += builtin/rebase--helper.o |
Linus Torvalds | 81b50f3 | 2010-02-22 08:42:18 -0800 | [diff] [blame] | 1009 | BUILTIN_OBJS += builtin/receive-pack.o |
| 1010 | BUILTIN_OBJS += builtin/reflog.o |
| 1011 | BUILTIN_OBJS += builtin/remote.o |
Ilari Liusvaara | 7f3eceb | 2010-10-12 19:39:43 +0300 | [diff] [blame] | 1012 | BUILTIN_OBJS += builtin/remote-ext.o |
Ilari Liusvaara | 3a9ed4b | 2010-10-12 19:39:42 +0300 | [diff] [blame] | 1013 | BUILTIN_OBJS += builtin/remote-fd.o |
Stefan Beller | a1bbc6c | 2013-09-15 17:33:20 +0200 | [diff] [blame] | 1014 | BUILTIN_OBJS += builtin/repack.o |
Linus Torvalds | 81b50f3 | 2010-02-22 08:42:18 -0800 | [diff] [blame] | 1015 | BUILTIN_OBJS += builtin/replace.o |
| 1016 | BUILTIN_OBJS += builtin/rerere.o |
| 1017 | BUILTIN_OBJS += builtin/reset.o |
| 1018 | BUILTIN_OBJS += builtin/rev-list.o |
| 1019 | BUILTIN_OBJS += builtin/rev-parse.o |
| 1020 | BUILTIN_OBJS += builtin/revert.o |
| 1021 | BUILTIN_OBJS += builtin/rm.o |
| 1022 | BUILTIN_OBJS += builtin/send-pack.o |
| 1023 | BUILTIN_OBJS += builtin/shortlog.o |
| 1024 | BUILTIN_OBJS += builtin/show-branch.o |
| 1025 | BUILTIN_OBJS += builtin/show-ref.o |
| 1026 | BUILTIN_OBJS += builtin/stripspace.o |
Stefan Beller | 74703a1 | 2015-09-02 14:42:24 -0700 | [diff] [blame] | 1027 | BUILTIN_OBJS += builtin/submodule--helper.o |
Linus Torvalds | 81b50f3 | 2010-02-22 08:42:18 -0800 | [diff] [blame] | 1028 | BUILTIN_OBJS += builtin/symbolic-ref.o |
| 1029 | BUILTIN_OBJS += builtin/tag.o |
Linus Torvalds | 81b50f3 | 2010-02-22 08:42:18 -0800 | [diff] [blame] | 1030 | BUILTIN_OBJS += builtin/unpack-file.o |
| 1031 | BUILTIN_OBJS += builtin/unpack-objects.o |
| 1032 | BUILTIN_OBJS += builtin/update-index.o |
| 1033 | BUILTIN_OBJS += builtin/update-ref.o |
| 1034 | BUILTIN_OBJS += builtin/update-server-info.o |
| 1035 | BUILTIN_OBJS += builtin/upload-archive.o |
| 1036 | BUILTIN_OBJS += builtin/var.o |
Michael J Gruber | d07b00b | 2014-06-23 09:05:49 +0200 | [diff] [blame] | 1037 | BUILTIN_OBJS += builtin/verify-commit.o |
Linus Torvalds | 81b50f3 | 2010-02-22 08:42:18 -0800 | [diff] [blame] | 1038 | BUILTIN_OBJS += builtin/verify-pack.o |
| 1039 | BUILTIN_OBJS += builtin/verify-tag.o |
Nguyễn Thái Ngọc Duy | df0b6cf | 2015-06-29 19:51:18 +0700 | [diff] [blame] | 1040 | BUILTIN_OBJS += builtin/worktree.o |
Linus Torvalds | 81b50f3 | 2010-02-22 08:42:18 -0800 | [diff] [blame] | 1041 | BUILTIN_OBJS += builtin/write-tree.o |
Linus Torvalds | 70827b1 | 2006-04-21 10:27:34 -0700 | [diff] [blame] | 1042 | |
Jeff King | 3f2e229 | 2016-07-01 01:58:58 -0400 | [diff] [blame] | 1043 | GITLIBS = common-main.o $(LIB_FILE) $(XDIFF_LIB) |
Robert Schiele | bef19da | 2007-07-29 20:35:45 +0200 | [diff] [blame] | 1044 | EXTLIBS = |
Linus Torvalds | cef661f | 2005-04-21 12:33:22 -0700 | [diff] [blame] | 1045 | |
Jeff King | 42dcbb7 | 2012-06-02 15:01:12 -0400 | [diff] [blame] | 1046 | GIT_USER_AGENT = git/$(GIT_VERSION) |
| 1047 | |
Junio C Hamano | cac87dc | 2017-07-01 22:05:47 +0000 | [diff] [blame] | 1048 | ifeq ($(wildcard sha1collisiondetection/lib/sha1.h),sha1collisiondetection/lib/sha1.h) |
| 1049 | DC_SHA1_SUBMODULE = auto |
| 1050 | endif |
| 1051 | |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 1052 | include config.mak.uname |
Jakub Narebski | 5566771 | 2006-07-03 01:56:48 +0200 | [diff] [blame] | 1053 | -include config.mak.autogen |
Johannes Schindelin | f2d6a25 | 2005-10-11 15:22:47 -0700 | [diff] [blame] | 1054 | -include config.mak |
Junio C Hamano | 597c9cc | 2005-09-07 12:22:56 -0700 | [diff] [blame] | 1055 | |
Matthieu Moy | d615628 | 2016-05-31 15:24:43 +0200 | [diff] [blame] | 1056 | ifdef DEVELOPER |
Matthieu Moy | 51dd3e8 | 2016-06-01 10:00:08 +0200 | [diff] [blame] | 1057 | CFLAGS += $(DEVELOPER_CFLAGS) |
Matthieu Moy | d615628 | 2016-05-31 15:24:43 +0200 | [diff] [blame] | 1058 | endif |
| 1059 | |
René Scharfe | 425ca67 | 2017-07-15 19:18:56 +0200 | [diff] [blame] | 1060 | comma := , |
| 1061 | empty := |
| 1062 | space := $(empty) $(empty) |
| 1063 | |
Jeff King | 56b5db3 | 2017-07-10 09:24:42 -0400 | [diff] [blame] | 1064 | ifdef SANITIZE |
René Scharfe | 425ca67 | 2017-07-15 19:18:56 +0200 | [diff] [blame] | 1065 | SANITIZERS := $(foreach flag,$(subst $(comma),$(space),$(SANITIZE)),$(flag)) |
Jeff King | 56b5db3 | 2017-07-10 09:24:42 -0400 | [diff] [blame] | 1066 | BASIC_CFLAGS += -fsanitize=$(SANITIZE) -fno-sanitize-recover=$(SANITIZE) |
Jeff King | ddbc8a6 | 2017-07-10 09:24:47 -0400 | [diff] [blame] | 1067 | BASIC_CFLAGS += -fno-omit-frame-pointer |
René Scharfe | 425ca67 | 2017-07-15 19:18:56 +0200 | [diff] [blame] | 1068 | ifneq ($(filter undefined,$(SANITIZERS)),) |
Jeff King | 566cf0b | 2017-07-10 09:24:50 -0400 | [diff] [blame] | 1069 | BASIC_CFLAGS += -DNO_UNALIGNED_LOADS |
| 1070 | endif |
Jeff King | 0e5bba5 | 2017-09-08 02:38:41 -0400 | [diff] [blame] | 1071 | ifneq ($(filter leak,$(SANITIZERS)),) |
| 1072 | BASIC_CFLAGS += -DSUPPRESS_ANNOTATED_LEAKS |
| 1073 | endif |
Jeff King | 56b5db3 | 2017-07-10 09:24:42 -0400 | [diff] [blame] | 1074 | endif |
| 1075 | |
Johannes Sixt | 9fb1e69 | 2011-05-09 10:24:55 +0200 | [diff] [blame] | 1076 | ifndef sysconfdir |
| 1077 | ifeq ($(prefix),/usr) |
| 1078 | sysconfdir = /etc |
| 1079 | else |
| 1080 | sysconfdir = etc |
| 1081 | endif |
| 1082 | endif |
| 1083 | |
Fredrik Kuivinen | 111ee18 | 2011-08-18 20:34:39 +0200 | [diff] [blame] | 1084 | ifndef COMPUTE_HEADER_DEPENDENCIES |
Jonathan Nieder | 024c843 | 2011-11-18 03:58:21 -0600 | [diff] [blame] | 1085 | COMPUTE_HEADER_DEPENDENCIES = auto |
| 1086 | endif |
| 1087 | |
| 1088 | ifeq ($(COMPUTE_HEADER_DEPENDENCIES),auto) |
David Aguilar | 1816bf2 | 2011-08-30 01:27:35 -0700 | [diff] [blame] | 1089 | dep_check = $(shell $(CC) $(ALL_CFLAGS) \ |
Jonathan Nieder | 6978934 | 2011-11-18 17:23:24 -0600 | [diff] [blame] | 1090 | -c -MF /dev/null -MQ /dev/null -MMD -MP \ |
| 1091 | -x c /dev/null -o /dev/null 2>&1; \ |
David Aguilar | 1816bf2 | 2011-08-30 01:27:35 -0700 | [diff] [blame] | 1092 | echo $$?) |
Fredrik Kuivinen | 111ee18 | 2011-08-18 20:34:39 +0200 | [diff] [blame] | 1093 | ifeq ($(dep_check),0) |
Jonathan Nieder | 024c843 | 2011-11-18 03:58:21 -0600 | [diff] [blame] | 1094 | override COMPUTE_HEADER_DEPENDENCIES = yes |
| 1095 | else |
| 1096 | override COMPUTE_HEADER_DEPENDENCIES = no |
Fredrik Kuivinen | 111ee18 | 2011-08-18 20:34:39 +0200 | [diff] [blame] | 1097 | endif |
Jonathan Nieder | f2fabbf | 2010-01-26 09:57:15 -0600 | [diff] [blame] | 1098 | endif |
| 1099 | |
Jonathan Nieder | 024c843 | 2011-11-18 03:58:21 -0600 | [diff] [blame] | 1100 | ifeq ($(COMPUTE_HEADER_DEPENDENCIES),yes) |
Jonathan Nieder | f2fabbf | 2010-01-26 09:57:15 -0600 | [diff] [blame] | 1101 | USE_COMPUTED_HEADER_DEPENDENCIES = YesPlease |
Jonathan Nieder | 024c843 | 2011-11-18 03:58:21 -0600 | [diff] [blame] | 1102 | else |
| 1103 | ifneq ($(COMPUTE_HEADER_DEPENDENCIES),no) |
| 1104 | $(error please set COMPUTE_HEADER_DEPENDENCIES to yes, no, or auto \ |
| 1105 | (not "$(COMPUTE_HEADER_DEPENDENCIES)")) |
| 1106 | endif |
Jonathan Nieder | f2fabbf | 2010-01-26 09:57:15 -0600 | [diff] [blame] | 1107 | endif |
| 1108 | |
Junio C Hamano | 0e0aea5 | 2009-06-05 18:36:15 -0500 | [diff] [blame] | 1109 | ifdef SANE_TOOL_PATH |
Junio C Hamano | 61dbb3c | 2009-06-08 09:41:49 -0700 | [diff] [blame] | 1110 | SANE_TOOL_PATH_SQ = $(subst ','\'',$(SANE_TOOL_PATH)) |
| 1111 | BROKEN_PATH_FIX = 's|^\# @@BROKEN_PATH_FIX@@$$|git_broken_path_fix $(SANE_TOOL_PATH_SQ)|' |
Junio C Hamano | 0e0aea5 | 2009-06-05 18:36:15 -0500 | [diff] [blame] | 1112 | PATH := $(SANE_TOOL_PATH):${PATH} |
| 1113 | else |
Junio C Hamano | 61dbb3c | 2009-06-08 09:41:49 -0700 | [diff] [blame] | 1114 | BROKEN_PATH_FIX = '/^\# @@BROKEN_PATH_FIX@@$$/d' |
Junio C Hamano | 0e0aea5 | 2009-06-05 18:36:15 -0500 | [diff] [blame] | 1115 | endif |
| 1116 | |
Eric Sunshine | b228940 | 2017-12-15 00:34:34 +0100 | [diff] [blame] | 1117 | ifeq (,$(HOST_CPU)) |
| 1118 | BASIC_CFLAGS += -DGIT_HOST_CPU="\"$(firstword $(subst -, ,$(uname_M)))\"" |
| 1119 | else |
| 1120 | BASIC_CFLAGS += -DGIT_HOST_CPU="\"$(HOST_CPU)\"" |
| 1121 | endif |
| 1122 | |
Gary V. Vaughan | f9f33cd | 2010-05-14 09:31:43 +0000 | [diff] [blame] | 1123 | ifneq (,$(INLINE)) |
| 1124 | BASIC_CFLAGS += -Dinline=$(INLINE) |
| 1125 | endif |
| 1126 | |
Gary V. Vaughan | e88a135 | 2010-05-14 09:31:42 +0000 | [diff] [blame] | 1127 | ifneq (,$(SOCKLEN_T)) |
| 1128 | BASIC_CFLAGS += -Dsocklen_t=$(SOCKLEN_T) |
| 1129 | endif |
| 1130 | |
Kyle J. McKay | 290c8e7 | 2015-01-11 12:09:22 -0800 | [diff] [blame] | 1131 | ifeq (yes,$(USE_PARENS_AROUND_GETTEXT_N)) |
| 1132 | BASIC_CFLAGS += -DUSE_PARENS_AROUND_GETTEXT_N=1 |
| 1133 | else |
| 1134 | ifeq (no,$(USE_PARENS_AROUND_GETTEXT_N)) |
| 1135 | BASIC_CFLAGS += -DUSE_PARENS_AROUND_GETTEXT_N=0 |
| 1136 | endif |
| 1137 | endif |
| 1138 | |
Brian Gernhardt | 59f8674 | 2006-12-12 12:01:47 -0500 | [diff] [blame] | 1139 | ifeq ($(uname_S),Darwin) |
| 1140 | ifndef NO_FINK |
| 1141 | ifeq ($(shell test -d /sw/lib && echo y),y) |
| 1142 | BASIC_CFLAGS += -I/sw/include |
| 1143 | BASIC_LDFLAGS += -L/sw/lib |
| 1144 | endif |
| 1145 | endif |
| 1146 | ifndef NO_DARWIN_PORTS |
| 1147 | ifeq ($(shell test -d /opt/local/lib && echo y),y) |
| 1148 | BASIC_CFLAGS += -I/opt/local/include |
| 1149 | BASIC_LDFLAGS += -L/opt/local/lib |
| 1150 | endif |
| 1151 | endif |
David Aguilar | 4dcd773 | 2013-05-19 06:23:34 -0400 | [diff] [blame] | 1152 | ifndef NO_APPLE_COMMON_CRYPTO |
Lars Schneider | f01fe92 | 2016-11-06 20:35:04 +0100 | [diff] [blame] | 1153 | NO_OPENSSL = YesPlease |
David Aguilar | 4dcd773 | 2013-05-19 06:23:34 -0400 | [diff] [blame] | 1154 | APPLE_COMMON_CRYPTO = YesPlease |
| 1155 | COMPAT_CFLAGS += -DAPPLE_COMMON_CRYPTO |
| 1156 | endif |
David Aguilar | 29de205 | 2013-05-11 01:22:26 -0700 | [diff] [blame] | 1157 | NO_REGEX = YesPlease |
Ted Pavlic | f7d9d04 | 2009-01-26 14:03:59 -0500 | [diff] [blame] | 1158 | PTHREAD_LIBS = |
Brian Gernhardt | 59f8674 | 2006-12-12 12:01:47 -0500 | [diff] [blame] | 1159 | endif |
| 1160 | |
Junio C Hamano | f5b904d | 2008-08-16 21:56:24 -0700 | [diff] [blame] | 1161 | ifndef CC_LD_DYNPATH |
| 1162 | ifdef NO_R_TO_GCC_LINKER |
| 1163 | # Some gcc does not accept and pass -R to the linker to specify |
| 1164 | # the runtime dynamic library path. |
| 1165 | CC_LD_DYNPATH = -Wl,-rpath, |
| 1166 | else |
| 1167 | CC_LD_DYNPATH = -R |
| 1168 | endif |
Junio C Hamano | bbfc63d | 2006-12-27 14:17:35 -0800 | [diff] [blame] | 1169 | endif |
| 1170 | |
David Aguilar | e1c0688 | 2009-05-31 01:35:51 -0700 | [diff] [blame] | 1171 | ifdef NO_LIBGEN_H |
| 1172 | COMPAT_CFLAGS += -DNO_LIBGEN_H |
| 1173 | COMPAT_OBJS += compat/basename.o |
| 1174 | endif |
| 1175 | |
Ævar Arnfjörð Bjarmason | 94da919 | 2017-06-01 18:20:56 +0000 | [diff] [blame] | 1176 | USE_LIBPCRE1 ?= $(USE_LIBPCRE) |
| 1177 | |
| 1178 | ifneq (,$(USE_LIBPCRE1)) |
| 1179 | ifdef USE_LIBPCRE2 |
| 1180 | $(error Only set USE_LIBPCRE1 (or its alias USE_LIBPCRE) or USE_LIBPCRE2, not both!) |
Michał Kiedrowicz | 63e7e9d | 2011-05-09 23:52:05 +0200 | [diff] [blame] | 1181 | endif |
Ævar Arnfjörð Bjarmason | 94da919 | 2017-06-01 18:20:56 +0000 | [diff] [blame] | 1182 | |
| 1183 | BASIC_CFLAGS += -DUSE_LIBPCRE1 |
Michał Kiedrowicz | 63e7e9d | 2011-05-09 23:52:05 +0200 | [diff] [blame] | 1184 | EXTLIBS += -lpcre |
Ævar Arnfjörð Bjarmason | fb95e2e | 2017-06-01 18:20:55 +0000 | [diff] [blame] | 1185 | |
| 1186 | ifdef NO_LIBPCRE1_JIT |
| 1187 | BASIC_CFLAGS += -DNO_LIBPCRE1_JIT |
| 1188 | endif |
Michał Kiedrowicz | 63e7e9d | 2011-05-09 23:52:05 +0200 | [diff] [blame] | 1189 | endif |
| 1190 | |
Ævar Arnfjörð Bjarmason | 94da919 | 2017-06-01 18:20:56 +0000 | [diff] [blame] | 1191 | ifdef USE_LIBPCRE2 |
| 1192 | BASIC_CFLAGS += -DUSE_LIBPCRE2 |
| 1193 | EXTLIBS += -lpcre2-8 |
| 1194 | endif |
| 1195 | |
| 1196 | ifdef LIBPCREDIR |
| 1197 | BASIC_CFLAGS += -I$(LIBPCREDIR)/include |
| 1198 | EXTLIBS += -L$(LIBPCREDIR)/$(lib) $(CC_LD_DYNPATH)$(LIBPCREDIR)/$(lib) |
Junio C Hamano | 229a7ed | 2005-09-23 10:41:40 -0700 | [diff] [blame] | 1199 | endif |
| 1200 | |
Kirill Smelkov | 61f76a3 | 2014-03-27 18:22:50 +0400 | [diff] [blame] | 1201 | ifdef HAVE_ALLOCA_H |
| 1202 | BASIC_CFLAGS += -DHAVE_ALLOCA_H |
| 1203 | endif |
| 1204 | |
Bernhard Reiter | 1e16b25 | 2014-11-09 15:55:53 +0100 | [diff] [blame] | 1205 | IMAP_SEND_BUILDDEPS = |
Remi Pommarel | 9eaa78b | 2015-10-21 19:01:13 +0200 | [diff] [blame] | 1206 | IMAP_SEND_LDFLAGS = |
Bernhard Reiter | 1e16b25 | 2014-11-09 15:55:53 +0100 | [diff] [blame] | 1207 | |
Daniel Barkalow | 30ae764 | 2007-09-10 23:02:45 -0400 | [diff] [blame] | 1208 | ifdef NO_CURL |
| 1209 | BASIC_CFLAGS += -DNO_CURL |
Johannes Sixt | 4256f36 | 2010-01-19 16:39:12 +0100 | [diff] [blame] | 1210 | REMOTE_CURL_PRIMARY = |
| 1211 | REMOTE_CURL_ALIASES = |
| 1212 | REMOTE_CURL_NAMES = |
Daniel Barkalow | 30ae764 | 2007-09-10 23:02:45 -0400 | [diff] [blame] | 1213 | else |
Junio C Hamano | 229a7ed | 2005-09-23 10:41:40 -0700 | [diff] [blame] | 1214 | ifdef CURLDIR |
Junio C Hamano | b2feb64 | 2014-04-30 10:58:10 -0700 | [diff] [blame] | 1215 | # Try "-Wl,-rpath=$(CURLDIR)/$(lib)" in such a case. |
| 1216 | BASIC_CFLAGS += -I$(CURLDIR)/include |
| 1217 | CURL_LIBCURL = -L$(CURLDIR)/$(lib) $(CC_LD_DYNPATH)$(CURLDIR)/$(lib) -lcurl |
Dave Borowitz | f3f11fa | 2014-04-28 14:01:23 -0700 | [diff] [blame] | 1218 | else |
Junio C Hamano | b2feb64 | 2014-04-30 10:58:10 -0700 | [diff] [blame] | 1219 | CURL_LIBCURL = -lcurl |
| 1220 | endif |
| 1221 | ifdef NEEDS_SSL_WITH_CURL |
| 1222 | CURL_LIBCURL += -lssl |
| 1223 | ifdef NEEDS_CRYPTO_WITH_SSL |
| 1224 | CURL_LIBCURL += -lcrypto |
Dave Borowitz | f3f11fa | 2014-04-28 14:01:23 -0700 | [diff] [blame] | 1225 | endif |
| 1226 | endif |
Junio C Hamano | b2feb64 | 2014-04-30 10:58:10 -0700 | [diff] [blame] | 1227 | ifdef NEEDS_IDN_WITH_CURL |
| 1228 | CURL_LIBCURL += -lidn |
Thomas Cort | bc5f813 | 2011-07-19 18:55:47 -0400 | [diff] [blame] | 1229 | endif |
| 1230 | |
Johannes Sixt | 4256f36 | 2010-01-19 16:39:12 +0100 | [diff] [blame] | 1231 | REMOTE_CURL_PRIMARY = git-remote-http$X |
| 1232 | REMOTE_CURL_ALIASES = git-remote-https$X git-remote-ftp$X git-remote-ftps$X |
| 1233 | REMOTE_CURL_NAMES = $(REMOTE_CURL_PRIMARY) $(REMOTE_CURL_ALIASES) |
Jonathan Nieder | 1b22c99 | 2010-01-26 09:54:23 -0600 | [diff] [blame] | 1234 | PROGRAM_OBJS += http-fetch.o |
| 1235 | PROGRAMS += $(REMOTE_CURL_NAMES) |
Remi Pommarel | f891587 | 2015-10-21 19:10:46 +0200 | [diff] [blame] | 1236 | curl_check := $(shell (echo 070908; $(CURL_CONFIG) --vernum | sed -e '/^70[BC]/s/^/0/') 2>/dev/null | sort -r | sed -ne 2p) |
Nick Hengeveld | 0890098 | 2005-11-18 17:08:36 -0800 | [diff] [blame] | 1237 | ifeq "$(curl_check)" "070908" |
| 1238 | ifndef NO_EXPAT |
Jonathan Nieder | 1b22c99 | 2010-01-26 09:54:23 -0600 | [diff] [blame] | 1239 | PROGRAM_OBJS += http-push.o |
Nick Hengeveld | 0890098 | 2005-11-18 17:08:36 -0800 | [diff] [blame] | 1240 | endif |
Nick Hengeveld | 58e60dd | 2005-11-02 11:19:24 -0800 | [diff] [blame] | 1241 | endif |
Remi Pommarel | f891587 | 2015-10-21 19:10:46 +0200 | [diff] [blame] | 1242 | curl_check := $(shell (echo 072200; $(CURL_CONFIG) --vernum | sed -e '/^70[BC]/s/^/0/') 2>/dev/null | sort -r | sed -ne 2p) |
Bernhard Reiter | 1e16b25 | 2014-11-09 15:55:53 +0100 | [diff] [blame] | 1243 | ifeq "$(curl_check)" "072200" |
| 1244 | USE_CURL_FOR_IMAP_SEND = YesPlease |
| 1245 | endif |
| 1246 | ifdef USE_CURL_FOR_IMAP_SEND |
| 1247 | BASIC_CFLAGS += -DUSE_CURL_FOR_IMAP_SEND |
| 1248 | IMAP_SEND_BUILDDEPS = http.o |
| 1249 | IMAP_SEND_LDFLAGS += $(CURL_LIBCURL) |
| 1250 | endif |
Johannes Schindelin | 459a21b | 2006-04-05 16:22:40 +0200 | [diff] [blame] | 1251 | ifndef NO_EXPAT |
Serge van den Boom | 85b4518 | 2009-01-28 21:43:57 +0100 | [diff] [blame] | 1252 | ifdef EXPATDIR |
| 1253 | BASIC_CFLAGS += -I$(EXPATDIR)/include |
| 1254 | EXPAT_LIBEXPAT = -L$(EXPATDIR)/$(lib) $(CC_LD_DYNPATH)$(EXPATDIR)/$(lib) -lexpat |
| 1255 | else |
| 1256 | EXPAT_LIBEXPAT = -lexpat |
| 1257 | endif |
Matt Kraai | 081fd8d | 2013-02-11 14:03:45 -0800 | [diff] [blame] | 1258 | ifdef EXPAT_NEEDS_XMLPARSE_H |
| 1259 | BASIC_CFLAGS += -DEXPAT_NEEDS_XMLPARSE_H |
| 1260 | endif |
Johannes Schindelin | 459a21b | 2006-04-05 16:22:40 +0200 | [diff] [blame] | 1261 | endif |
Junio C Hamano | 229a7ed | 2005-09-23 10:41:40 -0700 | [diff] [blame] | 1262 | endif |
Remi Pommarel | 9eaa78b | 2015-10-21 19:01:13 +0200 | [diff] [blame] | 1263 | IMAP_SEND_LDFLAGS += $(OPENSSL_LINK) $(OPENSSL_LIBSSL) $(LIB_4_CRYPTO) |
Junio C Hamano | 229a7ed | 2005-09-23 10:41:40 -0700 | [diff] [blame] | 1264 | |
Robert Schiele | bef19da | 2007-07-29 20:35:45 +0200 | [diff] [blame] | 1265 | ifdef ZLIB_PATH |
| 1266 | BASIC_CFLAGS += -I$(ZLIB_PATH)/include |
Robert Schiele | 10861be | 2007-08-01 06:30:35 +0200 | [diff] [blame] | 1267 | EXTLIBS += -L$(ZLIB_PATH)/$(lib) $(CC_LD_DYNPATH)$(ZLIB_PATH)/$(lib) |
Robert Schiele | bef19da | 2007-07-29 20:35:45 +0200 | [diff] [blame] | 1268 | endif |
| 1269 | EXTLIBS += -lz |
| 1270 | |
Petr Baudis | dd53c7a | 2005-07-29 17:50:51 +0200 | [diff] [blame] | 1271 | ifndef NO_OPENSSL |
Junio C Hamano | 215a7ad | 2005-09-07 17:26:23 -0700 | [diff] [blame] | 1272 | OPENSSL_LIBSSL = -lssl |
Junio C Hamano | 455a7f3 | 2005-09-30 13:31:16 -0700 | [diff] [blame] | 1273 | ifdef OPENSSLDIR |
Petr Baudis | 8d7f586 | 2006-06-25 03:47:03 +0200 | [diff] [blame] | 1274 | BASIC_CFLAGS += -I$(OPENSSLDIR)/include |
Robert Schiele | 10861be | 2007-08-01 06:30:35 +0200 | [diff] [blame] | 1275 | OPENSSL_LINK = -L$(OPENSSLDIR)/$(lib) $(CC_LD_DYNPATH)$(OPENSSLDIR)/$(lib) |
Junio C Hamano | 455a7f3 | 2005-09-30 13:31:16 -0700 | [diff] [blame] | 1276 | else |
| 1277 | OPENSSL_LINK = |
| 1278 | endif |
Brian Gernhardt | 0460dba | 2009-09-08 09:54:38 -0400 | [diff] [blame] | 1279 | ifdef NEEDS_CRYPTO_WITH_SSL |
Thomas Cort | bc5f813 | 2011-07-19 18:55:47 -0400 | [diff] [blame] | 1280 | OPENSSL_LIBSSL += -lcrypto |
Brian Gernhardt | 0460dba | 2009-09-08 09:54:38 -0400 | [diff] [blame] | 1281 | endif |
Petr Baudis | dd53c7a | 2005-07-29 17:50:51 +0200 | [diff] [blame] | 1282 | else |
Petr Baudis | 8d7f586 | 2006-06-25 03:47:03 +0200 | [diff] [blame] | 1283 | BASIC_CFLAGS += -DNO_OPENSSL |
Junio C Hamano | 215a7ad | 2005-09-07 17:26:23 -0700 | [diff] [blame] | 1284 | OPENSSL_LIBSSL = |
Petr Baudis | dd53c7a | 2005-07-29 17:50:51 +0200 | [diff] [blame] | 1285 | endif |
Junio C Hamano | 5b02b9b | 2010-12-08 14:54:13 -0800 | [diff] [blame] | 1286 | ifdef NO_OPENSSL |
| 1287 | LIB_4_CRYPTO = |
| 1288 | else |
Junio C Hamano | 597c9cc | 2005-09-07 12:22:56 -0700 | [diff] [blame] | 1289 | ifdef NEEDS_SSL_WITH_CRYPTO |
Junio C Hamano | 455a7f3 | 2005-09-30 13:31:16 -0700 | [diff] [blame] | 1290 | LIB_4_CRYPTO = $(OPENSSL_LINK) -lcrypto -lssl |
Junio C Hamano | 597c9cc | 2005-09-07 12:22:56 -0700 | [diff] [blame] | 1291 | else |
Junio C Hamano | 455a7f3 | 2005-09-30 13:31:16 -0700 | [diff] [blame] | 1292 | LIB_4_CRYPTO = $(OPENSSL_LINK) -lcrypto |
Junio C Hamano | 597c9cc | 2005-09-07 12:22:56 -0700 | [diff] [blame] | 1293 | endif |
Brian Gernhardt | c984938 | 2013-08-05 11:59:22 -0400 | [diff] [blame] | 1294 | ifdef APPLE_COMMON_CRYPTO |
| 1295 | LIB_4_CRYPTO += -framework Security -framework CoreFoundation |
| 1296 | endif |
Junio C Hamano | 5b02b9b | 2010-12-08 14:54:13 -0800 | [diff] [blame] | 1297 | endif |
Junio C Hamano | 597c9cc | 2005-09-07 12:22:56 -0700 | [diff] [blame] | 1298 | ifdef NEEDS_LIBICONV |
Junio C Hamano | 455a7f3 | 2005-09-30 13:31:16 -0700 | [diff] [blame] | 1299 | ifdef ICONVDIR |
Petr Baudis | 8d7f586 | 2006-06-25 03:47:03 +0200 | [diff] [blame] | 1300 | BASIC_CFLAGS += -I$(ICONVDIR)/include |
Robert Schiele | 10861be | 2007-08-01 06:30:35 +0200 | [diff] [blame] | 1301 | ICONV_LINK = -L$(ICONVDIR)/$(lib) $(CC_LD_DYNPATH)$(ICONVDIR)/$(lib) |
Junio C Hamano | 455a7f3 | 2005-09-30 13:31:16 -0700 | [diff] [blame] | 1302 | else |
| 1303 | ICONV_LINK = |
| 1304 | endif |
Joachim Schmitz | 6c10990 | 2012-09-19 12:03:30 +0200 | [diff] [blame] | 1305 | ifdef NEEDS_LIBINTL_BEFORE_LIBICONV |
| 1306 | ICONV_LINK += -lintl |
| 1307 | endif |
Petr Baudis | d595a47 | 2006-06-24 18:35:12 -0700 | [diff] [blame] | 1308 | EXTLIBS += $(ICONV_LINK) -liconv |
Junio C Hamano | 597c9cc | 2005-09-07 12:22:56 -0700 | [diff] [blame] | 1309 | endif |
Brandon Casey | ecc395c | 2009-07-10 12:10:45 -0500 | [diff] [blame] | 1310 | ifdef NEEDS_LIBGEN |
| 1311 | EXTLIBS += -lgen |
| 1312 | endif |
Ævar Arnfjörð Bjarmason | 5e9637c | 2011-11-18 00:14:42 +0100 | [diff] [blame] | 1313 | ifndef NO_GETTEXT |
| 1314 | ifndef LIBC_CONTAINS_LIBINTL |
| 1315 | EXTLIBS += -lintl |
| 1316 | endif |
| 1317 | endif |
Patrick Mauritz | f0ebff0 | 2005-09-06 01:24:03 +0200 | [diff] [blame] | 1318 | ifdef NEEDS_SOCKET |
Petr Baudis | d595a47 | 2006-06-24 18:35:12 -0700 | [diff] [blame] | 1319 | EXTLIBS += -lsocket |
Patrick Mauritz | f0ebff0 | 2005-09-06 01:24:03 +0200 | [diff] [blame] | 1320 | endif |
Junio C Hamano | 5a90d4a | 2005-09-11 22:25:49 -0700 | [diff] [blame] | 1321 | ifdef NEEDS_NSL |
Petr Baudis | d595a47 | 2006-06-24 18:35:12 -0700 | [diff] [blame] | 1322 | EXTLIBS += -lnsl |
Junio C Hamano | 5a90d4a | 2005-09-11 22:25:49 -0700 | [diff] [blame] | 1323 | endif |
Brandon Casey | 70cf991 | 2009-06-05 18:36:10 -0500 | [diff] [blame] | 1324 | ifdef NEEDS_RESOLV |
| 1325 | EXTLIBS += -lresolv |
| 1326 | endif |
Junio C Hamano | 63be37b | 2006-01-19 17:13:57 -0800 | [diff] [blame] | 1327 | ifdef NO_D_TYPE_IN_DIRENT |
Petr Baudis | 8d7f586 | 2006-06-25 03:47:03 +0200 | [diff] [blame] | 1328 | BASIC_CFLAGS += -DNO_D_TYPE_IN_DIRENT |
Junio C Hamano | 63be37b | 2006-01-19 17:13:57 -0800 | [diff] [blame] | 1329 | endif |
David Michael | 110d698 | 2012-12-14 14:56:59 -0500 | [diff] [blame] | 1330 | ifdef NO_GECOS_IN_PWENT |
| 1331 | BASIC_CFLAGS += -DNO_GECOS_IN_PWENT |
| 1332 | endif |
Junio C Hamano | fdb2a2a | 2008-08-18 21:57:16 +0200 | [diff] [blame] | 1333 | ifdef NO_ST_BLOCKS_IN_STRUCT_STAT |
| 1334 | BASIC_CFLAGS += -DNO_ST_BLOCKS_IN_STRUCT_STAT |
| 1335 | endif |
Brian Gernhardt | d7371a2 | 2009-03-08 17:22:51 -0400 | [diff] [blame] | 1336 | ifdef USE_NSEC |
| 1337 | BASIC_CFLAGS += -DUSE_NSEC |
| 1338 | endif |
Brian Gernhardt | c567383 | 2009-03-08 16:04:28 -0400 | [diff] [blame] | 1339 | ifdef USE_ST_TIMESPEC |
| 1340 | BASIC_CFLAGS += -DUSE_ST_TIMESPEC |
| 1341 | endif |
Junio C Hamano | 6520c84 | 2011-06-18 18:07:03 -0700 | [diff] [blame] | 1342 | ifdef NO_NORETURN |
| 1343 | BASIC_CFLAGS += -DNO_NORETURN |
| 1344 | endif |
Kjetil Barvik | c06ff49 | 2009-03-04 18:47:40 +0100 | [diff] [blame] | 1345 | ifdef NO_NSEC |
| 1346 | BASIC_CFLAGS += -DNO_NSEC |
| 1347 | endif |
Michal Rokos | c4582f9 | 2008-03-05 16:46:13 +0100 | [diff] [blame] | 1348 | ifdef SNPRINTF_RETURNS_BOGUS |
| 1349 | COMPAT_CFLAGS += -DSNPRINTF_RETURNS_BOGUS |
| 1350 | COMPAT_OBJS += compat/snprintf.o |
| 1351 | endif |
Brandon Casey | cba2252 | 2008-02-08 20:32:47 -0600 | [diff] [blame] | 1352 | ifdef FREAD_READS_DIRECTORIES |
| 1353 | COMPAT_CFLAGS += -DFREAD_READS_DIRECTORIES |
| 1354 | COMPAT_OBJS += compat/fopen.o |
| 1355 | endif |
Junio C Hamano | 9f0bb90 | 2006-05-02 00:40:24 -0700 | [diff] [blame] | 1356 | ifdef NO_SYMLINK_HEAD |
Petr Baudis | 8d7f586 | 2006-06-25 03:47:03 +0200 | [diff] [blame] | 1357 | BASIC_CFLAGS += -DNO_SYMLINK_HEAD |
Junio C Hamano | 9f0bb90 | 2006-05-02 00:40:24 -0700 | [diff] [blame] | 1358 | endif |
Ævar Arnfjörð Bjarmason | bb946bb | 2011-02-22 23:41:21 +0000 | [diff] [blame] | 1359 | ifdef GETTEXT_POISON |
| 1360 | BASIC_CFLAGS += -DGETTEXT_POISON |
| 1361 | endif |
Ævar Arnfjörð Bjarmason | 5e9637c | 2011-11-18 00:14:42 +0100 | [diff] [blame] | 1362 | ifdef NO_GETTEXT |
| 1363 | BASIC_CFLAGS += -DNO_GETTEXT |
Junio C Hamano | 60f4079 | 2012-01-23 18:31:09 -0600 | [diff] [blame] | 1364 | USE_GETTEXT_SCHEME ?= fallthrough |
Ævar Arnfjörð Bjarmason | 5e9637c | 2011-11-18 00:14:42 +0100 | [diff] [blame] | 1365 | endif |
Joachim Schmitz | 6d45eb1 | 2012-09-17 23:16:39 +0200 | [diff] [blame] | 1366 | ifdef NO_POLL |
| 1367 | NO_SYS_POLL_H = YesPlease |
| 1368 | COMPAT_CFLAGS += -DNO_POLL -Icompat/poll |
| 1369 | COMPAT_OBJS += compat/poll/poll.o |
| 1370 | endif |
Linus Torvalds | ef34af2 | 2005-09-18 18:30:50 -0700 | [diff] [blame] | 1371 | ifdef NO_STRCASESTR |
Junio C Hamano | 4050c0d | 2005-12-05 11:54:29 -0800 | [diff] [blame] | 1372 | COMPAT_CFLAGS += -DNO_STRCASESTR |
Jason Riedy | e40b61f | 2005-12-02 15:08:28 -0800 | [diff] [blame] | 1373 | COMPAT_OBJS += compat/strcasestr.o |
| 1374 | endif |
Peter Eriksen | 817151e | 2006-06-24 16:01:25 +0200 | [diff] [blame] | 1375 | ifdef NO_STRLCPY |
| 1376 | COMPAT_CFLAGS += -DNO_STRLCPY |
| 1377 | COMPAT_OBJS += compat/strlcpy.o |
| 1378 | endif |
Jason Riedy | bc6b4f5 | 2007-02-19 16:22:56 -0800 | [diff] [blame] | 1379 | ifdef NO_STRTOUMAX |
| 1380 | COMPAT_CFLAGS += -DNO_STRTOUMAX |
Nick Alcock | e3eed7f | 2011-11-02 15:46:22 +0000 | [diff] [blame] | 1381 | COMPAT_OBJS += compat/strtoumax.o compat/strtoimax.o |
Jason Riedy | bc6b4f5 | 2007-02-19 16:22:56 -0800 | [diff] [blame] | 1382 | endif |
| 1383 | ifdef NO_STRTOULL |
| 1384 | COMPAT_CFLAGS += -DNO_STRTOULL |
| 1385 | endif |
Jason Riedy | e40b61f | 2005-12-02 15:08:28 -0800 | [diff] [blame] | 1386 | ifdef NO_SETENV |
Junio C Hamano | 4050c0d | 2005-12-05 11:54:29 -0800 | [diff] [blame] | 1387 | COMPAT_CFLAGS += -DNO_SETENV |
Jason Riedy | e40b61f | 2005-12-02 15:08:28 -0800 | [diff] [blame] | 1388 | COMPAT_OBJS += compat/setenv.o |
Linus Torvalds | ef34af2 | 2005-09-18 18:30:50 -0700 | [diff] [blame] | 1389 | endif |
Shawn O. Pearce | ca5bb5d | 2007-10-20 16:03:49 -0400 | [diff] [blame] | 1390 | ifdef NO_MKDTEMP |
| 1391 | COMPAT_CFLAGS += -DNO_MKDTEMP |
| 1392 | COMPAT_OBJS += compat/mkdtemp.o |
| 1393 | endif |
Joachim Schmitz | dc9f462 | 2012-09-08 19:01:31 +0200 | [diff] [blame] | 1394 | ifdef MKDIR_WO_TRAILING_SLASH |
| 1395 | COMPAT_CFLAGS += -DMKDIR_WO_TRAILING_SLASH |
| 1396 | COMPAT_OBJS += compat/mkdir.o |
| 1397 | endif |
Johannes Schindelin | 104ff34 | 2006-08-29 12:51:14 +0200 | [diff] [blame] | 1398 | ifdef NO_UNSETENV |
Jason Riedy | 731043f | 2006-01-25 12:38:36 -0800 | [diff] [blame] | 1399 | COMPAT_CFLAGS += -DNO_UNSETENV |
| 1400 | COMPAT_OBJS += compat/unsetenv.o |
| 1401 | endif |
Robert Schiele | 2600973 | 2008-01-24 19:34:46 +0100 | [diff] [blame] | 1402 | ifdef NO_SYS_SELECT_H |
| 1403 | BASIC_CFLAGS += -DNO_SYS_SELECT_H |
| 1404 | endif |
Markus Duft | 2844923 | 2010-10-27 10:39:52 +0200 | [diff] [blame] | 1405 | ifdef NO_SYS_POLL_H |
| 1406 | BASIC_CFLAGS += -DNO_SYS_POLL_H |
| 1407 | endif |
Junio C Hamano | b2d05e0 | 2012-12-18 09:35:33 -0800 | [diff] [blame] | 1408 | ifdef NEEDS_SYS_PARAM_H |
| 1409 | BASIC_CFLAGS += -DNEEDS_SYS_PARAM_H |
David Michael | 6ede720 | 2012-12-14 14:56:58 -0500 | [diff] [blame] | 1410 | endif |
Markus Duft | 2844923 | 2010-10-27 10:39:52 +0200 | [diff] [blame] | 1411 | ifdef NO_INTTYPES_H |
| 1412 | BASIC_CFLAGS += -DNO_INTTYPES_H |
| 1413 | endif |
| 1414 | ifdef NO_INITGROUPS |
| 1415 | BASIC_CFLAGS += -DNO_INITGROUPS |
| 1416 | endif |
Johannes Schindelin | 730d48a | 2005-10-08 15:54:36 -0700 | [diff] [blame] | 1417 | ifdef NO_MMAP |
Junio C Hamano | 4050c0d | 2005-12-05 11:54:29 -0800 | [diff] [blame] | 1418 | COMPAT_CFLAGS += -DNO_MMAP |
Jason Riedy | e40b61f | 2005-12-02 15:08:28 -0800 | [diff] [blame] | 1419 | COMPAT_OBJS += compat/mmap.o |
Janos Laube | b130a72 | 2009-03-13 16:50:45 +0100 | [diff] [blame] | 1420 | else |
| 1421 | ifdef USE_WIN32_MMAP |
| 1422 | COMPAT_CFLAGS += -DUSE_WIN32_MMAP |
| 1423 | COMPAT_OBJS += compat/win32mmap.o |
| 1424 | endif |
Johannes Schindelin | 730d48a | 2005-10-08 15:54:36 -0700 | [diff] [blame] | 1425 | endif |
Michael Haggerty | 5b63361 | 2017-09-25 10:00:10 +0200 | [diff] [blame] | 1426 | ifdef MMAP_PREVENTS_DELETE |
| 1427 | BASIC_CFLAGS += -DMMAP_PREVENTS_DELETE |
| 1428 | endif |
Johannes Schindelin | 348df16 | 2009-04-28 00:32:25 +0200 | [diff] [blame] | 1429 | ifdef OBJECT_CREATION_USES_RENAMES |
| 1430 | COMPAT_CFLAGS += -DOBJECT_CREATION_MODE=1 |
Johannes Schindelin | be66a6c | 2009-04-25 11:57:14 +0200 | [diff] [blame] | 1431 | endif |
Joachim Schmitz | 7f9e848 | 2012-09-08 18:54:34 +0200 | [diff] [blame] | 1432 | ifdef NO_STRUCT_ITIMERVAL |
| 1433 | COMPAT_CFLAGS += -DNO_STRUCT_ITIMERVAL |
Stefano Lattarini | dd6fc7c | 2012-12-09 11:36:17 +0100 | [diff] [blame] | 1434 | NO_SETITIMER = YesPlease |
Joachim Schmitz | 7f9e848 | 2012-09-08 18:54:34 +0200 | [diff] [blame] | 1435 | endif |
| 1436 | ifdef NO_SETITIMER |
| 1437 | COMPAT_CFLAGS += -DNO_SETITIMER |
| 1438 | endif |
Stefan-W. Hahn | 6900679 | 2007-01-09 22:04:12 +0100 | [diff] [blame] | 1439 | ifdef NO_PREAD |
| 1440 | COMPAT_CFLAGS += -DNO_PREAD |
| 1441 | COMPAT_OBJS += compat/pread.o |
| 1442 | endif |
Shawn O. Pearce | 1510fea | 2006-12-14 06:15:57 -0500 | [diff] [blame] | 1443 | ifdef NO_FAST_WORKING_DIRECTORY |
| 1444 | BASIC_CFLAGS += -DNO_FAST_WORKING_DIRECTORY |
| 1445 | endif |
Shawn O. Pearce | c869753 | 2006-12-30 23:53:55 -0500 | [diff] [blame] | 1446 | ifdef NO_TRUSTABLE_FILEMODE |
| 1447 | BASIC_CFLAGS += -DNO_TRUSTABLE_FILEMODE |
| 1448 | endif |
David Michael | d543d9c | 2014-12-03 21:24:17 -0500 | [diff] [blame] | 1449 | ifdef NEEDS_MODE_TRANSLATION |
| 1450 | COMPAT_CFLAGS += -DNEEDS_MODE_TRANSLATION |
| 1451 | COMPAT_OBJS += compat/stat.o |
| 1452 | endif |
hpa | 49744d6 | 2005-09-28 16:52:21 -0700 | [diff] [blame] | 1453 | ifdef NO_IPV6 |
Petr Baudis | 8d7f586 | 2006-06-25 03:47:03 +0200 | [diff] [blame] | 1454 | BASIC_CFLAGS += -DNO_IPV6 |
Junio C Hamano | bdc37f5 | 2006-01-19 17:13:32 -0800 | [diff] [blame] | 1455 | endif |
Joachim Schmitz | 6c10990 | 2012-09-19 12:03:30 +0200 | [diff] [blame] | 1456 | ifdef NO_INTPTR_T |
| 1457 | COMPAT_CFLAGS += -DNO_INTPTR_T |
| 1458 | endif |
David M. Syzdek | 0bc3e78 | 2008-10-26 03:52:37 -0800 | [diff] [blame] | 1459 | ifdef NO_UINTMAX_T |
| 1460 | BASIC_CFLAGS += -Duintmax_t=uint32_t |
| 1461 | endif |
Junio C Hamano | bdc37f5 | 2006-01-19 17:13:32 -0800 | [diff] [blame] | 1462 | ifdef NO_SOCKADDR_STORAGE |
| 1463 | ifdef NO_IPV6 |
Petr Baudis | 8d7f586 | 2006-06-25 03:47:03 +0200 | [diff] [blame] | 1464 | BASIC_CFLAGS += -Dsockaddr_storage=sockaddr_in |
Junio C Hamano | bdc37f5 | 2006-01-19 17:13:32 -0800 | [diff] [blame] | 1465 | else |
Petr Baudis | 8d7f586 | 2006-06-25 03:47:03 +0200 | [diff] [blame] | 1466 | BASIC_CFLAGS += -Dsockaddr_storage=sockaddr_in6 |
Junio C Hamano | bdc37f5 | 2006-01-19 17:13:32 -0800 | [diff] [blame] | 1467 | endif |
hpa | 49744d6 | 2005-09-28 16:52:21 -0700 | [diff] [blame] | 1468 | endif |
Yakov Lerner | 6ba68ab | 2006-05-22 00:37:00 +0300 | [diff] [blame] | 1469 | ifdef NO_INET_NTOP |
| 1470 | LIB_OBJS += compat/inet_ntop.o |
Mike Pape | da523cc | 2010-11-04 02:35:11 +0100 | [diff] [blame] | 1471 | BASIC_CFLAGS += -DNO_INET_NTOP |
Yakov Lerner | 6ba68ab | 2006-05-22 00:37:00 +0300 | [diff] [blame] | 1472 | endif |
Jon Loeliger | dd46762 | 2006-09-26 09:47:43 -0500 | [diff] [blame] | 1473 | ifdef NO_INET_PTON |
| 1474 | LIB_OBJS += compat/inet_pton.o |
Mike Pape | da523cc | 2010-11-04 02:35:11 +0100 | [diff] [blame] | 1475 | BASIC_CFLAGS += -DNO_INET_PTON |
Jon Loeliger | dd46762 | 2006-09-26 09:47:43 -0500 | [diff] [blame] | 1476 | endif |
Johannes Sixt | 6320358 | 2011-12-12 22:12:56 +0100 | [diff] [blame] | 1477 | ifndef NO_UNIX_SOCKETS |
| 1478 | LIB_OBJS += unix-socket.o |
Johannes Sixt | 6320358 | 2011-12-12 22:12:56 +0100 | [diff] [blame] | 1479 | PROGRAM_OBJS += credential-cache.o |
| 1480 | PROGRAM_OBJS += credential-cache--daemon.o |
| 1481 | endif |
Linus Torvalds | cef661f | 2005-04-21 12:33:22 -0700 | [diff] [blame] | 1482 | |
Fernando J. Pereda | b6e56ec | 2006-02-16 09:38:01 +0100 | [diff] [blame] | 1483 | ifdef NO_ICONV |
Petr Baudis | 8d7f586 | 2006-06-25 03:47:03 +0200 | [diff] [blame] | 1484 | BASIC_CFLAGS += -DNO_ICONV |
Fernando J. Pereda | b6e56ec | 2006-02-16 09:38:01 +0100 | [diff] [blame] | 1485 | endif |
| 1486 | |
Ramsay Jones | fd547a9 | 2007-03-03 18:29:03 +0000 | [diff] [blame] | 1487 | ifdef OLD_ICONV |
| 1488 | BASIC_CFLAGS += -DOLD_ICONV |
| 1489 | endif |
| 1490 | |
David Symonds | 609a228 | 2007-11-07 14:24:28 +1100 | [diff] [blame] | 1491 | ifdef NO_DEFLATE_BOUND |
| 1492 | BASIC_CFLAGS += -DNO_DEFLATE_BOUND |
| 1493 | endif |
| 1494 | |
Erik Faye-Lund | a666b47 | 2010-11-04 02:35:24 +0100 | [diff] [blame] | 1495 | ifdef NO_POSIX_GOODIES |
| 1496 | BASIC_CFLAGS += -DNO_POSIX_GOODIES |
| 1497 | endif |
| 1498 | |
Atousa Pahlevan Duprat | 001fd7a | 2015-11-04 22:38:42 -0800 | [diff] [blame] | 1499 | ifdef APPLE_COMMON_CRYPTO |
| 1500 | # Apple CommonCrypto requires chunking |
| 1501 | SHA1_MAX_BLOCK_SIZE = 1024L*1024L*1024L |
| 1502 | endif |
| 1503 | |
Junio C Hamano | e6b07da | 2017-03-17 10:00:15 -0700 | [diff] [blame] | 1504 | ifdef OPENSSL_SHA1 |
| 1505 | EXTLIBS += $(LIB_4_CRYPTO) |
| 1506 | BASIC_CFLAGS += -DSHA1_OPENSSL |
Jeff King | 8325e43 | 2017-03-16 18:09:12 -0400 | [diff] [blame] | 1507 | else |
Linus Torvalds | d7c208a | 2009-08-05 16:13:20 -0700 | [diff] [blame] | 1508 | ifdef BLK_SHA1 |
Linus Torvalds | d7c208a | 2009-08-05 16:13:20 -0700 | [diff] [blame] | 1509 | LIB_OBJS += block-sha1/sha1.o |
brian m. carlson | f18f816 | 2017-03-11 22:28:18 +0000 | [diff] [blame] | 1510 | BASIC_CFLAGS += -DSHA1_BLK |
Linus Torvalds | d7c208a | 2009-08-05 16:13:20 -0700 | [diff] [blame] | 1511 | else |
Nicolas Pitre | 7c6ef2f | 2005-09-20 12:27:13 -0400 | [diff] [blame] | 1512 | ifdef PPC_SHA1 |
Nicolas Pitre | 7c6ef2f | 2005-09-20 12:27:13 -0400 | [diff] [blame] | 1513 | LIB_OBJS += ppc/sha1.o ppc/sha1ppc.o |
brian m. carlson | f18f816 | 2017-03-11 22:28:18 +0000 | [diff] [blame] | 1514 | BASIC_CFLAGS += -DSHA1_PPC |
Nicolas Pitre | 7c6ef2f | 2005-09-20 12:27:13 -0400 | [diff] [blame] | 1515 | else |
David Aguilar | 6106795 | 2013-05-19 06:23:35 -0400 | [diff] [blame] | 1516 | ifdef APPLE_COMMON_CRYPTO |
| 1517 | COMPAT_CFLAGS += -DCOMMON_DIGEST_FOR_OPENSSL |
brian m. carlson | f18f816 | 2017-03-11 22:28:18 +0000 | [diff] [blame] | 1518 | BASIC_CFLAGS += -DSHA1_APPLE |
David Aguilar | 6106795 | 2013-05-19 06:23:35 -0400 | [diff] [blame] | 1519 | else |
Junio C Hamano | e6b07da | 2017-03-17 10:00:15 -0700 | [diff] [blame] | 1520 | DC_SHA1 := YesPlease |
Takashi Iwai | 36f048c | 2017-08-15 14:04:16 +0200 | [diff] [blame] | 1521 | BASIC_CFLAGS += -DSHA1_DC |
| 1522 | LIB_OBJS += sha1dc_git.o |
Takashi Iwai | 3964cbb | 2017-08-15 14:04:17 +0200 | [diff] [blame] | 1523 | ifdef DC_SHA1_EXTERNAL |
| 1524 | ifdef DC_SHA1_SUBMODULE |
Ævar Arnfjörð Bjarmason | f39e05f | 2017-12-08 22:29:57 +0000 | [diff] [blame] | 1525 | ifneq ($(DC_SHA1_SUBMODULE),auto) |
Takashi Iwai | 3964cbb | 2017-08-15 14:04:17 +0200 | [diff] [blame] | 1526 | $(error Only set DC_SHA1_EXTERNAL or DC_SHA1_SUBMODULE, not both) |
Ævar Arnfjörð Bjarmason | f39e05f | 2017-12-08 22:29:57 +0000 | [diff] [blame] | 1527 | endif |
Takashi Iwai | 3964cbb | 2017-08-15 14:04:17 +0200 | [diff] [blame] | 1528 | endif |
| 1529 | BASIC_CFLAGS += -DDC_SHA1_EXTERNAL |
| 1530 | EXTLIBS += -lsha1detectcoll |
| 1531 | else |
Ævar Arnfjörð Bjarmason | 86cfd61 | 2017-07-01 22:05:46 +0000 | [diff] [blame] | 1532 | ifdef DC_SHA1_SUBMODULE |
| 1533 | LIB_OBJS += sha1collisiondetection/lib/sha1.o |
| 1534 | LIB_OBJS += sha1collisiondetection/lib/ubc_check.o |
| 1535 | BASIC_CFLAGS += -DDC_SHA1_SUBMODULE |
| 1536 | else |
Junio C Hamano | e6b07da | 2017-03-17 10:00:15 -0700 | [diff] [blame] | 1537 | LIB_OBJS += sha1dc/sha1.o |
| 1538 | LIB_OBJS += sha1dc/ubc_check.o |
Ævar Arnfjörð Bjarmason | 86cfd61 | 2017-07-01 22:05:46 +0000 | [diff] [blame] | 1539 | endif |
Ævar Arnfjörð Bjarmason | a010391 | 2017-05-20 11:54:28 +0000 | [diff] [blame] | 1540 | BASIC_CFLAGS += \ |
Ævar Arnfjörð Bjarmason | a010391 | 2017-05-20 11:54:28 +0000 | [diff] [blame] | 1541 | -DSHA1DC_NO_STANDARD_INCLUDES \ |
| 1542 | -DSHA1DC_INIT_SAFE_HASH_DEFAULT=0 \ |
| 1543 | -DSHA1DC_CUSTOM_INCLUDE_SHA1_C="\"cache.h\"" \ |
Ævar Arnfjörð Bjarmason | a010391 | 2017-05-20 11:54:28 +0000 | [diff] [blame] | 1544 | -DSHA1DC_CUSTOM_INCLUDE_UBC_CHECK_C="\"git-compat-util.h\"" |
Nicolas Pitre | 7c6ef2f | 2005-09-20 12:27:13 -0400 | [diff] [blame] | 1545 | endif |
Nicolas Pitre | 7c6ef2f | 2005-09-20 12:27:13 -0400 | [diff] [blame] | 1546 | endif |
| 1547 | endif |
David Aguilar | 6106795 | 2013-05-19 06:23:35 -0400 | [diff] [blame] | 1548 | endif |
Takashi Iwai | 3964cbb | 2017-08-15 14:04:17 +0200 | [diff] [blame] | 1549 | endif |
David Aguilar | 6106795 | 2013-05-19 06:23:35 -0400 | [diff] [blame] | 1550 | |
Atousa Pahlevan Duprat | 001fd7a | 2015-11-04 22:38:42 -0800 | [diff] [blame] | 1551 | ifdef SHA1_MAX_BLOCK_SIZE |
| 1552 | LIB_OBJS += compat/sha1-chunked.o |
| 1553 | BASIC_CFLAGS += -DSHA1_MAX_BLOCK_SIZE="$(SHA1_MAX_BLOCK_SIZE)" |
| 1554 | endif |
Alex Riesen | fa0c87c | 2007-06-13 20:54:32 +0200 | [diff] [blame] | 1555 | ifdef NO_HSTRERROR |
| 1556 | COMPAT_CFLAGS += -DNO_HSTRERROR |
| 1557 | COMPAT_OBJS += compat/hstrerror.o |
| 1558 | endif |
René Scharfe | b21b9f1 | 2007-09-07 00:32:54 +0200 | [diff] [blame] | 1559 | ifdef NO_MEMMEM |
| 1560 | COMPAT_CFLAGS += -DNO_MEMMEM |
| 1561 | COMPAT_OBJS += compat/memmem.o |
| 1562 | endif |
Matt Kraai | 40036be | 2012-12-18 14:03:55 -0800 | [diff] [blame] | 1563 | ifdef NO_GETPAGESIZE |
| 1564 | COMPAT_CFLAGS += -DNO_GETPAGESIZE |
| 1565 | endif |
Brian Downing | 43fe901 | 2008-02-05 15:10:44 -0600 | [diff] [blame] | 1566 | ifdef INTERNAL_QSORT |
| 1567 | COMPAT_CFLAGS += -DINTERNAL_QSORT |
| 1568 | COMPAT_OBJS += compat/qsort.o |
| 1569 | endif |
René Scharfe | 04ee8b8 | 2017-01-22 18:51:11 +0100 | [diff] [blame] | 1570 | ifdef HAVE_ISO_QSORT_S |
| 1571 | COMPAT_CFLAGS += -DHAVE_ISO_QSORT_S |
| 1572 | else |
| 1573 | COMPAT_OBJS += compat/qsort_s.o |
| 1574 | endif |
Steffen Prohaska | 35fb0e86 | 2009-01-18 13:00:14 +0100 | [diff] [blame] | 1575 | ifdef RUNTIME_PREFIX |
| 1576 | COMPAT_CFLAGS += -DRUNTIME_PREFIX |
| 1577 | endif |
Alex Riesen | b777434 | 2007-03-07 00:44:49 +0100 | [diff] [blame] | 1578 | |
Junio C Hamano | 46059cc | 2008-11-15 04:08:14 -0800 | [diff] [blame] | 1579 | ifdef NO_PTHREADS |
Junio C Hamano | 46059cc | 2008-11-15 04:08:14 -0800 | [diff] [blame] | 1580 | BASIC_CFLAGS += -DNO_PTHREADS |
| 1581 | else |
Gary V. Vaughan | 48793cf | 2010-05-14 09:31:34 +0000 | [diff] [blame] | 1582 | BASIC_CFLAGS += $(PTHREAD_CFLAGS) |
Junio C Hamano | 46059cc | 2008-11-15 04:08:14 -0800 | [diff] [blame] | 1583 | EXTLIBS += $(PTHREAD_LIBS) |
Andreas Ericsson | 833e3df | 2008-02-22 20:11:56 -0600 | [diff] [blame] | 1584 | LIB_OBJS += thread-utils.o |
Nicolas Pitre | 8ecce68 | 2007-09-06 02:13:11 -0400 | [diff] [blame] | 1585 | endif |
Dan McGee | 7eb151d | 2010-01-29 19:22:19 -0600 | [diff] [blame] | 1586 | |
Chris Webb | cb6a22c | 2010-04-13 10:07:13 +0100 | [diff] [blame] | 1587 | ifdef HAVE_PATHS_H |
| 1588 | BASIC_CFLAGS += -DHAVE_PATHS_H |
| 1589 | endif |
| 1590 | |
Ævar Arnfjörð Bjarmason | 5e9637c | 2011-11-18 00:14:42 +0100 | [diff] [blame] | 1591 | ifdef HAVE_LIBCHARSET_H |
| 1592 | BASIC_CFLAGS += -DHAVE_LIBCHARSET_H |
Дилян Палаузов | b522528 | 2012-02-12 17:23:36 +0100 | [diff] [blame] | 1593 | EXTLIBS += $(CHARSET_LIB) |
Ævar Arnfjörð Bjarmason | 5e9637c | 2011-11-18 00:14:42 +0100 | [diff] [blame] | 1594 | endif |
| 1595 | |
David Michael | b3e103d | 2012-12-14 14:57:01 -0500 | [diff] [blame] | 1596 | ifdef HAVE_STRINGS_H |
| 1597 | BASIC_CFLAGS += -DHAVE_STRINGS_H |
| 1598 | endif |
| 1599 | |
Jeff King | 21aeafc | 2011-12-10 05:41:01 -0500 | [diff] [blame] | 1600 | ifdef HAVE_DEV_TTY |
| 1601 | BASIC_CFLAGS += -DHAVE_DEV_TTY |
| 1602 | endif |
| 1603 | |
Alex Riesen | 81a24b5 | 2008-03-05 00:15:39 +0100 | [diff] [blame] | 1604 | ifdef DIR_HAS_BSD_GROUP_SEMANTICS |
| 1605 | COMPAT_CFLAGS += -DDIR_HAS_BSD_GROUP_SEMANTICS |
| 1606 | endif |
Johannes Sixt | 34779c5 | 2009-04-20 10:17:00 +0200 | [diff] [blame] | 1607 | ifdef UNRELIABLE_FSTAT |
| 1608 | BASIC_CFLAGS += -DUNRELIABLE_FSTAT |
| 1609 | endif |
Jeff King | 02232ad | 2009-06-16 15:07:40 -0400 | [diff] [blame] | 1610 | ifdef NO_REGEX |
| 1611 | COMPAT_CFLAGS += -Icompat/regex |
| 1612 | COMPAT_OBJS += compat/regex/regex.o |
| 1613 | endif |
Pat Thoyts | 5491e9e | 2014-08-30 23:38:59 +0200 | [diff] [blame] | 1614 | ifdef NATIVE_CRLF |
| 1615 | BASIC_CFLAGS += -DNATIVE_CRLF |
| 1616 | endif |
Nicolas Pitre | 8ecce68 | 2007-09-06 02:13:11 -0400 | [diff] [blame] | 1617 | |
Marius Storm-Olsen | f0ed822 | 2009-05-31 18:15:23 +0200 | [diff] [blame] | 1618 | ifdef USE_NED_ALLOCATOR |
René Scharfe | ca2baa3 | 2016-09-03 17:59:15 +0200 | [diff] [blame] | 1619 | COMPAT_CFLAGS += -Icompat/nedmalloc |
| 1620 | COMPAT_OBJS += compat/nedmalloc/nedmalloc.o |
| 1621 | OVERRIDE_STRDUP = YesPlease |
| 1622 | endif |
| 1623 | |
| 1624 | ifdef OVERRIDE_STRDUP |
| 1625 | COMPAT_CFLAGS += -DOVERRIDE_STRDUP |
| 1626 | COMPAT_OBJS += compat/strdup.o |
Marius Storm-Olsen | f0ed822 | 2009-05-31 18:15:23 +0200 | [diff] [blame] | 1627 | endif |
| 1628 | |
Junio C Hamano | 7b3bdbb | 2010-05-31 17:35:20 -0700 | [diff] [blame] | 1629 | ifdef GIT_TEST_CMP_USE_COPIED_CONTEXT |
| 1630 | export GIT_TEST_CMP_USE_COPIED_CONTEXT |
| 1631 | endif |
| 1632 | |
Ævar Arnfjörð Bjarmason | 5e9637c | 2011-11-18 00:14:42 +0100 | [diff] [blame] | 1633 | ifndef NO_MSGFMT_EXTENDED_OPTIONS |
| 1634 | MSGFMT += --check --statistics |
| 1635 | endif |
| 1636 | |
Jeff King | 6654754 | 2014-04-01 17:28:42 -0400 | [diff] [blame] | 1637 | ifdef GMTIME_UNRELIABLE_ERRORS |
| 1638 | COMPAT_OBJS += compat/gmtime.o |
| 1639 | BASIC_CFLAGS += -DGMTIME_UNRELIABLE_ERRORS |
| 1640 | endif |
| 1641 | |
Karsten Blees | 148d677 | 2014-07-12 02:05:42 +0200 | [diff] [blame] | 1642 | ifdef HAVE_CLOCK_GETTIME |
| 1643 | BASIC_CFLAGS += -DHAVE_CLOCK_GETTIME |
Karsten Blees | 148d677 | 2014-07-12 02:05:42 +0200 | [diff] [blame] | 1644 | endif |
| 1645 | |
Reuben Hawkins | a6c3c63 | 2015-01-08 12:00:56 -0800 | [diff] [blame] | 1646 | ifdef HAVE_CLOCK_MONOTONIC |
| 1647 | BASIC_CFLAGS += -DHAVE_CLOCK_MONOTONIC |
| 1648 | endif |
| 1649 | |
Ronald Wampler | d19e3a5 | 2016-07-07 16:45:54 -0400 | [diff] [blame] | 1650 | ifdef NEEDS_LIBRT |
| 1651 | EXTLIBS += -lrt |
| 1652 | endif |
| 1653 | |
Kyle J. McKay | 9529080 | 2015-03-07 23:14:36 -0800 | [diff] [blame] | 1654 | ifdef HAVE_BSD_SYSCTL |
| 1655 | BASIC_CFLAGS += -DHAVE_BSD_SYSCTL |
| 1656 | endif |
| 1657 | |
Jeff King | 0cc30e0 | 2015-04-16 05:01:38 -0400 | [diff] [blame] | 1658 | ifdef HAVE_GETDELIM |
| 1659 | BASIC_CFLAGS += -DHAVE_GETDELIM |
| 1660 | endif |
| 1661 | |
Eygene Ryabinkin | 81b63c7 | 2007-03-28 04:12:07 -0700 | [diff] [blame] | 1662 | ifeq ($(TCLTK_PATH),) |
Stefano Lattarini | dd6fc7c | 2012-12-09 11:36:17 +0100 | [diff] [blame] | 1663 | NO_TCLTK = NoThanks |
Eygene Ryabinkin | 81b63c7 | 2007-03-28 04:12:07 -0700 | [diff] [blame] | 1664 | endif |
| 1665 | |
Jeff King | 499c293 | 2009-04-03 15:32:20 -0400 | [diff] [blame] | 1666 | ifeq ($(PERL_PATH),) |
Stefano Lattarini | dd6fc7c | 2012-12-09 11:36:17 +0100 | [diff] [blame] | 1667 | NO_PERL = NoThanks |
Jeff King | 499c293 | 2009-04-03 15:32:20 -0400 | [diff] [blame] | 1668 | endif |
| 1669 | |
Johan Herland | d4e1b47 | 2009-11-18 02:42:31 +0100 | [diff] [blame] | 1670 | ifeq ($(PYTHON_PATH),) |
Stefano Lattarini | dd6fc7c | 2012-12-09 11:36:17 +0100 | [diff] [blame] | 1671 | NO_PYTHON = NoThanks |
Johan Herland | d4e1b47 | 2009-11-18 02:42:31 +0100 | [diff] [blame] | 1672 | endif |
| 1673 | |
Eric Wong | 995bc22 | 2016-08-04 11:40:25 +0000 | [diff] [blame] | 1674 | ifndef PAGER_ENV |
| 1675 | PAGER_ENV = LESS=FRX LV=-c |
| 1676 | endif |
| 1677 | |
Fernando J. Pereda | 3b486cd | 2007-04-04 22:42:33 +0200 | [diff] [blame] | 1678 | QUIET_SUBDIR0 = +$(MAKE) -C # space to separate -C and subdir |
Alex Riesen | b777434 | 2007-03-07 00:44:49 +0100 | [diff] [blame] | 1679 | QUIET_SUBDIR1 = |
| 1680 | |
John Keeping | ef49e05 | 2015-09-05 13:22:10 +0100 | [diff] [blame] | 1681 | ifneq ($(findstring w,$(MAKEFLAGS)),w) |
Alex Riesen | a6f3709 | 2007-03-07 00:05:34 +0100 | [diff] [blame] | 1682 | PRINT_DIR = --no-print-directory |
| 1683 | else # "make -w" |
| 1684 | NO_SUBDIR = : |
| 1685 | endif |
| 1686 | |
John Keeping | ef49e05 | 2015-09-05 13:22:10 +0100 | [diff] [blame] | 1687 | ifneq ($(findstring s,$(MAKEFLAGS)),s) |
Shawn O. Pearce | 2314c94 | 2007-03-06 02:09:14 -0500 | [diff] [blame] | 1688 | ifndef V |
Alex Riesen | 31d0399 | 2007-03-06 23:37:18 +0100 | [diff] [blame] | 1689 | QUIET_CC = @echo ' ' CC $@; |
Shawn O. Pearce | 74f2b2a | 2007-03-06 01:35:01 -0500 | [diff] [blame] | 1690 | QUIET_AR = @echo ' ' AR $@; |
| 1691 | QUIET_LINK = @echo ' ' LINK $@; |
| 1692 | QUIET_BUILT_IN = @echo ' ' BUILTIN $@; |
| 1693 | QUIET_GEN = @echo ' ' GEN $@; |
Junio C Hamano | 611c7f6 | 2009-08-06 22:08:09 -0700 | [diff] [blame] | 1694 | QUIET_LNCP = @echo ' ' LN/CP $@; |
Ævar Arnfjörð Bjarmason | cd5513a | 2011-02-22 23:41:23 +0000 | [diff] [blame] | 1695 | QUIET_XGETTEXT = @echo ' ' XGETTEXT $@; |
Ævar Arnfjörð Bjarmason | 5e9637c | 2011-11-18 00:14:42 +0100 | [diff] [blame] | 1696 | QUIET_MSGFMT = @echo ' ' MSGFMT $@; |
Ævar Arnfjörð Bjarmason | bc548ef | 2010-07-25 19:52:40 +0000 | [diff] [blame] | 1697 | QUIET_GCOV = @echo ' ' GCOV $@; |
Ramsay Jones | 0bcd9ae | 2011-04-21 20:14:42 +0100 | [diff] [blame] | 1698 | QUIET_SP = @echo ' ' SP $<; |
Pat Thoyts | ce39c2e | 2012-05-24 00:56:24 +0100 | [diff] [blame] | 1699 | QUIET_RC = @echo ' ' RC $@; |
Fernando J. Pereda | 3b486cd | 2007-04-04 22:42:33 +0200 | [diff] [blame] | 1700 | QUIET_SUBDIR0 = +@subdir= |
Alex Riesen | a6f3709 | 2007-03-07 00:05:34 +0100 | [diff] [blame] | 1701 | QUIET_SUBDIR1 = ;$(NO_SUBDIR) echo ' ' SUBDIR $$subdir; \ |
| 1702 | $(MAKE) $(PRINT_DIR) -C $$subdir |
Shawn O. Pearce | 2314c94 | 2007-03-06 02:09:14 -0500 | [diff] [blame] | 1703 | export V |
Alex Riesen | 31d0399 | 2007-03-06 23:37:18 +0100 | [diff] [blame] | 1704 | export QUIET_GEN |
Alex Riesen | b777434 | 2007-03-07 00:44:49 +0100 | [diff] [blame] | 1705 | export QUIET_BUILT_IN |
| 1706 | endif |
Shawn O. Pearce | 74f2b2a | 2007-03-06 01:35:01 -0500 | [diff] [blame] | 1707 | endif |
Nicolas Pitre | 7c6ef2f | 2005-09-20 12:27:13 -0400 | [diff] [blame] | 1708 | |
Junio C Hamano | 70de5e6 | 2012-05-02 15:12:10 -0700 | [diff] [blame] | 1709 | ifdef NO_INSTALL_HARDLINKS |
| 1710 | export NO_INSTALL_HARDLINKS |
| 1711 | endif |
| 1712 | |
Theodore Ts'o | f2d713f | 2012-02-06 01:00:17 -0500 | [diff] [blame] | 1713 | ### profile feedback build |
| 1714 | # |
| 1715 | |
| 1716 | # Can adjust this to be a global directory if you want to do extended |
| 1717 | # data gathering |
| 1718 | PROFILE_DIR := $(CURDIR) |
| 1719 | |
Johannes Sixt | e60ec75 | 2012-02-09 09:22:26 +0100 | [diff] [blame] | 1720 | ifeq ("$(PROFILE)","GEN") |
Andi Kleen | 0be314c | 2014-07-04 16:43:48 -0700 | [diff] [blame] | 1721 | BASIC_CFLAGS += -fprofile-generate=$(PROFILE_DIR) -DNO_NORETURN=1 |
Theodore Ts'o | f2d713f | 2012-02-06 01:00:17 -0500 | [diff] [blame] | 1722 | EXTLIBS += -lgcov |
Stefano Lattarini | dd6fc7c | 2012-12-09 11:36:17 +0100 | [diff] [blame] | 1723 | export CCACHE_DISABLE = t |
| 1724 | V = 1 |
Johannes Sixt | e60ec75 | 2012-02-09 09:22:26 +0100 | [diff] [blame] | 1725 | else |
| 1726 | ifneq ("$(PROFILE)","") |
Andi Kleen | 0be314c | 2014-07-04 16:43:48 -0700 | [diff] [blame] | 1727 | BASIC_CFLAGS += -fprofile-use=$(PROFILE_DIR) -fprofile-correction -DNO_NORETURN=1 |
Stefano Lattarini | dd6fc7c | 2012-12-09 11:36:17 +0100 | [diff] [blame] | 1728 | export CCACHE_DISABLE = t |
| 1729 | V = 1 |
Theodore Ts'o | f2d713f | 2012-02-06 01:00:17 -0500 | [diff] [blame] | 1730 | endif |
Johannes Sixt | e60ec75 | 2012-02-09 09:22:26 +0100 | [diff] [blame] | 1731 | endif |
Theodore Ts'o | f2d713f | 2012-02-06 01:00:17 -0500 | [diff] [blame] | 1732 | |
Pavel Roskin | addf88e | 2006-07-09 03:44:30 -0400 | [diff] [blame] | 1733 | # Shell quote (do not use $(call) to accommodate ancient setups); |
Johannes Schindelin | 39c015c | 2006-02-18 12:40:22 +0100 | [diff] [blame] | 1734 | |
Johannes Schindelin | 32043c9 | 2007-02-14 12:48:14 +0100 | [diff] [blame] | 1735 | ETC_GITCONFIG_SQ = $(subst ','\'',$(ETC_GITCONFIG)) |
Petr Onderka | 6df42ab | 2010-09-01 00:42:43 +0200 | [diff] [blame] | 1736 | ETC_GITATTRIBUTES_SQ = $(subst ','\'',$(ETC_GITATTRIBUTES)) |
Johannes Schindelin | 39c015c | 2006-02-18 12:40:22 +0100 | [diff] [blame] | 1737 | |
| 1738 | DESTDIR_SQ = $(subst ','\'',$(DESTDIR)) |
| 1739 | bindir_SQ = $(subst ','\'',$(bindir)) |
Steffen Prohaska | 026fa0d | 2009-01-18 13:00:09 +0100 | [diff] [blame] | 1740 | bindir_relative_SQ = $(subst ','\'',$(bindir_relative)) |
Ævar Arnfjörð Bjarmason | 20d2a30 | 2017-12-10 21:13:33 +0000 | [diff] [blame] | 1741 | mandir_SQ = $(subst ','\'',$(mandir)) |
John Keeping | 971f853 | 2013-02-24 19:55:01 +0000 | [diff] [blame] | 1742 | mandir_relative_SQ = $(subst ','\'',$(mandir_relative)) |
| 1743 | infodir_relative_SQ = $(subst ','\'',$(infodir_relative)) |
Ævar Arnfjörð Bjarmason | 20d2a30 | 2017-12-10 21:13:33 +0000 | [diff] [blame] | 1744 | perllibdir_SQ = $(subst ','\'',$(perllibdir)) |
Ævar Arnfjörð Bjarmason | 5e9637c | 2011-11-18 00:14:42 +0100 | [diff] [blame] | 1745 | localedir_SQ = $(subst ','\'',$(localedir)) |
Johannes Schindelin | 39c015c | 2006-02-18 12:40:22 +0100 | [diff] [blame] | 1746 | gitexecdir_SQ = $(subst ','\'',$(gitexecdir)) |
| 1747 | template_dir_SQ = $(subst ','\'',$(template_dir)) |
John Keeping | 971f853 | 2013-02-24 19:55:01 +0000 | [diff] [blame] | 1748 | htmldir_relative_SQ = $(subst ','\'',$(htmldir_relative)) |
Yakov Lerner | ca3bcab | 2006-06-15 01:36:00 +0300 | [diff] [blame] | 1749 | prefix_SQ = $(subst ','\'',$(prefix)) |
Pavan Kumar Sunkara | c0cb4ed | 2010-05-28 11:55:52 +0530 | [diff] [blame] | 1750 | gitwebdir_SQ = $(subst ','\'',$(gitwebdir)) |
Johannes Schindelin | 39c015c | 2006-02-18 12:40:22 +0100 | [diff] [blame] | 1751 | |
| 1752 | SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH)) |
Jeff King | 3f824e9 | 2017-12-08 05:47:22 -0500 | [diff] [blame] | 1753 | TEST_SHELL_PATH_SQ = $(subst ','\'',$(TEST_SHELL_PATH)) |
Johannes Schindelin | 39c015c | 2006-02-18 12:40:22 +0100 | [diff] [blame] | 1754 | PERL_PATH_SQ = $(subst ','\'',$(PERL_PATH)) |
Johan Herland | d4e1b47 | 2009-11-18 02:42:31 +0100 | [diff] [blame] | 1755 | PYTHON_PATH_SQ = $(subst ','\'',$(PYTHON_PATH)) |
Eygene Ryabinkin | 81b63c7 | 2007-03-28 04:12:07 -0700 | [diff] [blame] | 1756 | TCLTK_PATH_SQ = $(subst ','\'',$(TCLTK_PATH)) |
Junio C Hamano | 09ce4bb | 2010-06-05 09:36:13 -0700 | [diff] [blame] | 1757 | DIFF_SQ = $(subst ','\'',$(DIFF)) |
Jonathan Nieder | 0386dd3 | 2013-11-15 13:10:28 -0800 | [diff] [blame] | 1758 | PERLLIB_EXTRA_SQ = $(subst ','\'',$(PERLLIB_EXTRA)) |
Johannes Schindelin | 39c015c | 2006-02-18 12:40:22 +0100 | [diff] [blame] | 1759 | |
Jeff King | 3f2e229 | 2016-07-01 01:58:58 -0400 | [diff] [blame] | 1760 | # We must filter out any object files from $(GITLIBS), |
| 1761 | # as it is typically used like: |
| 1762 | # |
| 1763 | # foo: foo.o $(GITLIBS) |
| 1764 | # $(CC) $(filter %.o,$^) $(LIBS) |
| 1765 | # |
| 1766 | # where we use it as a dependency. Since we also pull object files |
| 1767 | # from the dependency list, that would make each entry appear twice. |
| 1768 | LIBS = $(filter-out %.o, $(GITLIBS)) $(EXTLIBS) |
Petr Baudis | d595a47 | 2006-06-24 18:35:12 -0700 | [diff] [blame] | 1769 | |
brian m. carlson | f18f816 | 2017-03-11 22:28:18 +0000 | [diff] [blame] | 1770 | BASIC_CFLAGS += $(COMPAT_CFLAGS) |
Jason Riedy | e40b61f | 2005-12-02 15:08:28 -0800 | [diff] [blame] | 1771 | LIB_OBJS += $(COMPAT_OBJS) |
Petr Baudis | 8d7f586 | 2006-06-25 03:47:03 +0200 | [diff] [blame] | 1772 | |
Jonathan Nieder | 8f4b576 | 2009-10-30 20:44:41 -0500 | [diff] [blame] | 1773 | # Quote for C |
| 1774 | |
| 1775 | ifdef DEFAULT_EDITOR |
| 1776 | DEFAULT_EDITOR_CQ = "$(subst ",\",$(subst \,\\,$(DEFAULT_EDITOR)))" |
| 1777 | DEFAULT_EDITOR_CQ_SQ = $(subst ','\'',$(DEFAULT_EDITOR_CQ)) |
| 1778 | |
| 1779 | BASIC_CFLAGS += -DDEFAULT_EDITOR='$(DEFAULT_EDITOR_CQ_SQ)' |
| 1780 | endif |
| 1781 | |
Junio C Hamano | a3d023d | 2009-10-30 20:45:34 -0500 | [diff] [blame] | 1782 | ifdef DEFAULT_PAGER |
| 1783 | DEFAULT_PAGER_CQ = "$(subst ",\",$(subst \,\\,$(DEFAULT_PAGER)))" |
| 1784 | DEFAULT_PAGER_CQ_SQ = $(subst ','\'',$(DEFAULT_PAGER_CQ)) |
| 1785 | |
| 1786 | BASIC_CFLAGS += -DDEFAULT_PAGER='$(DEFAULT_PAGER_CQ_SQ)' |
| 1787 | endif |
| 1788 | |
Ben Walton | b3e34dd | 2012-03-30 21:33:21 -0400 | [diff] [blame] | 1789 | ifdef SHELL_PATH |
| 1790 | SHELL_PATH_CQ = "$(subst ",\",$(subst \,\\,$(SHELL_PATH)))" |
| 1791 | SHELL_PATH_CQ_SQ = $(subst ','\'',$(SHELL_PATH_CQ)) |
| 1792 | |
| 1793 | BASIC_CFLAGS += -DSHELL_PATH='$(SHELL_PATH_CQ_SQ)' |
| 1794 | endif |
| 1795 | |
Jeff King | 42dcbb7 | 2012-06-02 15:01:12 -0400 | [diff] [blame] | 1796 | GIT_USER_AGENT_SQ = $(subst ','\'',$(GIT_USER_AGENT)) |
| 1797 | GIT_USER_AGENT_CQ = "$(subst ",\",$(subst \,\\,$(GIT_USER_AGENT)))" |
| 1798 | GIT_USER_AGENT_CQ_SQ = $(subst ','\'',$(GIT_USER_AGENT_CQ)) |
Jeff King | 620c293 | 2012-06-20 14:31:51 -0400 | [diff] [blame] | 1799 | GIT-USER-AGENT: FORCE |
| 1800 | @if test x'$(GIT_USER_AGENT_SQ)' != x"`cat GIT-USER-AGENT 2>/dev/null`"; then \ |
Jeff King | 620c293 | 2012-06-20 14:31:51 -0400 | [diff] [blame] | 1801 | echo '$(GIT_USER_AGENT_SQ)' >GIT-USER-AGENT; \ |
| 1802 | fi |
Jeff King | 42dcbb7 | 2012-06-02 15:01:12 -0400 | [diff] [blame] | 1803 | |
Vincent van Ravesteijn | 1cc8af0 | 2012-06-06 20:28:16 +0000 | [diff] [blame] | 1804 | ifdef DEFAULT_HELP_FORMAT |
| 1805 | BASIC_CFLAGS += -DDEFAULT_HELP_FORMAT='"$(DEFAULT_HELP_FORMAT)"' |
| 1806 | endif |
| 1807 | |
Eric Wong | 995bc22 | 2016-08-04 11:40:25 +0000 | [diff] [blame] | 1808 | PAGER_ENV_SQ = $(subst ','\'',$(PAGER_ENV)) |
| 1809 | PAGER_ENV_CQ = "$(subst ",\",$(subst \,\\,$(PAGER_ENV)))" |
| 1810 | PAGER_ENV_CQ_SQ = $(subst ','\'',$(PAGER_ENV_CQ)) |
| 1811 | BASIC_CFLAGS += -DPAGER_ENV='$(PAGER_ENV_CQ_SQ)' |
| 1812 | |
Petr Baudis | 8d7f586 | 2006-06-25 03:47:03 +0200 | [diff] [blame] | 1813 | ALL_CFLAGS += $(BASIC_CFLAGS) |
| 1814 | ALL_LDFLAGS += $(BASIC_LDFLAGS) |
| 1815 | |
Gary V. Vaughan | d1b1a91 | 2010-05-14 09:31:36 +0000 | [diff] [blame] | 1816 | export DIFF TAR INSTALL DESTDIR SHELL_PATH |
Petr Baudis | d595a47 | 2006-06-24 18:35:12 -0700 | [diff] [blame] | 1817 | |
| 1818 | |
Petr Baudis | 28818ff | 2005-07-29 17:50:24 +0200 | [diff] [blame] | 1819 | ### Build rules |
Linus Torvalds | 8996702 | 2005-04-30 13:19:56 -0700 | [diff] [blame] | 1820 | |
Brandon Casey | c94c8e5 | 2008-08-07 14:03:42 -0500 | [diff] [blame] | 1821 | SHELL = $(SHELL_PATH) |
| 1822 | |
Theodore Ts'o | f2d713f | 2012-02-06 01:00:17 -0500 | [diff] [blame] | 1823 | all:: shell_compatibility_test |
| 1824 | |
| 1825 | ifeq "$(PROFILE)" "BUILD" |
Andi Kleen | 066dd26 | 2014-07-07 23:35:11 -0700 | [diff] [blame] | 1826 | all:: profile |
| 1827 | endif |
| 1828 | |
| 1829 | profile:: profile-clean |
Theodore Ts'o | f2d713f | 2012-02-06 01:00:17 -0500 | [diff] [blame] | 1830 | $(MAKE) PROFILE=GEN all |
| 1831 | $(MAKE) PROFILE=GEN -j1 test |
Jeff King | 93b5393 | 2014-08-19 02:12:03 -0400 | [diff] [blame] | 1832 | @if test -n "$$GIT_PERF_REPO" || test -d .git; then \ |
| 1833 | $(MAKE) PROFILE=GEN -j1 perf; \ |
| 1834 | else \ |
| 1835 | echo "Skipping profile of perf tests..."; \ |
| 1836 | fi |
Andi Kleen | 066dd26 | 2014-07-07 23:35:11 -0700 | [diff] [blame] | 1837 | $(MAKE) PROFILE=USE all |
| 1838 | |
| 1839 | profile-fast: profile-clean |
| 1840 | $(MAKE) PROFILE=GEN all |
| 1841 | $(MAKE) PROFILE=GEN -j1 perf |
| 1842 | $(MAKE) PROFILE=USE all |
| 1843 | |
Theodore Ts'o | f2d713f | 2012-02-06 01:00:17 -0500 | [diff] [blame] | 1844 | |
| 1845 | all:: $(ALL_PROGRAMS) $(SCRIPT_LIB) $(BUILT_INS) $(OTHER_PROGRAMS) GIT-BUILD-OPTIONS |
Junio C Hamano | 6fc301b | 2007-01-10 12:24:54 -0800 | [diff] [blame] | 1846 | ifneq (,$X) |
Sebastian Schuberth | ade2ca0 | 2009-10-27 12:23:33 +0100 | [diff] [blame] | 1847 | $(QUIET_BUILT_IN)$(foreach p,$(patsubst %$X,%,$(filter %$X,$(ALL_PROGRAMS) $(BUILT_INS) git$X)), test -d '$p' -o '$p' -ef '$p$X' || $(RM) '$p';) |
Junio C Hamano | 6fc301b | 2007-01-10 12:24:54 -0800 | [diff] [blame] | 1848 | endif |
Petr Baudis | 28818ff | 2005-07-29 17:50:24 +0200 | [diff] [blame] | 1849 | |
Junio C Hamano | 6fc301b | 2007-01-10 12:24:54 -0800 | [diff] [blame] | 1850 | all:: |
Eygene Ryabinkin | 3cfaf11 | 2007-03-28 04:00:23 -0700 | [diff] [blame] | 1851 | ifndef NO_TCLTK |
Junio C Hamano | e84a063 | 2008-07-28 00:02:48 -0700 | [diff] [blame] | 1852 | $(QUIET_SUBDIR0)git-gui $(QUIET_SUBDIR1) gitexecdir='$(gitexec_instdir_SQ)' all |
Junio C Hamano | 62ba514 | 2007-11-17 10:51:16 -0800 | [diff] [blame] | 1853 | $(QUIET_SUBDIR0)gitk-git $(QUIET_SUBDIR1) all |
Eygene Ryabinkin | 3cfaf11 | 2007-03-28 04:00:23 -0700 | [diff] [blame] | 1854 | endif |
Ben Walton | 502be95 | 2010-03-20 10:48:08 -0400 | [diff] [blame] | 1855 | $(QUIET_SUBDIR0)templates $(QUIET_SUBDIR1) SHELL_PATH='$(SHELL_PATH_SQ)' PERL_PATH='$(PERL_PATH_SQ)' |
Nicolas Pitre | a310d43 | 2005-05-19 10:27:14 -0400 | [diff] [blame] | 1856 | |
Brandon Casey | 6dc4627 | 2008-08-07 14:06:26 -0500 | [diff] [blame] | 1857 | please_set_SHELL_PATH_to_a_more_modern_shell: |
| 1858 | @$$(:) |
| 1859 | |
| 1860 | shell_compatibility_test: please_set_SHELL_PATH_to_a_more_modern_shell |
| 1861 | |
Junio C Hamano | 4dc0002 | 2006-01-12 21:42:25 -0800 | [diff] [blame] | 1862 | strip: $(PROGRAMS) git$X |
Felipe Contreras | 654f23f | 2013-05-24 21:41:02 -0500 | [diff] [blame] | 1863 | $(STRIP) $(STRIP_OPTS) $^ |
Junio C Hamano | 4dc0002 | 2006-01-12 21:42:25 -0800 | [diff] [blame] | 1864 | |
Jonathan Nieder | 7b63c77 | 2012-07-06 23:19:09 -0500 | [diff] [blame] | 1865 | ### Target-specific flags and dependencies |
| 1866 | |
| 1867 | # The generic compilation pattern rule and automatically |
| 1868 | # computed header dependencies (falling back to a dependency on |
| 1869 | # LIB_H) are enough to describe how most targets should be built, |
| 1870 | # but some targets are special enough to need something a little |
| 1871 | # different. |
| 1872 | # |
| 1873 | # - When a source file "foo.c" #includes a generated header file, |
| 1874 | # we need to list that dependency for the "foo.o" target. |
| 1875 | # |
| 1876 | # We also list it from other targets that are built from foo.c |
| 1877 | # like "foo.sp" and "foo.s", even though that is easy to forget |
| 1878 | # to do because the generated header is already present around |
| 1879 | # after a regular build attempt. |
| 1880 | # |
| 1881 | # - Some code depends on configuration kept in makefile |
| 1882 | # variables. The target-specific variable EXTRA_CPPFLAGS can |
| 1883 | # be used to convey that information to the C preprocessor |
| 1884 | # using -D options. |
| 1885 | # |
| 1886 | # The "foo.o" target should have a corresponding dependency on |
| 1887 | # a file that changes when the value of the makefile variable |
| 1888 | # changes. For example, targets making use of the |
| 1889 | # $(GIT_VERSION) variable depend on GIT-VERSION-FILE. |
| 1890 | # |
| 1891 | # Technically the ".sp" and ".s" targets do not need this |
| 1892 | # dependency because they are force-built, but they get the |
| 1893 | # same dependency for consistency. This way, you do not have to |
| 1894 | # know how each target is implemented. And it means the |
| 1895 | # dependencies here will not need to change if the force-build |
| 1896 | # details change some day. |
| 1897 | |
Jeff King | be1dbd0 | 2012-06-20 14:31:55 -0400 | [diff] [blame] | 1898 | git.sp git.s git.o: GIT-PREFIX |
Jeff King | 816fb46 | 2012-06-02 14:51:42 -0400 | [diff] [blame] | 1899 | git.sp git.s git.o: EXTRA_CPPFLAGS = \ |
John Keeping | 971f853 | 2013-02-24 19:55:01 +0000 | [diff] [blame] | 1900 | '-DGIT_HTML_PATH="$(htmldir_relative_SQ)"' \ |
| 1901 | '-DGIT_MAN_PATH="$(mandir_relative_SQ)"' \ |
| 1902 | '-DGIT_INFO_PATH="$(infodir_relative_SQ)"' |
Junio C Hamano | 334d28a | 2007-06-13 01:28:21 -0700 | [diff] [blame] | 1903 | |
Fredrik Kuivinen | d9a25fc | 2011-06-22 12:50:56 +0200 | [diff] [blame] | 1904 | git$X: git.o GIT-LDFLAGS $(BUILTIN_OBJS) $(GITLIBS) |
Jeff King | 3f2e229 | 2016-07-01 01:58:58 -0400 | [diff] [blame] | 1905 | $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) \ |
| 1906 | $(filter %.o,$^) $(LIBS) |
Junio C Hamano | 6a2e50f | 2005-09-07 21:26:52 -0700 | [diff] [blame] | 1907 | |
Jeff King | c0219dd | 2012-06-20 14:31:33 -0400 | [diff] [blame] | 1908 | help.sp help.s help.o: common-cmds.h |
Erik Faye-Lund | 6612b9e | 2010-11-26 17:00:39 +0100 | [diff] [blame] | 1909 | |
Jeff King | be1dbd0 | 2012-06-20 14:31:55 -0400 | [diff] [blame] | 1910 | builtin/help.sp builtin/help.s builtin/help.o: common-cmds.h GIT-PREFIX |
Ramsay Jones | 0bcd9ae | 2011-04-21 20:14:42 +0100 | [diff] [blame] | 1911 | builtin/help.sp builtin/help.s builtin/help.o: EXTRA_CPPFLAGS = \ |
John Keeping | 971f853 | 2013-02-24 19:55:01 +0000 | [diff] [blame] | 1912 | '-DGIT_HTML_PATH="$(htmldir_relative_SQ)"' \ |
| 1913 | '-DGIT_MAN_PATH="$(mandir_relative_SQ)"' \ |
| 1914 | '-DGIT_INFO_PATH="$(infodir_relative_SQ)"' |
Junio C Hamano | 08df617 | 2006-04-21 21:56:13 -0700 | [diff] [blame] | 1915 | |
Jeff King | 520a6cd | 2012-06-20 14:32:22 -0400 | [diff] [blame] | 1916 | version.sp version.s version.o: GIT-VERSION-FILE GIT-USER-AGENT |
Jeff King | 816fb46 | 2012-06-02 14:51:42 -0400 | [diff] [blame] | 1917 | version.sp version.s version.o: EXTRA_CPPFLAGS = \ |
Jeff King | 620c293 | 2012-06-20 14:31:51 -0400 | [diff] [blame] | 1918 | '-DGIT_VERSION="$(GIT_VERSION)"' \ |
Johannes Schindelin | ed32b78 | 2017-12-15 00:34:38 +0100 | [diff] [blame] | 1919 | '-DGIT_USER_AGENT=$(GIT_USER_AGENT_CQ_SQ)' \ |
| 1920 | '-DGIT_BUILT_FROM_COMMIT="$(shell GIT_CEILING_DIRECTORIES=\"$(CURDIR)/..\" \ |
| 1921 | git rev-parse -q --verify HEAD || :)"' |
Jeff King | 816fb46 | 2012-06-02 14:51:42 -0400 | [diff] [blame] | 1922 | |
Junio C Hamano | 9173080 | 2006-04-10 17:37:58 -0700 | [diff] [blame] | 1923 | $(BUILT_INS): git$X |
Andreas Färber | 3e073dc | 2008-08-25 17:33:03 +0200 | [diff] [blame] | 1924 | $(QUIET_BUILT_IN)$(RM) $@ && \ |
Felipe Contreras | f530aa9 | 2013-05-24 21:41:03 -0500 | [diff] [blame] | 1925 | ln $< $@ 2>/dev/null || \ |
| 1926 | ln -s $< $@ 2>/dev/null || \ |
| 1927 | cp $< $@ |
Junio C Hamano | 9173080 | 2006-04-10 17:37:58 -0700 | [diff] [blame] | 1928 | |
Eric Sunshine | 82aec45 | 2015-08-23 17:31:09 -0400 | [diff] [blame] | 1929 | common-cmds.h: generate-cmdlist.sh command-list.txt |
Junio C Hamano | 48dd1da | 2007-06-13 02:00:01 -0700 | [diff] [blame] | 1930 | |
Junio C Hamano | 766b084 | 2007-04-05 15:03:48 -0700 | [diff] [blame] | 1931 | common-cmds.h: $(wildcard Documentation/git-*.txt) |
Alejandro R. Sedeño | 57cee8a | 2015-09-10 19:37:07 -0400 | [diff] [blame] | 1932 | $(QUIET_GEN)$(SHELL_PATH) ./generate-cmdlist.sh command-list.txt >$@+ && mv $@+ $@ |
Fredrik Kuivinen | a87cd02 | 2006-03-09 17:24:19 +0100 | [diff] [blame] | 1933 | |
Jeff King | e4dd89a | 2012-06-20 14:32:16 -0400 | [diff] [blame] | 1934 | SCRIPT_DEFINES = $(SHELL_PATH_SQ):$(DIFF_SQ):$(GIT_VERSION):\ |
Jeff King | b5295f3 | 2012-06-20 14:32:19 -0400 | [diff] [blame] | 1935 | $(localedir_SQ):$(NO_CURL):$(USE_GETTEXT_SCHEME):$(SANE_TOOL_PATH_SQ):\ |
Ævar Arnfjörð Bjarmason | 20d2a30 | 2017-12-10 21:13:33 +0000 | [diff] [blame] | 1936 | $(gitwebdir_SQ):$(PERL_PATH_SQ):$(SANE_TEXT_GREP):$(PAGER_ENV):\ |
| 1937 | $(perllibdir_SQ) |
Jonathan Nieder | 46bac90 | 2010-01-31 11:46:53 -0800 | [diff] [blame] | 1938 | define cmd_munge_script |
| 1939 | $(RM) $@ $@+ && \ |
| 1940 | sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \ |
| 1941 | -e 's|@SHELL_PATH@|$(SHELL_PATH_SQ)|' \ |
Junio C Hamano | 09ce4bb | 2010-06-05 09:36:13 -0700 | [diff] [blame] | 1942 | -e 's|@@DIFF@@|$(DIFF_SQ)|' \ |
Ævar Arnfjörð Bjarmason | 5e9637c | 2011-11-18 00:14:42 +0100 | [diff] [blame] | 1943 | -e 's|@@LOCALEDIR@@|$(localedir_SQ)|g' \ |
Jonathan Nieder | 46bac90 | 2010-01-31 11:46:53 -0800 | [diff] [blame] | 1944 | -e 's/@@NO_CURL@@/$(NO_CURL)/g' \ |
Alex Riesen | ad17ea7 | 2012-01-23 14:04:29 -0800 | [diff] [blame] | 1945 | -e 's/@@USE_GETTEXT_SCHEME@@/$(USE_GETTEXT_SCHEME)/g' \ |
Jonathan Nieder | 46bac90 | 2010-01-31 11:46:53 -0800 | [diff] [blame] | 1946 | -e $(BROKEN_PATH_FIX) \ |
Jeff King | b5295f3 | 2012-06-20 14:32:19 -0400 | [diff] [blame] | 1947 | -e 's|@@GITWEBDIR@@|$(gitwebdir_SQ)|g' \ |
| 1948 | -e 's|@@PERL@@|$(PERL_PATH_SQ)|g' \ |
Junio C Hamano | 71b4010 | 2016-03-08 15:47:57 -0800 | [diff] [blame] | 1949 | -e 's|@@SANE_TEXT_GREP@@|$(SANE_TEXT_GREP)|g' \ |
Eric Wong | 995bc22 | 2016-08-04 11:40:25 +0000 | [diff] [blame] | 1950 | -e 's|@@PAGER_ENV@@|$(PAGER_ENV_SQ)|g' \ |
Jonathan Nieder | 46bac90 | 2010-01-31 11:46:53 -0800 | [diff] [blame] | 1951 | $@.sh >$@+ |
| 1952 | endef |
| 1953 | |
Jeff King | e4dd89a | 2012-06-20 14:32:16 -0400 | [diff] [blame] | 1954 | GIT-SCRIPT-DEFINES: FORCE |
| 1955 | @FLAGS='$(SCRIPT_DEFINES)'; \ |
| 1956 | if test x"$$FLAGS" != x"`cat $@ 2>/dev/null`" ; then \ |
Christian Couder | 1a59d88 | 2012-12-18 16:26:39 +0100 | [diff] [blame] | 1957 | echo >&2 " * new script parameters"; \ |
Jeff King | e4dd89a | 2012-06-20 14:32:16 -0400 | [diff] [blame] | 1958 | echo "$$FLAGS" >$@; \ |
| 1959 | fi |
| 1960 | |
| 1961 | |
Jonathan Nieder | 64c07db | 2014-11-18 10:38:38 -0800 | [diff] [blame] | 1962 | $(SCRIPT_SH_GEN) : % : %.sh GIT-SCRIPT-DEFINES |
Jonathan Nieder | 46bac90 | 2010-01-31 11:46:53 -0800 | [diff] [blame] | 1963 | $(QUIET_GEN)$(cmd_munge_script) && \ |
Shawn O. Pearce | 74f2b2a | 2007-03-06 01:35:01 -0500 | [diff] [blame] | 1964 | chmod +x $@+ && \ |
Jim Meyering | fc36f6a | 2006-05-25 18:52:01 +0200 | [diff] [blame] | 1965 | mv $@+ $@ |
Junio C Hamano | bc6146d | 2005-09-08 18:50:33 -0700 | [diff] [blame] | 1966 | |
Jeff King | e4dd89a | 2012-06-20 14:32:16 -0400 | [diff] [blame] | 1967 | $(SCRIPT_LIB) : % : %.sh GIT-SCRIPT-DEFINES |
Jonathan Nieder | 46bac90 | 2010-01-31 11:46:53 -0800 | [diff] [blame] | 1968 | $(QUIET_GEN)$(cmd_munge_script) && \ |
| 1969 | mv $@+ $@ |
| 1970 | |
Pat Thoyts | bbc284d | 2012-06-01 23:29:33 +0100 | [diff] [blame] | 1971 | git.res: git.rc GIT-VERSION-FILE |
Pat Thoyts | ce39c2e | 2012-05-24 00:56:24 +0100 | [diff] [blame] | 1972 | $(QUIET_RC)$(RC) \ |
Johannes Schindelin | 39bb86b | 2017-10-30 18:19:42 +0100 | [diff] [blame] | 1973 | $(join -DMAJOR= -DMINOR= -DMICRO= -DPATCHLEVEL=, $(wordlist 1, 4, \ |
| 1974 | $(shell echo $(GIT_VERSION) 0 0 0 0 | tr '.a-zA-Z-' ' '))) \ |
Steven Penny | 7c44b33 | 2017-01-07 15:41:10 -0600 | [diff] [blame] | 1975 | -DGIT_VERSION="\\\"$(GIT_VERSION)\\\"" -i $< -o $@ |
Pat Thoyts | ce39c2e | 2012-05-24 00:56:24 +0100 | [diff] [blame] | 1976 | |
Jeff King | e204b00 | 2014-11-18 12:43:09 -0500 | [diff] [blame] | 1977 | # This makes sure we depend on the NO_PERL setting itself. |
Jonathan Nieder | 64c07db | 2014-11-18 10:38:38 -0800 | [diff] [blame] | 1978 | $(SCRIPT_PERL_GEN): GIT-BUILD-OPTIONS |
Jeff King | e204b00 | 2014-11-18 12:43:09 -0500 | [diff] [blame] | 1979 | |
Jeff King | 499c293 | 2009-04-03 15:32:20 -0400 | [diff] [blame] | 1980 | ifndef NO_PERL |
Ævar Arnfjörð Bjarmason | 20d2a30 | 2017-12-10 21:13:33 +0000 | [diff] [blame] | 1981 | $(SCRIPT_PERL_GEN): |
Alex Riesen | f848718 | 2006-12-04 10:50:04 +0100 | [diff] [blame] | 1982 | |
Ævar Arnfjörð Bjarmason | 20d2a30 | 2017-12-10 21:13:33 +0000 | [diff] [blame] | 1983 | PERL_DEFINES = $(PERL_PATH_SQ):$(PERLLIB_EXTRA_SQ):$(perllibdir_SQ) |
| 1984 | $(SCRIPT_PERL_GEN): % : %.perl GIT-PERL-DEFINES GIT-VERSION-FILE |
Emil Medve | 4cb08df | 2007-07-14 12:51:44 -0500 | [diff] [blame] | 1985 | $(QUIET_GEN)$(RM) $@ $@+ && \ |
Jonathan Nieder | 7a7bfc7 | 2018-01-02 12:01:40 -0800 | [diff] [blame] | 1986 | INSTLIBDIR='$(perllibdir_SQ)' && \ |
Jonathan Nieder | 0386dd3 | 2013-11-15 13:10:28 -0800 | [diff] [blame] | 1987 | INSTLIBDIR_EXTRA='$(PERLLIB_EXTRA_SQ)' && \ |
| 1988 | INSTLIBDIR="$$INSTLIBDIR$${INSTLIBDIR_EXTRA:+:$$INSTLIBDIR_EXTRA}" && \ |
Junio C Hamano | 998c4da | 2006-07-07 13:04:35 -0700 | [diff] [blame] | 1989 | sed -e '1{' \ |
| 1990 | -e ' s|#!.*perl|#!$(PERL_PATH_SQ)|' \ |
| 1991 | -e ' h' \ |
Ævar Arnfjörð Bjarmason | a6c6060 | 2010-05-30 17:12:41 +0000 | [diff] [blame] | 1992 | -e ' s=.*=use lib (split(/$(pathsep)/, $$ENV{GITPERLLIB} || "'"$$INSTLIBDIR"'"));=' \ |
Junio C Hamano | 998c4da | 2006-07-07 13:04:35 -0700 | [diff] [blame] | 1993 | -e ' H' \ |
| 1994 | -e ' x' \ |
| 1995 | -e '}' \ |
Junio C Hamano | 3ff8cbe | 2005-10-04 12:41:35 -0700 | [diff] [blame] | 1996 | -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \ |
Felipe Contreras | f530aa9 | 2013-05-24 21:41:03 -0500 | [diff] [blame] | 1997 | $< >$@+ && \ |
Shawn O. Pearce | 74f2b2a | 2007-03-06 01:35:01 -0500 | [diff] [blame] | 1998 | chmod +x $@+ && \ |
Jim Meyering | fc36f6a | 2006-05-25 18:52:01 +0200 | [diff] [blame] | 1999 | mv $@+ $@ |
Junio C Hamano | bc6146d | 2005-09-08 18:50:33 -0700 | [diff] [blame] | 2000 | |
Jonathan Nieder | 07981dc | 2013-11-18 14:23:11 -0800 | [diff] [blame] | 2001 | GIT-PERL-DEFINES: FORCE |
| 2002 | @FLAGS='$(PERL_DEFINES)'; \ |
| 2003 | if test x"$$FLAGS" != x"`cat $@ 2>/dev/null`" ; then \ |
| 2004 | echo >&2 " * new perl-specific parameters"; \ |
| 2005 | echo "$$FLAGS" >$@; \ |
| 2006 | fi |
| 2007 | |
John 'Warthog9' Hawley | 62331ef | 2010-01-30 23:30:40 +0100 | [diff] [blame] | 2008 | |
| 2009 | .PHONY: gitweb |
| 2010 | gitweb: |
| 2011 | $(QUIET_SUBDIR0)gitweb $(QUIET_SUBDIR1) all |
| 2012 | |
Jeff King | e25c7cc | 2015-05-29 03:25:45 -0400 | [diff] [blame] | 2013 | git-instaweb: git-instaweb.sh GIT-SCRIPT-DEFINES |
Jeff King | b5295f3 | 2012-06-20 14:32:19 -0400 | [diff] [blame] | 2014 | $(QUIET_GEN)$(cmd_munge_script) && \ |
Shawn O. Pearce | 74f2b2a | 2007-03-06 01:35:01 -0500 | [diff] [blame] | 2015 | chmod +x $@+ && \ |
Eric Wong | a51d37c | 2006-07-01 15:14:14 -0700 | [diff] [blame] | 2016 | mv $@+ $@ |
Jeff King | 499c293 | 2009-04-03 15:32:20 -0400 | [diff] [blame] | 2017 | else # NO_PERL |
Jonathan Nieder | 64c07db | 2014-11-18 10:38:38 -0800 | [diff] [blame] | 2018 | $(SCRIPT_PERL_GEN) git-instaweb: % : unimplemented.sh |
Jeff King | 499c293 | 2009-04-03 15:32:20 -0400 | [diff] [blame] | 2019 | $(QUIET_GEN)$(RM) $@ $@+ && \ |
| 2020 | sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \ |
| 2021 | -e 's|@@REASON@@|NO_PERL=$(NO_PERL)|g' \ |
| 2022 | unimplemented.sh >$@+ && \ |
| 2023 | chmod +x $@+ && \ |
| 2024 | mv $@+ $@ |
| 2025 | endif # NO_PERL |
Eric Wong | a51d37c | 2006-07-01 15:14:14 -0700 | [diff] [blame] | 2026 | |
Jonathan Nieder | ca2051d | 2014-11-18 10:43:47 -0800 | [diff] [blame] | 2027 | # This makes sure we depend on the NO_PYTHON setting itself. |
| 2028 | $(SCRIPT_PYTHON_GEN): GIT-BUILD-OPTIONS |
| 2029 | |
Sverre Rabbelier | 2fe40b6 | 2009-11-18 02:42:32 +0100 | [diff] [blame] | 2030 | ifndef NO_PYTHON |
Felipe Contreras | 1b0a0f8 | 2013-05-24 21:41:01 -0500 | [diff] [blame] | 2031 | $(SCRIPT_PYTHON_GEN): GIT-CFLAGS GIT-PREFIX GIT-PYTHON-VARS |
| 2032 | $(SCRIPT_PYTHON_GEN): % : %.py |
Sverre Rabbelier | 2fe40b6 | 2009-11-18 02:42:32 +0100 | [diff] [blame] | 2033 | $(QUIET_GEN)$(RM) $@ $@+ && \ |
Brian Gernhardt | f733f6a | 2010-04-09 11:57:45 -0400 | [diff] [blame] | 2034 | sed -e '1s|#!.*python|#!$(PYTHON_PATH_SQ)|' \ |
Felipe Contreras | f530aa9 | 2013-05-24 21:41:03 -0500 | [diff] [blame] | 2035 | $< >$@+ && \ |
Sverre Rabbelier | 2fe40b6 | 2009-11-18 02:42:32 +0100 | [diff] [blame] | 2036 | chmod +x $@+ && \ |
| 2037 | mv $@+ $@ |
| 2038 | else # NO_PYTHON |
Felipe Contreras | 1b0a0f8 | 2013-05-24 21:41:01 -0500 | [diff] [blame] | 2039 | $(SCRIPT_PYTHON_GEN): % : unimplemented.sh |
Sverre Rabbelier | 2fe40b6 | 2009-11-18 02:42:32 +0100 | [diff] [blame] | 2040 | $(QUIET_GEN)$(RM) $@ $@+ && \ |
| 2041 | sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \ |
| 2042 | -e 's|@@REASON@@|NO_PYTHON=$(NO_PYTHON)|g' \ |
| 2043 | unimplemented.sh >$@+ && \ |
| 2044 | chmod +x $@+ && \ |
| 2045 | mv $@+ $@ |
| 2046 | endif # NO_PYTHON |
| 2047 | |
Jeff King | 7f1b697 | 2013-02-21 01:26:14 -0500 | [diff] [blame] | 2048 | CONFIGURE_RECIPE = $(RM) configure configure.ac+ && \ |
| 2049 | sed -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \ |
| 2050 | configure.ac >configure.ac+ && \ |
| 2051 | autoconf -o configure configure.ac+ && \ |
| 2052 | $(RM) configure.ac+ |
| 2053 | |
Jeff King | 520a6cd | 2012-06-20 14:32:22 -0400 | [diff] [blame] | 2054 | configure: configure.ac GIT-VERSION-FILE |
Jeff King | 7f1b697 | 2013-02-21 01:26:14 -0500 | [diff] [blame] | 2055 | $(QUIET_GEN)$(CONFIGURE_RECIPE) |
Jakub Narebski | 3900145 | 2006-08-08 18:35:23 +0200 | [diff] [blame] | 2056 | |
Stefano Lattarini | 8242ff4 | 2012-07-19 09:50:02 +0200 | [diff] [blame] | 2057 | ifdef AUTOCONFIGURED |
Jonathan Nieder | 1226504 | 2013-01-02 00:25:44 -0800 | [diff] [blame] | 2058 | # We avoid depending on 'configure' here, because it gets rebuilt |
| 2059 | # every time GIT-VERSION-FILE is modified, only to update the embedded |
| 2060 | # version number string, which config.status does not care about. We |
| 2061 | # do want to recheck when the platform/environment detection logic |
| 2062 | # changes, hence this depends on configure.ac. |
| 2063 | config.status: configure.ac |
Jeff King | 7f1b697 | 2013-02-21 01:26:14 -0500 | [diff] [blame] | 2064 | $(QUIET_GEN)$(CONFIGURE_RECIPE) && \ |
Jonathan Nieder | 1226504 | 2013-01-02 00:25:44 -0800 | [diff] [blame] | 2065 | if test -f config.status; then \ |
Stefano Lattarini | 8242ff4 | 2012-07-19 09:50:02 +0200 | [diff] [blame] | 2066 | ./config.status --recheck; \ |
| 2067 | else \ |
| 2068 | ./configure; \ |
| 2069 | fi |
| 2070 | reconfigure config.mak.autogen: config.status |
| 2071 | $(QUIET_GEN)./config.status |
| 2072 | .PHONY: reconfigure # This is a convenience target. |
| 2073 | endif |
| 2074 | |
Jonathan Nieder | 3371f9b | 2011-03-27 13:13:22 -0500 | [diff] [blame] | 2075 | XDIFF_OBJS += xdiff/xdiffi.o |
| 2076 | XDIFF_OBJS += xdiff/xprepare.o |
| 2077 | XDIFF_OBJS += xdiff/xutils.o |
| 2078 | XDIFF_OBJS += xdiff/xemit.o |
| 2079 | XDIFF_OBJS += xdiff/xmerge.o |
| 2080 | XDIFF_OBJS += xdiff/xpatience.o |
Junio C Hamano | d475536 | 2012-01-27 11:04:28 -0800 | [diff] [blame] | 2081 | XDIFF_OBJS += xdiff/xhistogram.o |
Jonathan Nieder | 3371f9b | 2011-03-27 13:13:22 -0500 | [diff] [blame] | 2082 | |
Jonathan Nieder | 3371f9b | 2011-03-27 13:13:22 -0500 | [diff] [blame] | 2083 | VCSSVN_OBJS += vcs-svn/line_buffer.o |
Jonathan Nieder | 9d2f5dd | 2011-01-02 21:54:58 -0600 | [diff] [blame] | 2084 | VCSSVN_OBJS += vcs-svn/sliding_window.o |
Jonathan Nieder | 3371f9b | 2011-03-27 13:13:22 -0500 | [diff] [blame] | 2085 | VCSSVN_OBJS += vcs-svn/fast_export.o |
Jonathan Nieder | ddcc8c5 | 2010-12-25 05:11:32 -0600 | [diff] [blame] | 2086 | VCSSVN_OBJS += vcs-svn/svndiff.o |
Jonathan Nieder | 3371f9b | 2011-03-27 13:13:22 -0500 | [diff] [blame] | 2087 | VCSSVN_OBJS += vcs-svn/svndump.o |
| 2088 | |
Nguyễn Thái Ngọc Duy | efd71f8 | 2018-03-24 08:44:30 +0100 | [diff] [blame] | 2089 | TEST_OBJS := $(patsubst %$X,%.o,$(TEST_PROGRAMS)) $(patsubst %,t/helper/%,$(TEST_BUILTINS_OBJS)) |
Jonathan Nieder | 60d24dd | 2012-07-06 22:39:18 -0500 | [diff] [blame] | 2090 | OBJECTS := $(LIB_OBJS) $(BUILTIN_OBJS) $(PROGRAM_OBJS) $(TEST_OBJS) \ |
| 2091 | $(XDIFF_OBJS) \ |
| 2092 | $(VCSSVN_OBJS) \ |
Jeff King | 3f2e229 | 2016-07-01 01:58:58 -0400 | [diff] [blame] | 2093 | common-main.o \ |
Jonathan Nieder | 60d24dd | 2012-07-06 22:39:18 -0500 | [diff] [blame] | 2094 | git.o |
| 2095 | ifndef NO_CURL |
| 2096 | OBJECTS += http.o http-walker.o remote-curl.o |
| 2097 | endif |
Jonathan Nieder | c373991 | 2010-01-26 09:52:11 -0600 | [diff] [blame] | 2098 | |
Jonathan Nieder | ec5e0bb | 2010-01-31 15:23:53 -0600 | [diff] [blame] | 2099 | dep_files := $(foreach f,$(OBJECTS),$(dir $f).depend/$(notdir $f).d) |
Jonathan Nieder | 010acc1 | 2010-01-31 15:37:25 -0600 | [diff] [blame] | 2100 | dep_dirs := $(addsuffix .depend,$(sort $(dir $(OBJECTS)))) |
Jonathan Nieder | beeb456 | 2010-01-26 09:49:33 -0600 | [diff] [blame] | 2101 | |
Jonathan Nieder | 024c843 | 2011-11-18 03:58:21 -0600 | [diff] [blame] | 2102 | ifeq ($(COMPUTE_HEADER_DEPENDENCIES),yes) |
Jonathan Nieder | dfea575 | 2010-01-26 09:52:49 -0600 | [diff] [blame] | 2103 | $(dep_dirs): |
Junio C Hamano | eb0e0dd | 2011-10-05 12:36:21 -0700 | [diff] [blame] | 2104 | @mkdir -p $@ |
Jonathan Nieder | dfea575 | 2010-01-26 09:52:49 -0600 | [diff] [blame] | 2105 | |
| 2106 | missing_dep_dirs := $(filter-out $(wildcard $(dep_dirs)),$(dep_dirs)) |
Jonathan Nieder | ec5e0bb | 2010-01-31 15:23:53 -0600 | [diff] [blame] | 2107 | dep_file = $(dir $@).depend/$(notdir $@).d |
Jonathan Nieder | 6978934 | 2011-11-18 17:23:24 -0600 | [diff] [blame] | 2108 | dep_args = -MF $(dep_file) -MQ $@ -MMD -MP |
Jonathan Nieder | f2fabbf | 2010-01-26 09:57:15 -0600 | [diff] [blame] | 2109 | endif |
| 2110 | |
Jonathan Nieder | 024c843 | 2011-11-18 03:58:21 -0600 | [diff] [blame] | 2111 | ifneq ($(COMPUTE_HEADER_DEPENDENCIES),yes) |
Jonathan Nieder | dfea575 | 2010-01-26 09:52:49 -0600 | [diff] [blame] | 2112 | dep_dirs = |
| 2113 | missing_dep_dirs = |
Jonathan Nieder | f2fabbf | 2010-01-26 09:57:15 -0600 | [diff] [blame] | 2114 | dep_args = |
Jonathan Nieder | dfea575 | 2010-01-26 09:52:49 -0600 | [diff] [blame] | 2115 | endif |
Jonathan Nieder | f2fabbf | 2010-01-26 09:57:15 -0600 | [diff] [blame] | 2116 | |
| 2117 | ASM_SRC := $(wildcard $(OBJECTS:o=S)) |
| 2118 | ASM_OBJ := $(ASM_SRC:S=o) |
| 2119 | C_OBJ := $(filter-out $(ASM_OBJ),$(OBJECTS)) |
Jonathan Nieder | dfea575 | 2010-01-26 09:52:49 -0600 | [diff] [blame] | 2120 | |
Jonathan Nieder | 3024888 | 2010-01-26 09:51:24 -0600 | [diff] [blame] | 2121 | .SUFFIXES: |
| 2122 | |
Jonathan Nieder | f2fabbf | 2010-01-26 09:57:15 -0600 | [diff] [blame] | 2123 | $(C_OBJ): %.o: %.c GIT-CFLAGS $(missing_dep_dirs) |
Jonathan Nieder | a673cfe | 2010-03-19 22:20:12 -0500 | [diff] [blame] | 2124 | $(QUIET_CC)$(CC) -o $*.o -c $(dep_args) $(ALL_CFLAGS) $(EXTRA_CPPFLAGS) $< |
Jonathan Nieder | f2fabbf | 2010-01-26 09:57:15 -0600 | [diff] [blame] | 2125 | $(ASM_OBJ): %.o: %.S GIT-CFLAGS $(missing_dep_dirs) |
Jonathan Nieder | a673cfe | 2010-03-19 22:20:12 -0500 | [diff] [blame] | 2126 | $(QUIET_CC)$(CC) -o $*.o -c $(dep_args) $(ALL_CFLAGS) $(EXTRA_CPPFLAGS) $< |
Jonathan Nieder | f2fabbf | 2010-01-26 09:57:15 -0600 | [diff] [blame] | 2127 | |
Jonathan Nieder | 13fca9f | 2010-01-06 02:06:58 -0600 | [diff] [blame] | 2128 | %.s: %.c GIT-CFLAGS FORCE |
Jonathan Nieder | 1015cc4 | 2012-07-22 18:47:26 -0500 | [diff] [blame] | 2129 | $(QUIET_CC)$(CC) -o $@ -S $(ALL_CFLAGS) $(EXTRA_CPPFLAGS) $< |
Jonathan Nieder | f2fabbf | 2010-01-26 09:57:15 -0600 | [diff] [blame] | 2130 | |
| 2131 | ifdef USE_COMPUTED_HEADER_DEPENDENCIES |
| 2132 | # Take advantage of gcc's on-the-fly dependency generation |
| 2133 | # See <http://gcc.gnu.org/gcc-3.0/features.html>. |
| 2134 | dep_files_present := $(wildcard $(dep_files)) |
| 2135 | ifneq ($(dep_files_present),) |
| 2136 | include $(dep_files_present) |
| 2137 | endif |
| 2138 | else |
Jonathan Nieder | dfea575 | 2010-01-26 09:52:49 -0600 | [diff] [blame] | 2139 | # Dependencies on header files, for platforms that do not support |
| 2140 | # the gcc -MMD option. |
| 2141 | # |
| 2142 | # Dependencies on automatically generated headers such as common-cmds.h |
| 2143 | # should _not_ be included here, since they are necessary even when |
| 2144 | # building an object for the first time. |
Pavel Roskin | b05701c | 2005-08-06 01:36:15 -0400 | [diff] [blame] | 2145 | |
Jonathan Nieder | 60d24dd | 2012-07-06 22:39:18 -0500 | [diff] [blame] | 2146 | $(OBJECTS): $(LIB_H) |
Jonathan Nieder | dfea575 | 2010-01-26 09:52:49 -0600 | [diff] [blame] | 2147 | endif |
Junio C Hamano | 7a59013 | 2005-08-06 13:10:43 -0700 | [diff] [blame] | 2148 | |
Jeff King | be1dbd0 | 2012-06-20 14:31:55 -0400 | [diff] [blame] | 2149 | exec_cmd.sp exec_cmd.s exec_cmd.o: GIT-PREFIX |
Ramsay Jones | 0bcd9ae | 2011-04-21 20:14:42 +0100 | [diff] [blame] | 2150 | exec_cmd.sp exec_cmd.s exec_cmd.o: EXTRA_CPPFLAGS = \ |
Jonathan Nieder | 373a5ed | 2010-01-06 02:05:04 -0600 | [diff] [blame] | 2151 | '-DGIT_EXEC_PATH="$(gitexecdir_SQ)"' \ |
| 2152 | '-DBINDIR="$(bindir_relative_SQ)"' \ |
| 2153 | '-DPREFIX="$(prefix_SQ)"' |
Steffen Prohaska | 026fa0d | 2009-01-18 13:00:09 +0100 | [diff] [blame] | 2154 | |
Jeff King | be1dbd0 | 2012-06-20 14:31:55 -0400 | [diff] [blame] | 2155 | builtin/init-db.sp builtin/init-db.s builtin/init-db.o: GIT-PREFIX |
Ramsay Jones | 0bcd9ae | 2011-04-21 20:14:42 +0100 | [diff] [blame] | 2156 | builtin/init-db.sp builtin/init-db.s builtin/init-db.o: EXTRA_CPPFLAGS = \ |
Jonathan Nieder | 373a5ed | 2010-01-06 02:05:04 -0600 | [diff] [blame] | 2157 | -DDEFAULT_GIT_TEMPLATE_DIR='"$(template_dir_SQ)"' |
Michal Ostrowski | 77cb17e | 2006-01-10 21:12:17 -0500 | [diff] [blame] | 2158 | |
Jeff King | be1dbd0 | 2012-06-20 14:31:55 -0400 | [diff] [blame] | 2159 | config.sp config.s config.o: GIT-PREFIX |
Ramsay Jones | 0bcd9ae | 2011-04-21 20:14:42 +0100 | [diff] [blame] | 2160 | config.sp config.s config.o: EXTRA_CPPFLAGS = \ |
| 2161 | -DETC_GITCONFIG='"$(ETC_GITCONFIG_SQ)"' |
Johannes Sixt | 506b17b | 2007-11-13 21:05:05 +0100 | [diff] [blame] | 2162 | |
Jeff King | be1dbd0 | 2012-06-20 14:31:55 -0400 | [diff] [blame] | 2163 | attr.sp attr.s attr.o: GIT-PREFIX |
Ramsay Jones | 0bcd9ae | 2011-04-21 20:14:42 +0100 | [diff] [blame] | 2164 | attr.sp attr.s attr.o: EXTRA_CPPFLAGS = \ |
| 2165 | -DETC_GITATTRIBUTES='"$(ETC_GITATTRIBUTES_SQ)"' |
Petr Onderka | 6df42ab | 2010-09-01 00:42:43 +0200 | [diff] [blame] | 2166 | |
Jeff King | be1dbd0 | 2012-06-20 14:31:55 -0400 | [diff] [blame] | 2167 | gettext.sp gettext.s gettext.o: GIT-PREFIX |
Ævar Arnfjörð Bjarmason | 5e9637c | 2011-11-18 00:14:42 +0100 | [diff] [blame] | 2168 | gettext.sp gettext.s gettext.o: EXTRA_CPPFLAGS = \ |
| 2169 | -DGIT_LOCALE_PATH='"$(localedir_SQ)"' |
| 2170 | |
Bernhard Reiter | 1e16b25 | 2014-11-09 15:55:53 +0100 | [diff] [blame] | 2171 | http-push.sp http.sp http-walker.sp remote-curl.sp imap-send.sp: SPARSE_FLAGS += \ |
Ramsay Jones | 9371322 | 2013-10-06 21:52:21 +0100 | [diff] [blame] | 2172 | -DCURL_DISABLE_TYPECHECK |
| 2173 | |
Ramsay Jones | 54360a1 | 2018-02-12 00:21:02 +0000 | [diff] [blame] | 2174 | pack-revindex.sp: SPARSE_FLAGS += -Wno-memcpy-max-count |
| 2175 | |
Nick Hengeveld | 8d9fbe5 | 2006-04-04 05:33:18 -0700 | [diff] [blame] | 2176 | ifdef NO_EXPAT |
Ramsay Jones | 0bcd9ae | 2011-04-21 20:14:42 +0100 | [diff] [blame] | 2177 | http-walker.sp http-walker.s http-walker.o: EXTRA_CPPFLAGS = -DNO_EXPAT |
Nick Hengeveld | 8d9fbe5 | 2006-04-04 05:33:18 -0700 | [diff] [blame] | 2178 | endif |
| 2179 | |
Ævar Arnfjörð Bjarmason | a997bf4 | 2010-08-17 09:24:39 +0000 | [diff] [blame] | 2180 | ifdef NO_REGEX |
Ramsay Jones | 0bcd9ae | 2011-04-21 20:14:42 +0100 | [diff] [blame] | 2181 | compat/regex/regex.sp compat/regex/regex.o: EXTRA_CPPFLAGS = \ |
| 2182 | -DGAWK -DNO_MBSUPPORT |
Ævar Arnfjörð Bjarmason | a997bf4 | 2010-08-17 09:24:39 +0000 | [diff] [blame] | 2183 | endif |
| 2184 | |
René Scharfe | d555ff5 | 2010-09-11 11:59:18 +0200 | [diff] [blame] | 2185 | ifdef USE_NED_ALLOCATOR |
Ramsay Jones | 0bcd9ae | 2011-04-21 20:14:42 +0100 | [diff] [blame] | 2186 | compat/nedmalloc/nedmalloc.sp compat/nedmalloc/nedmalloc.o: EXTRA_CPPFLAGS = \ |
René Scharfe | ca2baa3 | 2016-09-03 17:59:15 +0200 | [diff] [blame] | 2187 | -DNDEBUG -DREPLACE_SYSTEM_ALLOCATOR |
Ramsay Jones | 241c957 | 2013-04-27 19:45:02 +0100 | [diff] [blame] | 2188 | compat/nedmalloc/nedmalloc.sp: SPARSE_FLAGS += -Wno-non-pointer-null |
René Scharfe | d555ff5 | 2010-09-11 11:59:18 +0200 | [diff] [blame] | 2189 | endif |
| 2190 | |
Fredrik Kuivinen | d9a25fc | 2011-06-22 12:50:56 +0200 | [diff] [blame] | 2191 | git-%$X: %.o GIT-LDFLAGS $(GITLIBS) |
Shawn O. Pearce | 74f2b2a | 2007-03-06 01:35:01 -0500 | [diff] [blame] | 2192 | $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS) |
Daniel Barkalow | 6eb7ed5 | 2005-04-23 18:47:23 -0700 | [diff] [blame] | 2193 | |
Bernhard Reiter | 1e16b25 | 2014-11-09 15:55:53 +0100 | [diff] [blame] | 2194 | git-imap-send$X: imap-send.o $(IMAP_SEND_BUILDDEPS) GIT-LDFLAGS $(GITLIBS) |
Robert Shearman | 684ec6c | 2008-07-09 22:29:00 +0100 | [diff] [blame] | 2195 | $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \ |
Steven Penny | aa38ad2 | 2017-01-08 00:12:38 -0600 | [diff] [blame] | 2196 | $(IMAP_SEND_LDFLAGS) $(LIBS) |
Mike McCormack | f2561fd | 2006-03-10 14:32:50 +0900 | [diff] [blame] | 2197 | |
John Keeping | fd78ced | 2014-01-25 13:11:44 +0000 | [diff] [blame] | 2198 | git-http-fetch$X: http.o http-walker.o http-fetch.o GIT-LDFLAGS $(GITLIBS) |
Linus Torvalds | 1088261 | 2009-08-05 01:01:59 -0400 | [diff] [blame] | 2199 | $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \ |
Remi Pommarel | 9eaa78b | 2015-10-21 19:01:13 +0200 | [diff] [blame] | 2200 | $(CURL_LIBCURL) $(LIBS) |
John Keeping | fd78ced | 2014-01-25 13:11:44 +0000 | [diff] [blame] | 2201 | git-http-push$X: http.o http-push.o GIT-LDFLAGS $(GITLIBS) |
Shawn O. Pearce | 74f2b2a | 2007-03-06 01:35:01 -0500 | [diff] [blame] | 2202 | $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \ |
Remi Pommarel | 9eaa78b | 2015-10-21 19:01:13 +0200 | [diff] [blame] | 2203 | $(CURL_LIBCURL) $(EXPAT_LIBEXPAT) $(LIBS) |
Johannes Schindelin | 39c015c | 2006-02-18 12:40:22 +0100 | [diff] [blame] | 2204 | |
Florian Achleitner | 48ea9f9 | 2012-09-19 17:21:16 +0200 | [diff] [blame] | 2205 | git-remote-testsvn$X: remote-testsvn.o GIT-LDFLAGS $(GITLIBS) $(VCSSVN_LIB) |
| 2206 | $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS) \ |
| 2207 | $(VCSSVN_LIB) |
| 2208 | |
Ilari Liusvaara | 28ca0c9 | 2009-12-09 17:26:34 +0200 | [diff] [blame] | 2209 | $(REMOTE_CURL_ALIASES): $(REMOTE_CURL_PRIMARY) |
| 2210 | $(QUIET_LNCP)$(RM) $@ && \ |
| 2211 | ln $< $@ 2>/dev/null || \ |
| 2212 | ln -s $< $@ 2>/dev/null || \ |
| 2213 | cp $< $@ |
| 2214 | |
Fredrik Kuivinen | d9a25fc | 2011-06-22 12:50:56 +0200 | [diff] [blame] | 2215 | $(REMOTE_CURL_PRIMARY): remote-curl.o http.o http-walker.o GIT-LDFLAGS $(GITLIBS) |
Daniel Barkalow | a2d725b | 2009-08-05 01:01:56 -0400 | [diff] [blame] | 2216 | $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \ |
Remi Pommarel | 9eaa78b | 2015-10-21 19:01:13 +0200 | [diff] [blame] | 2217 | $(CURL_LIBCURL) $(EXPAT_LIBEXPAT) $(LIBS) |
Daniel Barkalow | a2d725b | 2009-08-05 01:01:56 -0400 | [diff] [blame] | 2218 | |
Petr Baudis | 28818ff | 2005-07-29 17:50:24 +0200 | [diff] [blame] | 2219 | $(LIB_FILE): $(LIB_OBJS) |
Junio C Hamano | ac179b4 | 2015-09-10 14:27:21 -0700 | [diff] [blame] | 2220 | $(QUIET_AR)$(RM) $@ && $(AR) $(ARFLAGS) $@ $^ |
Petr Baudis | 28818ff | 2005-07-29 17:50:24 +0200 | [diff] [blame] | 2221 | |
Linus Torvalds | 3443546 | 2006-03-24 20:13:22 -0800 | [diff] [blame] | 2222 | $(XDIFF_LIB): $(XDIFF_OBJS) |
Junio C Hamano | ac179b4 | 2015-09-10 14:27:21 -0700 | [diff] [blame] | 2223 | $(QUIET_AR)$(RM) $@ && $(AR) $(ARFLAGS) $@ $^ |
Linus Torvalds | 3443546 | 2006-03-24 20:13:22 -0800 | [diff] [blame] | 2224 | |
Jonathan Nieder | 3f52737 | 2010-08-09 17:04:29 -0500 | [diff] [blame] | 2225 | $(VCSSVN_LIB): $(VCSSVN_OBJS) |
Junio C Hamano | ac179b4 | 2015-09-10 14:27:21 -0700 | [diff] [blame] | 2226 | $(QUIET_AR)$(RM) $@ && $(AR) $(ARFLAGS) $@ $^ |
Linus Torvalds | 3443546 | 2006-03-24 20:13:22 -0800 | [diff] [blame] | 2227 | |
Jonathan Nieder | 5b58619 | 2012-03-31 03:44:53 -0500 | [diff] [blame] | 2228 | export DEFAULT_EDITOR DEFAULT_PAGER |
| 2229 | |
SZEDER Gábor | 2530afd | 2018-02-15 03:14:10 +0100 | [diff] [blame] | 2230 | .PHONY: doc man man-perl html info pdf |
| 2231 | doc: man-perl |
Petr Baudis | 28818ff | 2005-07-29 17:50:24 +0200 | [diff] [blame] | 2232 | $(MAKE) -C Documentation all |
| 2233 | |
SZEDER Gábor | 2530afd | 2018-02-15 03:14:10 +0100 | [diff] [blame] | 2234 | man: man-perl |
Michael J Gruber | 414851a | 2008-09-10 10:19:34 +0200 | [diff] [blame] | 2235 | $(MAKE) -C Documentation man |
| 2236 | |
SZEDER Gábor | 2530afd | 2018-02-15 03:14:10 +0100 | [diff] [blame] | 2237 | man-perl: perl/build/man/man3/Git.3pm |
| 2238 | |
Michael J Gruber | 414851a | 2008-09-10 10:19:34 +0200 | [diff] [blame] | 2239 | html: |
| 2240 | $(MAKE) -C Documentation html |
| 2241 | |
David Kastrup | 4739809 | 2007-08-06 12:22:57 +0200 | [diff] [blame] | 2242 | info: |
| 2243 | $(MAKE) -C Documentation info |
| 2244 | |
Miklos Vajna | a325a1a | 2008-12-10 23:44:50 +0100 | [diff] [blame] | 2245 | pdf: |
| 2246 | $(MAKE) -C Documentation pdf |
| 2247 | |
Ævar Arnfjörð Bjarmason | cd5513a | 2011-02-22 23:41:23 +0000 | [diff] [blame] | 2248 | XGETTEXT_FLAGS = \ |
| 2249 | --force-po \ |
Jiang Xin | 47fbfde | 2014-04-17 13:37:18 +0800 | [diff] [blame] | 2250 | --add-comments=TRANSLATORS: \ |
Ævar Arnfjörð Bjarmason | cd5513a | 2011-02-22 23:41:23 +0000 | [diff] [blame] | 2251 | --msgid-bugs-address="Git Mailing List <git@vger.kernel.org>" \ |
| 2252 | --from-code=UTF-8 |
Ævar Arnfjörð Bjarmason | ff46a49 | 2011-04-10 19:37:01 +0000 | [diff] [blame] | 2253 | XGETTEXT_FLAGS_C = $(XGETTEXT_FLAGS) --language=C \ |
| 2254 | --keyword=_ --keyword=N_ --keyword="Q_:1,2" |
Jiang Xin | c2d140d | 2012-07-25 22:53:07 +0800 | [diff] [blame] | 2255 | XGETTEXT_FLAGS_SH = $(XGETTEXT_FLAGS) --language=Shell \ |
| 2256 | --keyword=gettextln --keyword=eval_gettextln |
Vasco Almeida | c4a85c3 | 2016-12-14 11:54:29 -0100 | [diff] [blame] | 2257 | XGETTEXT_FLAGS_PERL = $(XGETTEXT_FLAGS) --language=Perl \ |
Vasco Almeida | 0539d5e | 2016-12-14 11:54:30 -0100 | [diff] [blame] | 2258 | --keyword=__ --keyword=N__ --keyword="__n:1,2" |
Jeff King | d85b0df | 2014-08-25 16:00:42 -0400 | [diff] [blame] | 2259 | LOCALIZED_C = $(C_OBJ:o=c) $(LIB_H) $(GENERATED_H) |
Vasco Almeida | d323c6b | 2016-06-17 20:21:02 +0000 | [diff] [blame] | 2260 | LOCALIZED_SH = $(SCRIPT_SH) |
| 2261 | LOCALIZED_SH += git-parse-remote.sh |
Vasco Almeida | 9588c52 | 2016-06-17 20:21:03 +0000 | [diff] [blame] | 2262 | LOCALIZED_SH += git-rebase--interactive.sh |
Vasco Almeida | d323c6b | 2016-06-17 20:21:02 +0000 | [diff] [blame] | 2263 | LOCALIZED_SH += git-sh-setup.sh |
Jeff King | d85b0df | 2014-08-25 16:00:42 -0400 | [diff] [blame] | 2264 | LOCALIZED_PERL = $(SCRIPT_PERL) |
Ævar Arnfjörð Bjarmason | 5e9637c | 2011-11-18 00:14:42 +0100 | [diff] [blame] | 2265 | |
| 2266 | ifdef XGETTEXT_INCLUDE_TESTS |
| 2267 | LOCALIZED_C += t/t0200/test.c |
| 2268 | LOCALIZED_SH += t/t0200/test.sh |
| 2269 | LOCALIZED_PERL += t/t0200/test.perl |
| 2270 | endif |
Ævar Arnfjörð Bjarmason | cd5513a | 2011-02-22 23:41:23 +0000 | [diff] [blame] | 2271 | |
Junio C Hamano | fc0fd5b | 2017-07-20 11:57:01 -0700 | [diff] [blame] | 2272 | ## Note that this is meant to be run only by the localization coordinator |
| 2273 | ## under a very controlled condition, i.e. (1) it is to be run in a |
| 2274 | ## Git repository (not a tarball extract), (2) any local modifications |
| 2275 | ## will be lost. |
| 2276 | ## Gettext tools cannot work with our own custom PRItime type, so |
| 2277 | ## we replace PRItime with PRIuMAX. We need to update this to |
| 2278 | ## PRIdMAX if we switch to a signed type later. |
| 2279 | |
Jonathan Nieder | 1f31963 | 2014-08-22 00:32:08 -0400 | [diff] [blame] | 2280 | po/git.pot: $(GENERATED_H) FORCE |
Junio C Hamano | fc0fd5b | 2017-07-20 11:57:01 -0700 | [diff] [blame] | 2281 | # All modifications will be reverted at the end, so we do not |
| 2282 | # want to have any local change. |
| 2283 | git diff --quiet HEAD && git diff --quiet --cached |
| 2284 | |
| 2285 | @for s in $(LOCALIZED_C) $(LOCALIZED_SH) $(LOCALIZED_PERL); \ |
| 2286 | do \ |
| 2287 | sed -e 's|PRItime|PRIuMAX|g' <"$$s" >"$$s+" && \ |
| 2288 | cat "$$s+" >"$$s" && rm "$$s+"; \ |
| 2289 | done |
| 2290 | |
Ævar Arnfjörð Bjarmason | adc3b2b | 2011-05-14 13:47:45 +0000 | [diff] [blame] | 2291 | $(QUIET_XGETTEXT)$(XGETTEXT) -o$@+ $(XGETTEXT_FLAGS_C) $(LOCALIZED_C) |
| 2292 | $(QUIET_XGETTEXT)$(XGETTEXT) -o$@+ --join-existing $(XGETTEXT_FLAGS_SH) \ |
| 2293 | $(LOCALIZED_SH) |
Ævar Arnfjörð Bjarmason | 5e9637c | 2011-11-18 00:14:42 +0100 | [diff] [blame] | 2294 | $(QUIET_XGETTEXT)$(XGETTEXT) -o$@+ --join-existing $(XGETTEXT_FLAGS_PERL) \ |
| 2295 | $(LOCALIZED_PERL) |
Junio C Hamano | fc0fd5b | 2017-07-20 11:57:01 -0700 | [diff] [blame] | 2296 | |
| 2297 | # Reverting the munged source, leaving only the updated $@ |
| 2298 | git reset --hard |
Ævar Arnfjörð Bjarmason | cd5513a | 2011-02-22 23:41:23 +0000 | [diff] [blame] | 2299 | mv $@+ $@ |
| 2300 | |
Elia Pinto | e6be265 | 2015-12-15 15:21:00 +0000 | [diff] [blame] | 2301 | .PHONY: pot |
Ævar Arnfjörð Bjarmason | cd5513a | 2011-02-22 23:41:23 +0000 | [diff] [blame] | 2302 | pot: po/git.pot |
| 2303 | |
Ævar Arnfjörð Bjarmason | 5e9637c | 2011-11-18 00:14:42 +0100 | [diff] [blame] | 2304 | POFILES := $(wildcard po/*.po) |
| 2305 | MOFILES := $(patsubst po/%.po,po/build/locale/%/LC_MESSAGES/git.mo,$(POFILES)) |
| 2306 | |
| 2307 | ifndef NO_GETTEXT |
| 2308 | all:: $(MOFILES) |
| 2309 | endif |
| 2310 | |
| 2311 | po/build/locale/%/LC_MESSAGES/git.mo: po/%.po |
| 2312 | $(QUIET_MSGFMT)mkdir -p $(dir $@) && $(MSGFMT) -o $@ $< |
| 2313 | |
Ævar Arnfjörð Bjarmason | 805a378 | 2017-12-22 11:07:21 -0800 | [diff] [blame] | 2314 | LIB_PERL := $(wildcard perl/Git.pm perl/Git/*.pm perl/Git/*/*.pm perl/Git/*/*/*.pm) |
| 2315 | LIB_PERL_GEN := $(patsubst perl/%.pm,perl/build/lib/%.pm,$(LIB_PERL)) |
Ævar Arnfjörð Bjarmason | 382029f | 2018-03-03 15:38:15 +0000 | [diff] [blame] | 2316 | LIB_CPAN := $(wildcard perl/FromCPAN/*.pm perl/FromCPAN/*/*.pm) |
| 2317 | LIB_CPAN_GEN := $(patsubst perl/%.pm,perl/build/lib/%.pm,$(LIB_CPAN)) |
Ævar Arnfjörð Bjarmason | 20d2a30 | 2017-12-10 21:13:33 +0000 | [diff] [blame] | 2318 | |
| 2319 | ifndef NO_PERL |
Ævar Arnfjörð Bjarmason | 805a378 | 2017-12-22 11:07:21 -0800 | [diff] [blame] | 2320 | all:: $(LIB_PERL_GEN) |
Todd Zullinger | 075321c | 2018-03-03 15:38:16 +0000 | [diff] [blame] | 2321 | ifndef NO_PERL_CPAN_FALLBACKS |
Ævar Arnfjörð Bjarmason | 382029f | 2018-03-03 15:38:15 +0000 | [diff] [blame] | 2322 | all:: $(LIB_CPAN_GEN) |
Ævar Arnfjörð Bjarmason | 20d2a30 | 2017-12-10 21:13:33 +0000 | [diff] [blame] | 2323 | endif |
Ævar Arnfjörð Bjarmason | 1aca69c | 2018-03-03 15:38:17 +0000 | [diff] [blame] | 2324 | NO_PERL_CPAN_FALLBACKS_SQ = $(subst ','\'',$(NO_PERL_CPAN_FALLBACKS)) |
Ævar Arnfjörð Bjarmason | 20d2a30 | 2017-12-10 21:13:33 +0000 | [diff] [blame] | 2325 | endif |
| 2326 | |
Ævar Arnfjörð Bjarmason | 805a378 | 2017-12-22 11:07:21 -0800 | [diff] [blame] | 2327 | perl/build/lib/%.pm: perl/%.pm |
Ævar Arnfjörð Bjarmason | 20d2a30 | 2017-12-10 21:13:33 +0000 | [diff] [blame] | 2328 | $(QUIET_GEN)mkdir -p $(dir $@) && \ |
Ævar Arnfjörð Bjarmason | 1aca69c | 2018-03-03 15:38:17 +0000 | [diff] [blame] | 2329 | sed -e 's|@@LOCALEDIR@@|$(localedir_SQ)|g' \ |
| 2330 | -e 's|@@NO_PERL_CPAN_FALLBACKS@@|$(NO_PERL_CPAN_FALLBACKS_SQ)|g' \ |
| 2331 | < $< > $@ |
Ævar Arnfjörð Bjarmason | 20d2a30 | 2017-12-10 21:13:33 +0000 | [diff] [blame] | 2332 | |
| 2333 | perl/build/man/man3/Git.3pm: perl/Git.pm |
| 2334 | $(QUIET_GEN)mkdir -p $(dir $@) && \ |
| 2335 | pod2man $< $@ |
| 2336 | |
Jeff King | e951ebc | 2016-12-14 09:26:55 -0500 | [diff] [blame] | 2337 | FIND_SOURCE_FILES = ( \ |
Jeff King | e6fc85b | 2016-12-14 09:28:04 -0500 | [diff] [blame] | 2338 | git ls-files \ |
| 2339 | '*.[hcS]' \ |
Jeff King | 8fa2043 | 2016-12-14 09:29:44 -0500 | [diff] [blame] | 2340 | '*.sh' \ |
Jeff King | e6fc85b | 2016-12-14 09:28:04 -0500 | [diff] [blame] | 2341 | ':!*[tp][0-9][0-9][0-9][0-9]*' \ |
Jeff King | 046e4c1 | 2016-12-14 09:32:35 -0500 | [diff] [blame] | 2342 | ':!contrib' \ |
Jeff King | e6fc85b | 2016-12-14 09:28:04 -0500 | [diff] [blame] | 2343 | 2>/dev/null || \ |
Jeff King | e951ebc | 2016-12-14 09:26:55 -0500 | [diff] [blame] | 2344 | $(FIND) . \ |
| 2345 | \( -name .git -type d -prune \) \ |
Jeff King | 8fa2043 | 2016-12-14 09:29:44 -0500 | [diff] [blame] | 2346 | -o \( -name '[tp][0-9][0-9][0-9][0-9]*' -prune \) \ |
Jeff King | 046e4c1 | 2016-12-14 09:32:35 -0500 | [diff] [blame] | 2347 | -o \( -name contrib -type d -prune \) \ |
Jeff King | e6fc85b | 2016-12-14 09:28:04 -0500 | [diff] [blame] | 2348 | -o \( -name build -type d -prune \) \ |
| 2349 | -o \( -name 'trash*' -type d -prune \) \ |
Jeff King | e951ebc | 2016-12-14 09:26:55 -0500 | [diff] [blame] | 2350 | -o \( -name '*.[hcS]' -type f -print \) \ |
Jeff King | 8fa2043 | 2016-12-14 09:29:44 -0500 | [diff] [blame] | 2351 | -o \( -name '*.sh' -type f -print \) \ |
Jeff King | e951ebc | 2016-12-14 09:26:55 -0500 | [diff] [blame] | 2352 | ) |
Junio C Hamano | 3353397 | 2011-10-18 00:26:18 -0700 | [diff] [blame] | 2353 | |
Junio C Hamano | 2f76919 | 2010-09-28 16:08:38 -0500 | [diff] [blame] | 2354 | $(ETAGS_TARGET): FORCE |
| 2355 | $(RM) $(ETAGS_TARGET) |
Junio C Hamano | 3353397 | 2011-10-18 00:26:18 -0700 | [diff] [blame] | 2356 | $(FIND_SOURCE_FILES) | xargs etags -a -o $(ETAGS_TARGET) |
Fredrik Kuivinen | f81e7c6 | 2006-03-18 11:07:12 +0100 | [diff] [blame] | 2357 | |
Junio C Hamano | 2f76919 | 2010-09-28 16:08:38 -0500 | [diff] [blame] | 2358 | tags: FORCE |
Emil Medve | 4cb08df | 2007-07-14 12:51:44 -0500 | [diff] [blame] | 2359 | $(RM) tags |
Junio C Hamano | 3353397 | 2011-10-18 00:26:18 -0700 | [diff] [blame] | 2360 | $(FIND_SOURCE_FILES) | xargs ctags -a |
Petr Baudis | 28818ff | 2005-07-29 17:50:24 +0200 | [diff] [blame] | 2361 | |
Kristof Provost | a2a9150 | 2007-10-06 16:24:42 +0200 | [diff] [blame] | 2362 | cscope: |
| 2363 | $(RM) cscope* |
Junio C Hamano | 3353397 | 2011-10-18 00:26:18 -0700 | [diff] [blame] | 2364 | $(FIND_SOURCE_FILES) | xargs cscope -b |
Kristof Provost | a2a9150 | 2007-10-06 16:24:42 +0200 | [diff] [blame] | 2365 | |
Yakov Lerner | ca3bcab | 2006-06-15 01:36:00 +0300 | [diff] [blame] | 2366 | ### Detect prefix changes |
Jeff King | be1dbd0 | 2012-06-20 14:31:55 -0400 | [diff] [blame] | 2367 | TRACK_PREFIX = $(bindir_SQ):$(gitexecdir_SQ):$(template_dir_SQ):$(prefix_SQ):\ |
| 2368 | $(localedir_SQ) |
| 2369 | |
| 2370 | GIT-PREFIX: FORCE |
| 2371 | @FLAGS='$(TRACK_PREFIX)'; \ |
| 2372 | if test x"$$FLAGS" != x"`cat GIT-PREFIX 2>/dev/null`" ; then \ |
Christian Couder | 1a59d88 | 2012-12-18 16:26:39 +0100 | [diff] [blame] | 2373 | echo >&2 " * new prefix flags"; \ |
Jeff King | be1dbd0 | 2012-06-20 14:31:55 -0400 | [diff] [blame] | 2374 | echo "$$FLAGS" >GIT-PREFIX; \ |
| 2375 | fi |
| 2376 | |
| 2377 | TRACK_CFLAGS = $(CC):$(subst ','\'',$(ALL_CFLAGS)):$(USE_GETTEXT_SCHEME) |
Yakov Lerner | ca3bcab | 2006-06-15 01:36:00 +0300 | [diff] [blame] | 2378 | |
Jonathan Nieder | 13fca9f | 2010-01-06 02:06:58 -0600 | [diff] [blame] | 2379 | GIT-CFLAGS: FORCE |
Yakov Lerner | ca3bcab | 2006-06-15 01:36:00 +0300 | [diff] [blame] | 2380 | @FLAGS='$(TRACK_CFLAGS)'; \ |
| 2381 | if test x"$$FLAGS" != x"`cat GIT-CFLAGS 2>/dev/null`" ; then \ |
Christian Couder | 1a59d88 | 2012-12-18 16:26:39 +0100 | [diff] [blame] | 2382 | echo >&2 " * new build flags"; \ |
Yakov Lerner | ca3bcab | 2006-06-15 01:36:00 +0300 | [diff] [blame] | 2383 | echo "$$FLAGS" >GIT-CFLAGS; \ |
| 2384 | fi |
| 2385 | |
Fredrik Kuivinen | d9a25fc | 2011-06-22 12:50:56 +0200 | [diff] [blame] | 2386 | TRACK_LDFLAGS = $(subst ','\'',$(ALL_LDFLAGS)) |
| 2387 | |
| 2388 | GIT-LDFLAGS: FORCE |
| 2389 | @FLAGS='$(TRACK_LDFLAGS)'; \ |
| 2390 | if test x"$$FLAGS" != x"`cat GIT-LDFLAGS 2>/dev/null`" ; then \ |
Christian Couder | 1a59d88 | 2012-12-18 16:26:39 +0100 | [diff] [blame] | 2391 | echo >&2 " * new link flags"; \ |
Fredrik Kuivinen | d9a25fc | 2011-06-22 12:50:56 +0200 | [diff] [blame] | 2392 | echo "$$FLAGS" >GIT-LDFLAGS; \ |
| 2393 | fi |
| 2394 | |
Junio C Hamano | bfce508 | 2008-07-25 12:35:10 -0700 | [diff] [blame] | 2395 | # We need to apply sq twice, once to protect from the shell |
| 2396 | # that runs GIT-BUILD-OPTIONS, and then again to protect it |
| 2397 | # and the first level quoting from the shell that runs "echo". |
Jonathan Nieder | 13fca9f | 2010-01-06 02:06:58 -0600 | [diff] [blame] | 2398 | GIT-BUILD-OPTIONS: FORCE |
Jeff King | a2d25ef | 2015-05-29 03:26:30 -0400 | [diff] [blame] | 2399 | @echo SHELL_PATH=\''$(subst ','\'',$(SHELL_PATH_SQ))'\' >$@+ |
Jeff King | 3f824e9 | 2017-12-08 05:47:22 -0500 | [diff] [blame] | 2400 | @echo TEST_SHELL_PATH=\''$(subst ','\'',$(TEST_SHELL_PATH_SQ))'\' >>$@+ |
Jeff King | a2d25ef | 2015-05-29 03:26:30 -0400 | [diff] [blame] | 2401 | @echo PERL_PATH=\''$(subst ','\'',$(PERL_PATH_SQ))'\' >>$@+ |
| 2402 | @echo DIFF=\''$(subst ','\'',$(subst ','\'',$(DIFF)))'\' >>$@+ |
| 2403 | @echo PYTHON_PATH=\''$(subst ','\'',$(PYTHON_PATH_SQ))'\' >>$@+ |
| 2404 | @echo TAR=\''$(subst ','\'',$(subst ','\'',$(TAR)))'\' >>$@+ |
| 2405 | @echo NO_CURL=\''$(subst ','\'',$(subst ','\'',$(NO_CURL)))'\' >>$@+ |
Junio C Hamano | 0d5d7db | 2015-06-16 14:27:06 -0700 | [diff] [blame] | 2406 | @echo NO_EXPAT=\''$(subst ','\'',$(subst ','\'',$(NO_EXPAT)))'\' >>$@+ |
Ævar Arnfjörð Bjarmason | 94da919 | 2017-06-01 18:20:56 +0000 | [diff] [blame] | 2407 | @echo USE_LIBPCRE1=\''$(subst ','\'',$(subst ','\'',$(USE_LIBPCRE1)))'\' >>$@+ |
| 2408 | @echo USE_LIBPCRE2=\''$(subst ','\'',$(subst ','\'',$(USE_LIBPCRE2)))'\' >>$@+ |
Ævar Arnfjörð Bjarmason | fb95e2e | 2017-06-01 18:20:55 +0000 | [diff] [blame] | 2409 | @echo NO_LIBPCRE1_JIT=\''$(subst ','\'',$(subst ','\'',$(NO_LIBPCRE1_JIT)))'\' >>$@+ |
Jeff King | a2d25ef | 2015-05-29 03:26:30 -0400 | [diff] [blame] | 2410 | @echo NO_PERL=\''$(subst ','\'',$(subst ','\'',$(NO_PERL)))'\' >>$@+ |
Ævar Arnfjörð Bjarmason | 68c7d27 | 2017-05-25 19:45:31 +0000 | [diff] [blame] | 2411 | @echo NO_PTHREADS=\''$(subst ','\'',$(subst ','\'',$(NO_PTHREADS)))'\' >>$@+ |
Jeff King | a2d25ef | 2015-05-29 03:26:30 -0400 | [diff] [blame] | 2412 | @echo NO_PYTHON=\''$(subst ','\'',$(subst ','\'',$(NO_PYTHON)))'\' >>$@+ |
| 2413 | @echo NO_UNIX_SOCKETS=\''$(subst ','\'',$(subst ','\'',$(NO_UNIX_SOCKETS)))'\' >>$@+ |
Eric Wong | 995bc22 | 2016-08-04 11:40:25 +0000 | [diff] [blame] | 2414 | @echo PAGER_ENV=\''$(subst ','\'',$(subst ','\'',$(PAGER_ENV)))'\' >>$@+ |
Jeff King | f5f5e7f | 2017-03-16 18:09:36 -0400 | [diff] [blame] | 2415 | @echo DC_SHA1=\''$(subst ','\'',$(subst ','\'',$(DC_SHA1)))'\' >>$@+ |
John Keeping | 2d14e13 | 2013-04-29 19:16:21 +0100 | [diff] [blame] | 2416 | ifdef TEST_OUTPUT_DIRECTORY |
Jeff King | a2d25ef | 2015-05-29 03:26:30 -0400 | [diff] [blame] | 2417 | @echo TEST_OUTPUT_DIRECTORY=\''$(subst ','\'',$(subst ','\'',$(TEST_OUTPUT_DIRECTORY)))'\' >>$@+ |
John Keeping | 2d14e13 | 2013-04-29 19:16:21 +0100 | [diff] [blame] | 2418 | endif |
Thomas Rast | 342e9ef | 2012-02-17 11:25:09 +0100 | [diff] [blame] | 2419 | ifdef GIT_TEST_OPTS |
Jeff King | a2d25ef | 2015-05-29 03:26:30 -0400 | [diff] [blame] | 2420 | @echo GIT_TEST_OPTS=\''$(subst ','\'',$(subst ','\'',$(GIT_TEST_OPTS)))'\' >>$@+ |
Thomas Rast | 342e9ef | 2012-02-17 11:25:09 +0100 | [diff] [blame] | 2421 | endif |
Junio C Hamano | 5e87eae | 2010-06-11 09:40:25 -0700 | [diff] [blame] | 2422 | ifdef GIT_TEST_CMP |
Jeff King | a2d25ef | 2015-05-29 03:26:30 -0400 | [diff] [blame] | 2423 | @echo GIT_TEST_CMP=\''$(subst ','\'',$(subst ','\'',$(GIT_TEST_CMP)))'\' >>$@+ |
Junio C Hamano | 5e87eae | 2010-06-11 09:40:25 -0700 | [diff] [blame] | 2424 | endif |
| 2425 | ifdef GIT_TEST_CMP_USE_COPIED_CONTEXT |
Jeff King | a2d25ef | 2015-05-29 03:26:30 -0400 | [diff] [blame] | 2426 | @echo GIT_TEST_CMP_USE_COPIED_CONTEXT=YesPlease >>$@+ |
Junio C Hamano | 5e87eae | 2010-06-11 09:40:25 -0700 | [diff] [blame] | 2427 | endif |
Jeff King | a2d25ef | 2015-05-29 03:26:30 -0400 | [diff] [blame] | 2428 | @echo NO_GETTEXT=\''$(subst ','\'',$(subst ','\'',$(NO_GETTEXT)))'\' >>$@+ |
| 2429 | @echo GETTEXT_POISON=\''$(subst ','\'',$(subst ','\'',$(GETTEXT_POISON)))'\' >>$@+ |
Thomas Rast | 342e9ef | 2012-02-17 11:25:09 +0100 | [diff] [blame] | 2430 | ifdef GIT_PERF_REPEAT_COUNT |
Jeff King | a2d25ef | 2015-05-29 03:26:30 -0400 | [diff] [blame] | 2431 | @echo GIT_PERF_REPEAT_COUNT=\''$(subst ','\'',$(subst ','\'',$(GIT_PERF_REPEAT_COUNT)))'\' >>$@+ |
Thomas Rast | 342e9ef | 2012-02-17 11:25:09 +0100 | [diff] [blame] | 2432 | endif |
| 2433 | ifdef GIT_PERF_REPO |
Jeff King | a2d25ef | 2015-05-29 03:26:30 -0400 | [diff] [blame] | 2434 | @echo GIT_PERF_REPO=\''$(subst ','\'',$(subst ','\'',$(GIT_PERF_REPO)))'\' >>$@+ |
Thomas Rast | 342e9ef | 2012-02-17 11:25:09 +0100 | [diff] [blame] | 2435 | endif |
| 2436 | ifdef GIT_PERF_LARGE_REPO |
Jeff King | a2d25ef | 2015-05-29 03:26:30 -0400 | [diff] [blame] | 2437 | @echo GIT_PERF_LARGE_REPO=\''$(subst ','\'',$(subst ','\'',$(GIT_PERF_LARGE_REPO)))'\' >>$@+ |
Thomas Rast | 342e9ef | 2012-02-17 11:25:09 +0100 | [diff] [blame] | 2438 | endif |
| 2439 | ifdef GIT_PERF_MAKE_OPTS |
Jeff King | a2d25ef | 2015-05-29 03:26:30 -0400 | [diff] [blame] | 2440 | @echo GIT_PERF_MAKE_OPTS=\''$(subst ','\'',$(subst ','\'',$(GIT_PERF_MAKE_OPTS)))'\' >>$@+ |
Thomas Rast | 342e9ef | 2012-02-17 11:25:09 +0100 | [diff] [blame] | 2441 | endif |
Ævar Arnfjörð Bjarmason | 88b6197 | 2017-05-20 21:42:18 +0000 | [diff] [blame] | 2442 | ifdef GIT_PERF_MAKE_COMMAND |
| 2443 | @echo GIT_PERF_MAKE_COMMAND=\''$(subst ','\'',$(subst ','\'',$(GIT_PERF_MAKE_COMMAND)))'\' >>$@+ |
| 2444 | endif |
Jeff King | 3d89361 | 2017-02-25 04:37:07 -0500 | [diff] [blame] | 2445 | ifdef GIT_INTEROP_MAKE_OPTS |
| 2446 | @echo GIT_INTEROP_MAKE_OPTS=\''$(subst ','\'',$(subst ','\'',$(GIT_INTEROP_MAKE_OPTS)))'\' >>$@+ |
| 2447 | endif |
Thomas Gummerer | 5d9fc88 | 2014-02-23 21:49:58 +0100 | [diff] [blame] | 2448 | ifdef TEST_GIT_INDEX_VERSION |
Jeff King | a2d25ef | 2015-05-29 03:26:30 -0400 | [diff] [blame] | 2449 | @echo TEST_GIT_INDEX_VERSION=\''$(subst ','\'',$(subst ','\'',$(TEST_GIT_INDEX_VERSION)))'\' >>$@+ |
Thomas Gummerer | 5d9fc88 | 2014-02-23 21:49:58 +0100 | [diff] [blame] | 2450 | endif |
Jeff King | a2d25ef | 2015-05-29 03:26:30 -0400 | [diff] [blame] | 2451 | @if cmp $@+ $@ >/dev/null 2>&1; then $(RM) $@+; else mv $@+ $@; fi |
Jeff King | 7cf7f54 | 2008-02-24 14:40:45 -0500 | [diff] [blame] | 2452 | |
Christian Couder | 96a4647 | 2012-12-18 16:26:38 +0100 | [diff] [blame] | 2453 | ### Detect Python interpreter path changes |
| 2454 | ifndef NO_PYTHON |
| 2455 | TRACK_PYTHON = $(subst ','\'',-DPYTHON_PATH='$(PYTHON_PATH_SQ)') |
Eygene Ryabinkin | 6bdb18a | 2007-03-28 04:22:02 -0700 | [diff] [blame] | 2456 | |
Christian Couder | 96a4647 | 2012-12-18 16:26:38 +0100 | [diff] [blame] | 2457 | GIT-PYTHON-VARS: FORCE |
| 2458 | @VARS='$(TRACK_PYTHON)'; \ |
Eygene Ryabinkin | 6bdb18a | 2007-03-28 04:22:02 -0700 | [diff] [blame] | 2459 | if test x"$$VARS" != x"`cat $@ 2>/dev/null`" ; then \ |
Christian Couder | 1a59d88 | 2012-12-18 16:26:39 +0100 | [diff] [blame] | 2460 | echo >&2 " * new Python interpreter location"; \ |
Eygene Ryabinkin | 6bdb18a | 2007-03-28 04:22:02 -0700 | [diff] [blame] | 2461 | echo "$$VARS" >$@; \ |
| 2462 | fi |
Eygene Ryabinkin | 6bdb18a | 2007-03-28 04:22:02 -0700 | [diff] [blame] | 2463 | endif |
| 2464 | |
Matthew Ogilvie | ea92519 | 2009-12-02 22:14:05 -0700 | [diff] [blame] | 2465 | test_bindir_programs := $(patsubst %,bin-wrappers/%,$(BINDIR_PROGRAMS_NEED_X) $(BINDIR_PROGRAMS_NO_X) $(TEST_PROGRAMS_NEED_X)) |
| 2466 | |
| 2467 | all:: $(TEST_PROGRAMS) $(test_bindir_programs) |
Felipe Contreras | 6c473a5 | 2013-06-07 17:03:06 -0500 | [diff] [blame] | 2468 | all:: $(NO_INSTALL) |
Matthew Ogilvie | ea92519 | 2009-12-02 22:14:05 -0700 | [diff] [blame] | 2469 | |
| 2470 | bin-wrappers/%: wrap-for-bin.sh |
| 2471 | @mkdir -p bin-wrappers |
| 2472 | $(QUIET_GEN)sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \ |
| 2473 | -e 's|@@BUILD_DIR@@|$(shell pwd)|' \ |
Nguyễn Thái Ngọc Duy | e6e7530 | 2016-04-13 20:22:42 +0700 | [diff] [blame] | 2474 | -e 's|@@PROG@@|$(patsubst test-%,t/helper/test-%,$(@F))|' < $< > $@ && \ |
Matthew Ogilvie | ea92519 | 2009-12-02 22:14:05 -0700 | [diff] [blame] | 2475 | chmod +x $@ |
Junio C Hamano | 96651ef | 2007-04-28 15:32:49 -0700 | [diff] [blame] | 2476 | |
Johannes Schindelin | abb7c7b | 2006-02-18 13:01:18 +0100 | [diff] [blame] | 2477 | # GNU make supports exporting all variables by "export" without parameters. |
| 2478 | # However, the environment gets quite big, and some programs have problems |
| 2479 | # with that. |
| 2480 | |
Johannes Schindelin | 140245b | 2006-07-07 13:26:31 +0200 | [diff] [blame] | 2481 | export NO_SVN_TESTS |
Ramsay Jones | 1266686 | 2012-10-06 18:33:08 +0100 | [diff] [blame] | 2482 | export TEST_NO_MALLOC_CHECK |
Johannes Schindelin | abb7c7b | 2006-02-18 13:01:18 +0100 | [diff] [blame] | 2483 | |
Jonathan Nieder | 225f78c | 2010-01-26 10:08:44 -0600 | [diff] [blame] | 2484 | ### Testing rules |
| 2485 | |
Junio C Hamano | 96651ef | 2007-04-28 15:32:49 -0700 | [diff] [blame] | 2486 | test: all |
Petr Baudis | 28818ff | 2005-07-29 17:50:24 +0200 | [diff] [blame] | 2487 | $(MAKE) -C t/ all |
| 2488 | |
Thomas Rast | 342e9ef | 2012-02-17 11:25:09 +0100 | [diff] [blame] | 2489 | perf: all |
| 2490 | $(MAKE) -C t/perf/ all |
| 2491 | |
| 2492 | .PHONY: test perf |
| 2493 | |
Jeff King | 4df7c8a | 2016-07-01 03:59:44 -0400 | [diff] [blame] | 2494 | t/helper/test-line-buffer$X: $(VCSSVN_LIB) |
René Scharfe | b4285c7 | 2009-01-17 16:50:13 +0100 | [diff] [blame] | 2495 | |
Jeff King | 4df7c8a | 2016-07-01 03:59:44 -0400 | [diff] [blame] | 2496 | t/helper/test-svn-fe$X: $(VCSSVN_LIB) |
David Barr | 21746aa | 2010-08-09 17:55:00 -0500 | [diff] [blame] | 2497 | |
Jonathan Nieder | daa99a9 | 2010-01-26 09:45:54 -0600 | [diff] [blame] | 2498 | .PRECIOUS: $(TEST_OBJS) |
Junio C Hamano | fa8fe28 | 2007-08-30 19:14:31 -0700 | [diff] [blame] | 2499 | |
Nguyễn Thái Ngọc Duy | efd71f8 | 2018-03-24 08:44:30 +0100 | [diff] [blame] | 2500 | t/helper/test-tool$X: $(patsubst %,t/helper/%,$(TEST_BUILTINS_OBJS)) |
| 2501 | |
Nguyễn Thái Ngọc Duy | e6e7530 | 2016-04-13 20:22:42 +0700 | [diff] [blame] | 2502 | t/helper/test-%$X: t/helper/test-%.o GIT-LDFLAGS $(GITLIBS) |
David Barr | 1d73b52 | 2010-08-09 17:34:42 -0500 | [diff] [blame] | 2503 | $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(filter %.a,$^) $(LIBS) |
Nicolas Pitre | 2dca1af | 2007-04-11 13:59:51 -0400 | [diff] [blame] | 2504 | |
Nguyễn Thái Ngọc Duy | e6e7530 | 2016-04-13 20:22:42 +0700 | [diff] [blame] | 2505 | check-sha1:: t/helper/test-sha1$X |
| 2506 | t/helper/test-sha1.sh |
Junio C Hamano | b65bc21 | 2006-06-24 00:59:49 -0700 | [diff] [blame] | 2507 | |
Ramsay Jones | 0bcd9ae | 2011-04-21 20:14:42 +0100 | [diff] [blame] | 2508 | SP_OBJ = $(patsubst %.o,%.sp,$(C_OBJ)) |
| 2509 | |
| 2510 | $(SP_OBJ): %.sp: %.c GIT-CFLAGS FORCE |
| 2511 | $(QUIET_SP)cgcc -no-compile $(ALL_CFLAGS) $(EXTRA_CPPFLAGS) \ |
| 2512 | $(SPARSE_FLAGS) $< |
| 2513 | |
| 2514 | .PHONY: sparse $(SP_OBJ) |
| 2515 | sparse: $(SP_OBJ) |
| 2516 | |
Brandon Williams | 2118805 | 2017-08-14 14:30:46 -0700 | [diff] [blame] | 2517 | .PHONY: style |
| 2518 | style: |
| 2519 | git clang-format --style file --diff --extensions c,h |
| 2520 | |
René Scharfe | 7c4c9f4 | 2007-01-04 19:33:48 +0100 | [diff] [blame] | 2521 | check: common-cmds.h |
Ramsay Jones | f228d1f | 2011-04-07 19:22:18 +0100 | [diff] [blame] | 2522 | @if sparse; \ |
Junio C Hamano | 912f998 | 2008-11-11 13:12:17 -0800 | [diff] [blame] | 2523 | then \ |
Junio C Hamano | d55de70 | 2016-04-05 00:02:14 -0700 | [diff] [blame] | 2524 | echo >&2 "Use 'make sparse' instead"; \ |
Ramsay Jones | 0bcd9ae | 2011-04-21 20:14:42 +0100 | [diff] [blame] | 2525 | $(MAKE) --no-print-directory sparse; \ |
Junio C Hamano | 912f998 | 2008-11-11 13:12:17 -0800 | [diff] [blame] | 2526 | else \ |
Junio C Hamano | d55de70 | 2016-04-05 00:02:14 -0700 | [diff] [blame] | 2527 | echo >&2 "Did you mean 'make test'?"; \ |
Junio C Hamano | 912f998 | 2008-11-11 13:12:17 -0800 | [diff] [blame] | 2528 | exit 1; \ |
| 2529 | fi |
Petr Baudis | 28818ff | 2005-07-29 17:50:24 +0200 | [diff] [blame] | 2530 | |
René Scharfe | 63f0a75 | 2016-09-15 20:30:56 +0200 | [diff] [blame] | 2531 | C_SOURCES = $(patsubst %.o,%.c,$(C_OBJ)) |
| 2532 | %.cocci.patch: %.cocci $(C_SOURCES) |
| 2533 | @echo ' ' SPATCH $<; \ |
Jeff King | f5c2bc2 | 2017-03-10 03:31:18 -0500 | [diff] [blame] | 2534 | ret=0; \ |
René Scharfe | 63f0a75 | 2016-09-15 20:30:56 +0200 | [diff] [blame] | 2535 | for f in $(C_SOURCES); do \ |
Jeff King | f5c2bc2 | 2017-03-10 03:31:18 -0500 | [diff] [blame] | 2536 | $(SPATCH) --sp-file $< $$f $(SPATCH_FLAGS) || \ |
| 2537 | { ret=$$?; break; }; \ |
| 2538 | done >$@+ 2>$@.log; \ |
| 2539 | if test $$ret != 0; \ |
| 2540 | then \ |
| 2541 | cat $@.log; \ |
| 2542 | exit 1; \ |
| 2543 | fi; \ |
| 2544 | mv $@+ $@; \ |
René Scharfe | 63f0a75 | 2016-09-15 20:30:56 +0200 | [diff] [blame] | 2545 | if test -s $@; \ |
| 2546 | then \ |
| 2547 | echo ' ' SPATCH result: $@; \ |
| 2548 | fi |
| 2549 | coccicheck: $(patsubst %.cocci,%.cocci.patch,$(wildcard contrib/coccinelle/*.cocci)) |
| 2550 | |
Petr Baudis | 28818ff | 2005-07-29 17:50:24 +0200 | [diff] [blame] | 2551 | ### Installation rules |
| 2552 | |
Junio C Hamano | 0c0ead7 | 2009-02-05 00:04:17 -0800 | [diff] [blame] | 2553 | ifneq ($(filter /%,$(firstword $(template_dir))),) |
Johannes Sixt | 0b50b86 | 2008-01-01 22:15:21 +0100 | [diff] [blame] | 2554 | template_instdir = $(template_dir) |
Steffen Prohaska | 026fa0d | 2009-01-18 13:00:09 +0100 | [diff] [blame] | 2555 | else |
| 2556 | template_instdir = $(prefix)/$(template_dir) |
Johannes Sixt | 0b50b86 | 2008-01-01 22:15:21 +0100 | [diff] [blame] | 2557 | endif |
| 2558 | export template_instdir |
| 2559 | |
Junio C Hamano | 0c0ead7 | 2009-02-05 00:04:17 -0800 | [diff] [blame] | 2560 | ifneq ($(filter /%,$(firstword $(gitexecdir))),) |
Johannes Sixt | 49fa65a | 2008-07-23 21:12:18 +0200 | [diff] [blame] | 2561 | gitexec_instdir = $(gitexecdir) |
Steffen Prohaska | 026fa0d | 2009-01-18 13:00:09 +0100 | [diff] [blame] | 2562 | else |
| 2563 | gitexec_instdir = $(prefix)/$(gitexecdir) |
Johannes Sixt | 49fa65a | 2008-07-23 21:12:18 +0200 | [diff] [blame] | 2564 | endif |
| 2565 | gitexec_instdir_SQ = $(subst ','\'',$(gitexec_instdir)) |
| 2566 | export gitexec_instdir |
| 2567 | |
David Aguilar | bc7a96a | 2011-08-18 00:23:46 -0700 | [diff] [blame] | 2568 | ifneq ($(filter /%,$(firstword $(mergetoolsdir))),) |
| 2569 | mergetools_instdir = $(mergetoolsdir) |
| 2570 | else |
| 2571 | mergetools_instdir = $(prefix)/$(mergetoolsdir) |
| 2572 | endif |
| 2573 | mergetools_instdir_SQ = $(subst ','\'',$(mergetools_instdir)) |
| 2574 | |
Matthew Ogilvie | ea92519 | 2009-12-02 22:14:05 -0700 | [diff] [blame] | 2575 | install_bindir_programs := $(patsubst %,%$X,$(BINDIR_PROGRAMS_NEED_X)) $(BINDIR_PROGRAMS_NO_X) |
| 2576 | |
Elia Pinto | e6be265 | 2015-12-15 15:21:00 +0000 | [diff] [blame] | 2577 | .PHONY: profile-install profile-fast-install |
Andi Kleen | 066dd26 | 2014-07-07 23:35:11 -0700 | [diff] [blame] | 2578 | profile-install: profile |
| 2579 | $(MAKE) install |
| 2580 | |
| 2581 | profile-fast-install: profile-fast |
| 2582 | $(MAKE) install |
| 2583 | |
Andreas Ericsson | d6ebd25 | 2005-11-22 00:44:15 +0100 | [diff] [blame] | 2584 | install: all |
Robert Schiele | 4165076 | 2007-12-01 18:05:40 +0100 | [diff] [blame] | 2585 | $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(bindir_SQ)' |
Johannes Sixt | 49fa65a | 2008-07-23 21:12:18 +0200 | [diff] [blame] | 2586 | $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(gitexec_instdir_SQ)' |
| 2587 | $(INSTALL) $(ALL_PROGRAMS) '$(DESTDIR_SQ)$(gitexec_instdir_SQ)' |
Jonathan Nieder | 46bac90 | 2010-01-31 11:46:53 -0800 | [diff] [blame] | 2588 | $(INSTALL) -m 644 $(SCRIPT_LIB) '$(DESTDIR_SQ)$(gitexec_instdir_SQ)' |
Matthew Ogilvie | ea92519 | 2009-12-02 22:14:05 -0700 | [diff] [blame] | 2589 | $(INSTALL) $(install_bindir_programs) '$(DESTDIR_SQ)$(bindir_SQ)' |
Ramsay Allan Jones | 7ffe709 | 2006-07-29 17:25:03 +0100 | [diff] [blame] | 2590 | $(MAKE) -C templates DESTDIR='$(DESTDIR_SQ)' install |
David Aguilar | bc7a96a | 2011-08-18 00:23:46 -0700 | [diff] [blame] | 2591 | $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(mergetools_instdir_SQ)' |
Jonathan Nieder | 53b7425 | 2011-10-09 04:17:07 -0500 | [diff] [blame] | 2592 | $(INSTALL) -m 644 mergetools/* '$(DESTDIR_SQ)$(mergetools_instdir_SQ)' |
Ævar Arnfjörð Bjarmason | 5e9637c | 2011-11-18 00:14:42 +0100 | [diff] [blame] | 2593 | ifndef NO_GETTEXT |
| 2594 | $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(localedir_SQ)' |
| 2595 | (cd po/build/locale && $(TAR) cf - .) | \ |
| 2596 | (cd '$(DESTDIR_SQ)$(localedir_SQ)' && umask 022 && $(TAR) xof -) |
| 2597 | endif |
Junio C Hamano | 5be3b17 | 2009-04-22 22:42:28 -0700 | [diff] [blame] | 2598 | ifndef NO_PERL |
Ævar Arnfjörð Bjarmason | 20d2a30 | 2017-12-10 21:13:33 +0000 | [diff] [blame] | 2599 | $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perllibdir_SQ)' |
| 2600 | (cd perl/build/lib && $(TAR) cf - .) | \ |
| 2601 | (cd '$(DESTDIR_SQ)$(perllibdir_SQ)' && umask 022 && $(TAR) xof -) |
Junio C Hamano | 8d676d8 | 2010-06-21 06:02:44 -0700 | [diff] [blame] | 2602 | $(MAKE) -C gitweb install |
Junio C Hamano | 5be3b17 | 2009-04-22 22:42:28 -0700 | [diff] [blame] | 2603 | endif |
Eygene Ryabinkin | 3cfaf11 | 2007-03-28 04:00:23 -0700 | [diff] [blame] | 2604 | ifndef NO_TCLTK |
Junio C Hamano | 62ba514 | 2007-11-17 10:51:16 -0800 | [diff] [blame] | 2605 | $(MAKE) -C gitk-git install |
Johannes Sixt | 49fa65a | 2008-07-23 21:12:18 +0200 | [diff] [blame] | 2606 | $(MAKE) -C git-gui gitexecdir='$(gitexec_instdir_SQ)' install |
Eygene Ryabinkin | 3cfaf11 | 2007-03-28 04:00:23 -0700 | [diff] [blame] | 2607 | endif |
Junio C Hamano | 6fc301b | 2007-01-10 12:24:54 -0800 | [diff] [blame] | 2608 | ifneq (,$X) |
Eric Blake | d4b1902 | 2009-04-28 06:28:31 -0600 | [diff] [blame] | 2609 | $(foreach p,$(patsubst %$X,%,$(filter %$X,$(ALL_PROGRAMS) $(BUILT_INS) 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 Hamano | 6fc301b | 2007-01-10 12:24:54 -0800 | [diff] [blame] | 2610 | endif |
Ilari Liusvaara | 28ca0c9 | 2009-12-09 17:26:34 +0200 | [diff] [blame] | 2611 | |
Johannes Sixt | 46beb55 | 2008-07-21 21:19:51 +0200 | [diff] [blame] | 2612 | bindir=$$(cd '$(DESTDIR_SQ)$(bindir_SQ)' && pwd) && \ |
Johannes Sixt | 49fa65a | 2008-07-23 21:12:18 +0200 | [diff] [blame] | 2613 | execdir=$$(cd '$(DESTDIR_SQ)$(gitexec_instdir_SQ)' && pwd) && \ |
Junio C Hamano | 6edd149 | 2009-07-10 20:17:33 -0700 | [diff] [blame] | 2614 | { test "$$bindir/" = "$$execdir/" || \ |
Brandon Casey | 76d079a | 2010-07-23 12:50:45 -0500 | [diff] [blame] | 2615 | for p in git$X $(filter $(install_bindir_programs),$(ALL_PROGRAMS)); do \ |
| 2616 | $(RM) "$$execdir/$$p" && \ |
Junio C Hamano | 70de5e6 | 2012-05-02 15:12:10 -0700 | [diff] [blame] | 2617 | test -z "$(NO_INSTALL_HARDLINKS)$(NO_CROSS_DIRECTORY_HARDLINKS)" && \ |
Brandon Casey | 76d079a | 2010-07-23 12:50:45 -0500 | [diff] [blame] | 2618 | ln "$$bindir/$$p" "$$execdir/$$p" 2>/dev/null || \ |
| 2619 | cp "$$bindir/$$p" "$$execdir/$$p" || exit; \ |
| 2620 | done; \ |
| 2621 | } && \ |
Brandon Casey | 40919c4 | 2010-07-23 12:50:44 -0500 | [diff] [blame] | 2622 | for p in $(filter $(install_bindir_programs),$(BUILT_INS)); do \ |
| 2623 | $(RM) "$$bindir/$$p" && \ |
Junio C Hamano | 70de5e6 | 2012-05-02 15:12:10 -0700 | [diff] [blame] | 2624 | test -z "$(NO_INSTALL_HARDLINKS)" && \ |
Brandon Casey | 40919c4 | 2010-07-23 12:50:44 -0500 | [diff] [blame] | 2625 | ln "$$bindir/git$X" "$$bindir/$$p" 2>/dev/null || \ |
| 2626 | ln -s "git$X" "$$bindir/$$p" 2>/dev/null || \ |
| 2627 | cp "$$bindir/git$X" "$$bindir/$$p" || exit; \ |
| 2628 | done && \ |
Brandon Casey | ba2b4d7 | 2010-07-02 11:50:28 -0700 | [diff] [blame] | 2629 | for p in $(BUILT_INS); do \ |
Brandon Casey | b56c79c | 2009-01-19 19:44:03 -0600 | [diff] [blame] | 2630 | $(RM) "$$execdir/$$p" && \ |
Junio C Hamano | 70de5e6 | 2012-05-02 15:12:10 -0700 | [diff] [blame] | 2631 | test -z "$(NO_INSTALL_HARDLINKS)" && \ |
Jeff King | 4ecbc17 | 2009-07-09 02:37:35 -0400 | [diff] [blame] | 2632 | ln "$$execdir/git$X" "$$execdir/$$p" 2>/dev/null || \ |
| 2633 | ln -s "git$X" "$$execdir/$$p" 2>/dev/null || \ |
| 2634 | cp "$$execdir/git$X" "$$execdir/$$p" || exit; \ |
Brandon Casey | ba2b4d7 | 2010-07-02 11:50:28 -0700 | [diff] [blame] | 2635 | done && \ |
Brandon Casey | 49a43f5 | 2010-07-06 14:56:51 -0700 | [diff] [blame] | 2636 | remote_curl_aliases="$(REMOTE_CURL_ALIASES)" && \ |
| 2637 | for p in $$remote_curl_aliases; do \ |
Ilari Liusvaara | 28ca0c9 | 2009-12-09 17:26:34 +0200 | [diff] [blame] | 2638 | $(RM) "$$execdir/$$p" && \ |
Junio C Hamano | 70de5e6 | 2012-05-02 15:12:10 -0700 | [diff] [blame] | 2639 | test -z "$(NO_INSTALL_HARDLINKS)" && \ |
Ilari Liusvaara | 28ca0c9 | 2009-12-09 17:26:34 +0200 | [diff] [blame] | 2640 | ln "$$execdir/git-remote-http$X" "$$execdir/$$p" 2>/dev/null || \ |
| 2641 | ln -s "git-remote-http$X" "$$execdir/$$p" 2>/dev/null || \ |
| 2642 | cp "$$execdir/git-remote-http$X" "$$execdir/$$p" || exit; \ |
Brandon Casey | 49a43f5 | 2010-07-06 14:56:51 -0700 | [diff] [blame] | 2643 | done && \ |
Johannes Sixt | 7b4b59a | 2008-07-21 21:19:58 +0200 | [diff] [blame] | 2644 | ./check_bindir "z$$bindir" "z$$execdir" "$$bindir/git-add$X" |
Petr Baudis | 28818ff | 2005-07-29 17:50:24 +0200 | [diff] [blame] | 2645 | |
SZEDER Gábor | 2530afd | 2018-02-15 03:14:10 +0100 | [diff] [blame] | 2646 | .PHONY: install-gitweb install-doc install-man install-man-perl install-html install-info install-pdf |
Elia Pinto | e6be265 | 2015-12-15 15:21:00 +0000 | [diff] [blame] | 2647 | .PHONY: quick-install-doc quick-install-man quick-install-html |
Jakub Narebski | 152d943 | 2010-05-01 22:36:15 +0200 | [diff] [blame] | 2648 | install-gitweb: |
| 2649 | $(MAKE) -C gitweb install |
| 2650 | |
Ævar Arnfjörð Bjarmason | 20d2a30 | 2017-12-10 21:13:33 +0000 | [diff] [blame] | 2651 | install-doc: install-man-perl |
Petr Baudis | 28818ff | 2005-07-29 17:50:24 +0200 | [diff] [blame] | 2652 | $(MAKE) -C Documentation install |
| 2653 | |
Ævar Arnfjörð Bjarmason | 20d2a30 | 2017-12-10 21:13:33 +0000 | [diff] [blame] | 2654 | install-man: install-man-perl |
Markus Heidelberg | b1a46b7 | 2008-11-02 18:53:03 +0100 | [diff] [blame] | 2655 | $(MAKE) -C Documentation install-man |
| 2656 | |
SZEDER Gábor | 2530afd | 2018-02-15 03:14:10 +0100 | [diff] [blame] | 2657 | install-man-perl: man-perl |
Ævar Arnfjörð Bjarmason | 20d2a30 | 2017-12-10 21:13:33 +0000 | [diff] [blame] | 2658 | $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(mandir_SQ)/man3' |
| 2659 | (cd perl/build/man/man3 && $(TAR) cf - .) | \ |
| 2660 | (cd '$(DESTDIR_SQ)$(mandir_SQ)/man3' && umask 022 && $(TAR) xof -) |
| 2661 | |
Teemu Likonen | ae081f3 | 2008-06-10 11:34:25 +0300 | [diff] [blame] | 2662 | install-html: |
| 2663 | $(MAKE) -C Documentation install-html |
| 2664 | |
David Kastrup | 4739809 | 2007-08-06 12:22:57 +0200 | [diff] [blame] | 2665 | install-info: |
| 2666 | $(MAKE) -C Documentation install-info |
| 2667 | |
Miklos Vajna | a325a1a | 2008-12-10 23:44:50 +0100 | [diff] [blame] | 2668 | install-pdf: |
| 2669 | $(MAKE) -C Documentation install-pdf |
| 2670 | |
Eric Wong | 6538d1e | 2006-12-23 08:26:09 -0800 | [diff] [blame] | 2671 | quick-install-doc: |
| 2672 | $(MAKE) -C Documentation quick-install |
Petr Baudis | 28818ff | 2005-07-29 17:50:24 +0200 | [diff] [blame] | 2673 | |
Markus Heidelberg | b1a46b7 | 2008-11-02 18:53:03 +0100 | [diff] [blame] | 2674 | quick-install-man: |
| 2675 | $(MAKE) -C Documentation quick-install-man |
| 2676 | |
Michael J Gruber | 6fe570d | 2008-09-09 22:44:17 +0200 | [diff] [blame] | 2677 | quick-install-html: |
| 2678 | $(MAKE) -C Documentation quick-install-html |
| 2679 | |
Petr Baudis | 28818ff | 2005-07-29 17:50:24 +0200 | [diff] [blame] | 2680 | |
| 2681 | |
| 2682 | ### Maintainer's dist rules |
| 2683 | |
Stefano Lattarini | dd6fc7c | 2012-12-09 11:36:17 +0100 | [diff] [blame] | 2684 | GIT_TARNAME = git-$(GIT_VERSION) |
Dennis Kaarsemaker | ef642ff | 2016-04-27 19:54:35 +0200 | [diff] [blame] | 2685 | dist: git-archive$(X) configure |
Junio C Hamano | 9ccb64c | 2006-10-05 02:26:12 -0700 | [diff] [blame] | 2686 | ./git-archive --format=tar \ |
| 2687 | --prefix=$(GIT_TARNAME)/ HEAD^{tree} > $(GIT_TARNAME).tar |
Chris Wright | a9db297 | 2005-07-07 13:09:50 -0700 | [diff] [blame] | 2688 | @mkdir -p $(GIT_TARNAME) |
Junio C Hamano | ab21433 | 2016-04-04 23:42:41 -0700 | [diff] [blame] | 2689 | @cp configure $(GIT_TARNAME) |
H. Peter Anvin | 181129d | 2006-01-09 18:07:01 -0800 | [diff] [blame] | 2690 | @echo $(GIT_VERSION) > $(GIT_TARNAME)/version |
Shawn O. Pearce | d647c2e | 2007-02-12 18:20:34 -0500 | [diff] [blame] | 2691 | @$(MAKE) -C git-gui TARDIR=../$(GIT_TARNAME)/git-gui dist-version |
H. Peter Anvin | 181129d | 2006-01-09 18:07:01 -0800 | [diff] [blame] | 2692 | $(TAR) rf $(GIT_TARNAME).tar \ |
Matthias Lederhofer | f58494b | 2007-06-18 23:30:36 +0200 | [diff] [blame] | 2693 | $(GIT_TARNAME)/configure \ |
Shawn O. Pearce | d647c2e | 2007-02-12 18:20:34 -0500 | [diff] [blame] | 2694 | $(GIT_TARNAME)/version \ |
Shawn O. Pearce | 115f0fe | 2007-03-12 13:40:31 -0400 | [diff] [blame] | 2695 | $(GIT_TARNAME)/git-gui/version |
Ævar Arnfjörð Bjarmason | bc2ed31 | 2017-12-08 22:29:58 +0000 | [diff] [blame] | 2696 | ifdef DC_SHA1_SUBMODULE |
| 2697 | @mkdir -p $(GIT_TARNAME)/sha1collisiondetection/lib |
| 2698 | @cp sha1collisiondetection/LICENSE.txt \ |
| 2699 | $(GIT_TARNAME)/sha1collisiondetection/ |
| 2700 | @cp sha1collisiondetection/LICENSE.txt \ |
| 2701 | $(GIT_TARNAME)/sha1collisiondetection/ |
| 2702 | @cp sha1collisiondetection/lib/sha1.[ch] \ |
| 2703 | $(GIT_TARNAME)/sha1collisiondetection/lib/ |
| 2704 | @cp sha1collisiondetection/lib/ubc_check.[ch] \ |
| 2705 | $(GIT_TARNAME)/sha1collisiondetection/lib/ |
| 2706 | $(TAR) rf $(GIT_TARNAME).tar \ |
| 2707 | $(GIT_TARNAME)/sha1collisiondetection/LICENSE.txt \ |
| 2708 | $(GIT_TARNAME)/sha1collisiondetection/lib/sha1.[ch] \ |
| 2709 | $(GIT_TARNAME)/sha1collisiondetection/lib/ubc_check.[ch] |
| 2710 | endif |
Emil Medve | 4cb08df | 2007-07-14 12:51:44 -0500 | [diff] [blame] | 2711 | @$(RM) -r $(GIT_TARNAME) |
Eric W. Biederman | 9dce3c0 | 2005-07-14 19:20:50 -0600 | [diff] [blame] | 2712 | gzip -f -9 $(GIT_TARNAME).tar |
Chris Wright | a9db297 | 2005-07-07 13:09:50 -0700 | [diff] [blame] | 2713 | |
Junio C Hamano | ab21433 | 2016-04-04 23:42:41 -0700 | [diff] [blame] | 2714 | rpm:: |
| 2715 | @echo >&2 "Use distro packaged sources to run rpmbuild" |
| 2716 | @false |
| 2717 | .PHONY: rpm |
Chris Wright | a9db297 | 2005-07-07 13:09:50 -0700 | [diff] [blame] | 2718 | |
Tilman Sauerbeck | 52db049 | 2006-05-18 12:57:04 +0200 | [diff] [blame] | 2719 | htmldocs = git-htmldocs-$(GIT_VERSION) |
| 2720 | manpages = git-manpages-$(GIT_VERSION) |
Elia Pinto | e6be265 | 2015-12-15 15:21:00 +0000 | [diff] [blame] | 2721 | .PHONY: dist-doc distclean |
Tilman Sauerbeck | 52db049 | 2006-05-18 12:57:04 +0200 | [diff] [blame] | 2722 | dist-doc: |
Emil Medve | 4cb08df | 2007-07-14 12:51:44 -0500 | [diff] [blame] | 2723 | $(RM) -r .doc-tmp-dir |
Tilman Sauerbeck | 52db049 | 2006-05-18 12:57:04 +0200 | [diff] [blame] | 2724 | mkdir .doc-tmp-dir |
| 2725 | $(MAKE) -C Documentation WEBDOC_DEST=../.doc-tmp-dir install-webdoc |
| 2726 | cd .doc-tmp-dir && $(TAR) cf ../$(htmldocs).tar . |
| 2727 | gzip -n -9 -f $(htmldocs).tar |
| 2728 | : |
Emil Medve | 4cb08df | 2007-07-14 12:51:44 -0500 | [diff] [blame] | 2729 | $(RM) -r .doc-tmp-dir |
Junio C Hamano | 4392da4 | 2007-04-19 20:47:04 -0700 | [diff] [blame] | 2730 | mkdir -p .doc-tmp-dir/man1 .doc-tmp-dir/man5 .doc-tmp-dir/man7 |
Martin Waitz | c536032 | 2006-05-25 14:37:46 +0200 | [diff] [blame] | 2731 | $(MAKE) -C Documentation DESTDIR=./ \ |
Jakub Narebski | 7b8cf0c | 2006-06-29 23:26:54 +0200 | [diff] [blame] | 2732 | man1dir=../.doc-tmp-dir/man1 \ |
Junio C Hamano | 4392da4 | 2007-04-19 20:47:04 -0700 | [diff] [blame] | 2733 | man5dir=../.doc-tmp-dir/man5 \ |
Jakub Narebski | 7b8cf0c | 2006-06-29 23:26:54 +0200 | [diff] [blame] | 2734 | man7dir=../.doc-tmp-dir/man7 \ |
Tilman Sauerbeck | 52db049 | 2006-05-18 12:57:04 +0200 | [diff] [blame] | 2735 | install |
| 2736 | cd .doc-tmp-dir && $(TAR) cf ../$(manpages).tar . |
| 2737 | gzip -n -9 -f $(manpages).tar |
Emil Medve | 4cb08df | 2007-07-14 12:51:44 -0500 | [diff] [blame] | 2738 | $(RM) -r .doc-tmp-dir |
Tilman Sauerbeck | 52db049 | 2006-05-18 12:57:04 +0200 | [diff] [blame] | 2739 | |
Petr Baudis | 28818ff | 2005-07-29 17:50:24 +0200 | [diff] [blame] | 2740 | ### Cleaning rules |
Eric W. Biederman | 87a81c8 | 2005-07-14 19:21:57 -0600 | [diff] [blame] | 2741 | |
Mathias Megyei | 922aa80 | 2007-10-04 23:49:19 +0200 | [diff] [blame] | 2742 | distclean: clean |
| 2743 | $(RM) configure |
Stefano Lattarini | dc7ace5 | 2012-07-19 09:50:01 +0200 | [diff] [blame] | 2744 | $(RM) config.log config.status config.cache |
| 2745 | $(RM) config.mak.autogen config.mak.append |
| 2746 | $(RM) -r autom4te.cache |
Mathias Megyei | 922aa80 | 2007-10-04 23:49:19 +0200 | [diff] [blame] | 2747 | |
Theodore Ts'o | f2d713f | 2012-02-06 01:00:17 -0500 | [diff] [blame] | 2748 | profile-clean: |
| 2749 | $(RM) $(addsuffix *.gcda,$(addprefix $(PROFILE_DIR)/, $(object_dirs))) |
| 2750 | $(RM) $(addsuffix *.gcno,$(addprefix $(PROFILE_DIR)/, $(object_dirs))) |
| 2751 | |
Thomas Rast | dcbe7f1 | 2013-05-13 23:27:26 +0200 | [diff] [blame] | 2752 | clean: profile-clean coverage-clean |
Junio C Hamano | 7897d84 | 2016-04-15 10:06:52 -0700 | [diff] [blame] | 2753 | $(RM) *.res |
| 2754 | $(RM) $(OBJECTS) |
Vicent Marti | e127310 | 2013-11-14 07:43:51 -0500 | [diff] [blame] | 2755 | $(RM) $(LIB_FILE) $(XDIFF_LIB) $(VCSSVN_LIB) |
Jonathan Nieder | 46bac90 | 2010-01-31 11:46:53 -0800 | [diff] [blame] | 2756 | $(RM) $(ALL_PROGRAMS) $(SCRIPT_LIB) $(BUILT_INS) git$X |
Felipe Contreras | 6c473a5 | 2013-06-07 17:03:06 -0500 | [diff] [blame] | 2757 | $(RM) $(TEST_PROGRAMS) $(NO_INSTALL) |
Matt Kraai | 61564ca | 2013-02-13 07:57:48 -0800 | [diff] [blame] | 2758 | $(RM) -r bin-wrappers $(dep_dirs) |
Ævar Arnfjörð Bjarmason | 5e9637c | 2011-11-18 00:14:42 +0100 | [diff] [blame] | 2759 | $(RM) -r po/build/ |
Todd Zullinger | 4321bdc | 2018-02-16 22:06:24 -0500 | [diff] [blame] | 2760 | $(RM) *.pyc *.pyo */*.pyc */*.pyo common-cmds.h $(ETAGS_TARGET) tags cscope* |
Emil Medve | 4cb08df | 2007-07-14 12:51:44 -0500 | [diff] [blame] | 2761 | $(RM) -r $(GIT_TARNAME) .doc-tmp-dir |
| 2762 | $(RM) $(GIT_TARNAME).tar.gz git-core_$(GIT_VERSION)-*.tar.gz |
| 2763 | $(RM) $(htmldocs).tar.gz $(manpages).tar.gz |
René Scharfe | 63f0a75 | 2016-09-15 20:30:56 +0200 | [diff] [blame] | 2764 | $(RM) contrib/coccinelle/*.cocci.patch* |
Thomas Glanzmann | ca67f00 | 2005-05-22 20:27:28 +0200 | [diff] [blame] | 2765 | $(MAKE) -C Documentation/ clean |
Jeff King | 499c293 | 2009-04-03 15:32:20 -0400 | [diff] [blame] | 2766 | ifndef NO_PERL |
Ramsay Jones | e5bd0a1 | 2010-05-08 18:36:15 +0100 | [diff] [blame] | 2767 | $(MAKE) -C gitweb clean |
Ævar Arnfjörð Bjarmason | 20d2a30 | 2017-12-10 21:13:33 +0000 | [diff] [blame] | 2768 | $(RM) -r perl/build/ |
Jeff King | 499c293 | 2009-04-03 15:32:20 -0400 | [diff] [blame] | 2769 | endif |
Petr Baudis | b1edc53 | 2006-06-24 04:34:29 +0200 | [diff] [blame] | 2770 | $(MAKE) -C templates/ clean |
Junio C Hamano | 4b7581f | 2005-08-02 17:24:11 -0700 | [diff] [blame] | 2771 | $(MAKE) -C t/ clean |
Eygene Ryabinkin | 3cfaf11 | 2007-03-28 04:00:23 -0700 | [diff] [blame] | 2772 | ifndef NO_TCLTK |
Junio C Hamano | 62ba514 | 2007-11-17 10:51:16 -0800 | [diff] [blame] | 2773 | $(MAKE) -C gitk-git clean |
Eygene Ryabinkin | 3cfaf11 | 2007-03-28 04:00:23 -0700 | [diff] [blame] | 2774 | $(MAKE) -C git-gui clean |
| 2775 | endif |
Christian Couder | 8f26aa4 | 2012-12-18 16:26:37 +0100 | [diff] [blame] | 2776 | $(RM) GIT-VERSION-FILE GIT-CFLAGS GIT-LDFLAGS GIT-BUILD-OPTIONS |
Jonathan Nieder | 07981dc | 2013-11-18 14:23:11 -0800 | [diff] [blame] | 2777 | $(RM) GIT-USER-AGENT GIT-PREFIX |
| 2778 | $(RM) GIT-SCRIPT-DEFINES GIT-PERL-DEFINES GIT-PYTHON-VARS |
Junio C Hamano | 9b88fce | 2005-12-27 14:40:17 -0800 | [diff] [blame] | 2779 | |
Theodore Ts'o | f2d713f | 2012-02-06 01:00:17 -0500 | [diff] [blame] | 2780 | .PHONY: all install profile-clean clean strip |
Brandon Casey | 6dc4627 | 2008-08-07 14:06:26 -0500 | [diff] [blame] | 2781 | .PHONY: shell_compatibility_test please_set_SHELL_PATH_to_a_more_modern_shell |
Junio C Hamano | 2f76919 | 2010-09-28 16:08:38 -0500 | [diff] [blame] | 2782 | .PHONY: FORCE cscope |
Junio C Hamano | d89056c | 2005-12-19 17:59:58 -0800 | [diff] [blame] | 2783 | |
Junio C Hamano | 8c989ec | 2006-04-13 00:17:19 -0700 | [diff] [blame] | 2784 | ### Check documentation |
| 2785 | # |
Jeff King | cf6aaff | 2012-08-08 16:56:04 -0400 | [diff] [blame] | 2786 | ALL_COMMANDS = $(ALL_PROGRAMS) $(SCRIPT_LIB) $(BUILT_INS) |
| 2787 | ALL_COMMANDS += git |
| 2788 | ALL_COMMANDS += gitk |
| 2789 | ALL_COMMANDS += gitweb |
Jeff King | eb28501 | 2012-08-08 16:56:42 -0400 | [diff] [blame] | 2790 | ALL_COMMANDS += git-gui git-citool |
Elia Pinto | e6be265 | 2015-12-15 15:21:00 +0000 | [diff] [blame] | 2791 | |
| 2792 | .PHONY: check-docs |
Junio C Hamano | 8c989ec | 2006-04-13 00:17:19 -0700 | [diff] [blame] | 2793 | check-docs:: |
Junio C Hamano | ab81411 | 2016-05-04 14:34:23 -0700 | [diff] [blame] | 2794 | $(MAKE) -C Documentation lint-docs |
Jeff King | cf6aaff | 2012-08-08 16:56:04 -0400 | [diff] [blame] | 2795 | @(for v in $(ALL_COMMANDS); \ |
Junio C Hamano | 8c989ec | 2006-04-13 00:17:19 -0700 | [diff] [blame] | 2796 | do \ |
| 2797 | case "$$v" in \ |
Junio C Hamano | 8c989ec | 2006-04-13 00:17:19 -0700 | [diff] [blame] | 2798 | git-merge-octopus | git-merge-ours | git-merge-recursive | \ |
Miklos Vajna | 51add76 | 2008-07-05 16:43:51 +0200 | [diff] [blame] | 2799 | git-merge-resolve | git-merge-subtree | \ |
Junio C Hamano | 5c66d0d | 2008-01-17 22:52:40 -0800 | [diff] [blame] | 2800 | git-fsck-objects | git-init-db | \ |
Junio C Hamano | c88cd03 | 2010-03-10 15:31:34 -0800 | [diff] [blame] | 2801 | git-remote-* | git-stage | \ |
Junio C Hamano | 5b4617c | 2007-12-14 22:02:57 -0800 | [diff] [blame] | 2802 | git-?*--?* ) continue ;; \ |
Junio C Hamano | 8c989ec | 2006-04-13 00:17:19 -0700 | [diff] [blame] | 2803 | esac ; \ |
| 2804 | test -f "Documentation/$$v.txt" || \ |
| 2805 | echo "no doc: $$v"; \ |
Eric Sunshine | 11c6659 | 2015-05-21 19:39:18 +0200 | [diff] [blame] | 2806 | sed -e '1,/^### command list/d' -e '/^#/d' command-list.txt | \ |
Junio C Hamano | 4b02c52 | 2007-02-13 22:45:22 -0800 | [diff] [blame] | 2807 | grep -q "^$$v[ ]" || \ |
Junio C Hamano | 8c989ec | 2006-04-13 00:17:19 -0700 | [diff] [blame] | 2808 | case "$$v" in \ |
| 2809 | git) ;; \ |
| 2810 | *) echo "no link: $$v";; \ |
| 2811 | esac ; \ |
Junio C Hamano | 3f7ce64 | 2007-11-08 18:38:27 -0800 | [diff] [blame] | 2812 | done; \ |
| 2813 | ( \ |
Eric Sunshine | 11c6659 | 2015-05-21 19:39:18 +0200 | [diff] [blame] | 2814 | sed -e '1,/^### command list/d' \ |
| 2815 | -e '/^#/d' \ |
Junio C Hamano | 3f7ce64 | 2007-11-08 18:38:27 -0800 | [diff] [blame] | 2816 | -e 's/[ ].*//' \ |
Junio C Hamano | 79d3066 | 2007-12-01 23:39:19 -0800 | [diff] [blame] | 2817 | -e 's/^/listed /' command-list.txt; \ |
Jeff King | 5fafce0 | 2012-08-08 16:57:52 -0400 | [diff] [blame] | 2818 | $(MAKE) -C Documentation print-man1 | \ |
| 2819 | grep '\.txt$$' | \ |
Junio C Hamano | 3f7ce64 | 2007-11-08 18:38:27 -0800 | [diff] [blame] | 2820 | sed -e 's|Documentation/|documented |' \ |
| 2821 | -e 's/\.txt//'; \ |
| 2822 | ) | while read how cmd; \ |
| 2823 | do \ |
Jeff King | cf6aaff | 2012-08-08 16:56:04 -0400 | [diff] [blame] | 2824 | case " $(ALL_COMMANDS) " in \ |
Junio C Hamano | 3f7ce64 | 2007-11-08 18:38:27 -0800 | [diff] [blame] | 2825 | *" $$cmd "*) ;; \ |
| 2826 | *) echo "removed but $$how: $$cmd" ;; \ |
| 2827 | esac; \ |
| 2828 | done ) | sort |
Junio C Hamano | c74390e | 2006-11-05 11:26:21 -0800 | [diff] [blame] | 2829 | |
| 2830 | ### Make sure built-ins do not have dups and listed in git.c |
| 2831 | # |
| 2832 | check-builtins:: |
| 2833 | ./check-builtins.sh |
Junio C Hamano | 11c57e6 | 2008-01-14 15:10:38 -0800 | [diff] [blame] | 2834 | |
Thomas Rast | 901c369 | 2009-02-19 12:13:35 +0100 | [diff] [blame] | 2835 | ### Test suite coverage testing |
| 2836 | # |
Thomas Rast | 0c38a95 | 2013-05-13 23:27:25 +0200 | [diff] [blame] | 2837 | .PHONY: coverage coverage-clean coverage-compile coverage-test coverage-report |
Elia Pinto | e6be265 | 2015-12-15 15:21:00 +0000 | [diff] [blame] | 2838 | .PHONY: coverage-untested-functions cover_db cover_db_html |
Thomas Rast | dcbe7f1 | 2013-05-13 23:27:26 +0200 | [diff] [blame] | 2839 | .PHONY: coverage-clean-results |
Thomas Rast | 901c369 | 2009-02-19 12:13:35 +0100 | [diff] [blame] | 2840 | |
| 2841 | coverage: |
Thomas Rast | 0c38a95 | 2013-05-13 23:27:25 +0200 | [diff] [blame] | 2842 | $(MAKE) coverage-test |
Thomas Rast | 5ce4367 | 2013-05-13 23:27:28 +0200 | [diff] [blame] | 2843 | $(MAKE) coverage-untested-functions |
Thomas Rast | 901c369 | 2009-02-19 12:13:35 +0100 | [diff] [blame] | 2844 | |
Ævar Arnfjörð Bjarmason | bc548ef | 2010-07-25 19:52:40 +0000 | [diff] [blame] | 2845 | object_dirs := $(sort $(dir $(OBJECTS))) |
Thomas Rast | dcbe7f1 | 2013-05-13 23:27:26 +0200 | [diff] [blame] | 2846 | coverage-clean-results: |
Ævar Arnfjörð Bjarmason | bc548ef | 2010-07-25 19:52:40 +0000 | [diff] [blame] | 2847 | $(RM) $(addsuffix *.gcov,$(object_dirs)) |
| 2848 | $(RM) $(addsuffix *.gcda,$(object_dirs)) |
Ævar Arnfjörð Bjarmason | bc548ef | 2010-07-25 19:52:40 +0000 | [diff] [blame] | 2849 | $(RM) coverage-untested-functions |
Ævar Arnfjörð Bjarmason | 7432bd5 | 2010-07-25 19:52:42 +0000 | [diff] [blame] | 2850 | $(RM) -r cover_db/ |
Ævar Arnfjörð Bjarmason | df07acf | 2010-07-25 19:52:43 +0000 | [diff] [blame] | 2851 | $(RM) -r cover_db_html/ |
Thomas Rast | 901c369 | 2009-02-19 12:13:35 +0100 | [diff] [blame] | 2852 | |
Thomas Rast | dcbe7f1 | 2013-05-13 23:27:26 +0200 | [diff] [blame] | 2853 | coverage-clean: coverage-clean-results |
| 2854 | $(RM) $(addsuffix *.gcno,$(object_dirs)) |
| 2855 | |
Thomas Rast | 901c369 | 2009-02-19 12:13:35 +0100 | [diff] [blame] | 2856 | COVERAGE_CFLAGS = $(CFLAGS) -O0 -ftest-coverage -fprofile-arcs |
| 2857 | COVERAGE_LDFLAGS = $(CFLAGS) -O0 -lgcov |
Ævar Arnfjörð Bjarmason | bc548ef | 2010-07-25 19:52:40 +0000 | [diff] [blame] | 2858 | GCOVFLAGS = --preserve-paths --branch-probabilities --all-blocks |
Thomas Rast | 901c369 | 2009-02-19 12:13:35 +0100 | [diff] [blame] | 2859 | |
Thomas Rast | 0c38a95 | 2013-05-13 23:27:25 +0200 | [diff] [blame] | 2860 | coverage-compile: |
Thomas Rast | 901c369 | 2009-02-19 12:13:35 +0100 | [diff] [blame] | 2861 | $(MAKE) CFLAGS="$(COVERAGE_CFLAGS)" LDFLAGS="$(COVERAGE_LDFLAGS)" all |
Thomas Rast | 0c38a95 | 2013-05-13 23:27:25 +0200 | [diff] [blame] | 2862 | |
| 2863 | coverage-test: coverage-clean-results coverage-compile |
Thomas Rast | 901c369 | 2009-02-19 12:13:35 +0100 | [diff] [blame] | 2864 | $(MAKE) CFLAGS="$(COVERAGE_CFLAGS)" LDFLAGS="$(COVERAGE_LDFLAGS)" \ |
Thomas Rast | c14cc77 | 2013-05-13 23:27:27 +0200 | [diff] [blame] | 2865 | DEFAULT_TEST_TARGET=test -j1 test |
Thomas Rast | 901c369 | 2009-02-19 12:13:35 +0100 | [diff] [blame] | 2866 | |
| 2867 | coverage-report: |
Ævar Arnfjörð Bjarmason | bc548ef | 2010-07-25 19:52:40 +0000 | [diff] [blame] | 2868 | $(QUIET_GCOV)for dir in $(object_dirs); do \ |
Thomas Rast | e146d17 | 2010-07-26 09:43:41 +0200 | [diff] [blame] | 2869 | $(GCOV) $(GCOVFLAGS) --object-directory=$$dir $$dir*.c || exit; \ |
Ævar Arnfjörð Bjarmason | bc548ef | 2010-07-25 19:52:40 +0000 | [diff] [blame] | 2870 | done |
Ævar Arnfjörð Bjarmason | b5eed98 | 2010-07-25 19:52:41 +0000 | [diff] [blame] | 2871 | |
| 2872 | coverage-untested-functions: coverage-report |
Thomas Rast | 901c369 | 2009-02-19 12:13:35 +0100 | [diff] [blame] | 2873 | grep '^function.*called 0 ' *.c.gcov \ |
| 2874 | | sed -e 's/\([^:]*\)\.gcov: *function \([^ ]*\) called.*/\1: \2/' \ |
Ævar Arnfjörð Bjarmason | bc548ef | 2010-07-25 19:52:40 +0000 | [diff] [blame] | 2875 | > coverage-untested-functions |
Ævar Arnfjörð Bjarmason | 7432bd5 | 2010-07-25 19:52:42 +0000 | [diff] [blame] | 2876 | |
| 2877 | cover_db: coverage-report |
| 2878 | gcov2perl -db cover_db *.gcov |
Ævar Arnfjörð Bjarmason | df07acf | 2010-07-25 19:52:43 +0000 | [diff] [blame] | 2879 | |
| 2880 | cover_db_html: cover_db |
| 2881 | cover -report html -outputdir cover_db_html cover_db |
Andi Kleen | 7ddc271 | 2011-06-18 18:07:05 -0700 | [diff] [blame] | 2882 | |