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 | |
Ævar Arnfjörð Bjarmason | 8df786d | 2022-03-03 17:04:13 +0100 | [diff] [blame] | 4 | # Import tree-wide shared Makefile behavior and libraries |
| 5 | include shared.mak |
| 6 | |
Ævar Arnfjörð Bjarmason | 34b660e | 2022-11-07 22:23:06 +0100 | [diff] [blame] | 7 | # == Makefile defines == |
| 8 | # |
| 9 | # These defines change the behavior of the Makefile itself, but have |
| 10 | # no impact on what it builds: |
| 11 | # |
Shawn O. Pearce | 2314c94 | 2007-03-06 02:09:14 -0500 | [diff] [blame] | 12 | # Define V=1 to have a more verbose compile. |
Shawn O. Pearce | 74f2b2a | 2007-03-06 01:35:01 -0500 | [diff] [blame] | 13 | # |
Ævar Arnfjörð Bjarmason | 34b660e | 2022-11-07 22:23:06 +0100 | [diff] [blame] | 14 | # == Portability and optional library defines == |
| 15 | # |
| 16 | # These defines indicate what Git can expect from the OS, what |
| 17 | # libraries are available etc. Much of this is auto-detected in |
| 18 | # config.mak.uname, or in configure.ac when using the optional "make |
| 19 | # configure && ./configure" (see INSTALL). |
| 20 | # |
Junio C Hamano | 0e0aea5 | 2009-06-05 18:36:15 -0500 | [diff] [blame] | 21 | # Define SHELL_PATH to a POSIX shell if your /bin/sh is broken. |
| 22 | # |
| 23 | # Define SANE_TOOL_PATH to a colon-separated list of paths to prepend |
| 24 | # to PATH if your tools in /usr/bin are broken. |
| 25 | # |
Gary V. Vaughan | e88a135 | 2010-05-14 09:31:42 +0000 | [diff] [blame] | 26 | # Define SOCKLEN_T to a suitable type (such as 'size_t') if your |
| 27 | # system headers do not define a socklen_t type. |
| 28 | # |
Gary V. Vaughan | f9f33cd | 2010-05-14 09:31:43 +0000 | [diff] [blame] | 29 | # Define INLINE to a suitable substitute (such as '__inline' or '') if git |
| 30 | # fails to compile with errors about undefined inline functions or similar. |
| 31 | # |
Ian Liu Rodrigues | 3b2c541 | 2014-09-13 11:20:22 -0300 | [diff] [blame] | 32 | # Define SNPRINTF_RETURNS_BOGUS if you are on a system which snprintf() |
Michal Rokos | c4582f9 | 2008-03-05 16:46:13 +0100 | [diff] [blame] | 33 | # or vsnprintf() return -1 instead of number of characters which would |
| 34 | # have been written to the final string if enough space had been available. |
| 35 | # |
Ian Liu Rodrigues | 3b2c541 | 2014-09-13 11:20:22 -0300 | [diff] [blame] | 36 | # Define FREAD_READS_DIRECTORIES if you are on a system which succeeds |
Jeff King | 3adf9fd | 2017-06-14 01:30:18 -0400 | [diff] [blame] | 37 | # when attempting to read from an fopen'ed directory (or even to fopen |
| 38 | # it at all). |
Brandon Casey | cba2252 | 2008-02-08 20:32:47 -0600 | [diff] [blame] | 39 | # |
Jeff King | 2b08101 | 2021-02-26 01:14:35 -0500 | [diff] [blame] | 40 | # Define OPEN_RETURNS_EINTR if your open() system call may return EINTR |
| 41 | # when a signal is received (as opposed to restarting). |
| 42 | # |
Linus Torvalds | 765ac8e | 2006-02-28 15:07:20 -0800 | [diff] [blame] | 43 | # Define NO_OPENSSL environment variable if you do not have OpenSSL. |
Petr Baudis | 5bdac8b | 2005-07-29 17:48:26 +0200 | [diff] [blame] | 44 | # |
Kirill Smelkov | 61f76a3 | 2014-03-27 18:22:50 +0400 | [diff] [blame] | 45 | # Define HAVE_ALLOCA_H if you have working alloca(3) defined in that header. |
| 46 | # |
Chris Webb | cb6a22c | 2010-04-13 10:07:13 +0100 | [diff] [blame] | 47 | # Define HAVE_PATHS_H if you have paths.h and want to use the default PATH |
| 48 | # it specifies. |
| 49 | # |
Junio C Hamano | 63be37b | 2006-01-19 17:13:57 -0800 | [diff] [blame] | 50 | # 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] | 51 | # 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] | 52 | # |
David Michael | b3e103d | 2012-12-14 14:57:01 -0500 | [diff] [blame] | 53 | # Define HAVE_STRINGS_H if you have strings.h and need it for strcasecmp. |
| 54 | # |
Linus Torvalds | ef34af2 | 2005-09-18 18:30:50 -0700 | [diff] [blame] | 55 | # Define NO_STRCASESTR if you don't have strcasestr. |
| 56 | # |
René Scharfe | b21b9f1 | 2007-09-07 00:32:54 +0200 | [diff] [blame] | 57 | # Define NO_MEMMEM if you don't have memmem. |
| 58 | # |
Matt Kraai | 40036be | 2012-12-18 14:03:55 -0800 | [diff] [blame] | 59 | # Define NO_GETPAGESIZE if you don't have getpagesize. |
| 60 | # |
Peter Eriksen | 817151e | 2006-06-24 16:01:25 +0200 | [diff] [blame] | 61 | # Define NO_STRLCPY if you don't have strlcpy. |
| 62 | # |
Nick Alcock | e3eed7f | 2011-11-02 15:46:22 +0000 | [diff] [blame] | 63 | # Define NO_STRTOUMAX if you don't have both strtoimax and strtoumax in the |
| 64 | # 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] | 65 | # strtoull, define NO_STRTOULL. |
| 66 | # |
Jason Riedy | e40b61f | 2005-12-02 15:08:28 -0800 | [diff] [blame] | 67 | # Define NO_SETENV if you don't have setenv in the C library. |
| 68 | # |
Jakub Narebski | bfa8fcc | 2008-01-18 02:03:51 +0100 | [diff] [blame] | 69 | # Define NO_UNSETENV if you don't have unsetenv in the C library. |
| 70 | # |
Shawn O. Pearce | ca5bb5d | 2007-10-20 16:03:49 -0400 | [diff] [blame] | 71 | # Define NO_MKDTEMP if you don't have mkdtemp in the C library. |
| 72 | # |
Joachim Schmitz | dc9f462 | 2012-09-08 19:01:31 +0200 | [diff] [blame] | 73 | # Define MKDIR_WO_TRAILING_SLASH if your mkdir() can't deal with trailing slash. |
| 74 | # |
Rafael Gieschke | 590e081 | 2011-05-19 13:37:55 +0200 | [diff] [blame] | 75 | # Define NO_GECOS_IN_PWENT if you don't have pw_gecos in struct passwd |
| 76 | # in the C library. |
| 77 | # |
David Aguilar | e1c0688 | 2009-05-31 01:35:51 -0700 | [diff] [blame] | 78 | # Define NO_LIBGEN_H if you don't have libgen.h. |
| 79 | # |
Brandon Casey | ecc395c | 2009-07-10 12:10:45 -0500 | [diff] [blame] | 80 | # Define NEEDS_LIBGEN if your libgen needs -lgen when linking |
| 81 | # |
Robert Schiele | 2600973 | 2008-01-24 19:34:46 +0100 | [diff] [blame] | 82 | # Define NO_SYS_SELECT_H if you don't have sys/select.h. |
| 83 | # |
Junio C Hamano | 9f0bb90 | 2006-05-02 00:40:24 -0700 | [diff] [blame] | 84 | # Define NO_SYMLINK_HEAD if you never want .git/HEAD to be a symbolic link. |
| 85 | # Enable it on Windows. By default, symrefs are still used. |
Pavel Roskin | 2fabd21 | 2005-11-15 00:59:50 -0500 | [diff] [blame] | 86 | # |
Pavel Roskin | 0285358 | 2006-07-09 02:44:58 -0700 | [diff] [blame] | 87 | # 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] | 88 | # tests. These tests take up a significant amount of the total test time |
| 89 | # but are not needed unless you plan to talk to SVN repos. |
| 90 | # |
Shawn Pearce | 8eb38ca | 2006-07-24 00:28:28 -0400 | [diff] [blame] | 91 | # Define NO_FINK if you are building on Darwin/Mac OS X, have Fink |
| 92 | # installed in /sw, but don't want GIT to link against any libraries |
| 93 | # installed there. If defined you may specify your own (or Fink's) |
| 94 | # include directories and library directories by defining CFLAGS |
| 95 | # and LDFLAGS appropriately. |
| 96 | # |
| 97 | # Define NO_DARWIN_PORTS if you are building on Darwin/Mac OS X, |
| 98 | # have DarwinPorts installed in /opt/local, but don't want GIT to |
| 99 | # link against any libraries installed there. If defined you may |
| 100 | # specify your own (or DarwinPort's) include directories and |
| 101 | # library directories by defining CFLAGS and LDFLAGS appropriately. |
| 102 | # |
David Aguilar | 4dcd773 | 2013-05-19 06:23:34 -0400 | [diff] [blame] | 103 | # Define NO_APPLE_COMMON_CRYPTO if you are building on Darwin/Mac OS X |
| 104 | # and do not want to use Apple's CommonCrypto library. This allows you |
| 105 | # to provide your own OpenSSL library, for example from MacPorts. |
| 106 | # |
Brian Gernhardt | 0460dba | 2009-09-08 09:54:38 -0400 | [diff] [blame] | 107 | # Define NEEDS_CRYPTO_WITH_SSL if you need -lcrypto when using -lssl (Darwin). |
| 108 | # |
| 109 | # 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] | 110 | # |
Junio C Hamano | 597c9cc | 2005-09-07 12:22:56 -0700 | [diff] [blame] | 111 | # Define NEEDS_LIBICONV if linking with libc is not enough (Darwin). |
Patrick Mauritz | f0ebff0 | 2005-09-06 01:24:03 +0200 | [diff] [blame] | 112 | # |
Joachim Schmitz | 6c10990 | 2012-09-19 12:03:30 +0200 | [diff] [blame] | 113 | # Define NEEDS_LIBINTL_BEFORE_LIBICONV if you need libintl before libiconv. |
| 114 | # |
Justin Lebar | 0168990 | 2014-03-31 15:11:46 -0700 | [diff] [blame] | 115 | # 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] | 116 | # |
| 117 | # Define NO_UINTMAX_T if you don't have uintmax_t. |
| 118 | # |
Patrick Mauritz | f0ebff0 | 2005-09-06 01:24:03 +0200 | [diff] [blame] | 119 | # Define NEEDS_SOCKET if linking with libc is not enough (SunOS, |
| 120 | # Patrick Mauritz). |
| 121 | # |
Brandon Casey | 70cf991 | 2009-06-05 18:36:10 -0500 | [diff] [blame] | 122 | # Define NEEDS_RESOLV if linking with -lnsl and/or -lsocket is not enough. |
| 123 | # Notably on Solaris hstrerror resides in libresolv and on Solaris 7 |
| 124 | # inet_ntop and inet_pton additionally reside there. |
| 125 | # |
Johannes Schindelin | 730d48a | 2005-10-08 15:54:36 -0700 | [diff] [blame] | 126 | # Define NO_MMAP if you want to avoid mmap. |
| 127 | # |
Michael Haggerty | 5b63361 | 2017-09-25 10:00:10 +0200 | [diff] [blame] | 128 | # Define MMAP_PREVENTS_DELETE if a file that is currently mmapped cannot be |
| 129 | # deleted or cannot be replaced using rename(). |
| 130 | # |
Đoàn Trần Công Danh | 2648ccc | 2018-11-14 08:10:43 +0700 | [diff] [blame] | 131 | # Define NO_POLL_H if you don't have poll.h. |
| 132 | # |
Joachim Schmitz | 6d45eb1 | 2012-09-17 23:16:39 +0200 | [diff] [blame] | 133 | # Define NO_SYS_POLL_H if you don't have sys/poll.h. |
| 134 | # |
| 135 | # Define NO_POLL if you do not have or don't want to use poll(). |
Đoàn Trần Công Danh | 2648ccc | 2018-11-14 08:10:43 +0700 | [diff] [blame] | 136 | # This also implies NO_POLL_H and NO_SYS_POLL_H. |
Joachim Schmitz | 6d45eb1 | 2012-09-17 23:16:39 +0200 | [diff] [blame] | 137 | # |
Junio C Hamano | b2d05e0 | 2012-12-18 09:35:33 -0800 | [diff] [blame] | 138 | # Define NEEDS_SYS_PARAM_H if you need to include sys/param.h to compile, |
| 139 | # *PLEASE* REPORT to git@vger.kernel.org if your platform needs this; |
| 140 | # we want to know more about the issue. |
David Michael | 6ede720 | 2012-12-14 14:56:58 -0500 | [diff] [blame] | 141 | # |
Junio C Hamano | 46059cc | 2008-11-15 04:08:14 -0800 | [diff] [blame] | 142 | # Define NO_PTHREADS if you do not have or do not want to use Pthreads. |
| 143 | # |
Stefan-W. Hahn | 6900679 | 2007-01-09 22:04:12 +0100 | [diff] [blame] | 144 | # 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] | 145 | # cygwin1.dll before v1.5.22). |
Stefan-W. Hahn | 6900679 | 2007-01-09 22:04:12 +0100 | [diff] [blame] | 146 | # |
Joachim Schmitz | 7f9e848 | 2012-09-08 18:54:34 +0200 | [diff] [blame] | 147 | # Define NO_SETITIMER if you don't have setitimer() |
| 148 | # |
| 149 | # Define NO_STRUCT_ITIMERVAL if you don't have struct itimerval |
| 150 | # This also implies NO_SETITIMER |
| 151 | # |
Shawn O. Pearce | 1510fea | 2006-12-14 06:15:57 -0500 | [diff] [blame] | 152 | # Define NO_FAST_WORKING_DIRECTORY if accessing objects in pack files is |
| 153 | # generally faster on your platform than accessing the working directory. |
| 154 | # |
Shawn O. Pearce | c869753 | 2006-12-30 23:53:55 -0500 | [diff] [blame] | 155 | # Define NO_TRUSTABLE_FILEMODE if your filesystem may claim to support |
| 156 | # the executable mode bit, but doesn't really do so. |
| 157 | # |
brian m. carlson | 05cd988 | 2022-01-17 21:56:16 +0000 | [diff] [blame] | 158 | # Define CSPRNG_METHOD to "arc4random" if your system has arc4random and |
| 159 | # arc4random_buf, "libbsd" if your system has those functions from libbsd, |
| 160 | # "getrandom" if your system has getrandom, "getentropy" if your system has |
| 161 | # getentropy, "rtlgenrandom" for RtlGenRandom (Windows only), or "openssl" if |
| 162 | # you'd want to use the OpenSSL CSPRNG. You may set multiple options with |
| 163 | # spaces, in which case a suitable option will be chosen. If unset or set to |
| 164 | # anything else, defaults to using "/dev/urandom". |
| 165 | # |
David Michael | d543d9c | 2014-12-03 21:24:17 -0500 | [diff] [blame] | 166 | # Define NEEDS_MODE_TRANSLATION if your OS strays from the typical file type |
| 167 | # bits in mode values (e.g. z/OS defines I_SFMT to 0xFF000000 as opposed to the |
| 168 | # usual 0xF000). |
| 169 | # |
hpa | 49744d6 | 2005-09-28 16:52:21 -0700 | [diff] [blame] | 170 | # Define NO_IPV6 if you lack IPv6 support and getaddrinfo(). |
| 171 | # |
Johannes Sixt | 6320358 | 2011-12-12 22:12:56 +0100 | [diff] [blame] | 172 | # Define NO_UNIX_SOCKETS if your system does not offer unix sockets. |
| 173 | # |
Junio C Hamano | bdc37f5 | 2006-01-19 17:13:32 -0800 | [diff] [blame] | 174 | # Define NO_SOCKADDR_STORAGE if your platform does not have struct |
| 175 | # sockaddr_storage. |
| 176 | # |
Fernando J. Pereda | b6e56ec | 2006-02-16 09:38:01 +0100 | [diff] [blame] | 177 | # Define NO_ICONV if your libc does not properly support iconv. |
| 178 | # |
Ramsay Jones | fd547a9 | 2007-03-03 18:29:03 +0000 | [diff] [blame] | 179 | # Define OLD_ICONV if your library has an old iconv(), where the second |
| 180 | # (input buffer pointer) parameter is declared with type (const char **). |
| 181 | # |
brian m. carlson | 79444c9 | 2019-02-12 00:52:06 +0000 | [diff] [blame] | 182 | # Define ICONV_OMITS_BOM if your iconv implementation does not write a |
| 183 | # byte-order mark (BOM) when writing UTF-16 or UTF-32 and always writes in |
| 184 | # big-endian format. |
| 185 | # |
David Symonds | 609a228 | 2007-11-07 14:24:28 +1100 | [diff] [blame] | 186 | # Define NO_DEFLATE_BOUND if your zlib does not have deflateBound. |
| 187 | # |
Junio C Hamano | 6520c84 | 2011-06-18 18:07:03 -0700 | [diff] [blame] | 188 | # Define NO_NORETURN if using buggy versions of gcc 4.6+ and profile feedback, |
Josh Soref | d05b08c | 2023-11-24 03:35:13 +0000 | [diff] [blame] | 189 | # as the compiler can crash (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=49299) |
Junio C Hamano | 6520c84 | 2011-06-18 18:07:03 -0700 | [diff] [blame] | 190 | # |
Petr Baudis | 5bdac8b | 2005-07-29 17:48:26 +0200 | [diff] [blame] | 191 | # 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] | 192 | # and ctimes. Note that you need recent glibc (at least 2.2.4) for this. On |
| 193 | # Linux, kernel 2.6.11 or newer is required for reliable sub-second file times |
| 194 | # on file systems with exactly 1 ns or 1 s resolution. If you intend to use Git |
| 195 | # on other file systems (e.g. CEPH, CIFS, NTFS, UDF), don't enable USE_NSEC. See |
| 196 | # Documentation/technical/racy-git.txt for details. |
Junio C Hamano | f6af75d | 2006-06-23 17:57:48 -0700 | [diff] [blame] | 197 | # |
Brian Gernhardt | c567383 | 2009-03-08 16:04:28 -0400 | [diff] [blame] | 198 | # Define USE_ST_TIMESPEC if your "struct stat" uses "st_ctimespec" instead of |
| 199 | # "st_ctim" |
| 200 | # |
Kjetil Barvik | c06ff49 | 2009-03-04 18:47:40 +0100 | [diff] [blame] | 201 | # Define NO_NSEC if your "struct stat" does not have "st_ctim.tv_nsec" |
| 202 | # available. This automatically turns USE_NSEC off. |
| 203 | # |
Petr Baudis | 5bdac8b | 2005-07-29 17:48:26 +0200 | [diff] [blame] | 204 | # 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] | 205 | # change being considered an inode change from the update-index perspective. |
Alex Riesen | f848718 | 2006-12-04 10:50:04 +0100 | [diff] [blame] | 206 | # |
Junio C Hamano | fdb2a2a | 2008-08-18 21:57:16 +0200 | [diff] [blame] | 207 | # Define NO_ST_BLOCKS_IN_STRUCT_STAT if your platform does not have st_blocks |
| 208 | # field that counts the on-disk footprint in 512-byte blocks. |
| 209 | # |
brian m. carlson | ec3366e | 2017-01-22 02:41:56 +0000 | [diff] [blame] | 210 | # Define USE_ASCIIDOCTOR to use Asciidoctor instead of AsciiDoc to build the |
| 211 | # documentation. |
| 212 | # |
| 213 | # Define ASCIIDOCTOR_EXTENSIONS_LAB to point to the location of the Asciidoctor |
| 214 | # Extensions Lab if you have it available. |
| 215 | # |
Junio C Hamano | cdbada7 | 2013-01-13 22:48:07 -0800 | [diff] [blame] | 216 | # Define PERL_PATH to the path of your Perl binary (usually /usr/bin/perl). |
| 217 | # |
Jeff King | 499c293 | 2009-04-03 15:32:20 -0400 | [diff] [blame] | 218 | # Define NO_PERL if you do not want Perl scripts or libraries at all. |
| 219 | # |
Todd Zullinger | 075321c | 2018-03-03 15:38:16 +0000 | [diff] [blame] | 220 | # Define NO_PERL_CPAN_FALLBACKS if you do not want to install bundled |
| 221 | # copies of CPAN modules that serve as a fallback in case the modules |
| 222 | # are not available on the system. This option is intended for |
| 223 | # distributions that want to use their packaged versions of Perl |
| 224 | # modules, instead of the fallbacks shipped with Git. |
| 225 | # |
Ævar Arnfjörð Bjarmason | a35258c | 2022-06-28 12:16:02 +0200 | [diff] [blame] | 226 | # Define NO_GITWEB if you do not want to build or install |
| 227 | # 'gitweb'. Note that defining NO_PERL currently has the same effect |
| 228 | # on not installing gitweb, but not on whether it's built in the |
| 229 | # gitweb/ directory. |
| 230 | # |
Junio C Hamano | cdbada7 | 2013-01-13 22:48:07 -0800 | [diff] [blame] | 231 | # Define PYTHON_PATH to the path of your Python binary (often /usr/bin/python |
Đoàn Trần Công Danh | fcedbc1 | 2020-12-10 21:30:17 +0700 | [diff] [blame] | 232 | # but /usr/bin/python2.7 or /usr/bin/python3 on some platforms). |
Junio C Hamano | cdbada7 | 2013-01-13 22:48:07 -0800 | [diff] [blame] | 233 | # |
Johan Herland | d4e1b47 | 2009-11-18 02:42:31 +0100 | [diff] [blame] | 234 | # Define NO_PYTHON if you do not want Python scripts or libraries at all. |
| 235 | # |
Eygene Ryabinkin | 3cfaf11 | 2007-03-28 04:00:23 -0700 | [diff] [blame] | 236 | # Define NO_TCLTK if you do not want Tcl/Tk GUI. |
| 237 | # |
Shawn O. Pearce | 5f5dbd7 | 2007-05-07 23:36:31 -0400 | [diff] [blame] | 238 | # The TCL_PATH variable governs the location of the Tcl interpreter |
| 239 | # used to optimize git-gui for your system. Only used if NO_TCLTK |
| 240 | # is not set. Defaults to the bare 'tclsh'. |
| 241 | # |
| 242 | # The TCLTK_PATH variable governs the location of the Tcl/Tk interpreter. |
Eygene Ryabinkin | 81b63c7 | 2007-03-28 04:12:07 -0700 | [diff] [blame] | 243 | # If not set it defaults to the bare 'wish'. If it is set to the empty |
| 244 | # string then NO_TCLTK will be forced (this is used by configure script). |
| 245 | # |
Brian Downing | 43fe901 | 2008-02-05 15:10:44 -0600 | [diff] [blame] | 246 | # Define INTERNAL_QSORT to use Git's implementation of qsort(), which |
| 247 | # is a simplified version of the merge sort used in glibc. This is |
| 248 | # recommended if Git triggers O(n^2) behavior in your platform's qsort(). |
| 249 | # |
René Scharfe | 04ee8b8 | 2017-01-22 18:51:11 +0100 | [diff] [blame] | 250 | # Define HAVE_ISO_QSORT_S if your platform provides a qsort_s() that's |
| 251 | # compatible with the one described in C11 Annex K. |
| 252 | # |
Johannes Sixt | 34779c5 | 2009-04-20 10:17:00 +0200 | [diff] [blame] | 253 | # Define UNRELIABLE_FSTAT if your system's fstat does not return the same |
| 254 | # information on a not yet closed file that lstat would return for the same |
| 255 | # file after it was closed. |
Johannes Schindelin | be66a6c | 2009-04-25 11:57:14 +0200 | [diff] [blame] | 256 | # |
Johannes Schindelin | 348df16 | 2009-04-28 00:32:25 +0200 | [diff] [blame] | 257 | # Define OBJECT_CREATION_USES_RENAMES if your operating systems has problems |
| 258 | # 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] | 259 | # 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] | 260 | # |
Ævar Arnfjörð Bjarmason | ad87460 | 2018-03-13 20:39:35 +0000 | [diff] [blame] | 261 | # Define INSTALL_SYMLINKS if you prefer to have everything that can be |
| 262 | # symlinked between bin/ and libexec/ to use relative symlinks between |
| 263 | # the two. This option overrides NO_CROSS_DIRECTORY_HARDLINKS and |
| 264 | # NO_INSTALL_HARDLINKS which will also use symlinking by indirection |
| 265 | # within the same directory in some cases, INSTALL_SYMLINKS will |
| 266 | # always symlink to the final target directly. |
| 267 | # |
Johannes Schindelin | 3426e34 | 2009-05-11 13:02:18 +0200 | [diff] [blame] | 268 | # Define NO_CROSS_DIRECTORY_HARDLINKS if you plan to distribute the installed |
| 269 | # 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] | 270 | # |
Junio C Hamano | 70de5e6 | 2012-05-02 15:12:10 -0700 | [diff] [blame] | 271 | # Define NO_INSTALL_HARDLINKS if you prefer to use either symbolic links or |
| 272 | # copies to install built-in git commands e.g. git-cat-file. |
| 273 | # |
Johannes Schindelin | 179227d | 2020-09-21 22:28:16 +0000 | [diff] [blame] | 274 | # Define SKIP_DASHED_BUILT_INS if you do not need the dashed versions of the |
| 275 | # built-ins to be linked/copied at all. |
| 276 | # |
Marius Storm-Olsen | f0ed822 | 2009-05-31 18:15:23 +0200 | [diff] [blame] | 277 | # Define USE_NED_ALLOCATOR if you want to replace the platforms default |
| 278 | # memory allocators with the nedmalloc allocator written by Niall Douglas. |
Jeff King | 02232ad | 2009-06-16 15:07:40 -0400 | [diff] [blame] | 279 | # |
René Scharfe | ca2baa3 | 2016-09-03 17:59:15 +0200 | [diff] [blame] | 280 | # Define OVERRIDE_STRDUP to override the libc version of strdup(3). |
| 281 | # This is necessary when using a custom allocator in order to avoid |
| 282 | # crashes due to allocation and free working on different 'heaps'. |
| 283 | # It's defined automatically if USE_NED_ALLOCATOR is set. |
| 284 | # |
Johannes Schindelin | 2f89522 | 2016-09-21 20:24:04 +0200 | [diff] [blame] | 285 | # Define NO_REGEX if your C library lacks regex support with REG_STARTEND |
| 286 | # feature. |
Jonathan Nieder | 8f4b576 | 2009-10-30 20:44:41 -0500 | [diff] [blame] | 287 | # |
René Scharfe | 54463d3 | 2023-01-08 01:42:04 +0100 | [diff] [blame] | 288 | # Define USE_ENHANCED_BASIC_REGULAR_EXPRESSIONS if your C library provides |
| 289 | # the flag REG_ENHANCED and you'd like to use it to enable enhanced basic |
| 290 | # regular expressions. |
| 291 | # |
Jeff King | 21aeafc | 2011-12-10 05:41:01 -0500 | [diff] [blame] | 292 | # Define HAVE_DEV_TTY if your system can open /dev/tty to interact with the |
| 293 | # user. |
| 294 | # |
Jakub Narebski | 63267de | 2009-09-01 13:39:20 +0200 | [diff] [blame] | 295 | # Define JSMIN to point to JavaScript minifier that functions as |
| 296 | # a filter to have gitweb.js minified. |
Junio C Hamano | 8678bc0 | 2009-12-01 11:28:15 -0800 | [diff] [blame] | 297 | # |
Mark Rada | 0e6ce21 | 2010-04-02 20:35:05 -0400 | [diff] [blame] | 298 | # Define CSSMIN to point to a CSS minifier in order to generate a minified |
| 299 | # version of gitweb.css |
| 300 | # |
Junio C Hamano | a3d023d | 2009-10-30 20:45:34 -0500 | [diff] [blame] | 301 | # Define DEFAULT_PAGER to a sensible pager command (defaults to "less") if |
| 302 | # you want to use something different. The value will be interpreted by the |
| 303 | # shell at runtime when it is used. |
| 304 | # |
Jonathan Nieder | 8f4b576 | 2009-10-30 20:44:41 -0500 | [diff] [blame] | 305 | # Define DEFAULT_EDITOR to a sensible editor command (defaults to "vi") if you |
| 306 | # want to use something different. The value will be interpreted by the shell |
| 307 | # if necessary when it is used. Examples: |
| 308 | # |
| 309 | # DEFAULT_EDITOR='~/bin/vi', |
| 310 | # DEFAULT_EDITOR='$GIT_FALLBACK_EDITOR', |
| 311 | # DEFAULT_EDITOR='"C:\Program Files\Vim\gvim.exe" --nofork' |
Jonathan Nieder | dfea575 | 2010-01-26 09:52:49 -0600 | [diff] [blame] | 312 | # |
Jonathan Nieder | 024c843 | 2011-11-18 03:58:21 -0600 | [diff] [blame] | 313 | # Define COMPUTE_HEADER_DEPENDENCIES to "yes" if you want dependencies on |
| 314 | # header files to be automatically computed, to avoid rebuilding objects when |
| 315 | # an unrelated header file changes. Define it to "no" to use the hard-coded |
| 316 | # dependency rules. The default is "auto", which means to use computed header |
| 317 | # dependencies if your compiler is detected to support it. |
| 318 | # |
Eyvind Bernhardsen | 942e774 | 2010-06-04 21:29:08 +0200 | [diff] [blame] | 319 | # Define NATIVE_CRLF if your platform uses CRLF for line endings. |
Thomas Rast | 6942efc | 2012-04-06 23:01:23 +0200 | [diff] [blame] | 320 | # |
Jeff King | 42dcbb7 | 2012-06-02 15:01:12 -0400 | [diff] [blame] | 321 | # Define GIT_USER_AGENT if you want to change how git identifies itself during |
| 322 | # network interactions. The default is "git/$(GIT_VERSION)". |
Junio C Hamano | a88d7aa | 2012-06-21 14:42:38 -0700 | [diff] [blame] | 323 | # |
Vincent van Ravesteijn | 1cc8af0 | 2012-06-06 20:28:16 +0000 | [diff] [blame] | 324 | # Define DEFAULT_HELP_FORMAT to "man", "info" or "html" |
| 325 | # (defaults to "man") if you want to have a different default when |
| 326 | # "git help" is called without a parameter specifying the format. |
Thomas Gummerer | 5d9fc88 | 2014-02-23 21:49:58 +0100 | [diff] [blame] | 327 | # |
Ben Peart | 1f357b0 | 2018-09-18 23:29:36 +0000 | [diff] [blame] | 328 | # Define GIT_TEST_INDEX_VERSION to 2, 3 or 4 to run the test suite |
Thomas Gummerer | 5d9fc88 | 2014-02-23 21:49:58 +0100 | [diff] [blame] | 329 | # with a different indexfile format version. If it isn't set the index |
| 330 | # file format used is index-v[23]. |
Junio C Hamano | bdb830c | 2014-04-08 11:59:05 -0700 | [diff] [blame] | 331 | # |
Đoàn Trần Công Danh | 482c962 | 2021-06-08 13:56:28 +0700 | [diff] [blame] | 332 | # Define GIT_TEST_UTF8_LOCALE to preferred utf-8 locale for testing. |
| 333 | # If it isn't set, fallback to $LC_ALL, $LANG or use the first utf-8 |
| 334 | # locale returned by "locale -a". |
| 335 | # |
Ronald Wampler | d19e3a5 | 2016-07-07 16:45:54 -0400 | [diff] [blame] | 336 | # Define HAVE_CLOCK_GETTIME if your platform has clock_gettime. |
Reuben Hawkins | a6c3c63 | 2015-01-08 12:00:56 -0800 | [diff] [blame] | 337 | # |
Ronald Wampler | d19e3a5 | 2016-07-07 16:45:54 -0400 | [diff] [blame] | 338 | # Define HAVE_CLOCK_MONOTONIC if your platform has CLOCK_MONOTONIC. |
| 339 | # |
Neeraj Singh | abf38ab | 2022-03-10 22:43:20 +0000 | [diff] [blame] | 340 | # Define HAVE_SYNC_FILE_RANGE if your platform has sync_file_range. |
| 341 | # |
Ronald Wampler | d19e3a5 | 2016-07-07 16:45:54 -0400 | [diff] [blame] | 342 | # Define NEEDS_LIBRT if your platform requires linking with librt (glibc version |
| 343 | # before 2.17) for clock_gettime and CLOCK_MONOTONIC. |
Reuben Hawkins | 88e0118 | 2015-01-08 12:00:57 -0800 | [diff] [blame] | 344 | # |
Kyle J. McKay | 9529080 | 2015-03-07 23:14:36 -0800 | [diff] [blame] | 345 | # 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] | 346 | # |
| 347 | # Define HAVE_GETDELIM if your system has the getdelim() function. |
Eric Wong | 995bc22 | 2016-08-04 11:40:25 +0000 | [diff] [blame] | 348 | # |
Duy Nguyen | 18a4f6b | 2019-02-12 21:14:41 +0700 | [diff] [blame] | 349 | # Define FILENO_IS_A_MACRO if fileno() is a macro, not a real function. |
| 350 | # |
Clément Chigot | 400caaf | 2019-04-25 07:01:56 +0000 | [diff] [blame] | 351 | # Define NEED_ACCESS_ROOT_HANDLER if access() under root may success for X_OK |
| 352 | # even if execution permission isn't granted for any user. |
| 353 | # |
Eric Wong | 995bc22 | 2016-08-04 11:40:25 +0000 | [diff] [blame] | 354 | # Define PAGER_ENV to a SP separated VAR=VAL pairs to define |
| 355 | # default environment variables to be passed when a pager is spawned, e.g. |
| 356 | # |
| 357 | # PAGER_ENV = LESS=FRX LV=-c |
| 358 | # |
| 359 | # to say "export LESS=FRX (and LV=-c) if the environment variable |
| 360 | # LESS (and LV) is not set, respectively". |
Eric Sunshine | b228940 | 2017-12-15 00:34:34 +0100 | [diff] [blame] | 361 | # |
Jeff King | 3f824e9 | 2017-12-08 05:47:22 -0500 | [diff] [blame] | 362 | # Define TEST_SHELL_PATH if you want to use a shell besides SHELL_PATH for |
| 363 | # running the test scripts (e.g., bash has better support for "set -x" |
| 364 | # tracing). |
Junio C Hamano | 07b747d | 2018-01-05 13:28:09 -0800 | [diff] [blame] | 365 | # |
Eric Sunshine | b228940 | 2017-12-15 00:34:34 +0100 | [diff] [blame] | 366 | # When cross-compiling, define HOST_CPU as the canonical name of the CPU on |
| 367 | # which the built Git will run (for instance "x86_64"). |
Dan Jacques | 07d90ea | 2018-04-10 11:05:43 -0400 | [diff] [blame] | 368 | # |
| 369 | # Define RUNTIME_PREFIX to configure Git to resolve its ancillary tooling and |
| 370 | # support files relative to the location of the runtime binary, rather than |
| 371 | # hard-coding them into the binary. Git installations built with RUNTIME_PREFIX |
| 372 | # can be moved to arbitrary filesystem locations. RUNTIME_PREFIX also causes |
| 373 | # Perl scripts to use a modified entry point header allowing them to resolve |
| 374 | # support files at runtime. |
Dan Jacques | 226c0dd | 2018-04-10 11:05:44 -0400 | [diff] [blame] | 375 | # |
| 376 | # When using RUNTIME_PREFIX, define HAVE_BSD_KERN_PROC_SYSCTL if your platform |
| 377 | # supports the KERN_PROC BSD sysctl function. |
| 378 | # |
| 379 | # When using RUNTIME_PREFIX, define PROCFS_EXECUTABLE_PATH if your platform |
| 380 | # mounts a "procfs" filesystem capable of resolving the path of the current |
| 381 | # executable. If defined, this must be the canonical path for the "procfs" |
| 382 | # current executable path. |
| 383 | # |
| 384 | # When using RUNTIME_PREFIX, define HAVE_NS_GET_EXECUTABLE_PATH if your platform |
| 385 | # supports calling _NSGetExecutablePath to retrieve the path of the running |
| 386 | # executable. |
Johannes Schindelin | c1be1cb | 2018-04-10 11:05:45 -0400 | [diff] [blame] | 387 | # |
| 388 | # When using RUNTIME_PREFIX, define HAVE_WPGMPTR if your platform offers |
| 389 | # the global variable _wpgmptr containing the absolute path of the current |
| 390 | # executable (this is the case on Windows). |
Junio C Hamano | e998e7a | 2018-05-08 15:59:21 +0900 | [diff] [blame] | 391 | # |
Bagas Sanjaya | 3231f41 | 2021-09-05 12:17:56 -0700 | [diff] [blame] | 392 | # INSTALL_STRIP can be set to "-s" to strip binaries during installation, |
| 393 | # if your $(INSTALL) command supports the option. |
| 394 | # |
Philippe Blain | 3821c38 | 2020-09-03 22:13:38 +0000 | [diff] [blame] | 395 | # Define GENERATE_COMPILATION_DATABASE to "yes" to generate JSON compilation |
| 396 | # database entries during compilation if your compiler supports it, using the |
| 397 | # `-MJ` flag. The JSON entries will be placed in the `compile_commands/` |
| 398 | # directory, and the JSON compilation database 'compile_commands.json' will be |
| 399 | # created at the root of the repository. |
| 400 | # |
Jeff Hostetler | 62c7367 | 2022-03-25 18:02:51 +0000 | [diff] [blame] | 401 | # If your platform supports a built-in fsmonitor backend, set |
| 402 | # FSMONITOR_DAEMON_BACKEND to the "<name>" of the corresponding |
Jeff Hostetler | d060555 | 2022-05-26 21:47:10 +0000 | [diff] [blame] | 403 | # `compat/fsmonitor/fsm-listen-<name>.c` and |
| 404 | # `compat/fsmonitor/fsm-health-<name>.c` files |
| 405 | # that implement the `fsm_listen__*()` and `fsm_health__*()` routines. |
Jeff Hostetler | 62c7367 | 2022-03-25 18:02:51 +0000 | [diff] [blame] | 406 | # |
Jeff Hostetler | d33c804 | 2022-05-26 21:46:59 +0000 | [diff] [blame] | 407 | # If your platform has OS-specific ways to tell if a repo is incompatible with |
| 408 | # fsmonitor (whether the hook or IPC daemon version), set FSMONITOR_OS_SETTINGS |
| 409 | # to the "<name>" of the corresponding `compat/fsmonitor/fsm-settings-<name>.c` |
| 410 | # that implements the `fsm_os_settings__*()` routines. |
Nguyễn Thái Ngọc Duy | 1da1580 | 2018-04-14 19:19:44 +0000 | [diff] [blame] | 411 | # |
Josh Steadmon | 8427b7e | 2024-04-24 11:14:42 -0700 | [diff] [blame] | 412 | # Define LINK_FUZZ_PROGRAMS if you want `make all` to also build the fuzz test |
| 413 | # programs in oss-fuzz/. |
| 414 | # |
Ævar Arnfjörð Bjarmason | 34b660e | 2022-11-07 22:23:06 +0100 | [diff] [blame] | 415 | # === Optional library: libintl === |
| 416 | # |
| 417 | # Define NO_GETTEXT if you don't want Git output to be translated. |
| 418 | # A translated Git requires GNU libintl or another gettext implementation, |
| 419 | # plus libintl-perl at runtime. |
| 420 | # |
| 421 | # Define USE_GETTEXT_SCHEME and set it to 'fallthrough', if you don't trust |
| 422 | # the installed gettext translation of the shell scripts output. |
| 423 | # |
| 424 | # Define HAVE_LIBCHARSET_H if you haven't set NO_GETTEXT and you can't |
| 425 | # trust the langinfo.h's nl_langinfo(CODESET) function to return the |
| 426 | # current character set. GNU and Solaris have a nl_langinfo(CODESET), |
| 427 | # FreeBSD can use either, but MinGW and some others need to use |
| 428 | # libcharset.h's locale_charset() instead. |
| 429 | # |
| 430 | # Define CHARSET_LIB to the library you need to link with in order to |
| 431 | # use locale_charset() function. On some platforms this needs to set to |
| 432 | # -lcharset, on others to -liconv . |
| 433 | # |
| 434 | # Define LIBC_CONTAINS_LIBINTL if your gettext implementation doesn't |
| 435 | # need -lintl when linking. |
| 436 | # |
| 437 | # Define NO_MSGFMT_EXTENDED_OPTIONS if your implementation of msgfmt |
| 438 | # doesn't support GNU extensions like --check and --statistics |
| 439 | # |
| 440 | # === Optional library: libexpat === |
| 441 | # |
| 442 | # Define NO_EXPAT if you do not have expat installed. git-http-push is |
| 443 | # not built, and you cannot push using http:// and https:// transports (dumb). |
| 444 | # |
| 445 | # Define EXPATDIR=/foo/bar if your expat header and library files are in |
| 446 | # /foo/bar/include and /foo/bar/lib directories. |
| 447 | # |
| 448 | # Define EXPAT_NEEDS_XMLPARSE_H if you have an old version of expat (e.g., |
| 449 | # 1.1 or 1.2) that provides xmlparse.h instead of expat.h. |
| 450 | |
| 451 | # === Optional library: libcurl === |
| 452 | # |
| 453 | # Define NO_CURL if you do not have libcurl installed. git-http-fetch and |
| 454 | # git-http-push are not built, and you cannot use http:// and https:// |
| 455 | # transports (neither smart nor dumb). |
| 456 | # |
| 457 | # Define CURLDIR=/foo/bar if your curl header and library files are in |
| 458 | # /foo/bar/include and /foo/bar/lib directories. |
| 459 | # |
| 460 | # Define CURL_CONFIG to curl's configuration program that prints information |
| 461 | # about the library (e.g., its version number). The default is 'curl-config'. |
| 462 | # |
| 463 | # Define CURL_LDFLAGS to specify flags that you need to link when using libcurl, |
| 464 | # if you do not want to rely on the libraries provided by CURL_CONFIG. The |
| 465 | # default value is a result of `curl-config --libs`. An example value for |
| 466 | # CURL_LDFLAGS is as follows: |
| 467 | # |
| 468 | # CURL_LDFLAGS=-lcurl |
| 469 | # |
| 470 | # === Optional library: libpcre2 === |
| 471 | # |
| 472 | # Define USE_LIBPCRE if you have and want to use libpcre. Various |
| 473 | # commands such as log and grep offer runtime options to use |
| 474 | # Perl-compatible regular expressions instead of standard or extended |
| 475 | # POSIX regular expressions. |
| 476 | # |
| 477 | # Only libpcre version 2 is supported. USE_LIBPCRE2 is a synonym for |
| 478 | # USE_LIBPCRE, support for the old USE_LIBPCRE1 has been removed. |
| 479 | # |
| 480 | # Define LIBPCREDIR=/foo/bar if your PCRE header and library files are |
| 481 | # in /foo/bar/include and /foo/bar/lib directories. |
| 482 | # |
| 483 | # == SHA-1 and SHA-256 defines == |
| 484 | # |
| 485 | # === SHA-1 backend === |
| 486 | # |
Ævar Arnfjörð Bjarmason | d00fa55 | 2022-11-07 22:23:12 +0100 | [diff] [blame] | 487 | # ==== Security ==== |
| 488 | # |
| 489 | # Due to the SHAttered (https://shattered.io) attack vector on SHA-1 |
| 490 | # it's strongly recommended to use the sha1collisiondetection |
| 491 | # counter-cryptanalysis library for SHA-1 hashing. |
| 492 | # |
| 493 | # If you know that you can trust the repository contents, or where |
| 494 | # potential SHA-1 attacks are otherwise mitigated the other backends |
| 495 | # listed in "SHA-1 implementations" are faster than |
| 496 | # sha1collisiondetection. |
| 497 | # |
Ævar Arnfjörð Bjarmason | ed605fa | 2022-11-07 22:23:09 +0100 | [diff] [blame] | 498 | # ==== Default SHA-1 backend ==== |
| 499 | # |
| 500 | # If no *_SHA1 backend is picked, the first supported one listed in |
| 501 | # "SHA-1 implementations" will be picked. |
| 502 | # |
Ævar Arnfjörð Bjarmason | 34b660e | 2022-11-07 22:23:06 +0100 | [diff] [blame] | 503 | # ==== Options common to all SHA-1 implementations ==== |
| 504 | # |
| 505 | # Define SHA1_MAX_BLOCK_SIZE to limit the amount of data that will be hashed |
| 506 | # in one call to the platform's SHA1_Update(). e.g. APPLE_COMMON_CRYPTO |
| 507 | # wants 'SHA1_MAX_BLOCK_SIZE=1024L*1024L*1024L' defined. |
| 508 | # |
| 509 | # ==== SHA-1 implementations ==== |
| 510 | # |
Ævar Arnfjörð Bjarmason | ed605fa | 2022-11-07 22:23:09 +0100 | [diff] [blame] | 511 | # Define OPENSSL_SHA1 to link to the SHA-1 routines from the OpenSSL |
| 512 | # library. |
Ævar Arnfjörð Bjarmason | 34b660e | 2022-11-07 22:23:06 +0100 | [diff] [blame] | 513 | # |
Ævar Arnfjörð Bjarmason | f569897 | 2022-11-07 22:23:07 +0100 | [diff] [blame] | 514 | # Define BLK_SHA1 to make use of optimized C SHA-1 routines bundled |
| 515 | # with git (in the block-sha1/ directory). |
Ævar Arnfjörð Bjarmason | 34b660e | 2022-11-07 22:23:06 +0100 | [diff] [blame] | 516 | # |
Ævar Arnfjörð Bjarmason | 35898ad | 2022-12-15 09:43:05 +0100 | [diff] [blame] | 517 | # Define APPLE_COMMON_CRYPTO_SHA1 to use Apple's CommonCrypto for |
| 518 | # SHA-1. |
Ævar Arnfjörð Bjarmason | fb8d7ad | 2022-11-07 22:23:11 +0100 | [diff] [blame] | 519 | # |
Ævar Arnfjörð Bjarmason | dc1cf35 | 2022-11-07 22:23:10 +0100 | [diff] [blame] | 520 | # If don't enable any of the *_SHA1 settings in this section, Git will |
| 521 | # default to its built-in sha1collisiondetection library, which is a |
| 522 | # collision-detecting sha1 This is slower, but may detect attempted |
| 523 | # collision attacks. |
Ævar Arnfjörð Bjarmason | 34b660e | 2022-11-07 22:23:06 +0100 | [diff] [blame] | 524 | # |
| 525 | # ==== Options for the sha1collisiondetection library ==== |
| 526 | # |
Ævar Arnfjörð Bjarmason | f569897 | 2022-11-07 22:23:07 +0100 | [diff] [blame] | 527 | # Define DC_SHA1_EXTERNAL if you want to build / link |
Ævar Arnfjörð Bjarmason | 34b660e | 2022-11-07 22:23:06 +0100 | [diff] [blame] | 528 | # git with the external SHA1 collision-detect library. |
| 529 | # Without this option, i.e. the default behavior is to build git with its |
| 530 | # own built-in code (or submodule). |
| 531 | # |
Ævar Arnfjörð Bjarmason | f569897 | 2022-11-07 22:23:07 +0100 | [diff] [blame] | 532 | # Define DC_SHA1_SUBMODULE to use the |
Ævar Arnfjörð Bjarmason | 34b660e | 2022-11-07 22:23:06 +0100 | [diff] [blame] | 533 | # sha1collisiondetection shipped as a submodule instead of the |
| 534 | # non-submodule copy in sha1dc/. This is an experimental option used |
| 535 | # by the git project to migrate to using sha1collisiondetection as a |
| 536 | # submodule. |
| 537 | # |
| 538 | # === SHA-256 backend === |
| 539 | # |
Ævar Arnfjörð Bjarmason | d00fa55 | 2022-11-07 22:23:12 +0100 | [diff] [blame] | 540 | # ==== Security ==== |
| 541 | # |
| 542 | # Unlike SHA-1 the SHA-256 algorithm does not suffer from any known |
| 543 | # vulnerabilities, so any implementation will do. |
| 544 | # |
Ævar Arnfjörð Bjarmason | 34b660e | 2022-11-07 22:23:06 +0100 | [diff] [blame] | 545 | # ==== SHA-256 implementations ==== |
| 546 | # |
Ævar Arnfjörð Bjarmason | ed605fa | 2022-11-07 22:23:09 +0100 | [diff] [blame] | 547 | # Define OPENSSL_SHA256 to use the SHA-256 routines in OpenSSL. |
| 548 | # |
Ævar Arnfjörð Bjarmason | 34b660e | 2022-11-07 22:23:06 +0100 | [diff] [blame] | 549 | # Define NETTLE_SHA256 to use the SHA-256 routines in libnettle. |
| 550 | # |
| 551 | # Define GCRYPT_SHA256 to use the SHA-256 routines in libgcrypt. |
| 552 | # |
Ævar Arnfjörð Bjarmason | 84d71c2 | 2022-11-07 22:23:08 +0100 | [diff] [blame] | 553 | # If don't enable any of the *_SHA256 settings in this section, Git |
| 554 | # will default to its built-in sha256 implementation. |
| 555 | # |
Ævar Arnfjörð Bjarmason | 34b660e | 2022-11-07 22:23:06 +0100 | [diff] [blame] | 556 | # == DEVELOPER defines == |
| 557 | # |
Nguyễn Thái Ngọc Duy | 1da1580 | 2018-04-14 19:19:44 +0000 | [diff] [blame] | 558 | # Define DEVELOPER to enable more compiler warnings. Compiler version |
| 559 | # and family are auto detected, but could be overridden by defining |
Ævar Arnfjörð Bjarmason | 6d5d4b4 | 2019-02-22 15:41:27 +0100 | [diff] [blame] | 560 | # COMPILER_FEATURES (see config.mak.dev). You can still set |
| 561 | # CFLAGS="..." in combination with DEVELOPER enables, whether that's |
| 562 | # for tweaking something unrelated (e.g. optimization level), or for |
| 563 | # selectively overriding something DEVELOPER or one of the DEVOPTS |
| 564 | # (see just below) brings in. |
Ævar Arnfjörð Bjarmason | 99f763b | 2018-04-14 19:19:45 +0000 | [diff] [blame] | 565 | # |
| 566 | # When DEVELOPER is set, DEVOPTS can be used to control compiler |
| 567 | # options. This variable contains keywords separated by |
ryenus | 571fb96 | 2019-12-15 15:12:24 +0000 | [diff] [blame] | 568 | # whitespace. The following keywords are recognized: |
Ævar Arnfjörð Bjarmason | 99f763b | 2018-04-14 19:19:45 +0000 | [diff] [blame] | 569 | # |
| 570 | # no-error: |
| 571 | # |
| 572 | # suppresses the -Werror that implicitly comes with |
| 573 | # DEVELOPER=1. Useful for getting the full set of errors |
| 574 | # without immediately dying, or for logging them. |
Ævar Arnfjörð Bjarmason | 26d2e4f | 2018-04-14 19:19:46 +0000 | [diff] [blame] | 575 | # |
| 576 | # extra-all: |
| 577 | # |
| 578 | # The DEVELOPER mode enables -Wextra with a few exceptions. By |
| 579 | # setting this flag the exceptions are removed, and all of |
| 580 | # -Wextra is used. |
Beat Bolli | 729b392 | 2018-07-24 21:26:43 +0200 | [diff] [blame] | 581 | # |
Carlo Marcelo Arenas Belón | 6a8cbc4 | 2021-09-03 10:02:32 -0700 | [diff] [blame] | 582 | # no-pedantic: |
Beat Bolli | 729b392 | 2018-07-24 21:26:43 +0200 | [diff] [blame] | 583 | # |
Carlo Marcelo Arenas Belón | 6a8cbc4 | 2021-09-03 10:02:32 -0700 | [diff] [blame] | 584 | # Disable -pedantic compilation. |
Petr Baudis | 5bdac8b | 2005-07-29 17:48:26 +0200 | [diff] [blame] | 585 | |
Jonathan Nieder | 13fca9f | 2010-01-06 02:06:58 -0600 | [diff] [blame] | 586 | GIT-VERSION-FILE: FORCE |
Fredrik Kuivinen | 3654638 | 2006-02-14 00:15:14 +0100 | [diff] [blame] | 587 | @$(SHELL_PATH) ./GIT-VERSION-GEN |
Junio C Hamano | 9b88fce | 2005-12-27 14:40:17 -0800 | [diff] [blame] | 588 | -include GIT-VERSION-FILE |
Petr Baudis | 5bdac8b | 2005-07-29 17:48:26 +0200 | [diff] [blame] | 589 | |
Ævar Arnfjörð Bjarmason | 65260a4 | 2019-02-22 15:41:24 +0100 | [diff] [blame] | 590 | # Set our default configuration. |
| 591 | # |
Johannes Sixt | 49fa65a | 2008-07-23 21:12:18 +0200 | [diff] [blame] | 592 | # Among the variables below, these: |
| 593 | # gitexecdir |
| 594 | # template_dir |
Johannes Sixt | 9fb1e69 | 2011-05-09 10:24:55 +0200 | [diff] [blame] | 595 | # sysconfdir |
Steffen Prohaska | 026fa0d | 2009-01-18 13:00:09 +0100 | [diff] [blame] | 596 | # can be specified as a relative path some/where/else; |
Đoàn Trần Công Danh | ebb6c16 | 2022-10-06 08:32:05 +0700 | [diff] [blame] | 597 | # this is interpreted as relative to $(prefix) and "git" built with |
| 598 | # RUNTIME_PREFIX flag will figure out (at runtime) where they are |
| 599 | # based on the path to the executable. |
John Keeping | 971f853 | 2013-02-24 19:55:01 +0000 | [diff] [blame] | 600 | # Additionally, the following will be treated as relative by "git" if they |
| 601 | # begin with "$(prefix)/": |
| 602 | # mandir |
| 603 | # infodir |
| 604 | # htmldir |
Dan Jacques | 07d90ea | 2018-04-10 11:05:43 -0400 | [diff] [blame] | 605 | # localedir |
| 606 | # perllibdir |
Johannes Sixt | 49fa65a | 2008-07-23 21:12:18 +0200 | [diff] [blame] | 607 | # This can help installing the suite in a relocatable way. |
| 608 | |
Pavel Roskin | b05701c | 2005-08-06 01:36:15 -0400 | [diff] [blame] | 609 | prefix = $(HOME) |
Ævar Arnfjörð Bjarmason | 7bc506d | 2018-03-13 20:39:33 +0000 | [diff] [blame] | 610 | bindir = $(prefix)/bin |
John Keeping | 971f853 | 2013-02-24 19:55:01 +0000 | [diff] [blame] | 611 | mandir = $(prefix)/share/man |
| 612 | infodir = $(prefix)/share/info |
Steffen Prohaska | 026fa0d | 2009-01-18 13:00:09 +0100 | [diff] [blame] | 613 | gitexecdir = libexec/git-core |
David Aguilar | bc7a96a | 2011-08-18 00:23:46 -0700 | [diff] [blame] | 614 | mergetoolsdir = $(gitexecdir)/mergetools |
Johannes Sixt | 9354768 | 2007-06-11 10:02:17 +0200 | [diff] [blame] | 615 | sharedir = $(prefix)/share |
Pavan Kumar Sunkara | bc95196 | 2010-05-28 11:55:50 +0530 | [diff] [blame] | 616 | gitwebdir = $(sharedir)/gitweb |
Ævar Arnfjörð Bjarmason | affc3b7 | 2022-06-28 12:16:00 +0200 | [diff] [blame] | 617 | gitwebstaticdir = $(gitwebdir)/static |
Ævar Arnfjörð Bjarmason | 20d2a30 | 2017-12-10 21:13:33 +0000 | [diff] [blame] | 618 | perllibdir = $(sharedir)/perl5 |
Ævar Arnfjörð Bjarmason | 5e9637c | 2011-11-18 00:14:42 +0100 | [diff] [blame] | 619 | localedir = $(sharedir)/locale |
Steffen Prohaska | 026fa0d | 2009-01-18 13:00:09 +0100 | [diff] [blame] | 620 | template_dir = share/git-core/templates |
John Keeping | 971f853 | 2013-02-24 19:55:01 +0000 | [diff] [blame] | 621 | htmldir = $(prefix)/share/doc/git-doc |
Steffen Prohaska | 026fa0d | 2009-01-18 13:00:09 +0100 | [diff] [blame] | 622 | ETC_GITCONFIG = $(sysconfdir)/gitconfig |
Petr Onderka | 6df42ab | 2010-09-01 00:42:43 +0200 | [diff] [blame] | 623 | ETC_GITATTRIBUTES = $(sysconfdir)/gitattributes |
Robert Schiele | 10861be | 2007-08-01 06:30:35 +0200 | [diff] [blame] | 624 | lib = lib |
Stefano Lattarini | dd6fc7c | 2012-12-09 11:36:17 +0100 | [diff] [blame] | 625 | # DESTDIR = |
Johannes Schindelin | 352c811 | 2009-05-23 10:04:48 +0200 | [diff] [blame] | 626 | pathsep = : |
Petr Baudis | 5c2a7fb | 2005-04-13 02:14:06 -0700 | [diff] [blame] | 627 | |
Ævar Arnfjörð Bjarmason | 7bc506d | 2018-03-13 20:39:33 +0000 | [diff] [blame] | 628 | bindir_relative = $(patsubst $(prefix)/%,%,$(bindir)) |
John Keeping | 971f853 | 2013-02-24 19:55:01 +0000 | [diff] [blame] | 629 | mandir_relative = $(patsubst $(prefix)/%,%,$(mandir)) |
| 630 | infodir_relative = $(patsubst $(prefix)/%,%,$(infodir)) |
Ævar Arnfjörð Bjarmason | a4d79b9 | 2018-03-13 20:39:34 +0000 | [diff] [blame] | 631 | gitexecdir_relative = $(patsubst $(prefix)/%,%,$(gitexecdir)) |
Dan Jacques | 07d90ea | 2018-04-10 11:05:43 -0400 | [diff] [blame] | 632 | localedir_relative = $(patsubst $(prefix)/%,%,$(localedir)) |
John Keeping | 971f853 | 2013-02-24 19:55:01 +0000 | [diff] [blame] | 633 | htmldir_relative = $(patsubst $(prefix)/%,%,$(htmldir)) |
Dan Jacques | 07d90ea | 2018-04-10 11:05:43 -0400 | [diff] [blame] | 634 | perllibdir_relative = $(patsubst $(prefix)/%,%,$(perllibdir)) |
John Keeping | 971f853 | 2013-02-24 19:55:01 +0000 | [diff] [blame] | 635 | |
Ævar Arnfjörð Bjarmason | affc3b7 | 2022-06-28 12:16:00 +0200 | [diff] [blame] | 636 | export prefix bindir sharedir sysconfdir perllibdir localedir |
Jakub Narebski | e14421b | 2006-06-29 22:11:25 +0200 | [diff] [blame] | 637 | |
Ævar Arnfjörð Bjarmason | 65260a4 | 2019-02-22 15:41:24 +0100 | [diff] [blame] | 638 | # Set our default programs |
Ævar Arnfjörð Bjarmason | 6d62c98 | 2011-12-20 23:40:47 +0000 | [diff] [blame] | 639 | CC = cc |
Pavel Roskin | b05701c | 2005-08-06 01:36:15 -0400 | [diff] [blame] | 640 | AR = ar |
Emil Medve | 4cb08df | 2007-07-14 12:51:44 -0500 | [diff] [blame] | 641 | RM = rm -f |
Gary V. Vaughan | d1b1a91 | 2010-05-14 09:31:36 +0000 | [diff] [blame] | 642 | DIFF = diff |
Junio C Hamano | 229a7ed | 2005-09-23 10:41:40 -0700 | [diff] [blame] | 643 | TAR = tar |
David Kastrup | 89b2f19 | 2007-07-29 15:23:28 -0700 | [diff] [blame] | 644 | FIND = find |
Pavel Roskin | b05701c | 2005-08-06 01:36:15 -0400 | [diff] [blame] | 645 | INSTALL = install |
Shawn O. Pearce | 5f5dbd7 | 2007-05-07 23:36:31 -0400 | [diff] [blame] | 646 | TCL_PATH = tclsh |
Eygene Ryabinkin | 81b63c7 | 2007-03-28 04:12:07 -0700 | [diff] [blame] | 647 | TCLTK_PATH = wish |
Ævar Arnfjörð Bjarmason | cd5513a | 2011-02-22 23:41:23 +0000 | [diff] [blame] | 648 | XGETTEXT = xgettext |
Ævar Arnfjörð Bjarmason | 1cc0425 | 2022-05-26 22:50:28 +0800 | [diff] [blame] | 649 | MSGCAT = msgcat |
Ævar Arnfjörð Bjarmason | 5e9637c | 2011-11-18 00:14:42 +0100 | [diff] [blame] | 650 | MSGFMT = msgfmt |
Jiang Xin | fbb3d32 | 2022-05-26 22:50:33 +0800 | [diff] [blame] | 651 | MSGMERGE = msgmerge |
Remi Pommarel | f891587 | 2015-10-21 19:10:46 +0200 | [diff] [blame] | 652 | CURL_CONFIG = curl-config |
Thomas Rast | e146d17 | 2010-07-26 09:43:41 +0200 | [diff] [blame] | 653 | GCOV = gcov |
Ævar Arnfjörð Bjarmason | 9559f8f | 2019-02-22 15:41:23 +0100 | [diff] [blame] | 654 | STRIP = strip |
René Scharfe | 63f0a75 | 2016-09-15 20:30:56 +0200 | [diff] [blame] | 655 | SPATCH = spatch |
Linus Torvalds | e83c516 | 2005-04-07 15:13:13 -0700 | [diff] [blame] | 656 | |
Shawn O. Pearce | 5f5dbd7 | 2007-05-07 23:36:31 -0400 | [diff] [blame] | 657 | export TCL_PATH TCLTK_PATH |
| 658 | |
Ævar Arnfjörð Bjarmason | 8fb2a23 | 2019-02-22 15:41:25 +0100 | [diff] [blame] | 659 | # Set our default LIBS variables |
| 660 | PTHREAD_LIBS = -lpthread |
Petr Baudis | 8d7f586 | 2006-06-25 03:47:03 +0200 | [diff] [blame] | 661 | |
Johannes Schindelin | 5c928c0 | 2009-03-25 17:27:28 +0100 | [diff] [blame] | 662 | # Guard against environment variables |
| 663 | BUILTIN_OBJS = |
| 664 | BUILT_INS = |
| 665 | COMPAT_CFLAGS = |
| 666 | COMPAT_OBJS = |
Jonathan Nieder | 3371f9b | 2011-03-27 13:13:22 -0500 | [diff] [blame] | 667 | XDIFF_OBJS = |
Jeff King | b8ba629 | 2012-06-20 14:30:56 -0400 | [diff] [blame] | 668 | GENERATED_H = |
Jonathan Nieder | a673cfe | 2010-03-19 22:20:12 -0500 | [diff] [blame] | 669 | EXTRA_CPPFLAGS = |
Josh Steadmon | 5e47215 | 2018-10-12 17:58:40 -0700 | [diff] [blame] | 670 | FUZZ_OBJS = |
| 671 | FUZZ_PROGRAMS = |
Ævar Arnfjörð Bjarmason | abc3c87 | 2021-02-23 12:41:30 +0100 | [diff] [blame] | 672 | GIT_OBJS = |
Johannes Schindelin | 5c928c0 | 2009-03-25 17:27:28 +0100 | [diff] [blame] | 673 | LIB_OBJS = |
Victoria Dye | 7b5c93c | 2022-09-02 15:56:43 +0000 | [diff] [blame] | 674 | SCALAR_OBJS = |
Ævar Arnfjörð Bjarmason | 752b3ef | 2021-02-23 12:41:28 +0100 | [diff] [blame] | 675 | OBJECTS = |
Victoria Dye | 7b5c93c | 2022-09-02 15:56:43 +0000 | [diff] [blame] | 676 | OTHER_PROGRAMS = |
Jonathan Nieder | 1b22c99 | 2010-01-26 09:54:23 -0600 | [diff] [blame] | 677 | PROGRAM_OBJS = |
Johannes Schindelin | 5c928c0 | 2009-03-25 17:27:28 +0100 | [diff] [blame] | 678 | PROGRAMS = |
Johannes Schindelin | 724d635 | 2019-04-18 06:16:40 -0700 | [diff] [blame] | 679 | EXCLUDED_PROGRAMS = |
Johannes Schindelin | 5c928c0 | 2009-03-25 17:27:28 +0100 | [diff] [blame] | 680 | SCRIPT_PERL = |
Johan Herland | d4e1b47 | 2009-11-18 02:42:31 +0100 | [diff] [blame] | 681 | SCRIPT_PYTHON = |
Johannes Schindelin | 5c928c0 | 2009-03-25 17:27:28 +0100 | [diff] [blame] | 682 | SCRIPT_SH = |
Jonathan Nieder | 46bac90 | 2010-01-31 11:46:53 -0800 | [diff] [blame] | 683 | SCRIPT_LIB = |
Nguyễn Thái Ngọc Duy | efd71f8 | 2018-03-24 08:44:30 +0100 | [diff] [blame] | 684 | TEST_BUILTINS_OBJS = |
Ævar Arnfjörð Bjarmason | bed3419 | 2021-02-23 12:41:27 +0100 | [diff] [blame] | 685 | TEST_OBJS = |
Jonathan Nieder | 225f78c | 2010-01-26 10:08:44 -0600 | [diff] [blame] | 686 | TEST_PROGRAMS_NEED_X = |
Denton Liu | 5dedf7d | 2019-09-16 12:23:11 -0700 | [diff] [blame] | 687 | THIRD_PARTY_SOURCES = |
Phillip Wood | e137fe3 | 2023-11-09 10:50:43 -0800 | [diff] [blame] | 688 | UNIT_TEST_PROGRAMS = |
| 689 | UNIT_TEST_DIR = t/unit-tests |
| 690 | UNIT_TEST_BIN = $(UNIT_TEST_DIR)/bin |
Johannes Schindelin | 5c928c0 | 2009-03-25 17:27:28 +0100 | [diff] [blame] | 691 | |
Jonathan Nieder | c40d92e | 2010-03-19 19:06:15 -0500 | [diff] [blame] | 692 | # Having this variable in your environment would break pipelines because |
| 693 | # you cause "cd" to echo its destination to stdout. It can also take |
| 694 | # scripts to unexpected places. If you like CDPATH, define it for your |
| 695 | # interactive shell sessions without exporting it. |
| 696 | unexport CDPATH |
| 697 | |
David Aguilar | afcbc8e | 2009-04-07 01:21:20 -0700 | [diff] [blame] | 698 | SCRIPT_SH += git-difftool--helper.sh |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 699 | SCRIPT_SH += git-filter-branch.sh |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 700 | SCRIPT_SH += git-merge-octopus.sh |
| 701 | SCRIPT_SH += git-merge-one-file.sh |
| 702 | SCRIPT_SH += git-merge-resolve.sh |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 703 | SCRIPT_SH += git-mergetool.sh |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 704 | SCRIPT_SH += git-quiltimport.sh |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 705 | SCRIPT_SH += git-request-pull.sh |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 706 | SCRIPT_SH += git-submodule.sh |
| 707 | SCRIPT_SH += git-web--browse.sh |
Petr Baudis | 28818ff | 2005-07-29 17:50:24 +0200 | [diff] [blame] | 708 | |
Jonathan Nieder | 46bac90 | 2010-01-31 11:46:53 -0800 | [diff] [blame] | 709 | SCRIPT_LIB += git-mergetool--lib |
Ævar Arnfjörð Bjarmason | e00cf07 | 2011-05-14 13:47:43 +0000 | [diff] [blame] | 710 | SCRIPT_LIB += git-sh-i18n |
Denton Liu | 805d9ea | 2020-03-21 05:21:20 -0400 | [diff] [blame] | 711 | SCRIPT_LIB += git-sh-setup |
Jonathan Nieder | 46bac90 | 2010-01-31 11:46:53 -0800 | [diff] [blame] | 712 | |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 713 | SCRIPT_PERL += git-archimport.perl |
| 714 | SCRIPT_PERL += git-cvsexportcommit.perl |
| 715 | SCRIPT_PERL += git-cvsimport.perl |
| 716 | SCRIPT_PERL += git-cvsserver.perl |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 717 | SCRIPT_PERL += git-send-email.perl |
| 718 | SCRIPT_PERL += git-svn.perl |
Junio C Hamano | 60036a4 | 2005-07-30 17:31:47 -0700 | [diff] [blame] | 719 | |
Pete Wyckoff | b6f9305 | 2012-04-08 20:18:00 -0400 | [diff] [blame] | 720 | SCRIPT_PYTHON += git-p4.py |
Sverre Rabbelier | 7aeaa2f | 2010-03-29 11:48:28 -0500 | [diff] [blame] | 721 | |
Matthieu Moy | 4c06b41 | 2013-02-08 18:31:16 +0100 | [diff] [blame] | 722 | # Generated files for scripts |
| 723 | SCRIPT_SH_GEN = $(patsubst %.sh,%,$(SCRIPT_SH)) |
| 724 | SCRIPT_PERL_GEN = $(patsubst %.perl,%,$(SCRIPT_PERL)) |
| 725 | SCRIPT_PYTHON_GEN = $(patsubst %.py,%,$(SCRIPT_PYTHON)) |
| 726 | |
| 727 | # Individual rules to allow e.g. |
| 728 | # "make -C ../.. SCRIPT_PERL=contrib/foo/bar.perl build-perl-script" |
| 729 | # from subdirectories like contrib/*/ |
| 730 | .PHONY: build-perl-script build-sh-script build-python-script |
| 731 | build-perl-script: $(SCRIPT_PERL_GEN) |
| 732 | build-sh-script: $(SCRIPT_SH_GEN) |
| 733 | build-python-script: $(SCRIPT_PYTHON_GEN) |
| 734 | |
| 735 | .PHONY: install-perl-script install-sh-script install-python-script |
Johannes Schindelin | 0b64e21 | 2019-04-18 06:16:39 -0700 | [diff] [blame] | 736 | install-sh-script: $(SCRIPT_SH_GEN) |
Felipe Contreras | 654f23f | 2013-05-24 21:41:02 -0500 | [diff] [blame] | 737 | $(INSTALL) $^ '$(DESTDIR_SQ)$(gitexec_instdir_SQ)' |
Johannes Schindelin | 0b64e21 | 2019-04-18 06:16:39 -0700 | [diff] [blame] | 738 | install-perl-script: $(SCRIPT_PERL_GEN) |
Felipe Contreras | 654f23f | 2013-05-24 21:41:02 -0500 | [diff] [blame] | 739 | $(INSTALL) $^ '$(DESTDIR_SQ)$(gitexec_instdir_SQ)' |
Johannes Schindelin | 0b64e21 | 2019-04-18 06:16:39 -0700 | [diff] [blame] | 740 | install-python-script: $(SCRIPT_PYTHON_GEN) |
Felipe Contreras | 654f23f | 2013-05-24 21:41:02 -0500 | [diff] [blame] | 741 | $(INSTALL) $^ '$(DESTDIR_SQ)$(gitexec_instdir_SQ)' |
Matthieu Moy | 4c06b41 | 2013-02-08 18:31:16 +0100 | [diff] [blame] | 742 | |
| 743 | .PHONY: clean-perl-script clean-sh-script clean-python-script |
| 744 | clean-sh-script: |
| 745 | $(RM) $(SCRIPT_SH_GEN) |
| 746 | clean-perl-script: |
| 747 | $(RM) $(SCRIPT_PERL_GEN) |
| 748 | clean-python-script: |
| 749 | $(RM) $(SCRIPT_PYTHON_GEN) |
| 750 | |
Johannes Schindelin | 0b64e21 | 2019-04-18 06:16:39 -0700 | [diff] [blame] | 751 | SCRIPTS = $(SCRIPT_SH_GEN) \ |
| 752 | $(SCRIPT_PERL_GEN) \ |
| 753 | $(SCRIPT_PYTHON_GEN) \ |
Shawn O. Pearce | e475fe1 | 2007-11-23 15:35:08 -0500 | [diff] [blame] | 754 | git-instaweb |
Andreas Ericsson | d6ebd25 | 2005-11-22 00:44:15 +0100 | [diff] [blame] | 755 | |
Junio C Hamano | 2f76919 | 2010-09-28 16:08:38 -0500 | [diff] [blame] | 756 | ETAGS_TARGET = TAGS |
| 757 | |
Junio C Hamano | 42f7740 | 2006-08-15 21:38:07 -0700 | [diff] [blame] | 758 | # Empty... |
| 759 | EXTRA_PROGRAMS = |
Andreas Ericsson | d6ebd25 | 2005-11-22 00:44:15 +0100 | [diff] [blame] | 760 | |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 761 | # ... and all the rest that could be moved out of bindir to gitexecdir |
| 762 | PROGRAMS += $(EXTRA_PROGRAMS) |
Jonathan Nieder | 1b22c99 | 2010-01-26 09:54:23 -0600 | [diff] [blame] | 763 | |
Erik Faye-Lund | a666b47 | 2010-11-04 02:35:24 +0100 | [diff] [blame] | 764 | PROGRAM_OBJS += daemon.o |
Nguyễn Thái Ngọc Duy | 8275905 | 2012-05-04 20:52:36 +0700 | [diff] [blame] | 765 | PROGRAM_OBJS += http-backend.o |
Jonathan Nieder | 1b22c99 | 2010-01-26 09:54:23 -0600 | [diff] [blame] | 766 | PROGRAM_OBJS += imap-send.o |
Nguyễn Thái Ngọc Duy | 8275905 | 2012-05-04 20:52:36 +0700 | [diff] [blame] | 767 | PROGRAM_OBJS += sh-i18n--envsubst.o |
Jonathan Nieder | 1b22c99 | 2010-01-26 09:54:23 -0600 | [diff] [blame] | 768 | PROGRAM_OBJS += shell.o |
Ævar Arnfjörð Bjarmason | 029bac0 | 2021-02-23 12:41:31 +0100 | [diff] [blame] | 769 | .PHONY: program-objs |
| 770 | program-objs: $(PROGRAM_OBJS) |
Jonathan Nieder | 1b22c99 | 2010-01-26 09:54:23 -0600 | [diff] [blame] | 771 | |
Michael Palimaka | ace5e97 | 2012-02-08 21:59:04 +1100 | [diff] [blame] | 772 | # Binary suffix, set to .exe for Windows builds |
| 773 | X = |
| 774 | |
Jonathan Nieder | 1b22c99 | 2010-01-26 09:54:23 -0600 | [diff] [blame] | 775 | PROGRAMS += $(patsubst %.o,git-%$X,$(PROGRAM_OBJS)) |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 776 | |
Heba Waly | b3b18d1 | 2020-03-02 20:01:59 +0000 | [diff] [blame] | 777 | TEST_BUILTINS_OBJS += test-advise.o |
Taylor Blau | 483fa7f | 2021-03-31 21:32:11 -0400 | [diff] [blame] | 778 | TEST_BUILTINS_OBJS += test-bitmap.o |
Garima Singh | f52207a | 2020-03-30 00:31:24 +0000 | [diff] [blame] | 779 | TEST_BUILTINS_OBJS += test-bloom.o |
Ævar Arnfjörð Bjarmason | d796ced | 2022-10-12 12:52:32 +0000 | [diff] [blame] | 780 | TEST_BUILTINS_OBJS += test-bundle-uri.o |
Victoria Dye | 94fcf0e | 2022-11-10 19:06:01 +0000 | [diff] [blame] | 781 | TEST_BUILTINS_OBJS += test-cache-tree.o |
Nguyễn Thái Ngọc Duy | 0e49649 | 2018-03-24 08:44:31 +0100 | [diff] [blame] | 782 | TEST_BUILTINS_OBJS += test-chmtime.o |
Nguyễn Thái Ngọc Duy | 0e2678a | 2018-03-24 08:44:34 +0100 | [diff] [blame] | 783 | TEST_BUILTINS_OBJS += test-config.o |
Derrick Stolee | 2fec604 | 2020-09-11 17:49:18 +0000 | [diff] [blame] | 784 | TEST_BUILTINS_OBJS += test-crontab.o |
brian m. carlson | 05cd988 | 2022-01-17 21:56:16 +0000 | [diff] [blame] | 785 | TEST_BUILTINS_OBJS += test-csprng.o |
Nguyễn Thái Ngọc Duy | a801a7c | 2018-03-24 08:44:36 +0100 | [diff] [blame] | 786 | TEST_BUILTINS_OBJS += test-date.o |
Eric W. Biederman | 7673ecd | 2023-10-01 21:40:34 -0500 | [diff] [blame] | 787 | TEST_BUILTINS_OBJS += test-delete-gpgsig.o |
Nguyễn Thái Ngọc Duy | 9153dde | 2018-03-24 08:44:37 +0100 | [diff] [blame] | 788 | TEST_BUILTINS_OBJS += test-delta.o |
Daniel Ferreira | 150791a | 2019-07-10 20:58:57 -0300 | [diff] [blame] | 789 | TEST_BUILTINS_OBJS += test-dir-iterator.o |
Nguyễn Thái Ngọc Duy | 1c85474 | 2018-03-24 08:44:38 +0100 | [diff] [blame] | 790 | TEST_BUILTINS_OBJS += test-drop-caches.o |
Nguyễn Thái Ngọc Duy | 06ccb29 | 2018-03-24 08:44:39 +0100 | [diff] [blame] | 791 | TEST_BUILTINS_OBJS += test-dump-cache-tree.o |
Nguyễn Thái Ngọc Duy | f1ef0b0 | 2018-09-09 19:36:30 +0200 | [diff] [blame] | 792 | TEST_BUILTINS_OBJS += test-dump-fsmonitor.o |
Nguyễn Thái Ngọc Duy | 8133061 | 2018-03-24 08:44:40 +0100 | [diff] [blame] | 793 | TEST_BUILTINS_OBJS += test-dump-split-index.o |
Nguyễn Thái Ngọc Duy | cd780f0 | 2018-09-09 19:36:27 +0200 | [diff] [blame] | 794 | TEST_BUILTINS_OBJS += test-dump-untracked-cache.o |
Ævar Arnfjörð Bjarmason | 4a1baac | 2023-01-12 17:03:21 +0100 | [diff] [blame] | 795 | TEST_BUILTINS_OBJS += test-env-helper.o |
Josh Steadmon | 80bb227 | 2024-05-06 12:57:31 -0700 | [diff] [blame] | 796 | TEST_BUILTINS_OBJS += test-example-tap.o |
Christian Couder | 66589f8 | 2023-10-02 18:54:57 +0200 | [diff] [blame] | 797 | TEST_BUILTINS_OBJS += test-find-pack.o |
Jeff Hostetler | 148405f | 2022-03-25 18:03:03 +0000 | [diff] [blame] | 798 | TEST_BUILTINS_OBJS += test-fsmonitor-client.o |
Nguyễn Thái Ngọc Duy | c680668 | 2018-03-24 08:44:42 +0100 | [diff] [blame] | 799 | TEST_BUILTINS_OBJS += test-genrandom.o |
Johannes Schindelin | d5cfd14 | 2019-02-14 13:33:12 -0800 | [diff] [blame] | 800 | TEST_BUILTINS_OBJS += test-genzeros.o |
Ævar Arnfjörð Bjarmason | 482e148 | 2021-07-30 18:18:14 +0200 | [diff] [blame] | 801 | TEST_BUILTINS_OBJS += test-getcwd.o |
Denton Liu | 805d9ea | 2020-03-21 05:21:20 -0400 | [diff] [blame] | 802 | TEST_BUILTINS_OBJS += test-hash-speed.o |
brian m. carlson | 50c817e | 2018-11-14 04:09:32 +0000 | [diff] [blame] | 803 | TEST_BUILTINS_OBJS += test-hash.o |
Nguyễn Thái Ngọc Duy | 7c18cbd | 2018-03-24 08:44:43 +0100 | [diff] [blame] | 804 | TEST_BUILTINS_OBJS += test-hashmap.o |
Jeff Hostetler | 9915e08 | 2022-05-26 21:47:20 +0000 | [diff] [blame] | 805 | TEST_BUILTINS_OBJS += test-hexdump.o |
Jeff Hostetler | 7545941 | 2018-07-13 16:54:08 +0000 | [diff] [blame] | 806 | TEST_BUILTINS_OBJS += test-json-writer.o |
Nguyễn Thái Ngọc Duy | 64eb82f | 2018-03-24 08:44:33 +0100 | [diff] [blame] | 807 | TEST_BUILTINS_OBJS += test-lazy-init-name-hash.o |
Nguyễn Thái Ngọc Duy | 9080e75 | 2018-03-24 08:44:45 +0100 | [diff] [blame] | 808 | TEST_BUILTINS_OBJS += test-match-trees.o |
Nguyễn Thái Ngọc Duy | 34889d3 | 2018-03-24 08:44:46 +0100 | [diff] [blame] | 809 | TEST_BUILTINS_OBJS += test-mergesort.o |
Nguyễn Thái Ngọc Duy | d9cc2c8 | 2018-03-24 08:44:47 +0100 | [diff] [blame] | 810 | TEST_BUILTINS_OBJS += test-mktemp.o |
Junio C Hamano | bf10200 | 2020-04-29 16:15:27 -0700 | [diff] [blame] | 811 | TEST_BUILTINS_OBJS += test-oid-array.o |
Christian Couder | 11510de | 2019-06-15 12:06:59 +0200 | [diff] [blame] | 812 | TEST_BUILTINS_OBJS += test-oidmap.o |
Eric Wong | 92d8ed8 | 2021-07-07 23:10:19 +0000 | [diff] [blame] | 813 | TEST_BUILTINS_OBJS += test-oidtree.o |
Nguyễn Thái Ngọc Duy | c033cc1 | 2018-03-24 08:44:48 +0100 | [diff] [blame] | 814 | TEST_BUILTINS_OBJS += test-online-cpus.o |
Taylor Blau | 2bd4427 | 2022-05-20 19:17:46 -0400 | [diff] [blame] | 815 | TEST_BUILTINS_OBJS += test-pack-mtimes.o |
Nguyễn Thái Ngọc Duy | 2f17c78 | 2018-09-09 19:36:29 +0200 | [diff] [blame] | 816 | TEST_BUILTINS_OBJS += test-parse-options.o |
Alexandr Miloslavskiy | d0d0a35 | 2019-12-31 10:15:12 +0000 | [diff] [blame] | 817 | TEST_BUILTINS_OBJS += test-parse-pathspec-file.o |
Jonathan Tan | ef830cc | 2021-06-17 10:13:26 -0700 | [diff] [blame] | 818 | TEST_BUILTINS_OBJS += test-partial-clone.o |
Nguyễn Thái Ngọc Duy | b8d5cf4 | 2018-03-24 08:44:49 +0100 | [diff] [blame] | 819 | TEST_BUILTINS_OBJS += test-path-utils.o |
Ævar Arnfjörð Bjarmason | 95ca1f9 | 2021-01-24 18:28:13 +0100 | [diff] [blame] | 820 | TEST_BUILTINS_OBJS += test-pcre2-config.o |
Nguyễn Thái Ngọc Duy | 8ea40cc | 2018-09-09 19:36:28 +0200 | [diff] [blame] | 821 | TEST_BUILTINS_OBJS += test-pkt-line.o |
Jiang Xin | 15d3af5 | 2020-08-27 11:45:44 -0400 | [diff] [blame] | 822 | TEST_BUILTINS_OBJS += test-proc-receive.o |
SZEDER Gábor | 2bb74b5 | 2019-09-16 22:54:12 +0200 | [diff] [blame] | 823 | TEST_BUILTINS_OBJS += test-progress.o |
Derrick Stolee | ab176ac | 2018-07-20 16:33:15 +0000 | [diff] [blame] | 824 | TEST_BUILTINS_OBJS += test-reach.o |
Nguyễn Thái Ngọc Duy | 5fbe600 | 2018-03-24 08:44:51 +0100 | [diff] [blame] | 825 | TEST_BUILTINS_OBJS += test-read-cache.o |
Derrick Stolee | 4bd0593 | 2019-11-12 16:58:20 +0000 | [diff] [blame] | 826 | TEST_BUILTINS_OBJS += test-read-graph.o |
Derrick Stolee | 4d80560 | 2018-07-12 15:39:23 -0400 | [diff] [blame] | 827 | TEST_BUILTINS_OBJS += test-read-midx.o |
Nguyễn Thái Ngọc Duy | 65370d8 | 2018-03-24 08:44:52 +0100 | [diff] [blame] | 828 | TEST_BUILTINS_OBJS += test-ref-store.o |
Han-Wen Nienhuys | ef8a6c6 | 2021-10-07 20:25:00 +0000 | [diff] [blame] | 829 | TEST_BUILTINS_OBJS += test-reftable.o |
Nguyễn Thái Ngọc Duy | 9038531 | 2018-03-24 08:44:53 +0100 | [diff] [blame] | 830 | TEST_BUILTINS_OBJS += test-regex.o |
Matheus Tavares | 52917a9 | 2022-08-14 22:06:37 -0300 | [diff] [blame] | 831 | TEST_BUILTINS_OBJS += test-rot13-filter.o |
Jonathan Tan | dade47c | 2018-07-11 15:42:42 -0700 | [diff] [blame] | 832 | TEST_BUILTINS_OBJS += test-repository.o |
Nguyễn Thái Ngọc Duy | 77d4b8c | 2018-03-24 08:44:54 +0100 | [diff] [blame] | 833 | TEST_BUILTINS_OBJS += test-revision-walking.o |
Nguyễn Thái Ngọc Duy | ae6a51f | 2018-03-24 08:44:55 +0100 | [diff] [blame] | 834 | TEST_BUILTINS_OBJS += test-run-command.o |
Nguyễn Thái Ngọc Duy | ff5fb8b | 2018-03-24 08:44:56 +0100 | [diff] [blame] | 835 | TEST_BUILTINS_OBJS += test-scrap-cache-tree.o |
Johannes Schindelin | b7ce24d | 2019-04-18 06:16:51 -0700 | [diff] [blame] | 836 | TEST_BUILTINS_OBJS += test-serve-v2.o |
Nguyễn Thái Ngọc Duy | dae2ff9 | 2018-03-24 08:44:32 +0100 | [diff] [blame] | 837 | TEST_BUILTINS_OBJS += test-sha1.o |
brian m. carlson | 13eeedb | 2018-11-14 04:09:36 +0000 | [diff] [blame] | 838 | TEST_BUILTINS_OBJS += test-sha256.o |
Nguyễn Thái Ngọc Duy | e154a6f | 2018-03-24 08:44:58 +0100 | [diff] [blame] | 839 | TEST_BUILTINS_OBJS += test-sigchain.o |
Jeff Hostetler | 36a7eb6 | 2021-03-22 10:29:48 +0000 | [diff] [blame] | 840 | TEST_BUILTINS_OBJS += test-simple-ipc.o |
Nguyễn Thái Ngọc Duy | c932a5f | 2018-03-24 08:45:00 +0100 | [diff] [blame] | 841 | TEST_BUILTINS_OBJS += test-string-list.o |
Nguyễn Thái Ngọc Duy | b618821 | 2018-03-24 08:45:01 +0100 | [diff] [blame] | 842 | TEST_BUILTINS_OBJS += test-submodule-config.o |
Antonio Ospite | 2b1257e | 2018-10-25 18:18:13 +0200 | [diff] [blame] | 843 | TEST_BUILTINS_OBJS += test-submodule-nested-repo-config.o |
Ævar Arnfjörð Bjarmason | 9fb2a97 | 2022-09-01 01:17:48 +0200 | [diff] [blame] | 844 | TEST_BUILTINS_OBJS += test-submodule.o |
Nguyễn Thái Ngọc Duy | 112edd6 | 2018-03-24 08:45:02 +0100 | [diff] [blame] | 845 | TEST_BUILTINS_OBJS += test-subprocess.o |
Jeff Hostetler | a15860d | 2019-02-22 14:25:10 -0800 | [diff] [blame] | 846 | TEST_BUILTINS_OBJS += test-trace2.o |
brian m. carlson | 678eb55 | 2023-10-12 16:09:29 +0000 | [diff] [blame] | 847 | TEST_BUILTINS_OBJS += test-truncate.o |
Nguyễn Thái Ngọc Duy | 599fbd8 | 2018-03-24 08:45:03 +0100 | [diff] [blame] | 848 | TEST_BUILTINS_OBJS += test-urlmatch-normalization.o |
Ævar Arnfjörð Bjarmason | 28e8f0d | 2021-04-08 17:04:21 +0200 | [diff] [blame] | 849 | TEST_BUILTINS_OBJS += test-userdiff.o |
Nguyễn Thái Ngọc Duy | 0489289 | 2018-03-24 08:45:04 +0100 | [diff] [blame] | 850 | TEST_BUILTINS_OBJS += test-wildmatch.o |
Jeff Hostetler | 06ba9d0 | 2018-09-11 13:06:01 -0700 | [diff] [blame] | 851 | TEST_BUILTINS_OBJS += test-windows-named-pipe.o |
Nguyễn Thái Ngọc Duy | c81f843 | 2018-03-24 08:45:05 +0100 | [diff] [blame] | 852 | TEST_BUILTINS_OBJS += test-write-cache.o |
Denton Liu | 805d9ea | 2020-03-21 05:21:20 -0400 | [diff] [blame] | 853 | TEST_BUILTINS_OBJS += test-xml-encode.o |
Nguyễn Thái Ngọc Duy | 0e49649 | 2018-03-24 08:44:31 +0100 | [diff] [blame] | 854 | |
Nguyễn Thái Ngọc Duy | c9a1f41 | 2018-09-09 19:36:31 +0200 | [diff] [blame] | 855 | # Do not add more tests here unless they have extra dependencies. Add |
| 856 | # them in TEST_BUILTINS_OBJS above. |
Johannes Schindelin | 3064d5a | 2016-01-27 17:19:37 +0100 | [diff] [blame] | 857 | TEST_PROGRAMS_NEED_X += test-fake-ssh |
Nguyễn Thái Ngọc Duy | efd71f8 | 2018-03-24 08:44:30 +0100 | [diff] [blame] | 858 | TEST_PROGRAMS_NEED_X += test-tool |
Jonathan Nieder | 225f78c | 2010-01-26 10:08:44 -0600 | [diff] [blame] | 859 | |
Nguyễn Thái Ngọc Duy | e6e7530 | 2016-04-13 20:22:42 +0700 | [diff] [blame] | 860 | TEST_PROGRAMS = $(patsubst %,t/helper/%$X,$(TEST_PROGRAMS_NEED_X)) |
Andreas Ericsson | d6ebd25 | 2005-11-22 00:44:15 +0100 | [diff] [blame] | 861 | |
Junio C Hamano | 1736855 | 2008-02-23 11:08:25 -0800 | [diff] [blame] | 862 | # List built-in command $C whose implementation cmd_$C() is not in |
Linus Torvalds | 81b50f3 | 2010-02-22 08:42:18 -0800 | [diff] [blame] | 863 | # builtin/$C.o but is linked in as part of some other command. |
| 864 | BUILT_INS += $(patsubst builtin/%.o,git-%$X,$(BUILTIN_OBJS)) |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 865 | |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 866 | BUILT_INS += git-cherry$X |
Stephan Beyer | fcb6c07 | 2009-02-09 23:00:45 +0100 | [diff] [blame] | 867 | BUILT_INS += git-cherry-pick$X |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 868 | BUILT_INS += git-format-patch$X |
| 869 | BUILT_INS += git-fsck-objects$X |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 870 | BUILT_INS += git-init$X |
Jeff King | 0a21d0e | 2020-12-01 21:34:11 -0500 | [diff] [blame] | 871 | BUILT_INS += git-maintenance$X |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 872 | BUILT_INS += git-merge-subtree$X |
Nguyễn Thái Ngọc Duy | 46e91b6 | 2019-04-25 16:45:45 +0700 | [diff] [blame] | 873 | BUILT_INS += git-restore$X |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 874 | BUILT_INS += git-show$X |
Junio C Hamano | 24b1f65 | 2008-12-03 00:30:34 -0800 | [diff] [blame] | 875 | BUILT_INS += git-stage$X |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 876 | BUILT_INS += git-status$X |
Nguyễn Thái Ngọc Duy | d787d31 | 2019-03-29 17:39:05 +0700 | [diff] [blame] | 877 | BUILT_INS += git-switch$X |
Victoria Dye | 9b1dc1c | 2022-09-20 00:19:55 +0000 | [diff] [blame] | 878 | BUILT_INS += git-version$X |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 879 | BUILT_INS += git-whatchanged$X |
Junio C Hamano | 9173080 | 2006-04-10 17:37:58 -0700 | [diff] [blame] | 880 | |
Eygene Ryabinkin | 3cfaf11 | 2007-03-28 04:00:23 -0700 | [diff] [blame] | 881 | # what 'all' will build but not install in gitexecdir |
Victoria Dye | 7b5c93c | 2022-09-02 15:56:43 +0000 | [diff] [blame] | 882 | OTHER_PROGRAMS += git$X |
| 883 | OTHER_PROGRAMS += scalar$X |
Eygene Ryabinkin | 3cfaf11 | 2007-03-28 04:00:23 -0700 | [diff] [blame] | 884 | |
Matthew Ogilvie | ea92519 | 2009-12-02 22:14:05 -0700 | [diff] [blame] | 885 | # what test wrappers are needed and 'install' will install, in bindir |
| 886 | BINDIR_PROGRAMS_NEED_X += git |
Victoria Dye | 7b5c93c | 2022-09-02 15:56:43 +0000 | [diff] [blame] | 887 | BINDIR_PROGRAMS_NEED_X += scalar |
Matthew Ogilvie | ea92519 | 2009-12-02 22:14:05 -0700 | [diff] [blame] | 888 | BINDIR_PROGRAMS_NEED_X += git-receive-pack |
Matthew Ogilvie | ea92519 | 2009-12-02 22:14:05 -0700 | [diff] [blame] | 889 | BINDIR_PROGRAMS_NEED_X += git-shell |
Denton Liu | 805d9ea | 2020-03-21 05:21:20 -0400 | [diff] [blame] | 890 | BINDIR_PROGRAMS_NEED_X += git-upload-archive |
| 891 | BINDIR_PROGRAMS_NEED_X += git-upload-pack |
Matthew Ogilvie | ea92519 | 2009-12-02 22:14:05 -0700 | [diff] [blame] | 892 | |
| 893 | BINDIR_PROGRAMS_NO_X += git-cvsserver |
| 894 | |
Ryan Anderson | 3d32051 | 2005-11-21 00:11:22 -0500 | [diff] [blame] | 895 | # Set paths to tools early so that they can be used for version tests. |
| 896 | ifndef SHELL_PATH |
| 897 | SHELL_PATH = /bin/sh |
| 898 | endif |
| 899 | ifndef PERL_PATH |
| 900 | PERL_PATH = /usr/bin/perl |
| 901 | endif |
Johan Herland | d4e1b47 | 2009-11-18 02:42:31 +0100 | [diff] [blame] | 902 | ifndef PYTHON_PATH |
| 903 | PYTHON_PATH = /usr/bin/python |
| 904 | endif |
Junio C Hamano | 720d150 | 2005-09-10 17:46:27 -0700 | [diff] [blame] | 905 | |
Luben Tuikov | 3a79347 | 2006-12-14 23:03:03 -0800 | [diff] [blame] | 906 | export PERL_PATH |
Johan Herland | d4e1b47 | 2009-11-18 02:42:31 +0100 | [diff] [blame] | 907 | export PYTHON_PATH |
Luben Tuikov | 3a79347 | 2006-12-14 23:03:03 -0800 | [diff] [blame] | 908 | |
Jeff King | 3f824e9 | 2017-12-08 05:47:22 -0500 | [diff] [blame] | 909 | TEST_SHELL_PATH = $(SHELL_PATH) |
| 910 | |
Stefano Lattarini | dd6fc7c | 2012-12-09 11:36:17 +0100 | [diff] [blame] | 911 | LIB_FILE = libgit.a |
| 912 | XDIFF_LIB = xdiff/lib.a |
Han-Wen Nienhuys | ef8a6c6 | 2021-10-07 20:25:00 +0000 | [diff] [blame] | 913 | REFTABLE_LIB = reftable/libreftable.a |
| 914 | REFTABLE_TEST_LIB = reftable/libreftable_test.a |
Linus Torvalds | 0a02ce7 | 2005-04-18 12:49:39 -0700 | [diff] [blame] | 915 | |
Nguyễn Thái Ngọc Duy | 60f487a | 2018-05-10 10:46:43 +0200 | [diff] [blame] | 916 | GENERATED_H += command-list.h |
Denton Liu | 8474f26 | 2020-10-08 00:39:26 -0700 | [diff] [blame] | 917 | GENERATED_H += config-list.h |
Ævar Arnfjörð Bjarmason | cfe853e | 2021-09-26 21:03:29 +0200 | [diff] [blame] | 918 | GENERATED_H += hook-list.h |
| 919 | |
Ævar Arnfjörð Bjarmason | 7c3c0a9 | 2021-09-23 12:29:57 +0200 | [diff] [blame] | 920 | .PHONY: generated-hdrs |
| 921 | generated-hdrs: $(GENERATED_H) |
Nguyễn Thái Ngọc Duy | 1b8b2e4 | 2012-04-23 19:30:21 +0700 | [diff] [blame] | 922 | |
Ævar Arnfjörð Bjarmason | f4c6a52 | 2022-03-03 17:04:15 +0100 | [diff] [blame] | 923 | ## Exhaustive lists of our source files, either dynamically generated, |
| 924 | ## or hardcoded. |
| 925 | SOURCES_CMD = ( \ |
Jiang Xin | 15fe406 | 2022-05-26 22:50:30 +0800 | [diff] [blame] | 926 | git ls-files --deduplicate \ |
Ævar Arnfjörð Bjarmason | f4c6a52 | 2022-03-03 17:04:15 +0100 | [diff] [blame] | 927 | '*.[hcS]' \ |
| 928 | '*.sh' \ |
| 929 | ':!*[tp][0-9][0-9][0-9][0-9]*' \ |
| 930 | ':!contrib' \ |
| 931 | 2>/dev/null || \ |
Johannes Schindelin | 92b88eb | 2019-03-04 05:47:06 -0800 | [diff] [blame] | 932 | $(FIND) . \ |
Ævar Arnfjörð Bjarmason | f4c6a52 | 2022-03-03 17:04:15 +0100 | [diff] [blame] | 933 | \( -name .git -type d -prune \) \ |
| 934 | -o \( -name '[tp][0-9][0-9][0-9][0-9]*' -prune \) \ |
| 935 | -o \( -name contrib -type d -prune \) \ |
| 936 | -o \( -name build -type d -prune \) \ |
Ævar Arnfjörð Bjarmason | 1cc0425 | 2022-05-26 22:50:28 +0800 | [diff] [blame] | 937 | -o \( -name .build -type d -prune \) \ |
Ævar Arnfjörð Bjarmason | f4c6a52 | 2022-03-03 17:04:15 +0100 | [diff] [blame] | 938 | -o \( -name 'trash*' -type d -prune \) \ |
| 939 | -o \( -name '*.[hcS]' -type f -print \) \ |
| 940 | -o \( -name '*.sh' -type f -print \) \ |
| 941 | | sed -e 's|^\./||' \ |
| 942 | ) |
Jiang Xin | 15fe406 | 2022-05-26 22:50:30 +0800 | [diff] [blame] | 943 | FOUND_SOURCE_FILES := $(filter-out $(GENERATED_H),$(shell $(SOURCES_CMD))) |
Ævar Arnfjörð Bjarmason | f4c6a52 | 2022-03-03 17:04:15 +0100 | [diff] [blame] | 944 | |
| 945 | FOUND_C_SOURCES = $(filter %.c,$(FOUND_SOURCE_FILES)) |
| 946 | FOUND_H_SOURCES = $(filter %.h,$(FOUND_SOURCE_FILES)) |
| 947 | |
| 948 | COCCI_SOURCES = $(filter-out $(THIRD_PARTY_SOURCES),$(FOUND_C_SOURCES)) |
| 949 | |
| 950 | LIB_H = $(FOUND_H_SOURCES) |
Junio C Hamano | 8f3f9b0 | 2005-07-23 17:54:41 -0700 | [diff] [blame] | 951 | |
Dmitry Potapov | 5b8e6f8 | 2008-06-28 00:46:42 +0400 | [diff] [blame] | 952 | LIB_OBJS += abspath.o |
Johannes Schindelin | f83dff6 | 2019-11-13 12:40:57 +0000 | [diff] [blame] | 953 | LIB_OBJS += add-interactive.o |
Johannes Schindelin | f6aa7ec | 2019-12-13 08:07:48 +0000 | [diff] [blame] | 954 | LIB_OBJS += add-patch.o |
Jeff King | 7519443 | 2009-09-09 07:38:58 -0400 | [diff] [blame] | 955 | LIB_OBJS += advice.o |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 956 | LIB_OBJS += alias.o |
| 957 | LIB_OBJS += alloc.o |
Christian Couder | bb493a5 | 2016-08-08 23:03:07 +0200 | [diff] [blame] | 958 | LIB_OBJS += apply.o |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 959 | LIB_OBJS += archive-tar.o |
| 960 | LIB_OBJS += archive-zip.o |
Denton Liu | 805d9ea | 2020-03-21 05:21:20 -0400 | [diff] [blame] | 961 | LIB_OBJS += archive.o |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 962 | LIB_OBJS += attr.o |
| 963 | LIB_OBJS += base85.o |
Christian Couder | a2ad79c | 2009-03-26 05:55:24 +0100 | [diff] [blame] | 964 | LIB_OBJS += bisect.o |
Jeff Smith | f5dd754 | 2017-05-24 00:15:33 -0500 | [diff] [blame] | 965 | LIB_OBJS += blame.o |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 966 | LIB_OBJS += blob.o |
Garima Singh | f52207a | 2020-03-30 00:31:24 +0000 | [diff] [blame] | 967 | LIB_OBJS += bloom.o |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 968 | LIB_OBJS += branch.o |
Junio C Hamano | 568508e | 2011-10-28 14:48:40 -0700 | [diff] [blame] | 969 | LIB_OBJS += bulk-checkin.o |
Derrick Stolee | 53a5089 | 2022-08-09 13:11:40 +0000 | [diff] [blame] | 970 | LIB_OBJS += bundle-uri.o |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 971 | LIB_OBJS += bundle.o |
| 972 | LIB_OBJS += cache-tree.o |
Eric Wong | 92d8ed8 | 2021-07-07 23:10:19 +0000 | [diff] [blame] | 973 | LIB_OBJS += cbtree.o |
Jeff King | 2b5ed37 | 2018-03-30 14:35:04 -0400 | [diff] [blame] | 974 | LIB_OBJS += chdir-notify.o |
Thomas Gummerer | 7c85a87 | 2017-11-26 19:43:51 +0000 | [diff] [blame] | 975 | LIB_OBJS += checkout.o |
Derrick Stolee | 570df42 | 2021-02-18 14:07:24 +0000 | [diff] [blame] | 976 | LIB_OBJS += chunk-format.o |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 977 | LIB_OBJS += color.o |
Nguyễn Thái Ngọc Duy | 7e29b82 | 2012-04-21 11:44:32 +0700 | [diff] [blame] | 978 | LIB_OBJS += column.o |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 979 | LIB_OBJS += combine-diff.o |
Derrick Stolee | 08fd81c | 2018-04-02 16:34:19 -0400 | [diff] [blame] | 980 | LIB_OBJS += commit-graph.o |
Derrick Stolee | 5227c38 | 2018-07-20 16:33:02 +0000 | [diff] [blame] | 981 | LIB_OBJS += commit-reach.o |
Denton Liu | 805d9ea | 2020-03-21 05:21:20 -0400 | [diff] [blame] | 982 | LIB_OBJS += commit.o |
Jeff King | 10f7433 | 2022-08-17 02:04:55 -0400 | [diff] [blame] | 983 | LIB_OBJS += compat/nonblock.o |
Fredrik Kuivinen | e831171 | 2011-08-21 00:40:40 +0200 | [diff] [blame] | 984 | LIB_OBJS += compat/obstack.o |
Jeff King | 21aeafc | 2011-12-10 05:41:01 -0500 | [diff] [blame] | 985 | LIB_OBJS += compat/terminal.o |
Ævar Arnfjörð Bjarmason | 0756477 | 2022-01-24 10:27:59 -0800 | [diff] [blame] | 986 | LIB_OBJS += compat/zlib-uncompress2.o |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 987 | LIB_OBJS += config.o |
| 988 | LIB_OBJS += connect.o |
Junio C Hamano | f96400c | 2011-09-02 16:33:22 -0700 | [diff] [blame] | 989 | LIB_OBJS += connected.o |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 990 | LIB_OBJS += convert.o |
| 991 | LIB_OBJS += copy.o |
Jeff King | abca927 | 2011-12-10 05:31:11 -0500 | [diff] [blame] | 992 | LIB_OBJS += credential.o |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 993 | LIB_OBJS += csum-file.o |
| 994 | LIB_OBJS += ctype.o |
| 995 | LIB_OBJS += date.o |
| 996 | LIB_OBJS += decorate.o |
Jeff King | c8d521f | 2018-08-16 08:13:07 +0200 | [diff] [blame] | 997 | LIB_OBJS += delta-islands.o |
Victoria Dye | bb2c349 | 2022-08-12 20:10:13 +0000 | [diff] [blame] | 998 | LIB_OBJS += diagnose.o |
Denton Liu | 805d9ea | 2020-03-21 05:21:20 -0400 | [diff] [blame] | 999 | LIB_OBJS += diff-delta.o |
Sergey Organov | a37eec6 | 2020-12-21 18:19:33 +0300 | [diff] [blame] | 1000 | LIB_OBJS += diff-merges.o |
Denton Liu | 805d9ea | 2020-03-21 05:21:20 -0400 | [diff] [blame] | 1001 | LIB_OBJS += diff-lib.o |
| 1002 | LIB_OBJS += diff-no-index.o |
| 1003 | LIB_OBJS += diff.o |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 1004 | LIB_OBJS += diffcore-break.o |
| 1005 | LIB_OBJS += diffcore-delta.o |
| 1006 | LIB_OBJS += diffcore-order.o |
| 1007 | LIB_OBJS += diffcore-pickaxe.o |
| 1008 | LIB_OBJS += diffcore-rename.o |
Junio C Hamano | 1eb4136 | 2021-02-11 11:57:50 -0800 | [diff] [blame] | 1009 | LIB_OBJS += diffcore-rotate.o |
Michael Haggerty | 0fe5043 | 2016-06-18 06:15:18 +0200 | [diff] [blame] | 1010 | LIB_OBJS += dir-iterator.o |
Denton Liu | 805d9ea | 2020-03-21 05:21:20 -0400 | [diff] [blame] | 1011 | LIB_OBJS += dir.o |
Stephan Beyer | d82f33e | 2008-07-25 18:28:41 +0200 | [diff] [blame] | 1012 | LIB_OBJS += editor.o |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 1013 | LIB_OBJS += entry.o |
| 1014 | LIB_OBJS += environment.o |
Vicent Marti | e127310 | 2013-11-14 07:43:51 -0500 | [diff] [blame] | 1015 | LIB_OBJS += ewah/bitmap.o |
| 1016 | LIB_OBJS += ewah/ewah_bitmap.o |
| 1017 | LIB_OBJS += ewah/ewah_io.o |
| 1018 | LIB_OBJS += ewah/ewah_rlw.o |
Stefan Beller | d807c4a | 2018-04-10 14:26:18 -0700 | [diff] [blame] | 1019 | LIB_OBJS += exec-cmd.o |
Jonathan Tan | ec06283 | 2018-06-14 15:54:28 -0700 | [diff] [blame] | 1020 | LIB_OBJS += fetch-negotiator.o |
Nguyễn Thái Ngọc Duy | 745f7a8 | 2012-10-26 22:53:55 +0700 | [diff] [blame] | 1021 | LIB_OBJS += fetch-pack.o |
Denton Liu | ce6521e | 2020-03-23 21:07:51 -0400 | [diff] [blame] | 1022 | LIB_OBJS += fmt-merge-msg.o |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 1023 | LIB_OBJS += fsck.o |
Ben Peart | 883e248 | 2017-09-22 12:35:40 -0400 | [diff] [blame] | 1024 | LIB_OBJS += fsmonitor.o |
Jeff Hostetler | d2bd862 | 2022-03-25 18:02:45 +0000 | [diff] [blame] | 1025 | LIB_OBJS += fsmonitor-ipc.o |
Jeff Hostetler | 1e0ea5c | 2022-03-25 18:02:46 +0000 | [diff] [blame] | 1026 | LIB_OBJS += fsmonitor-settings.o |
Ævar Arnfjörð Bjarmason | 5e9637c | 2011-11-18 00:14:42 +0100 | [diff] [blame] | 1027 | LIB_OBJS += gettext.o |
Elijah Newren | d88dbaa | 2023-04-11 00:41:51 -0700 | [diff] [blame] | 1028 | LIB_OBJS += git-zlib.o |
Nguyễn Thái Ngọc Duy | 8275905 | 2012-05-04 20:52:36 +0700 | [diff] [blame] | 1029 | LIB_OBJS += gpg-interface.o |
Adam Simpkins | c12172d | 2008-05-04 03:36:53 -0700 | [diff] [blame] | 1030 | LIB_OBJS += graph.o |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 1031 | LIB_OBJS += grep.o |
Martin Ågren | bc62692 | 2020-12-31 12:56:23 +0100 | [diff] [blame] | 1032 | LIB_OBJS += hash-lookup.o |
Karsten Blees | 6a364ce | 2013-11-14 20:17:54 +0100 | [diff] [blame] | 1033 | LIB_OBJS += hashmap.o |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 1034 | LIB_OBJS += help.o |
Linus Torvalds | a503121 | 2010-01-21 15:25:19 -0800 | [diff] [blame] | 1035 | LIB_OBJS += hex.o |
Calvin Wan | d88e810 | 2023-09-29 14:20:48 -0700 | [diff] [blame] | 1036 | LIB_OBJS += hex-ll.o |
Ævar Arnfjörð Bjarmason | 5e3aba3 | 2021-09-26 21:03:26 +0200 | [diff] [blame] | 1037 | LIB_OBJS += hook.o |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 1038 | LIB_OBJS += ident.o |
Jeff Hostetler | 7545941 | 2018-07-13 16:54:08 +0000 | [diff] [blame] | 1039 | LIB_OBJS += json-writer.o |
Fredrik Kuivinen | b95c5ad | 2011-08-21 00:41:57 +0200 | [diff] [blame] | 1040 | LIB_OBJS += kwset.o |
Johannes Schindelin | 8af84da | 2008-08-31 15:50:23 +0200 | [diff] [blame] | 1041 | LIB_OBJS += levenshtein.o |
Thomas Rast | 12da1d1 | 2013-03-28 17:47:32 +0100 | [diff] [blame] | 1042 | LIB_OBJS += line-log.o |
Bo Yang | 25ed341 | 2013-03-28 17:47:30 +0100 | [diff] [blame] | 1043 | LIB_OBJS += line-range.o |
Denton Liu | 805d9ea | 2020-03-21 05:21:20 -0400 | [diff] [blame] | 1044 | LIB_OBJS += linear-assignment.o |
Jeff Hostetler | 25ec7bc | 2017-11-21 20:58:50 +0000 | [diff] [blame] | 1045 | LIB_OBJS += list-objects-filter-options.o |
Denton Liu | 805d9ea | 2020-03-21 05:21:20 -0400 | [diff] [blame] | 1046 | LIB_OBJS += list-objects-filter.o |
| 1047 | LIB_OBJS += list-objects.o |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 1048 | LIB_OBJS += lockfile.o |
| 1049 | LIB_OBJS += log-tree.o |
brian m. carlson | 23b2c7e | 2023-10-01 21:40:09 -0500 | [diff] [blame] | 1050 | LIB_OBJS += loose.o |
Brandon Williams | 72d0ea0 | 2018-03-15 10:31:20 -0700 | [diff] [blame] | 1051 | LIB_OBJS += ls-refs.o |
Junio C Hamano | c6905e4 | 2015-10-14 17:44:55 -0700 | [diff] [blame] | 1052 | LIB_OBJS += mailinfo.o |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 1053 | LIB_OBJS += mailmap.o |
| 1054 | LIB_OBJS += match-trees.o |
Jameson Miller | 065feab | 2018-04-11 18:37:55 +0000 | [diff] [blame] | 1055 | LIB_OBJS += mem-pool.o |
Junio C Hamano | fa2364e | 2012-12-06 15:08:01 -0800 | [diff] [blame] | 1056 | LIB_OBJS += merge-blobs.o |
Elijah Newren | 6723899 | 2023-05-16 06:34:04 +0000 | [diff] [blame] | 1057 | LIB_OBJS += merge-ll.o |
Elijah Newren | 17e5574 | 2020-10-27 02:08:07 +0000 | [diff] [blame] | 1058 | LIB_OBJS += merge-ort.o |
Elijah Newren | 47b1e89 | 2020-10-27 02:08:08 +0000 | [diff] [blame] | 1059 | LIB_OBJS += merge-ort-wrappers.o |
Miklos Vajna | 9047ebb | 2008-08-12 18:45:14 +0200 | [diff] [blame] | 1060 | LIB_OBJS += merge-recursive.o |
Denton Liu | 805d9ea | 2020-03-21 05:21:20 -0400 | [diff] [blame] | 1061 | LIB_OBJS += merge.o |
Derrick Stolee | a340773 | 2018-07-12 15:39:21 -0400 | [diff] [blame] | 1062 | LIB_OBJS += midx.o |
Taylor Blau | 748b88a | 2024-04-01 17:16:34 -0400 | [diff] [blame] | 1063 | LIB_OBJS += midx-write.o |
Linus Torvalds | 96872bc | 2008-03-21 13:16:24 -0700 | [diff] [blame] | 1064 | LIB_OBJS += name-hash.o |
Jonathan Tan | ec06283 | 2018-06-14 15:54:28 -0700 | [diff] [blame] | 1065 | LIB_OBJS += negotiator/default.o |
Jonathan Tan | cbe566a | 2020-08-17 21:01:31 -0700 | [diff] [blame] | 1066 | LIB_OBJS += negotiator/noop.o |
Jonathan Tan | 42cc748 | 2018-07-16 11:44:01 -0700 | [diff] [blame] | 1067 | LIB_OBJS += negotiator/skipping.o |
Jeff King | a941d5e | 2010-04-01 20:07:40 -0400 | [diff] [blame] | 1068 | LIB_OBJS += notes-cache.o |
Johan Herland | 75ef3f4 | 2010-11-09 22:49:46 +0100 | [diff] [blame] | 1069 | LIB_OBJS += notes-merge.o |
Johan Herland | 49c2470 | 2013-06-12 02:13:00 +0200 | [diff] [blame] | 1070 | LIB_OBJS += notes-utils.o |
Denton Liu | 805d9ea | 2020-03-21 05:21:20 -0400 | [diff] [blame] | 1071 | LIB_OBJS += notes.o |
Eric W. Biederman | 5e9d802 | 2023-10-01 21:40:05 -0500 | [diff] [blame] | 1072 | LIB_OBJS += object-file-convert.o |
Martin Ågren | e5afd44 | 2020-12-31 12:56:21 +0100 | [diff] [blame] | 1073 | LIB_OBJS += object-file.o |
Martin Ågren | 1e6771e | 2020-12-31 12:56:20 +0100 | [diff] [blame] | 1074 | LIB_OBJS += object-name.o |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 1075 | LIB_OBJS += object.o |
Junio C Hamano | bf10200 | 2020-04-29 16:15:27 -0700 | [diff] [blame] | 1076 | LIB_OBJS += oid-array.o |
Jonathan Tan | 9e6fabde | 2017-09-29 15:54:22 -0700 | [diff] [blame] | 1077 | LIB_OBJS += oidmap.o |
Jeff King | 29c2bd5 | 2017-02-08 15:53:07 -0500 | [diff] [blame] | 1078 | LIB_OBJS += oidset.o |
Eric Wong | 92d8ed8 | 2021-07-07 23:10:19 +0000 | [diff] [blame] | 1079 | LIB_OBJS += oidtree.o |
Vicent Marti | 7cc8f97 | 2013-12-21 09:00:16 -0500 | [diff] [blame] | 1080 | LIB_OBJS += pack-bitmap-write.o |
Denton Liu | 805d9ea | 2020-03-21 05:21:20 -0400 | [diff] [blame] | 1081 | LIB_OBJS += pack-bitmap.o |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 1082 | LIB_OBJS += pack-check.o |
Taylor Blau | 94cd775 | 2022-05-20 19:17:35 -0400 | [diff] [blame] | 1083 | LIB_OBJS += pack-mtimes.o |
Vicent Marti | 2834bc2 | 2013-10-24 14:01:06 -0400 | [diff] [blame] | 1084 | LIB_OBJS += pack-objects.o |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 1085 | LIB_OBJS += pack-revindex.o |
| 1086 | LIB_OBJS += pack-write.o |
Denton Liu | 805d9ea | 2020-03-21 05:21:20 -0400 | [diff] [blame] | 1087 | LIB_OBJS += packfile.o |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 1088 | LIB_OBJS += pager.o |
Matheus Tavares | 04155bd | 2021-04-18 21:14:53 -0300 | [diff] [blame] | 1089 | LIB_OBJS += parallel-checkout.o |
Calvin Wan | b1bda75 | 2023-09-29 14:20:51 -0700 | [diff] [blame] | 1090 | LIB_OBJS += parse.o |
Dmitry Ivankov | 0687628 | 2011-08-11 15:15:38 +0600 | [diff] [blame] | 1091 | LIB_OBJS += parse-options-cb.o |
Denton Liu | 805d9ea | 2020-03-21 05:21:20 -0400 | [diff] [blame] | 1092 | LIB_OBJS += parse-options.o |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 1093 | LIB_OBJS += patch-delta.o |
| 1094 | LIB_OBJS += patch-ids.o |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 1095 | LIB_OBJS += path.o |
Adam Spiers | 6f525e7 | 2013-01-06 16:58:08 +0000 | [diff] [blame] | 1096 | LIB_OBJS += pathspec.o |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 1097 | LIB_OBJS += pkt-line.o |
Stephan Beyer | fcb6c07 | 2009-02-09 23:00:45 +0100 | [diff] [blame] | 1098 | LIB_OBJS += preload-index.o |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 1099 | LIB_OBJS += pretty.o |
Junio C Hamano | b4b594a | 2013-06-06 19:13:50 -0700 | [diff] [blame] | 1100 | LIB_OBJS += prio-queue.o |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 1101 | LIB_OBJS += progress.o |
Christian Couder | 48de315 | 2019-06-25 15:40:27 +0200 | [diff] [blame] | 1102 | LIB_OBJS += promisor-remote.o |
Jeff King | d3c58b8 | 2011-12-10 05:40:54 -0500 | [diff] [blame] | 1103 | LIB_OBJS += prompt.o |
Brandon Williams | 373d70e | 2017-10-16 10:55:24 -0700 | [diff] [blame] | 1104 | LIB_OBJS += protocol.o |
Bruno Albuquerque | a2ba162 | 2021-04-20 16:38:31 -0700 | [diff] [blame] | 1105 | LIB_OBJS += protocol-caps.o |
Denton Liu | 9460fd4 | 2020-03-23 21:07:52 -0400 | [diff] [blame] | 1106 | LIB_OBJS += prune-packed.o |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 1107 | LIB_OBJS += quote.o |
Johannes Schindelin | d9c66f0 | 2018-08-13 04:33:04 -0700 | [diff] [blame] | 1108 | LIB_OBJS += range-diff.o |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 1109 | LIB_OBJS += reachable.o |
| 1110 | LIB_OBJS += read-cache.o |
Alban Gruin | 145e05a | 2018-08-10 18:51:29 +0200 | [diff] [blame] | 1111 | LIB_OBJS += rebase-interactive.o |
Denton Liu | 805d9ea | 2020-03-21 05:21:20 -0400 | [diff] [blame] | 1112 | LIB_OBJS += rebase.o |
| 1113 | LIB_OBJS += ref-filter.o |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 1114 | LIB_OBJS += reflog-walk.o |
John Cai | 7d3d226 | 2022-03-02 22:27:23 +0000 | [diff] [blame] | 1115 | LIB_OBJS += reflog.o |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 1116 | LIB_OBJS += refs.o |
Han-Wen Nienhuys | 4441f42 | 2020-09-09 10:15:08 +0000 | [diff] [blame] | 1117 | LIB_OBJS += refs/debug.o |
Michael Haggerty | 7bd9bcf | 2015-11-09 14:34:01 +0100 | [diff] [blame] | 1118 | LIB_OBJS += refs/files-backend.o |
Patrick Steinhardt | 57db2a0 | 2024-02-07 08:20:31 +0100 | [diff] [blame] | 1119 | LIB_OBJS += refs/reftable-backend.o |
Michael Haggerty | 3bc581b | 2016-06-18 06:15:15 +0200 | [diff] [blame] | 1120 | LIB_OBJS += refs/iterator.o |
Michael Haggerty | 67be7c5 | 2017-06-23 09:01:37 +0200 | [diff] [blame] | 1121 | LIB_OBJS += refs/packed-backend.o |
Michael Haggerty | 958f964 | 2017-04-16 08:41:31 +0200 | [diff] [blame] | 1122 | LIB_OBJS += refs/ref-cache.o |
Brandon Williams | ec0cb49 | 2018-05-16 15:57:48 -0700 | [diff] [blame] | 1123 | LIB_OBJS += refspec.o |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 1124 | LIB_OBJS += remote.o |
Stefan Beller | 11bc058 | 2018-04-10 14:26:21 -0700 | [diff] [blame] | 1125 | LIB_OBJS += replace-object.o |
Derrick Stolee | 7211b9e | 2019-08-13 11:37:43 -0700 | [diff] [blame] | 1126 | LIB_OBJS += repo-settings.o |
Brandon Williams | 359efef | 2017-06-22 11:43:32 -0700 | [diff] [blame] | 1127 | LIB_OBJS += repository.o |
Stephan Beyer | 5b2fd95 | 2008-07-09 14:58:57 +0200 | [diff] [blame] | 1128 | LIB_OBJS += rerere.o |
Denton Liu | b309a97 | 2020-04-07 10:28:00 -0400 | [diff] [blame] | 1129 | LIB_OBJS += reset.o |
Junio C Hamano | cfc5789 | 2009-12-25 00:30:51 -0800 | [diff] [blame] | 1130 | LIB_OBJS += resolve-undo.o |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 1131 | LIB_OBJS += revision.o |
| 1132 | LIB_OBJS += run-command.o |
Nguyễn Thái Ngọc Duy | f5d942e | 2012-10-26 22:53:53 +0700 | [diff] [blame] | 1133 | LIB_OBJS += send-pack.o |
Nguyễn Thái Ngọc Duy | 8275905 | 2012-05-04 20:52:36 +0700 | [diff] [blame] | 1134 | LIB_OBJS += sequencer.o |
Brandon Williams | ed10cb9 | 2018-03-15 10:31:19 -0700 | [diff] [blame] | 1135 | LIB_OBJS += serve.o |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 1136 | LIB_OBJS += server-info.o |
| 1137 | LIB_OBJS += setup.o |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 1138 | LIB_OBJS += shallow.o |
| 1139 | LIB_OBJS += sideband.o |
Jeff King | 4a16d07 | 2009-01-22 01:02:35 -0500 | [diff] [blame] | 1140 | LIB_OBJS += sigchain.o |
Derrick Stolee | 3964fc2 | 2021-03-30 13:10:47 +0000 | [diff] [blame] | 1141 | LIB_OBJS += sparse-index.o |
Nguyễn Thái Ngọc Duy | 5fc2fc8 | 2014-06-13 19:19:36 +0700 | [diff] [blame] | 1142 | LIB_OBJS += split-index.o |
Johannes Schindelin | 97fff61 | 2019-09-30 10:21:54 -0700 | [diff] [blame] | 1143 | LIB_OBJS += stable-qsort.o |
Elijah Newren | 90cbae9 | 2023-05-16 06:33:48 +0000 | [diff] [blame] | 1144 | LIB_OBJS += statinfo.o |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 1145 | LIB_OBJS += strbuf.o |
Junio C Hamano | 46bf043 | 2011-05-11 19:30:25 -0700 | [diff] [blame] | 1146 | LIB_OBJS += streaming.o |
Stephan Beyer | fcb6c07 | 2009-02-09 23:00:45 +0100 | [diff] [blame] | 1147 | LIB_OBJS += string-list.o |
Elijah Newren | ae20bf1 | 2020-11-02 18:55:06 +0000 | [diff] [blame] | 1148 | LIB_OBJS += strmap.o |
Denton Liu | 8474f26 | 2020-10-08 00:39:26 -0700 | [diff] [blame] | 1149 | LIB_OBJS += strvec.o |
Ben Peart | 99605d6 | 2017-05-05 11:28:01 -0400 | [diff] [blame] | 1150 | LIB_OBJS += sub-process.o |
Denton Liu | 805d9ea | 2020-03-21 05:21:20 -0400 | [diff] [blame] | 1151 | LIB_OBJS += submodule-config.o |
| 1152 | LIB_OBJS += submodule.o |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 1153 | LIB_OBJS += symlinks.o |
| 1154 | LIB_OBJS += tag.o |
Michael Haggerty | 1a9d15d | 2015-08-10 11:47:41 +0200 | [diff] [blame] | 1155 | LIB_OBJS += tempfile.o |
Nguyễn Thái Ngọc Duy | 0ec7935 | 2018-10-27 19:29:59 +0200 | [diff] [blame] | 1156 | LIB_OBJS += thread-utils.o |
Jeff King | 2564d99 | 2016-10-03 16:49:11 -0400 | [diff] [blame] | 1157 | LIB_OBJS += tmp-objdir.o |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 1158 | LIB_OBJS += trace.o |
Jeff Hostetler | ee4512e | 2019-02-22 14:25:01 -0800 | [diff] [blame] | 1159 | LIB_OBJS += trace2.o |
| 1160 | LIB_OBJS += trace2/tr2_cfg.o |
| 1161 | LIB_OBJS += trace2/tr2_cmd_name.o |
Jeff Hostetler | 8107162 | 2022-10-24 13:41:07 +0000 | [diff] [blame] | 1162 | LIB_OBJS += trace2/tr2_ctr.o |
Jeff Hostetler | ee4512e | 2019-02-22 14:25:01 -0800 | [diff] [blame] | 1163 | LIB_OBJS += trace2/tr2_dst.o |
| 1164 | LIB_OBJS += trace2/tr2_sid.o |
Jeff Hostetler | bce9db6 | 2019-04-15 13:39:47 -0700 | [diff] [blame] | 1165 | LIB_OBJS += trace2/tr2_sysenv.o |
Jeff Hostetler | ee4512e | 2019-02-22 14:25:01 -0800 | [diff] [blame] | 1166 | LIB_OBJS += trace2/tr2_tbuf.o |
| 1167 | LIB_OBJS += trace2/tr2_tgt_event.o |
| 1168 | LIB_OBJS += trace2/tr2_tgt_normal.o |
| 1169 | LIB_OBJS += trace2/tr2_tgt_perf.o |
| 1170 | LIB_OBJS += trace2/tr2_tls.o |
Jeff Hostetler | 8ad5756 | 2022-10-24 13:41:06 +0000 | [diff] [blame] | 1171 | LIB_OBJS += trace2/tr2_tmr.o |
Christian Couder | 9385b5d | 2014-10-13 20:16:23 +0200 | [diff] [blame] | 1172 | LIB_OBJS += trailer.o |
Daniel Barkalow | 6eb996b | 2009-08-05 01:01:53 -0400 | [diff] [blame] | 1173 | LIB_OBJS += transport-helper.o |
Denton Liu | 805d9ea | 2020-03-21 05:21:20 -0400 | [diff] [blame] | 1174 | LIB_OBJS += transport.o |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 1175 | LIB_OBJS += tree-diff.o |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 1176 | LIB_OBJS += tree-walk.o |
Denton Liu | 805d9ea | 2020-03-21 05:21:20 -0400 | [diff] [blame] | 1177 | LIB_OBJS += tree.o |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 1178 | LIB_OBJS += unpack-trees.o |
Brandon Williams | a3d6b53 | 2018-03-14 11:31:41 -0700 | [diff] [blame] | 1179 | LIB_OBJS += upload-pack.o |
Jeff King | 638794c | 2010-05-23 05:17:55 -0400 | [diff] [blame] | 1180 | LIB_OBJS += url.o |
Kyle J. McKay | 6a56993 | 2013-08-05 13:20:36 -0700 | [diff] [blame] | 1181 | LIB_OBJS += urlmatch.o |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 1182 | LIB_OBJS += usage.o |
Stephan Beyer | fcb6c07 | 2009-02-09 23:00:45 +0100 | [diff] [blame] | 1183 | LIB_OBJS += userdiff.o |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 1184 | LIB_OBJS += utf8.o |
Junio C Hamano | d2c1898 | 2012-04-03 15:53:08 -0700 | [diff] [blame] | 1185 | LIB_OBJS += varint.o |
Jeff King | 816fb46 | 2012-06-02 14:51:42 -0400 | [diff] [blame] | 1186 | LIB_OBJS += version.o |
Nguyễn Thái Ngọc Duy | 9ef176b | 2014-02-27 19:56:52 +0700 | [diff] [blame] | 1187 | LIB_OBJS += versioncmp.o |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 1188 | LIB_OBJS += walker.o |
Nguyễn Thái Ngọc Duy | feabcc1 | 2012-10-15 13:25:55 +0700 | [diff] [blame] | 1189 | LIB_OBJS += wildmatch.o |
Michael Rappazzo | ac6c561 | 2015-10-02 07:55:31 -0400 | [diff] [blame] | 1190 | LIB_OBJS += worktree.o |
Linus Torvalds | 112db55 | 2008-06-22 12:19:25 -0700 | [diff] [blame] | 1191 | LIB_OBJS += wrapper.o |
Stefan Beller | fa2656f | 2018-04-10 14:26:16 -0700 | [diff] [blame] | 1192 | LIB_OBJS += write-or-die.o |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 1193 | LIB_OBJS += ws.o |
| 1194 | LIB_OBJS += wt-status.o |
| 1195 | LIB_OBJS += xdiff-interface.o |
Josef Weidendorfer | b1bf95b | 2005-07-31 21:17:43 +0200 | [diff] [blame] | 1196 | |
Linus Torvalds | 81b50f3 | 2010-02-22 08:42:18 -0800 | [diff] [blame] | 1197 | BUILTIN_OBJS += builtin/add.o |
Paul Tan | 73c2779 | 2015-08-04 21:51:24 +0800 | [diff] [blame] | 1198 | BUILTIN_OBJS += builtin/am.o |
Linus Torvalds | 81b50f3 | 2010-02-22 08:42:18 -0800 | [diff] [blame] | 1199 | BUILTIN_OBJS += builtin/annotate.o |
| 1200 | BUILTIN_OBJS += builtin/apply.o |
| 1201 | BUILTIN_OBJS += builtin/archive.o |
Johannes Schindelin | 73fce29 | 2022-11-10 23:36:46 +0700 | [diff] [blame] | 1202 | BUILTIN_OBJS += builtin/bisect.o |
Linus Torvalds | 81b50f3 | 2010-02-22 08:42:18 -0800 | [diff] [blame] | 1203 | BUILTIN_OBJS += builtin/blame.o |
| 1204 | BUILTIN_OBJS += builtin/branch.o |
Jeff King | d7a5649 | 2020-08-13 10:59:36 -0400 | [diff] [blame] | 1205 | BUILTIN_OBJS += builtin/bugreport.o |
Linus Torvalds | 81b50f3 | 2010-02-22 08:42:18 -0800 | [diff] [blame] | 1206 | BUILTIN_OBJS += builtin/bundle.o |
| 1207 | BUILTIN_OBJS += builtin/cat-file.o |
| 1208 | BUILTIN_OBJS += builtin/check-attr.o |
Adam Spiers | 368aa52 | 2013-01-06 16:58:13 +0000 | [diff] [blame] | 1209 | BUILTIN_OBJS += builtin/check-ignore.o |
Eric Sunshine | 226ad34 | 2013-07-12 20:53:10 -0400 | [diff] [blame] | 1210 | BUILTIN_OBJS += builtin/check-mailmap.o |
Linus Torvalds | 81b50f3 | 2010-02-22 08:42:18 -0800 | [diff] [blame] | 1211 | BUILTIN_OBJS += builtin/check-ref-format.o |
Matheus Tavares | e9e8adf | 2021-04-18 21:14:54 -0300 | [diff] [blame] | 1212 | BUILTIN_OBJS += builtin/checkout--worker.o |
Linus Torvalds | 81b50f3 | 2010-02-22 08:42:18 -0800 | [diff] [blame] | 1213 | BUILTIN_OBJS += builtin/checkout-index.o |
| 1214 | BUILTIN_OBJS += builtin/checkout.o |
| 1215 | BUILTIN_OBJS += builtin/clean.o |
| 1216 | BUILTIN_OBJS += builtin/clone.o |
Nguyễn Thái Ngọc Duy | 7e29b82 | 2012-04-21 11:44:32 +0700 | [diff] [blame] | 1217 | BUILTIN_OBJS += builtin/column.o |
Denton Liu | 805d9ea | 2020-03-21 05:21:20 -0400 | [diff] [blame] | 1218 | BUILTIN_OBJS += builtin/commit-graph.o |
Linus Torvalds | 81b50f3 | 2010-02-22 08:42:18 -0800 | [diff] [blame] | 1219 | BUILTIN_OBJS += builtin/commit-tree.o |
| 1220 | BUILTIN_OBJS += builtin/commit.o |
| 1221 | BUILTIN_OBJS += builtin/config.o |
| 1222 | BUILTIN_OBJS += builtin/count-objects.o |
Denton Liu | 8474f26 | 2020-10-08 00:39:26 -0700 | [diff] [blame] | 1223 | BUILTIN_OBJS += builtin/credential-cache--daemon.o |
| 1224 | BUILTIN_OBJS += builtin/credential-cache.o |
| 1225 | BUILTIN_OBJS += builtin/credential-store.o |
Javier Roucher Iglesias | e30b2fe | 2012-06-24 13:39:59 +0200 | [diff] [blame] | 1226 | BUILTIN_OBJS += builtin/credential.o |
Linus Torvalds | 81b50f3 | 2010-02-22 08:42:18 -0800 | [diff] [blame] | 1227 | BUILTIN_OBJS += builtin/describe.o |
Victoria Dye | 6783fd3 | 2022-08-12 20:10:15 +0000 | [diff] [blame] | 1228 | BUILTIN_OBJS += builtin/diagnose.o |
Linus Torvalds | 81b50f3 | 2010-02-22 08:42:18 -0800 | [diff] [blame] | 1229 | BUILTIN_OBJS += builtin/diff-files.o |
| 1230 | BUILTIN_OBJS += builtin/diff-index.o |
| 1231 | BUILTIN_OBJS += builtin/diff-tree.o |
| 1232 | BUILTIN_OBJS += builtin/diff.o |
Johannes Schindelin | be8a90e | 2017-01-17 16:54:57 +0100 | [diff] [blame] | 1233 | BUILTIN_OBJS += builtin/difftool.o |
Linus Torvalds | 81b50f3 | 2010-02-22 08:42:18 -0800 | [diff] [blame] | 1234 | BUILTIN_OBJS += builtin/fast-export.o |
Jeff King | a006f87 | 2020-08-13 10:59:45 -0400 | [diff] [blame] | 1235 | BUILTIN_OBJS += builtin/fast-import.o |
Linus Torvalds | 81b50f3 | 2010-02-22 08:42:18 -0800 | [diff] [blame] | 1236 | BUILTIN_OBJS += builtin/fetch-pack.o |
| 1237 | BUILTIN_OBJS += builtin/fetch.o |
| 1238 | BUILTIN_OBJS += builtin/fmt-merge-msg.o |
| 1239 | BUILTIN_OBJS += builtin/for-each-ref.o |
Derrick Stolee | 4950b2a | 2020-09-11 17:49:16 +0000 | [diff] [blame] | 1240 | BUILTIN_OBJS += builtin/for-each-repo.o |
Linus Torvalds | 81b50f3 | 2010-02-22 08:42:18 -0800 | [diff] [blame] | 1241 | BUILTIN_OBJS += builtin/fsck.o |
Jeff Hostetler | 16d9d61 | 2022-03-25 18:02:49 +0000 | [diff] [blame] | 1242 | BUILTIN_OBJS += builtin/fsmonitor--daemon.o |
Linus Torvalds | 81b50f3 | 2010-02-22 08:42:18 -0800 | [diff] [blame] | 1243 | BUILTIN_OBJS += builtin/gc.o |
Jonathan Nieder | bb5d531 | 2013-12-02 15:37:10 -0800 | [diff] [blame] | 1244 | BUILTIN_OBJS += builtin/get-tar-commit-id.o |
Linus Torvalds | 81b50f3 | 2010-02-22 08:42:18 -0800 | [diff] [blame] | 1245 | BUILTIN_OBJS += builtin/grep.o |
| 1246 | BUILTIN_OBJS += builtin/hash-object.o |
| 1247 | BUILTIN_OBJS += builtin/help.o |
Emily Shaffer | 96e7225 | 2021-12-22 04:59:27 +0100 | [diff] [blame] | 1248 | BUILTIN_OBJS += builtin/hook.o |
Linus Torvalds | 81b50f3 | 2010-02-22 08:42:18 -0800 | [diff] [blame] | 1249 | BUILTIN_OBJS += builtin/index-pack.o |
| 1250 | BUILTIN_OBJS += builtin/init-db.o |
Christian Couder | 6634f05 | 2014-10-13 20:16:29 +0200 | [diff] [blame] | 1251 | BUILTIN_OBJS += builtin/interpret-trailers.o |
Linus Torvalds | 81b50f3 | 2010-02-22 08:42:18 -0800 | [diff] [blame] | 1252 | BUILTIN_OBJS += builtin/log.o |
| 1253 | BUILTIN_OBJS += builtin/ls-files.o |
| 1254 | BUILTIN_OBJS += builtin/ls-remote.o |
| 1255 | BUILTIN_OBJS += builtin/ls-tree.o |
| 1256 | BUILTIN_OBJS += builtin/mailinfo.o |
| 1257 | BUILTIN_OBJS += builtin/mailsplit.o |
Linus Torvalds | 81b50f3 | 2010-02-22 08:42:18 -0800 | [diff] [blame] | 1258 | BUILTIN_OBJS += builtin/merge-base.o |
| 1259 | BUILTIN_OBJS += builtin/merge-file.o |
| 1260 | BUILTIN_OBJS += builtin/merge-index.o |
| 1261 | BUILTIN_OBJS += builtin/merge-ours.o |
| 1262 | BUILTIN_OBJS += builtin/merge-recursive.o |
| 1263 | BUILTIN_OBJS += builtin/merge-tree.o |
Denton Liu | 805d9ea | 2020-03-21 05:21:20 -0400 | [diff] [blame] | 1264 | BUILTIN_OBJS += builtin/merge.o |
Linus Torvalds | 81b50f3 | 2010-02-22 08:42:18 -0800 | [diff] [blame] | 1265 | BUILTIN_OBJS += builtin/mktag.o |
| 1266 | BUILTIN_OBJS += builtin/mktree.o |
Derrick Stolee | 6a257f0 | 2018-07-12 15:39:20 -0400 | [diff] [blame] | 1267 | BUILTIN_OBJS += builtin/multi-pack-index.o |
Linus Torvalds | 81b50f3 | 2010-02-22 08:42:18 -0800 | [diff] [blame] | 1268 | BUILTIN_OBJS += builtin/mv.o |
| 1269 | BUILTIN_OBJS += builtin/name-rev.o |
Junio C Hamano | 2949151 | 2010-03-15 00:52:06 -0700 | [diff] [blame] | 1270 | BUILTIN_OBJS += builtin/notes.o |
Linus Torvalds | 81b50f3 | 2010-02-22 08:42:18 -0800 | [diff] [blame] | 1271 | BUILTIN_OBJS += builtin/pack-objects.o |
| 1272 | BUILTIN_OBJS += builtin/pack-redundant.o |
| 1273 | BUILTIN_OBJS += builtin/pack-refs.o |
| 1274 | BUILTIN_OBJS += builtin/patch-id.o |
| 1275 | BUILTIN_OBJS += builtin/prune-packed.o |
| 1276 | BUILTIN_OBJS += builtin/prune.o |
Paul Tan | 1e1ea69 | 2015-06-14 16:41:51 +0800 | [diff] [blame] | 1277 | BUILTIN_OBJS += builtin/pull.o |
Linus Torvalds | 81b50f3 | 2010-02-22 08:42:18 -0800 | [diff] [blame] | 1278 | BUILTIN_OBJS += builtin/push.o |
Johannes Schindelin | 348ae56 | 2018-08-13 04:33:02 -0700 | [diff] [blame] | 1279 | BUILTIN_OBJS += builtin/range-diff.o |
Linus Torvalds | 81b50f3 | 2010-02-22 08:42:18 -0800 | [diff] [blame] | 1280 | BUILTIN_OBJS += builtin/read-tree.o |
Pratik Karki | 55071ea | 2018-08-07 01:16:09 +0545 | [diff] [blame] | 1281 | BUILTIN_OBJS += builtin/rebase.o |
Linus Torvalds | 81b50f3 | 2010-02-22 08:42:18 -0800 | [diff] [blame] | 1282 | BUILTIN_OBJS += builtin/receive-pack.o |
| 1283 | BUILTIN_OBJS += builtin/reflog.o |
Patrick Steinhardt | 25a0023 | 2024-06-06 07:29:49 +0200 | [diff] [blame] | 1284 | BUILTIN_OBJS += builtin/refs.o |
Ilari Liusvaara | 7f3eceb | 2010-10-12 19:39:43 +0300 | [diff] [blame] | 1285 | BUILTIN_OBJS += builtin/remote-ext.o |
Ilari Liusvaara | 3a9ed4b | 2010-10-12 19:39:42 +0300 | [diff] [blame] | 1286 | BUILTIN_OBJS += builtin/remote-fd.o |
Denton Liu | 805d9ea | 2020-03-21 05:21:20 -0400 | [diff] [blame] | 1287 | BUILTIN_OBJS += builtin/remote.o |
Stefan Beller | a1bbc6c | 2013-09-15 17:33:20 +0200 | [diff] [blame] | 1288 | BUILTIN_OBJS += builtin/repack.o |
Linus Torvalds | 81b50f3 | 2010-02-22 08:42:18 -0800 | [diff] [blame] | 1289 | BUILTIN_OBJS += builtin/replace.o |
Elijah Newren | f920b02 | 2023-11-24 12:10:31 +0100 | [diff] [blame] | 1290 | BUILTIN_OBJS += builtin/replay.o |
Linus Torvalds | 81b50f3 | 2010-02-22 08:42:18 -0800 | [diff] [blame] | 1291 | BUILTIN_OBJS += builtin/rerere.o |
| 1292 | BUILTIN_OBJS += builtin/reset.o |
| 1293 | BUILTIN_OBJS += builtin/rev-list.o |
| 1294 | BUILTIN_OBJS += builtin/rev-parse.o |
| 1295 | BUILTIN_OBJS += builtin/revert.o |
| 1296 | BUILTIN_OBJS += builtin/rm.o |
| 1297 | BUILTIN_OBJS += builtin/send-pack.o |
| 1298 | BUILTIN_OBJS += builtin/shortlog.o |
| 1299 | BUILTIN_OBJS += builtin/show-branch.o |
Jeff King | ff41726 | 2018-05-28 05:38:53 -0400 | [diff] [blame] | 1300 | BUILTIN_OBJS += builtin/show-index.o |
Linus Torvalds | 81b50f3 | 2010-02-22 08:42:18 -0800 | [diff] [blame] | 1301 | BUILTIN_OBJS += builtin/show-ref.o |
Derrick Stolee | 94c0956 | 2019-11-21 22:04:33 +0000 | [diff] [blame] | 1302 | BUILTIN_OBJS += builtin/sparse-checkout.o |
Paul-Sebastian Ungureanu | 40af146 | 2019-02-25 23:16:28 +0000 | [diff] [blame] | 1303 | BUILTIN_OBJS += builtin/stash.o |
Linus Torvalds | 81b50f3 | 2010-02-22 08:42:18 -0800 | [diff] [blame] | 1304 | BUILTIN_OBJS += builtin/stripspace.o |
Stefan Beller | 74703a1 | 2015-09-02 14:42:24 -0700 | [diff] [blame] | 1305 | BUILTIN_OBJS += builtin/submodule--helper.o |
Linus Torvalds | 81b50f3 | 2010-02-22 08:42:18 -0800 | [diff] [blame] | 1306 | BUILTIN_OBJS += builtin/symbolic-ref.o |
| 1307 | BUILTIN_OBJS += builtin/tag.o |
Linus Torvalds | 81b50f3 | 2010-02-22 08:42:18 -0800 | [diff] [blame] | 1308 | BUILTIN_OBJS += builtin/unpack-file.o |
| 1309 | BUILTIN_OBJS += builtin/unpack-objects.o |
| 1310 | BUILTIN_OBJS += builtin/update-index.o |
| 1311 | BUILTIN_OBJS += builtin/update-ref.o |
| 1312 | BUILTIN_OBJS += builtin/update-server-info.o |
| 1313 | BUILTIN_OBJS += builtin/upload-archive.o |
Brandon Williams | a3d6b53 | 2018-03-14 11:31:41 -0700 | [diff] [blame] | 1314 | BUILTIN_OBJS += builtin/upload-pack.o |
Linus Torvalds | 81b50f3 | 2010-02-22 08:42:18 -0800 | [diff] [blame] | 1315 | BUILTIN_OBJS += builtin/var.o |
Michael J Gruber | d07b00b | 2014-06-23 09:05:49 +0200 | [diff] [blame] | 1316 | BUILTIN_OBJS += builtin/verify-commit.o |
Linus Torvalds | 81b50f3 | 2010-02-22 08:42:18 -0800 | [diff] [blame] | 1317 | BUILTIN_OBJS += builtin/verify-pack.o |
| 1318 | BUILTIN_OBJS += builtin/verify-tag.o |
Nguyễn Thái Ngọc Duy | df0b6cf | 2015-06-29 19:51:18 +0700 | [diff] [blame] | 1319 | BUILTIN_OBJS += builtin/worktree.o |
Linus Torvalds | 81b50f3 | 2010-02-22 08:42:18 -0800 | [diff] [blame] | 1320 | BUILTIN_OBJS += builtin/write-tree.o |
Linus Torvalds | 70827b1 | 2006-04-21 10:27:34 -0700 | [diff] [blame] | 1321 | |
Denton Liu | 5dedf7d | 2019-09-16 12:23:11 -0700 | [diff] [blame] | 1322 | # THIRD_PARTY_SOURCES is a list of patterns compatible with the |
| 1323 | # $(filter) and $(filter-out) family of functions. They specify source |
| 1324 | # files which are taken from some third-party source where we want to be |
| 1325 | # less strict about issues such as coding style so we don't diverge from |
| 1326 | # upstream unnecessarily (making merging in future changes easier). |
| 1327 | THIRD_PARTY_SOURCES += compat/inet_ntop.c |
| 1328 | THIRD_PARTY_SOURCES += compat/inet_pton.c |
| 1329 | THIRD_PARTY_SOURCES += compat/nedmalloc/% |
| 1330 | THIRD_PARTY_SOURCES += compat/obstack.% |
| 1331 | THIRD_PARTY_SOURCES += compat/poll/% |
| 1332 | THIRD_PARTY_SOURCES += compat/regex/% |
| 1333 | THIRD_PARTY_SOURCES += sha1collisiondetection/% |
| 1334 | THIRD_PARTY_SOURCES += sha1dc/% |
| 1335 | |
Achu Luma | e875d45 | 2024-01-12 11:27:43 +0100 | [diff] [blame] | 1336 | UNIT_TEST_PROGRAMS += t-ctype |
Junio C Hamano | 2a061a6 | 2024-06-12 13:37:18 -0700 | [diff] [blame] | 1337 | UNIT_TEST_PROGRAMS += t-example-decorate |
Ghanshyam Thakkar | 2794932 | 2024-05-29 13:30:30 +0530 | [diff] [blame] | 1338 | UNIT_TEST_PROGRAMS += t-hash |
Linus Arver | 704b590 | 2024-05-02 04:54:18 +0000 | [diff] [blame] | 1339 | UNIT_TEST_PROGRAMS += t-mem-pool |
Chandra Pratap | 808b77e | 2024-01-21 19:28:45 +0000 | [diff] [blame] | 1340 | UNIT_TEST_PROGRAMS += t-prio-queue |
Chandra Pratap | b34116a | 2024-05-29 22:29:27 +0530 | [diff] [blame] | 1341 | UNIT_TEST_PROGRAMS += t-reftable-basics |
Linus Arver | 704b590 | 2024-05-02 04:54:18 +0000 | [diff] [blame] | 1342 | UNIT_TEST_PROGRAMS += t-strbuf |
Ghanshyam Thakkar | 4d00d94 | 2024-05-20 02:14:42 +0530 | [diff] [blame] | 1343 | UNIT_TEST_PROGRAMS += t-strcmp-offset |
Junio C Hamano | cf79265 | 2024-06-06 12:49:23 -0700 | [diff] [blame] | 1344 | UNIT_TEST_PROGRAMS += t-strvec |
Linus Arver | 56b0488 | 2024-05-02 04:54:19 +0000 | [diff] [blame] | 1345 | UNIT_TEST_PROGRAMS += t-trailer |
Phillip Wood | e137fe3 | 2023-11-09 10:50:43 -0800 | [diff] [blame] | 1346 | UNIT_TEST_PROGS = $(patsubst %,$(UNIT_TEST_BIN)/%$X,$(UNIT_TEST_PROGRAMS)) |
| 1347 | UNIT_TEST_OBJS = $(patsubst %,$(UNIT_TEST_DIR)/%.o,$(UNIT_TEST_PROGRAMS)) |
| 1348 | UNIT_TEST_OBJS += $(UNIT_TEST_DIR)/test-lib.o |
| 1349 | |
Ævar Arnfjörð Bjarmason | 0756477 | 2022-01-24 10:27:59 -0800 | [diff] [blame] | 1350 | # xdiff and reftable libs may in turn depend on what is in libgit.a |
| 1351 | GITLIBS = common-main.o $(LIB_FILE) $(XDIFF_LIB) $(REFTABLE_LIB) $(LIB_FILE) |
Robert Schiele | bef19da | 2007-07-29 20:35:45 +0200 | [diff] [blame] | 1352 | EXTLIBS = |
Linus Torvalds | cef661f | 2005-04-21 12:33:22 -0700 | [diff] [blame] | 1353 | |
Jeff King | 42dcbb7 | 2012-06-02 15:01:12 -0400 | [diff] [blame] | 1354 | GIT_USER_AGENT = git/$(GIT_VERSION) |
| 1355 | |
Junio C Hamano | cac87dc | 2017-07-01 22:05:47 +0000 | [diff] [blame] | 1356 | ifeq ($(wildcard sha1collisiondetection/lib/sha1.h),sha1collisiondetection/lib/sha1.h) |
| 1357 | DC_SHA1_SUBMODULE = auto |
| 1358 | endif |
| 1359 | |
Ævar Arnfjörð Bjarmason | 71a7894 | 2019-02-22 15:41:26 +0100 | [diff] [blame] | 1360 | # Set CFLAGS, LDFLAGS and other *FLAGS variables. These might be |
| 1361 | # tweaked by config.* below as well as the command-line, both of |
| 1362 | # which'll override these defaults. |
Junio C Hamano | 44ba10d | 2021-11-14 22:27:45 -0800 | [diff] [blame] | 1363 | # Older versions of GCC may require adding "-std=gnu99" at the end. |
Ævar Arnfjörð Bjarmason | 71a7894 | 2019-02-22 15:41:26 +0100 | [diff] [blame] | 1364 | CFLAGS = -g -O2 -Wall |
| 1365 | LDFLAGS = |
Ævar Arnfjörð Bjarmason | 0f50c8e | 2019-05-17 23:58:47 +0200 | [diff] [blame] | 1366 | CC_LD_DYNPATH = -Wl,-rpath, |
Ævar Arnfjörð Bjarmason | 71a7894 | 2019-02-22 15:41:26 +0100 | [diff] [blame] | 1367 | BASIC_CFLAGS = -I. |
| 1368 | BASIC_LDFLAGS = |
| 1369 | |
| 1370 | # library flags |
| 1371 | ARFLAGS = rcs |
| 1372 | PTHREAD_CFLAGS = |
| 1373 | |
| 1374 | # For the 'sparse' target |
brian m. carlson | 7bc341e | 2021-12-01 01:40:50 +0000 | [diff] [blame] | 1375 | SPARSE_FLAGS ?= -std=gnu99 |
Luc Van Oostenryck | 1c966423 | 2020-05-22 02:25:02 +0200 | [diff] [blame] | 1376 | SP_EXTRA_FLAGS = -Wno-universal-initializer |
Ævar Arnfjörð Bjarmason | 71a7894 | 2019-02-22 15:41:26 +0100 | [diff] [blame] | 1377 | |
Phillip Wood | 067109a | 2022-04-09 12:28:37 +0000 | [diff] [blame] | 1378 | # For informing GIT-BUILD-OPTIONS of the SANITIZE=leak,address targets |
Ævar Arnfjörð Bjarmason | 2cdc292 | 2021-09-23 11:20:45 +0200 | [diff] [blame] | 1379 | SANITIZE_LEAK = |
Phillip Wood | 067109a | 2022-04-09 12:28:37 +0000 | [diff] [blame] | 1380 | SANITIZE_ADDRESS = |
Ævar Arnfjörð Bjarmason | 2cdc292 | 2021-09-23 11:20:45 +0200 | [diff] [blame] | 1381 | |
Ævar Arnfjörð Bjarmason | 49f54c4 | 2022-11-01 23:35:47 +0100 | [diff] [blame] | 1382 | # For the 'coccicheck' target |
Ævar Arnfjörð Bjarmason | 60cfad9 | 2022-11-01 23:35:49 +0100 | [diff] [blame] | 1383 | SPATCH_INCLUDE_FLAGS = --all-includes |
| 1384 | SPATCH_FLAGS = |
Ævar Arnfjörð Bjarmason | b75f270 | 2022-11-01 23:35:48 +0100 | [diff] [blame] | 1385 | SPATCH_TEST_FLAGS = |
Ævar Arnfjörð Bjarmason | 71a7894 | 2019-02-22 15:41:26 +0100 | [diff] [blame] | 1386 | |
Ævar Arnfjörð Bjarmason | 316e388 | 2022-11-01 23:35:51 +0100 | [diff] [blame] | 1387 | # If *.o files are present, have "coccicheck" depend on them, with |
| 1388 | # COMPUTE_HEADER_DEPENDENCIES this will speed up the common-case of |
| 1389 | # only needing to re-generate coccicheck results for the users of a |
| 1390 | # given API if it's changed, and not all files in the project. If |
| 1391 | # COMPUTE_HEADER_DEPENDENCIES=no this will be unset too. |
| 1392 | SPATCH_USE_O_DEPENDENCIES = YesPlease |
| 1393 | |
Ævar Arnfjörð Bjarmason | d0e624a | 2022-11-01 23:35:54 +0100 | [diff] [blame] | 1394 | # Set SPATCH_CONCAT_COCCI to concatenate the contrib/cocci/*.cocci |
| 1395 | # files into a single contrib/cocci/ALL.cocci before running |
| 1396 | # "coccicheck". |
| 1397 | # |
| 1398 | # Pros: |
| 1399 | # |
| 1400 | # - Speeds up a one-shot run of "make coccicheck", as we won't have to |
| 1401 | # parse *.[ch] files N times for the N *.cocci rules |
| 1402 | # |
| 1403 | # Cons: |
| 1404 | # |
| 1405 | # - Will make incremental development of *.cocci slower, as |
| 1406 | # e.g. changing strbuf.cocci will re-run all *.cocci. |
| 1407 | # |
| 1408 | # - Makes error and performance analysis harder, as rules will be |
| 1409 | # applied from a monolithic ALL.cocci, rather than |
| 1410 | # e.g. strbuf.cocci. To work around this either undefine this, or |
| 1411 | # generate a specific patch, e.g. this will always use strbuf.cocci, |
| 1412 | # not ALL.cocci: |
| 1413 | # |
| 1414 | # make contrib/coccinelle/strbuf.cocci.patch |
| 1415 | SPATCH_CONCAT_COCCI = YesPlease |
| 1416 | |
Ævar Arnfjörð Bjarmason | 09d9a69 | 2022-11-01 23:35:46 +0100 | [diff] [blame] | 1417 | # Rebuild 'coccicheck' if $(SPATCH), its flags etc. change |
| 1418 | TRACK_SPATCH_DEFINES = |
| 1419 | TRACK_SPATCH_DEFINES += $(SPATCH) |
Ævar Arnfjörð Bjarmason | 60cfad9 | 2022-11-01 23:35:49 +0100 | [diff] [blame] | 1420 | TRACK_SPATCH_DEFINES += $(SPATCH_INCLUDE_FLAGS) |
Ævar Arnfjörð Bjarmason | 09d9a69 | 2022-11-01 23:35:46 +0100 | [diff] [blame] | 1421 | TRACK_SPATCH_DEFINES += $(SPATCH_FLAGS) |
Ævar Arnfjörð Bjarmason | b75f270 | 2022-11-01 23:35:48 +0100 | [diff] [blame] | 1422 | TRACK_SPATCH_DEFINES += $(SPATCH_TEST_FLAGS) |
Ævar Arnfjörð Bjarmason | 09d9a69 | 2022-11-01 23:35:46 +0100 | [diff] [blame] | 1423 | GIT-SPATCH-DEFINES: FORCE |
| 1424 | @FLAGS='$(TRACK_SPATCH_DEFINES)'; \ |
| 1425 | if test x"$$FLAGS" != x"`cat GIT-SPATCH-DEFINES 2>/dev/null`" ; then \ |
| 1426 | echo >&2 " * new spatch flags"; \ |
| 1427 | echo "$$FLAGS" >GIT-SPATCH-DEFINES; \ |
| 1428 | fi |
Linus Torvalds | cef661f | 2005-04-21 12:33:22 -0700 | [diff] [blame] | 1429 | |
Jeff King | e1b6dbb | 2013-01-03 16:05:41 -0500 | [diff] [blame] | 1430 | include config.mak.uname |
Jakub Narebski | 5566771 | 2006-07-03 01:56:48 +0200 | [diff] [blame] | 1431 | -include config.mak.autogen |
Johannes Schindelin | f2d6a25 | 2005-10-11 15:22:47 -0700 | [diff] [blame] | 1432 | -include config.mak |
Junio C Hamano | 597c9cc | 2005-09-07 12:22:56 -0700 | [diff] [blame] | 1433 | |
Matthieu Moy | d615628 | 2016-05-31 15:24:43 +0200 | [diff] [blame] | 1434 | ifdef DEVELOPER |
Nguyễn Thái Ngọc Duy | 1da1580 | 2018-04-14 19:19:44 +0000 | [diff] [blame] | 1435 | include config.mak.dev |
Matthieu Moy | d615628 | 2016-05-31 15:24:43 +0200 | [diff] [blame] | 1436 | endif |
| 1437 | |
Johannes Schindelin | 4a5ec7d | 2021-01-21 13:09:45 +0000 | [diff] [blame] | 1438 | # what 'all' will build and 'install' will install in gitexecdir, |
| 1439 | # excluding programs for built-in commands |
| 1440 | ALL_PROGRAMS = $(PROGRAMS) $(SCRIPTS) |
| 1441 | ALL_COMMANDS_TO_INSTALL = $(ALL_PROGRAMS) |
| 1442 | ifeq (,$(SKIP_DASHED_BUILT_INS)) |
| 1443 | ALL_COMMANDS_TO_INSTALL += $(BUILT_INS) |
| 1444 | else |
| 1445 | # git-upload-pack, git-receive-pack and git-upload-archive are special: they |
| 1446 | # are _expected_ to be present in the `bin/` directory in their dashed form. |
| 1447 | ALL_COMMANDS_TO_INSTALL += git-receive-pack$(X) |
| 1448 | ALL_COMMANDS_TO_INSTALL += git-upload-archive$(X) |
| 1449 | ALL_COMMANDS_TO_INSTALL += git-upload-pack$(X) |
| 1450 | endif |
| 1451 | |
Ævar Arnfjörð Bjarmason | 6d5d4b4 | 2019-02-22 15:41:27 +0100 | [diff] [blame] | 1452 | ALL_CFLAGS = $(DEVELOPER_CFLAGS) $(CPPFLAGS) $(CFLAGS) |
Ævar Arnfjörð Bjarmason | 71a7894 | 2019-02-22 15:41:26 +0100 | [diff] [blame] | 1453 | ALL_LDFLAGS = $(LDFLAGS) |
| 1454 | |
Jeff King | 56b5db3 | 2017-07-10 09:24:42 -0400 | [diff] [blame] | 1455 | ifdef SANITIZE |
René Scharfe | 425ca67 | 2017-07-15 19:18:56 +0200 | [diff] [blame] | 1456 | SANITIZERS := $(foreach flag,$(subst $(comma),$(space),$(SANITIZE)),$(flag)) |
Jeff King | 56b5db3 | 2017-07-10 09:24:42 -0400 | [diff] [blame] | 1457 | BASIC_CFLAGS += -fsanitize=$(SANITIZE) -fno-sanitize-recover=$(SANITIZE) |
Jeff King | ddbc8a6 | 2017-07-10 09:24:47 -0400 | [diff] [blame] | 1458 | BASIC_CFLAGS += -fno-omit-frame-pointer |
René Scharfe | 425ca67 | 2017-07-15 19:18:56 +0200 | [diff] [blame] | 1459 | ifneq ($(filter undefined,$(SANITIZERS)),) |
Jeff King | 07a20f5 | 2019-03-12 17:06:26 -0400 | [diff] [blame] | 1460 | BASIC_CFLAGS += -DSHA1DC_FORCE_ALIGNED_ACCESS |
Jeff King | 566cf0b | 2017-07-10 09:24:50 -0400 | [diff] [blame] | 1461 | endif |
Jeff King | 0e5bba5 | 2017-09-08 02:38:41 -0400 | [diff] [blame] | 1462 | ifneq ($(filter leak,$(SANITIZERS)),) |
| 1463 | BASIC_CFLAGS += -DSUPPRESS_ANNOTATED_LEAKS |
Jeff King | d3775de | 2022-10-18 16:15:33 -0400 | [diff] [blame] | 1464 | BASIC_CFLAGS += -O0 |
Ævar Arnfjörð Bjarmason | 2cdc292 | 2021-09-23 11:20:45 +0200 | [diff] [blame] | 1465 | SANITIZE_LEAK = YesCompiledWithIt |
Jeff King | 0e5bba5 | 2017-09-08 02:38:41 -0400 | [diff] [blame] | 1466 | endif |
Jeff King | f65d07f | 2020-01-16 12:51:38 -0500 | [diff] [blame] | 1467 | ifneq ($(filter address,$(SANITIZERS)),) |
| 1468 | NO_REGEX = NeededForASAN |
Phillip Wood | 067109a | 2022-04-09 12:28:37 +0000 | [diff] [blame] | 1469 | SANITIZE_ADDRESS = YesCompiledWithIt |
Jeff King | f65d07f | 2020-01-16 12:51:38 -0500 | [diff] [blame] | 1470 | endif |
Jeff King | 56b5db3 | 2017-07-10 09:24:42 -0400 | [diff] [blame] | 1471 | endif |
| 1472 | |
Johannes Sixt | 9fb1e69 | 2011-05-09 10:24:55 +0200 | [diff] [blame] | 1473 | ifndef sysconfdir |
| 1474 | ifeq ($(prefix),/usr) |
| 1475 | sysconfdir = /etc |
| 1476 | else |
| 1477 | sysconfdir = etc |
| 1478 | endif |
| 1479 | endif |
| 1480 | |
Fredrik Kuivinen | 111ee18 | 2011-08-18 20:34:39 +0200 | [diff] [blame] | 1481 | ifndef COMPUTE_HEADER_DEPENDENCIES |
Jonathan Nieder | 024c843 | 2011-11-18 03:58:21 -0600 | [diff] [blame] | 1482 | COMPUTE_HEADER_DEPENDENCIES = auto |
| 1483 | endif |
| 1484 | |
| 1485 | ifeq ($(COMPUTE_HEADER_DEPENDENCIES),auto) |
David Aguilar | 1816bf2 | 2011-08-30 01:27:35 -0700 | [diff] [blame] | 1486 | dep_check = $(shell $(CC) $(ALL_CFLAGS) \ |
Ævar Arnfjörð Bjarmason | 731b685 | 2021-09-23 00:08:01 +0200 | [diff] [blame] | 1487 | -Wno-pedantic \ |
Jonathan Nieder | 6978934 | 2011-11-18 17:23:24 -0600 | [diff] [blame] | 1488 | -c -MF /dev/null -MQ /dev/null -MMD -MP \ |
| 1489 | -x c /dev/null -o /dev/null 2>&1; \ |
David Aguilar | 1816bf2 | 2011-08-30 01:27:35 -0700 | [diff] [blame] | 1490 | echo $$?) |
Fredrik Kuivinen | 111ee18 | 2011-08-18 20:34:39 +0200 | [diff] [blame] | 1491 | ifeq ($(dep_check),0) |
Jonathan Nieder | 024c843 | 2011-11-18 03:58:21 -0600 | [diff] [blame] | 1492 | override COMPUTE_HEADER_DEPENDENCIES = yes |
| 1493 | else |
| 1494 | override COMPUTE_HEADER_DEPENDENCIES = no |
Fredrik Kuivinen | 111ee18 | 2011-08-18 20:34:39 +0200 | [diff] [blame] | 1495 | endif |
Jonathan Nieder | f2fabbf | 2010-01-26 09:57:15 -0600 | [diff] [blame] | 1496 | endif |
| 1497 | |
Jonathan Nieder | 024c843 | 2011-11-18 03:58:21 -0600 | [diff] [blame] | 1498 | ifeq ($(COMPUTE_HEADER_DEPENDENCIES),yes) |
Jonathan Nieder | f2fabbf | 2010-01-26 09:57:15 -0600 | [diff] [blame] | 1499 | USE_COMPUTED_HEADER_DEPENDENCIES = YesPlease |
Jonathan Nieder | 024c843 | 2011-11-18 03:58:21 -0600 | [diff] [blame] | 1500 | else |
| 1501 | ifneq ($(COMPUTE_HEADER_DEPENDENCIES),no) |
| 1502 | $(error please set COMPUTE_HEADER_DEPENDENCIES to yes, no, or auto \ |
| 1503 | (not "$(COMPUTE_HEADER_DEPENDENCIES)")) |
| 1504 | endif |
Jonathan Nieder | f2fabbf | 2010-01-26 09:57:15 -0600 | [diff] [blame] | 1505 | endif |
| 1506 | |
Philippe Blain | 3821c38 | 2020-09-03 22:13:38 +0000 | [diff] [blame] | 1507 | ifndef GENERATE_COMPILATION_DATABASE |
| 1508 | GENERATE_COMPILATION_DATABASE = no |
| 1509 | endif |
| 1510 | |
| 1511 | ifeq ($(GENERATE_COMPILATION_DATABASE),yes) |
| 1512 | compdb_check = $(shell $(CC) $(ALL_CFLAGS) \ |
Ævar Arnfjörð Bjarmason | dd20e4a | 2021-09-23 00:08:02 +0200 | [diff] [blame] | 1513 | -Wno-pedantic \ |
Philippe Blain | 3821c38 | 2020-09-03 22:13:38 +0000 | [diff] [blame] | 1514 | -c -MJ /dev/null \ |
| 1515 | -x c /dev/null -o /dev/null 2>&1; \ |
| 1516 | echo $$?) |
| 1517 | ifneq ($(compdb_check),0) |
| 1518 | override GENERATE_COMPILATION_DATABASE = no |
| 1519 | $(warning GENERATE_COMPILATION_DATABASE is set to "yes", but your compiler does not \ |
| 1520 | support generating compilation database entries) |
| 1521 | endif |
| 1522 | else |
| 1523 | ifneq ($(GENERATE_COMPILATION_DATABASE),no) |
| 1524 | $(error please set GENERATE_COMPILATION_DATABASE to "yes" or "no" \ |
| 1525 | (not "$(GENERATE_COMPILATION_DATABASE)")) |
| 1526 | endif |
| 1527 | endif |
| 1528 | |
Junio C Hamano | 0e0aea5 | 2009-06-05 18:36:15 -0500 | [diff] [blame] | 1529 | ifdef SANE_TOOL_PATH |
Junio C Hamano | 61dbb3c | 2009-06-08 09:41:49 -0700 | [diff] [blame] | 1530 | SANE_TOOL_PATH_SQ = $(subst ','\'',$(SANE_TOOL_PATH)) |
Jeff Hostetler | c444bf8 | 2019-06-19 14:06:06 -0700 | [diff] [blame] | 1531 | 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] | 1532 | PATH := $(SANE_TOOL_PATH):${PATH} |
| 1533 | else |
Junio C Hamano | 61dbb3c | 2009-06-08 09:41:49 -0700 | [diff] [blame] | 1534 | BROKEN_PATH_FIX = '/^\# @@BROKEN_PATH_FIX@@$$/d' |
Junio C Hamano | 0e0aea5 | 2009-06-05 18:36:15 -0500 | [diff] [blame] | 1535 | endif |
| 1536 | |
Eric Sunshine | b228940 | 2017-12-15 00:34:34 +0100 | [diff] [blame] | 1537 | ifeq (,$(HOST_CPU)) |
| 1538 | BASIC_CFLAGS += -DGIT_HOST_CPU="\"$(firstword $(subst -, ,$(uname_M)))\"" |
| 1539 | else |
| 1540 | BASIC_CFLAGS += -DGIT_HOST_CPU="\"$(HOST_CPU)\"" |
| 1541 | endif |
| 1542 | |
Gary V. Vaughan | f9f33cd | 2010-05-14 09:31:43 +0000 | [diff] [blame] | 1543 | ifneq (,$(INLINE)) |
| 1544 | BASIC_CFLAGS += -Dinline=$(INLINE) |
| 1545 | endif |
| 1546 | |
Gary V. Vaughan | e88a135 | 2010-05-14 09:31:42 +0000 | [diff] [blame] | 1547 | ifneq (,$(SOCKLEN_T)) |
| 1548 | BASIC_CFLAGS += -Dsocklen_t=$(SOCKLEN_T) |
| 1549 | endif |
| 1550 | |
Brian Gernhardt | 59f8674 | 2006-12-12 12:01:47 -0500 | [diff] [blame] | 1551 | ifeq ($(uname_S),Darwin) |
Taylor Blau | 728b9ac | 2024-04-08 11:51:44 -0400 | [diff] [blame] | 1552 | ifndef NO_FINK |
| 1553 | ifeq ($(shell test -d /sw/lib && echo y),y) |
Brian Gernhardt | 59f8674 | 2006-12-12 12:01:47 -0500 | [diff] [blame] | 1554 | BASIC_CFLAGS += -I/sw/include |
| 1555 | BASIC_LDFLAGS += -L/sw/lib |
Taylor Blau | 728b9ac | 2024-04-08 11:51:44 -0400 | [diff] [blame] | 1556 | endif |
| 1557 | endif |
| 1558 | ifndef NO_DARWIN_PORTS |
| 1559 | ifeq ($(shell test -d /opt/local/lib && echo y),y) |
Brian Gernhardt | 59f8674 | 2006-12-12 12:01:47 -0500 | [diff] [blame] | 1560 | BASIC_CFLAGS += -I/opt/local/include |
| 1561 | BASIC_LDFLAGS += -L/opt/local/lib |
Taylor Blau | 728b9ac | 2024-04-08 11:51:44 -0400 | [diff] [blame] | 1562 | endif |
| 1563 | endif |
| 1564 | ifndef NO_APPLE_COMMON_CRYPTO |
Lars Schneider | f01fe92 | 2016-11-06 20:35:04 +0100 | [diff] [blame] | 1565 | NO_OPENSSL = YesPlease |
David Aguilar | 4dcd773 | 2013-05-19 06:23:34 -0400 | [diff] [blame] | 1566 | APPLE_COMMON_CRYPTO = YesPlease |
| 1567 | COMPAT_CFLAGS += -DAPPLE_COMMON_CRYPTO |
Taylor Blau | 728b9ac | 2024-04-08 11:51:44 -0400 | [diff] [blame] | 1568 | endif |
Ted Pavlic | f7d9d04 | 2009-01-26 14:03:59 -0500 | [diff] [blame] | 1569 | PTHREAD_LIBS = |
Brian Gernhardt | 59f8674 | 2006-12-12 12:01:47 -0500 | [diff] [blame] | 1570 | endif |
| 1571 | |
David Aguilar | e1c0688 | 2009-05-31 01:35:51 -0700 | [diff] [blame] | 1572 | ifdef NO_LIBGEN_H |
| 1573 | COMPAT_CFLAGS += -DNO_LIBGEN_H |
| 1574 | COMPAT_OBJS += compat/basename.o |
| 1575 | endif |
| 1576 | |
Ævar Arnfjörð Bjarmason | 7599730 | 2021-01-24 02:58:33 +0100 | [diff] [blame] | 1577 | ifdef USE_LIBPCRE1 |
| 1578 | $(error The USE_LIBPCRE1 build option has been removed, use version 2 with USE_LIBPCRE) |
| 1579 | endif |
| 1580 | |
Ævar Arnfjörð Bjarmason | e6c531b | 2018-03-11 13:26:09 +0000 | [diff] [blame] | 1581 | USE_LIBPCRE2 ?= $(USE_LIBPCRE) |
Ævar Arnfjörð Bjarmason | 94da919 | 2017-06-01 18:20:56 +0000 | [diff] [blame] | 1582 | |
Ævar Arnfjörð Bjarmason | e6c531b | 2018-03-11 13:26:09 +0000 | [diff] [blame] | 1583 | ifneq (,$(USE_LIBPCRE2)) |
Ævar Arnfjörð Bjarmason | e6c531b | 2018-03-11 13:26:09 +0000 | [diff] [blame] | 1584 | BASIC_CFLAGS += -DUSE_LIBPCRE2 |
| 1585 | EXTLIBS += -lpcre2-8 |
| 1586 | endif |
| 1587 | |
Ævar Arnfjörð Bjarmason | 94da919 | 2017-06-01 18:20:56 +0000 | [diff] [blame] | 1588 | ifdef LIBPCREDIR |
| 1589 | BASIC_CFLAGS += -I$(LIBPCREDIR)/include |
Junio C Hamano | 354dbf7 | 2024-01-31 09:42:19 -0800 | [diff] [blame] | 1590 | EXTLIBS += $(call libpath_template,$(LIBPCREDIR)/$(lib)) |
Michał Kiedrowicz | 63e7e9d | 2011-05-09 23:52:05 +0200 | [diff] [blame] | 1591 | endif |
| 1592 | |
Kirill Smelkov | 61f76a3 | 2014-03-27 18:22:50 +0400 | [diff] [blame] | 1593 | ifdef HAVE_ALLOCA_H |
| 1594 | BASIC_CFLAGS += -DHAVE_ALLOCA_H |
| 1595 | endif |
| 1596 | |
Bernhard Reiter | 1e16b25 | 2014-11-09 15:55:53 +0100 | [diff] [blame] | 1597 | IMAP_SEND_BUILDDEPS = |
Remi Pommarel | 9eaa78b | 2015-10-21 19:01:13 +0200 | [diff] [blame] | 1598 | IMAP_SEND_LDFLAGS = |
Bernhard Reiter | 1e16b25 | 2014-11-09 15:55:53 +0100 | [diff] [blame] | 1599 | |
Daniel Barkalow | 30ae764 | 2007-09-10 23:02:45 -0400 | [diff] [blame] | 1600 | ifdef NO_CURL |
| 1601 | BASIC_CFLAGS += -DNO_CURL |
Johannes Sixt | 4256f36 | 2010-01-19 16:39:12 +0100 | [diff] [blame] | 1602 | REMOTE_CURL_PRIMARY = |
| 1603 | REMOTE_CURL_ALIASES = |
| 1604 | REMOTE_CURL_NAMES = |
Johannes Schindelin | 724d635 | 2019-04-18 06:16:40 -0700 | [diff] [blame] | 1605 | EXCLUDED_PROGRAMS += git-http-fetch git-http-push |
Daniel Barkalow | 30ae764 | 2007-09-10 23:02:45 -0400 | [diff] [blame] | 1606 | else |
Taylor Blau | 728b9ac | 2024-04-08 11:51:44 -0400 | [diff] [blame] | 1607 | ifdef CURLDIR |
Junio C Hamano | b2feb64 | 2014-04-30 10:58:10 -0700 | [diff] [blame] | 1608 | # Try "-Wl,-rpath=$(CURLDIR)/$(lib)" in such a case. |
Jeff King | 897d68e | 2020-03-26 04:08:55 -0400 | [diff] [blame] | 1609 | CURL_CFLAGS = -I$(CURLDIR)/include |
Junio C Hamano | 354dbf7 | 2024-01-31 09:42:19 -0800 | [diff] [blame] | 1610 | CURL_LIBCURL = $(call libpath_template,$(CURLDIR)/$(lib)) |
Taylor Blau | 728b9ac | 2024-04-08 11:51:44 -0400 | [diff] [blame] | 1611 | else |
Jeff King | 897d68e | 2020-03-26 04:08:55 -0400 | [diff] [blame] | 1612 | CURL_CFLAGS = |
James Knight | 23c4bbe | 2018-11-03 05:12:11 +0000 | [diff] [blame] | 1613 | CURL_LIBCURL = |
Taylor Blau | 728b9ac | 2024-04-08 11:51:44 -0400 | [diff] [blame] | 1614 | endif |
James Knight | 23c4bbe | 2018-11-03 05:12:11 +0000 | [diff] [blame] | 1615 | |
Taylor Blau | 728b9ac | 2024-04-08 11:51:44 -0400 | [diff] [blame] | 1616 | ifndef CURL_LDFLAGS |
Jeff King | 0573831 | 2020-04-04 10:58:29 -0400 | [diff] [blame] | 1617 | CURL_LDFLAGS = $(eval CURL_LDFLAGS := $$(shell $$(CURL_CONFIG) --libs))$(CURL_LDFLAGS) |
Taylor Blau | 728b9ac | 2024-04-08 11:51:44 -0400 | [diff] [blame] | 1618 | endif |
James Knight | 23c4bbe | 2018-11-03 05:12:11 +0000 | [diff] [blame] | 1619 | CURL_LIBCURL += $(CURL_LDFLAGS) |
Thomas Cort | bc5f813 | 2011-07-19 18:55:47 -0400 | [diff] [blame] | 1620 | |
Taylor Blau | 728b9ac | 2024-04-08 11:51:44 -0400 | [diff] [blame] | 1621 | ifndef CURL_CFLAGS |
Jeff King | 0573831 | 2020-04-04 10:58:29 -0400 | [diff] [blame] | 1622 | CURL_CFLAGS = $(eval CURL_CFLAGS := $$(shell $$(CURL_CONFIG) --cflags))$(CURL_CFLAGS) |
Taylor Blau | 728b9ac | 2024-04-08 11:51:44 -0400 | [diff] [blame] | 1623 | endif |
Jeff King | 897d68e | 2020-03-26 04:08:55 -0400 | [diff] [blame] | 1624 | BASIC_CFLAGS += $(CURL_CFLAGS) |
Junio C Hamano | 229a7ed | 2005-09-23 10:41:40 -0700 | [diff] [blame] | 1625 | |
Johannes Sixt | 4256f36 | 2010-01-19 16:39:12 +0100 | [diff] [blame] | 1626 | REMOTE_CURL_PRIMARY = git-remote-http$X |
| 1627 | REMOTE_CURL_ALIASES = git-remote-https$X git-remote-ftp$X git-remote-ftps$X |
| 1628 | REMOTE_CURL_NAMES = $(REMOTE_CURL_PRIMARY) $(REMOTE_CURL_ALIASES) |
Jonathan Nieder | 1b22c99 | 2010-01-26 09:54:23 -0600 | [diff] [blame] | 1629 | PROGRAM_OBJS += http-fetch.o |
| 1630 | PROGRAMS += $(REMOTE_CURL_NAMES) |
Taylor Blau | 728b9ac | 2024-04-08 11:51:44 -0400 | [diff] [blame] | 1631 | ifndef NO_EXPAT |
Ævar Arnfjörð Bjarmason | 2d4032c | 2021-09-13 16:51:24 +0200 | [diff] [blame] | 1632 | PROGRAM_OBJS += http-push.o |
Taylor Blau | 728b9ac | 2024-04-08 11:51:44 -0400 | [diff] [blame] | 1633 | endif |
Remi Pommarel | f891587 | 2015-10-21 19:10:46 +0200 | [diff] [blame] | 1634 | curl_check := $(shell (echo 072200; $(CURL_CONFIG) --vernum | sed -e '/^70[BC]/s/^/0/') 2>/dev/null | sort -r | sed -ne 2p) |
Taylor Blau | 728b9ac | 2024-04-08 11:51:44 -0400 | [diff] [blame] | 1635 | ifeq "$(curl_check)" "072200" |
Bernhard Reiter | 1e16b25 | 2014-11-09 15:55:53 +0100 | [diff] [blame] | 1636 | USE_CURL_FOR_IMAP_SEND = YesPlease |
Taylor Blau | 728b9ac | 2024-04-08 11:51:44 -0400 | [diff] [blame] | 1637 | endif |
| 1638 | ifdef USE_CURL_FOR_IMAP_SEND |
Bernhard Reiter | 1e16b25 | 2014-11-09 15:55:53 +0100 | [diff] [blame] | 1639 | BASIC_CFLAGS += -DUSE_CURL_FOR_IMAP_SEND |
| 1640 | IMAP_SEND_BUILDDEPS = http.o |
| 1641 | IMAP_SEND_LDFLAGS += $(CURL_LIBCURL) |
Taylor Blau | 728b9ac | 2024-04-08 11:51:44 -0400 | [diff] [blame] | 1642 | endif |
| 1643 | ifndef NO_EXPAT |
| 1644 | ifdef EXPATDIR |
Serge van den Boom | 85b4518 | 2009-01-28 21:43:57 +0100 | [diff] [blame] | 1645 | BASIC_CFLAGS += -I$(EXPATDIR)/include |
Junio C Hamano | 354dbf7 | 2024-01-31 09:42:19 -0800 | [diff] [blame] | 1646 | EXPAT_LIBEXPAT = $(call libpath_template,$(EXPATDIR)/$(lib)) -lexpat |
Taylor Blau | 728b9ac | 2024-04-08 11:51:44 -0400 | [diff] [blame] | 1647 | else |
Serge van den Boom | 85b4518 | 2009-01-28 21:43:57 +0100 | [diff] [blame] | 1648 | EXPAT_LIBEXPAT = -lexpat |
Taylor Blau | 728b9ac | 2024-04-08 11:51:44 -0400 | [diff] [blame] | 1649 | endif |
| 1650 | ifdef EXPAT_NEEDS_XMLPARSE_H |
Matt Kraai | 081fd8d | 2013-02-11 14:03:45 -0800 | [diff] [blame] | 1651 | BASIC_CFLAGS += -DEXPAT_NEEDS_XMLPARSE_H |
Taylor Blau | 728b9ac | 2024-04-08 11:51:44 -0400 | [diff] [blame] | 1652 | endif |
| 1653 | endif |
Junio C Hamano | 229a7ed | 2005-09-23 10:41:40 -0700 | [diff] [blame] | 1654 | endif |
Remi Pommarel | 9eaa78b | 2015-10-21 19:01:13 +0200 | [diff] [blame] | 1655 | IMAP_SEND_LDFLAGS += $(OPENSSL_LINK) $(OPENSSL_LIBSSL) $(LIB_4_CRYPTO) |
Junio C Hamano | 229a7ed | 2005-09-23 10:41:40 -0700 | [diff] [blame] | 1656 | |
Robert Schiele | bef19da | 2007-07-29 20:35:45 +0200 | [diff] [blame] | 1657 | ifdef ZLIB_PATH |
| 1658 | BASIC_CFLAGS += -I$(ZLIB_PATH)/include |
Junio C Hamano | 354dbf7 | 2024-01-31 09:42:19 -0800 | [diff] [blame] | 1659 | EXTLIBS += $(call libpath_template,$(ZLIB_PATH)/$(lib)) |
Robert Schiele | bef19da | 2007-07-29 20:35:45 +0200 | [diff] [blame] | 1660 | endif |
| 1661 | EXTLIBS += -lz |
| 1662 | |
Petr Baudis | dd53c7a | 2005-07-29 17:50:51 +0200 | [diff] [blame] | 1663 | ifndef NO_OPENSSL |
Junio C Hamano | 215a7ad | 2005-09-07 17:26:23 -0700 | [diff] [blame] | 1664 | OPENSSL_LIBSSL = -lssl |
Taylor Blau | 728b9ac | 2024-04-08 11:51:44 -0400 | [diff] [blame] | 1665 | ifdef OPENSSLDIR |
Petr Baudis | 8d7f586 | 2006-06-25 03:47:03 +0200 | [diff] [blame] | 1666 | BASIC_CFLAGS += -I$(OPENSSLDIR)/include |
Junio C Hamano | 354dbf7 | 2024-01-31 09:42:19 -0800 | [diff] [blame] | 1667 | OPENSSL_LINK = $(call libpath_template,$(OPENSSLDIR)/$(lib)) |
Taylor Blau | 728b9ac | 2024-04-08 11:51:44 -0400 | [diff] [blame] | 1668 | else |
Junio C Hamano | 455a7f3 | 2005-09-30 13:31:16 -0700 | [diff] [blame] | 1669 | OPENSSL_LINK = |
Taylor Blau | 728b9ac | 2024-04-08 11:51:44 -0400 | [diff] [blame] | 1670 | endif |
| 1671 | ifdef NEEDS_CRYPTO_WITH_SSL |
Thomas Cort | bc5f813 | 2011-07-19 18:55:47 -0400 | [diff] [blame] | 1672 | OPENSSL_LIBSSL += -lcrypto |
Taylor Blau | 728b9ac | 2024-04-08 11:51:44 -0400 | [diff] [blame] | 1673 | endif |
Petr Baudis | dd53c7a | 2005-07-29 17:50:51 +0200 | [diff] [blame] | 1674 | else |
Petr Baudis | 8d7f586 | 2006-06-25 03:47:03 +0200 | [diff] [blame] | 1675 | BASIC_CFLAGS += -DNO_OPENSSL |
Junio C Hamano | 215a7ad | 2005-09-07 17:26:23 -0700 | [diff] [blame] | 1676 | OPENSSL_LIBSSL = |
Petr Baudis | dd53c7a | 2005-07-29 17:50:51 +0200 | [diff] [blame] | 1677 | endif |
Junio C Hamano | 5b02b9b | 2010-12-08 14:54:13 -0800 | [diff] [blame] | 1678 | ifdef NO_OPENSSL |
| 1679 | LIB_4_CRYPTO = |
| 1680 | else |
Junio C Hamano | 597c9cc | 2005-09-07 12:22:56 -0700 | [diff] [blame] | 1681 | ifdef NEEDS_SSL_WITH_CRYPTO |
Junio C Hamano | 455a7f3 | 2005-09-30 13:31:16 -0700 | [diff] [blame] | 1682 | LIB_4_CRYPTO = $(OPENSSL_LINK) -lcrypto -lssl |
Junio C Hamano | 597c9cc | 2005-09-07 12:22:56 -0700 | [diff] [blame] | 1683 | else |
Junio C Hamano | 455a7f3 | 2005-09-30 13:31:16 -0700 | [diff] [blame] | 1684 | LIB_4_CRYPTO = $(OPENSSL_LINK) -lcrypto |
Junio C Hamano | 597c9cc | 2005-09-07 12:22:56 -0700 | [diff] [blame] | 1685 | endif |
Brian Gernhardt | c984938 | 2013-08-05 11:59:22 -0400 | [diff] [blame] | 1686 | ifdef APPLE_COMMON_CRYPTO |
| 1687 | LIB_4_CRYPTO += -framework Security -framework CoreFoundation |
| 1688 | endif |
Junio C Hamano | 5b02b9b | 2010-12-08 14:54:13 -0800 | [diff] [blame] | 1689 | endif |
Eric Sunshine | fdb1fbb | 2018-06-14 22:25:03 -0400 | [diff] [blame] | 1690 | ifndef NO_ICONV |
Taylor Blau | 728b9ac | 2024-04-08 11:51:44 -0400 | [diff] [blame] | 1691 | ifdef NEEDS_LIBICONV |
| 1692 | ifdef ICONVDIR |
Eric Sunshine | fdb1fbb | 2018-06-14 22:25:03 -0400 | [diff] [blame] | 1693 | BASIC_CFLAGS += -I$(ICONVDIR)/include |
Junio C Hamano | 354dbf7 | 2024-01-31 09:42:19 -0800 | [diff] [blame] | 1694 | ICONV_LINK = $(call libpath_template,$(ICONVDIR)/$(lib)) |
Taylor Blau | 728b9ac | 2024-04-08 11:51:44 -0400 | [diff] [blame] | 1695 | else |
Eric Sunshine | fdb1fbb | 2018-06-14 22:25:03 -0400 | [diff] [blame] | 1696 | ICONV_LINK = |
Taylor Blau | 728b9ac | 2024-04-08 11:51:44 -0400 | [diff] [blame] | 1697 | endif |
| 1698 | ifdef NEEDS_LIBINTL_BEFORE_LIBICONV |
Eric Sunshine | fdb1fbb | 2018-06-14 22:25:03 -0400 | [diff] [blame] | 1699 | ICONV_LINK += -lintl |
Taylor Blau | 728b9ac | 2024-04-08 11:51:44 -0400 | [diff] [blame] | 1700 | endif |
Eric Sunshine | fdb1fbb | 2018-06-14 22:25:03 -0400 | [diff] [blame] | 1701 | EXTLIBS += $(ICONV_LINK) -liconv |
Taylor Blau | 728b9ac | 2024-04-08 11:51:44 -0400 | [diff] [blame] | 1702 | endif |
Junio C Hamano | 597c9cc | 2005-09-07 12:22:56 -0700 | [diff] [blame] | 1703 | endif |
brian m. carlson | 79444c9 | 2019-02-12 00:52:06 +0000 | [diff] [blame] | 1704 | ifdef ICONV_OMITS_BOM |
| 1705 | BASIC_CFLAGS += -DICONV_OMITS_BOM |
| 1706 | endif |
Brandon Casey | ecc395c | 2009-07-10 12:10:45 -0500 | [diff] [blame] | 1707 | ifdef NEEDS_LIBGEN |
| 1708 | EXTLIBS += -lgen |
| 1709 | endif |
Ævar Arnfjörð Bjarmason | 5e9637c | 2011-11-18 00:14:42 +0100 | [diff] [blame] | 1710 | ifndef NO_GETTEXT |
| 1711 | ifndef LIBC_CONTAINS_LIBINTL |
| 1712 | EXTLIBS += -lintl |
| 1713 | endif |
| 1714 | endif |
Patrick Mauritz | f0ebff0 | 2005-09-06 01:24:03 +0200 | [diff] [blame] | 1715 | ifdef NEEDS_SOCKET |
Petr Baudis | d595a47 | 2006-06-24 18:35:12 -0700 | [diff] [blame] | 1716 | EXTLIBS += -lsocket |
Patrick Mauritz | f0ebff0 | 2005-09-06 01:24:03 +0200 | [diff] [blame] | 1717 | endif |
Junio C Hamano | 5a90d4a | 2005-09-11 22:25:49 -0700 | [diff] [blame] | 1718 | ifdef NEEDS_NSL |
Petr Baudis | d595a47 | 2006-06-24 18:35:12 -0700 | [diff] [blame] | 1719 | EXTLIBS += -lnsl |
Junio C Hamano | 5a90d4a | 2005-09-11 22:25:49 -0700 | [diff] [blame] | 1720 | endif |
Brandon Casey | 70cf991 | 2009-06-05 18:36:10 -0500 | [diff] [blame] | 1721 | ifdef NEEDS_RESOLV |
| 1722 | EXTLIBS += -lresolv |
| 1723 | endif |
Junio C Hamano | 63be37b | 2006-01-19 17:13:57 -0800 | [diff] [blame] | 1724 | ifdef NO_D_TYPE_IN_DIRENT |
Petr Baudis | 8d7f586 | 2006-06-25 03:47:03 +0200 | [diff] [blame] | 1725 | BASIC_CFLAGS += -DNO_D_TYPE_IN_DIRENT |
Junio C Hamano | 63be37b | 2006-01-19 17:13:57 -0800 | [diff] [blame] | 1726 | endif |
David Michael | 110d698 | 2012-12-14 14:56:59 -0500 | [diff] [blame] | 1727 | ifdef NO_GECOS_IN_PWENT |
| 1728 | BASIC_CFLAGS += -DNO_GECOS_IN_PWENT |
| 1729 | endif |
Junio C Hamano | fdb2a2a | 2008-08-18 21:57:16 +0200 | [diff] [blame] | 1730 | ifdef NO_ST_BLOCKS_IN_STRUCT_STAT |
| 1731 | BASIC_CFLAGS += -DNO_ST_BLOCKS_IN_STRUCT_STAT |
| 1732 | endif |
Brian Gernhardt | d7371a2 | 2009-03-08 17:22:51 -0400 | [diff] [blame] | 1733 | ifdef USE_NSEC |
| 1734 | BASIC_CFLAGS += -DUSE_NSEC |
| 1735 | endif |
Brian Gernhardt | c567383 | 2009-03-08 16:04:28 -0400 | [diff] [blame] | 1736 | ifdef USE_ST_TIMESPEC |
| 1737 | BASIC_CFLAGS += -DUSE_ST_TIMESPEC |
| 1738 | endif |
Junio C Hamano | 6520c84 | 2011-06-18 18:07:03 -0700 | [diff] [blame] | 1739 | ifdef NO_NORETURN |
| 1740 | BASIC_CFLAGS += -DNO_NORETURN |
| 1741 | endif |
Kjetil Barvik | c06ff49 | 2009-03-04 18:47:40 +0100 | [diff] [blame] | 1742 | ifdef NO_NSEC |
| 1743 | BASIC_CFLAGS += -DNO_NSEC |
| 1744 | endif |
Michal Rokos | c4582f9 | 2008-03-05 16:46:13 +0100 | [diff] [blame] | 1745 | ifdef SNPRINTF_RETURNS_BOGUS |
| 1746 | COMPAT_CFLAGS += -DSNPRINTF_RETURNS_BOGUS |
| 1747 | COMPAT_OBJS += compat/snprintf.o |
| 1748 | endif |
Brandon Casey | cba2252 | 2008-02-08 20:32:47 -0600 | [diff] [blame] | 1749 | ifdef FREAD_READS_DIRECTORIES |
| 1750 | COMPAT_CFLAGS += -DFREAD_READS_DIRECTORIES |
| 1751 | COMPAT_OBJS += compat/fopen.o |
| 1752 | endif |
Jeff King | 2b08101 | 2021-02-26 01:14:35 -0500 | [diff] [blame] | 1753 | ifdef OPEN_RETURNS_EINTR |
| 1754 | COMPAT_CFLAGS += -DOPEN_RETURNS_EINTR |
| 1755 | COMPAT_OBJS += compat/open.o |
| 1756 | endif |
Junio C Hamano | 9f0bb90 | 2006-05-02 00:40:24 -0700 | [diff] [blame] | 1757 | ifdef NO_SYMLINK_HEAD |
Petr Baudis | 8d7f586 | 2006-06-25 03:47:03 +0200 | [diff] [blame] | 1758 | BASIC_CFLAGS += -DNO_SYMLINK_HEAD |
Junio C Hamano | 9f0bb90 | 2006-05-02 00:40:24 -0700 | [diff] [blame] | 1759 | endif |
Ævar Arnfjörð Bjarmason | 5e9637c | 2011-11-18 00:14:42 +0100 | [diff] [blame] | 1760 | ifdef NO_GETTEXT |
| 1761 | BASIC_CFLAGS += -DNO_GETTEXT |
Junio C Hamano | 60f4079 | 2012-01-23 18:31:09 -0600 | [diff] [blame] | 1762 | USE_GETTEXT_SCHEME ?= fallthrough |
Ævar Arnfjörð Bjarmason | 5e9637c | 2011-11-18 00:14:42 +0100 | [diff] [blame] | 1763 | endif |
Joachim Schmitz | 6d45eb1 | 2012-09-17 23:16:39 +0200 | [diff] [blame] | 1764 | ifdef NO_POLL |
Đoàn Trần Công Danh | 2648ccc | 2018-11-14 08:10:43 +0700 | [diff] [blame] | 1765 | NO_POLL_H = YesPlease |
Joachim Schmitz | 6d45eb1 | 2012-09-17 23:16:39 +0200 | [diff] [blame] | 1766 | NO_SYS_POLL_H = YesPlease |
| 1767 | COMPAT_CFLAGS += -DNO_POLL -Icompat/poll |
| 1768 | COMPAT_OBJS += compat/poll/poll.o |
| 1769 | endif |
Linus Torvalds | ef34af2 | 2005-09-18 18:30:50 -0700 | [diff] [blame] | 1770 | ifdef NO_STRCASESTR |
Junio C Hamano | 4050c0d | 2005-12-05 11:54:29 -0800 | [diff] [blame] | 1771 | COMPAT_CFLAGS += -DNO_STRCASESTR |
Jason Riedy | e40b61f | 2005-12-02 15:08:28 -0800 | [diff] [blame] | 1772 | COMPAT_OBJS += compat/strcasestr.o |
| 1773 | endif |
Peter Eriksen | 817151e | 2006-06-24 16:01:25 +0200 | [diff] [blame] | 1774 | ifdef NO_STRLCPY |
| 1775 | COMPAT_CFLAGS += -DNO_STRLCPY |
| 1776 | COMPAT_OBJS += compat/strlcpy.o |
| 1777 | endif |
Jason Riedy | bc6b4f5 | 2007-02-19 16:22:56 -0800 | [diff] [blame] | 1778 | ifdef NO_STRTOUMAX |
| 1779 | COMPAT_CFLAGS += -DNO_STRTOUMAX |
Nick Alcock | e3eed7f | 2011-11-02 15:46:22 +0000 | [diff] [blame] | 1780 | COMPAT_OBJS += compat/strtoumax.o compat/strtoimax.o |
Jason Riedy | bc6b4f5 | 2007-02-19 16:22:56 -0800 | [diff] [blame] | 1781 | endif |
| 1782 | ifdef NO_STRTOULL |
| 1783 | COMPAT_CFLAGS += -DNO_STRTOULL |
| 1784 | endif |
Jason Riedy | e40b61f | 2005-12-02 15:08:28 -0800 | [diff] [blame] | 1785 | ifdef NO_SETENV |
Junio C Hamano | 4050c0d | 2005-12-05 11:54:29 -0800 | [diff] [blame] | 1786 | COMPAT_CFLAGS += -DNO_SETENV |
Jason Riedy | e40b61f | 2005-12-02 15:08:28 -0800 | [diff] [blame] | 1787 | COMPAT_OBJS += compat/setenv.o |
Linus Torvalds | ef34af2 | 2005-09-18 18:30:50 -0700 | [diff] [blame] | 1788 | endif |
Shawn O. Pearce | ca5bb5d | 2007-10-20 16:03:49 -0400 | [diff] [blame] | 1789 | ifdef NO_MKDTEMP |
| 1790 | COMPAT_CFLAGS += -DNO_MKDTEMP |
| 1791 | COMPAT_OBJS += compat/mkdtemp.o |
| 1792 | endif |
Joachim Schmitz | dc9f462 | 2012-09-08 19:01:31 +0200 | [diff] [blame] | 1793 | ifdef MKDIR_WO_TRAILING_SLASH |
| 1794 | COMPAT_CFLAGS += -DMKDIR_WO_TRAILING_SLASH |
| 1795 | COMPAT_OBJS += compat/mkdir.o |
| 1796 | endif |
Johannes Schindelin | 104ff34 | 2006-08-29 12:51:14 +0200 | [diff] [blame] | 1797 | ifdef NO_UNSETENV |
Jason Riedy | 731043f | 2006-01-25 12:38:36 -0800 | [diff] [blame] | 1798 | COMPAT_CFLAGS += -DNO_UNSETENV |
| 1799 | COMPAT_OBJS += compat/unsetenv.o |
| 1800 | endif |
Robert Schiele | 2600973 | 2008-01-24 19:34:46 +0100 | [diff] [blame] | 1801 | ifdef NO_SYS_SELECT_H |
| 1802 | BASIC_CFLAGS += -DNO_SYS_SELECT_H |
| 1803 | endif |
Đoàn Trần Công Danh | 2648ccc | 2018-11-14 08:10:43 +0700 | [diff] [blame] | 1804 | ifdef NO_POLL_H |
| 1805 | BASIC_CFLAGS += -DNO_POLL_H |
| 1806 | endif |
Markus Duft | 2844923 | 2010-10-27 10:39:52 +0200 | [diff] [blame] | 1807 | ifdef NO_SYS_POLL_H |
| 1808 | BASIC_CFLAGS += -DNO_SYS_POLL_H |
| 1809 | endif |
Junio C Hamano | b2d05e0 | 2012-12-18 09:35:33 -0800 | [diff] [blame] | 1810 | ifdef NEEDS_SYS_PARAM_H |
| 1811 | BASIC_CFLAGS += -DNEEDS_SYS_PARAM_H |
David Michael | 6ede720 | 2012-12-14 14:56:58 -0500 | [diff] [blame] | 1812 | endif |
Markus Duft | 2844923 | 2010-10-27 10:39:52 +0200 | [diff] [blame] | 1813 | ifdef NO_INTTYPES_H |
| 1814 | BASIC_CFLAGS += -DNO_INTTYPES_H |
| 1815 | endif |
| 1816 | ifdef NO_INITGROUPS |
| 1817 | BASIC_CFLAGS += -DNO_INITGROUPS |
| 1818 | endif |
Johannes Schindelin | 730d48a | 2005-10-08 15:54:36 -0700 | [diff] [blame] | 1819 | ifdef NO_MMAP |
Junio C Hamano | 4050c0d | 2005-12-05 11:54:29 -0800 | [diff] [blame] | 1820 | COMPAT_CFLAGS += -DNO_MMAP |
Jason Riedy | e40b61f | 2005-12-02 15:08:28 -0800 | [diff] [blame] | 1821 | COMPAT_OBJS += compat/mmap.o |
Janos Laube | b130a72 | 2009-03-13 16:50:45 +0100 | [diff] [blame] | 1822 | else |
Taylor Blau | 728b9ac | 2024-04-08 11:51:44 -0400 | [diff] [blame] | 1823 | ifdef USE_WIN32_MMAP |
Janos Laube | b130a72 | 2009-03-13 16:50:45 +0100 | [diff] [blame] | 1824 | COMPAT_CFLAGS += -DUSE_WIN32_MMAP |
| 1825 | COMPAT_OBJS += compat/win32mmap.o |
Taylor Blau | 728b9ac | 2024-04-08 11:51:44 -0400 | [diff] [blame] | 1826 | endif |
Johannes Schindelin | 730d48a | 2005-10-08 15:54:36 -0700 | [diff] [blame] | 1827 | endif |
Michael Haggerty | 5b63361 | 2017-09-25 10:00:10 +0200 | [diff] [blame] | 1828 | ifdef MMAP_PREVENTS_DELETE |
| 1829 | BASIC_CFLAGS += -DMMAP_PREVENTS_DELETE |
| 1830 | endif |
Johannes Schindelin | 348df16 | 2009-04-28 00:32:25 +0200 | [diff] [blame] | 1831 | ifdef OBJECT_CREATION_USES_RENAMES |
| 1832 | COMPAT_CFLAGS += -DOBJECT_CREATION_MODE=1 |
Johannes Schindelin | be66a6c | 2009-04-25 11:57:14 +0200 | [diff] [blame] | 1833 | endif |
Joachim Schmitz | 7f9e848 | 2012-09-08 18:54:34 +0200 | [diff] [blame] | 1834 | ifdef NO_STRUCT_ITIMERVAL |
| 1835 | COMPAT_CFLAGS += -DNO_STRUCT_ITIMERVAL |
Stefano Lattarini | dd6fc7c | 2012-12-09 11:36:17 +0100 | [diff] [blame] | 1836 | NO_SETITIMER = YesPlease |
Joachim Schmitz | 7f9e848 | 2012-09-08 18:54:34 +0200 | [diff] [blame] | 1837 | endif |
| 1838 | ifdef NO_SETITIMER |
| 1839 | COMPAT_CFLAGS += -DNO_SETITIMER |
| 1840 | endif |
Stefan-W. Hahn | 6900679 | 2007-01-09 22:04:12 +0100 | [diff] [blame] | 1841 | ifdef NO_PREAD |
| 1842 | COMPAT_CFLAGS += -DNO_PREAD |
| 1843 | COMPAT_OBJS += compat/pread.o |
| 1844 | endif |
Shawn O. Pearce | 1510fea | 2006-12-14 06:15:57 -0500 | [diff] [blame] | 1845 | ifdef NO_FAST_WORKING_DIRECTORY |
| 1846 | BASIC_CFLAGS += -DNO_FAST_WORKING_DIRECTORY |
| 1847 | endif |
Shawn O. Pearce | c869753 | 2006-12-30 23:53:55 -0500 | [diff] [blame] | 1848 | ifdef NO_TRUSTABLE_FILEMODE |
| 1849 | BASIC_CFLAGS += -DNO_TRUSTABLE_FILEMODE |
| 1850 | endif |
David Michael | d543d9c | 2014-12-03 21:24:17 -0500 | [diff] [blame] | 1851 | ifdef NEEDS_MODE_TRANSLATION |
| 1852 | COMPAT_CFLAGS += -DNEEDS_MODE_TRANSLATION |
| 1853 | COMPAT_OBJS += compat/stat.o |
| 1854 | endif |
hpa | 49744d6 | 2005-09-28 16:52:21 -0700 | [diff] [blame] | 1855 | ifdef NO_IPV6 |
Petr Baudis | 8d7f586 | 2006-06-25 03:47:03 +0200 | [diff] [blame] | 1856 | BASIC_CFLAGS += -DNO_IPV6 |
Junio C Hamano | bdc37f5 | 2006-01-19 17:13:32 -0800 | [diff] [blame] | 1857 | endif |
Joachim Schmitz | 6c10990 | 2012-09-19 12:03:30 +0200 | [diff] [blame] | 1858 | ifdef NO_INTPTR_T |
| 1859 | COMPAT_CFLAGS += -DNO_INTPTR_T |
| 1860 | endif |
David M. Syzdek | 0bc3e78 | 2008-10-26 03:52:37 -0800 | [diff] [blame] | 1861 | ifdef NO_UINTMAX_T |
| 1862 | BASIC_CFLAGS += -Duintmax_t=uint32_t |
| 1863 | endif |
Junio C Hamano | bdc37f5 | 2006-01-19 17:13:32 -0800 | [diff] [blame] | 1864 | ifdef NO_SOCKADDR_STORAGE |
| 1865 | ifdef NO_IPV6 |
Petr Baudis | 8d7f586 | 2006-06-25 03:47:03 +0200 | [diff] [blame] | 1866 | BASIC_CFLAGS += -Dsockaddr_storage=sockaddr_in |
Junio C Hamano | bdc37f5 | 2006-01-19 17:13:32 -0800 | [diff] [blame] | 1867 | else |
Petr Baudis | 8d7f586 | 2006-06-25 03:47:03 +0200 | [diff] [blame] | 1868 | BASIC_CFLAGS += -Dsockaddr_storage=sockaddr_in6 |
Junio C Hamano | bdc37f5 | 2006-01-19 17:13:32 -0800 | [diff] [blame] | 1869 | endif |
hpa | 49744d6 | 2005-09-28 16:52:21 -0700 | [diff] [blame] | 1870 | endif |
Yakov Lerner | 6ba68ab | 2006-05-22 00:37:00 +0300 | [diff] [blame] | 1871 | ifdef NO_INET_NTOP |
| 1872 | LIB_OBJS += compat/inet_ntop.o |
Mike Pape | da523cc | 2010-11-04 02:35:11 +0100 | [diff] [blame] | 1873 | BASIC_CFLAGS += -DNO_INET_NTOP |
Yakov Lerner | 6ba68ab | 2006-05-22 00:37:00 +0300 | [diff] [blame] | 1874 | endif |
Jon Loeliger | dd46762 | 2006-09-26 09:47:43 -0500 | [diff] [blame] | 1875 | ifdef NO_INET_PTON |
| 1876 | LIB_OBJS += compat/inet_pton.o |
Mike Pape | da523cc | 2010-11-04 02:35:11 +0100 | [diff] [blame] | 1877 | BASIC_CFLAGS += -DNO_INET_PTON |
Jon Loeliger | dd46762 | 2006-09-26 09:47:43 -0500 | [diff] [blame] | 1878 | endif |
Jeff Hostetler | ee4512e | 2019-02-22 14:25:01 -0800 | [diff] [blame] | 1879 | ifdef NO_UNIX_SOCKETS |
| 1880 | BASIC_CFLAGS += -DNO_UNIX_SOCKETS |
| 1881 | else |
Johannes Sixt | 6320358 | 2011-12-12 22:12:56 +0100 | [diff] [blame] | 1882 | LIB_OBJS += unix-socket.o |
Jeff Hostetler | 9fd1902 | 2021-03-15 21:08:27 +0000 | [diff] [blame] | 1883 | LIB_OBJS += unix-stream-server.o |
Jeff Hostetler | 6aac70a | 2021-05-20 18:28:10 +0000 | [diff] [blame] | 1884 | endif |
| 1885 | |
| 1886 | # Simple IPC requires threads and platform-specific IPC support. |
| 1887 | # Only platforms that have both should include these source files |
| 1888 | # in the build. |
| 1889 | # |
| 1890 | # On Windows-based systems, Simple IPC requires threads and Windows |
| 1891 | # Named Pipes. These are always available, so Simple IPC support |
| 1892 | # is optional. |
| 1893 | # |
| 1894 | # On Unix-based systems, Simple IPC requires pthreads and Unix |
| 1895 | # domain sockets. So support is only enabled when both are present. |
| 1896 | # |
| 1897 | ifdef USE_WIN32_IPC |
| 1898 | BASIC_CFLAGS += -DSUPPORTS_SIMPLE_IPC |
| 1899 | LIB_OBJS += compat/simple-ipc/ipc-shared.o |
| 1900 | LIB_OBJS += compat/simple-ipc/ipc-win32.o |
| 1901 | else |
| 1902 | ifndef NO_PTHREADS |
| 1903 | ifndef NO_UNIX_SOCKETS |
| 1904 | BASIC_CFLAGS += -DSUPPORTS_SIMPLE_IPC |
Jeff Hostetler | 7cd5dbc | 2021-03-22 10:29:47 +0000 | [diff] [blame] | 1905 | LIB_OBJS += compat/simple-ipc/ipc-shared.o |
| 1906 | LIB_OBJS += compat/simple-ipc/ipc-unix-socket.o |
Johannes Sixt | 6320358 | 2011-12-12 22:12:56 +0100 | [diff] [blame] | 1907 | endif |
Jeff Hostetler | 6aac70a | 2021-05-20 18:28:10 +0000 | [diff] [blame] | 1908 | endif |
Fernando J. Pereda | b6e56ec | 2006-02-16 09:38:01 +0100 | [diff] [blame] | 1909 | endif |
| 1910 | |
| 1911 | ifdef NO_ICONV |
Petr Baudis | 8d7f586 | 2006-06-25 03:47:03 +0200 | [diff] [blame] | 1912 | BASIC_CFLAGS += -DNO_ICONV |
Nicolas Pitre | 7c6ef2f | 2005-09-20 12:27:13 -0400 | [diff] [blame] | 1913 | endif |
| 1914 | |
Ramsay Jones | fd547a9 | 2007-03-03 18:29:03 +0000 | [diff] [blame] | 1915 | ifdef OLD_ICONV |
| 1916 | BASIC_CFLAGS += -DOLD_ICONV |
| 1917 | endif |
| 1918 | |
David Symonds | 609a228 | 2007-11-07 14:24:28 +1100 | [diff] [blame] | 1919 | ifdef NO_DEFLATE_BOUND |
| 1920 | BASIC_CFLAGS += -DNO_DEFLATE_BOUND |
| 1921 | endif |
| 1922 | |
Erik Faye-Lund | a666b47 | 2010-11-04 02:35:24 +0100 | [diff] [blame] | 1923 | ifdef NO_POSIX_GOODIES |
| 1924 | BASIC_CFLAGS += -DNO_POSIX_GOODIES |
| 1925 | endif |
| 1926 | |
Ævar Arnfjörð Bjarmason | 35898ad | 2022-12-15 09:43:05 +0100 | [diff] [blame] | 1927 | ifdef APPLE_COMMON_CRYPTO_SHA1 |
Atousa Pahlevan Duprat | 001fd7a | 2015-11-04 22:38:42 -0800 | [diff] [blame] | 1928 | # Apple CommonCrypto requires chunking |
| 1929 | SHA1_MAX_BLOCK_SIZE = 1024L*1024L*1024L |
| 1930 | endif |
| 1931 | |
Ævar Arnfjörð Bjarmason | 9dc523a | 2022-08-31 11:18:43 +0200 | [diff] [blame] | 1932 | ifdef PPC_SHA1 |
| 1933 | $(error the PPC_SHA1 flag has been removed along with the PowerPC-specific SHA-1 implementation.) |
| 1934 | endif |
| 1935 | |
Junio C Hamano | e6b07da | 2017-03-17 10:00:15 -0700 | [diff] [blame] | 1936 | ifdef OPENSSL_SHA1 |
| 1937 | EXTLIBS += $(LIB_4_CRYPTO) |
| 1938 | BASIC_CFLAGS += -DSHA1_OPENSSL |
Jeff King | 8325e43 | 2017-03-16 18:09:12 -0400 | [diff] [blame] | 1939 | else |
Linus Torvalds | d7c208a | 2009-08-05 16:13:20 -0700 | [diff] [blame] | 1940 | ifdef BLK_SHA1 |
Linus Torvalds | d7c208a | 2009-08-05 16:13:20 -0700 | [diff] [blame] | 1941 | LIB_OBJS += block-sha1/sha1.o |
brian m. carlson | f18f816 | 2017-03-11 22:28:18 +0000 | [diff] [blame] | 1942 | BASIC_CFLAGS += -DSHA1_BLK |
Linus Torvalds | d7c208a | 2009-08-05 16:13:20 -0700 | [diff] [blame] | 1943 | else |
Ævar Arnfjörð Bjarmason | 35898ad | 2022-12-15 09:43:05 +0100 | [diff] [blame] | 1944 | ifdef APPLE_COMMON_CRYPTO_SHA1 |
David Aguilar | 6106795 | 2013-05-19 06:23:35 -0400 | [diff] [blame] | 1945 | COMPAT_CFLAGS += -DCOMMON_DIGEST_FOR_OPENSSL |
brian m. carlson | f18f816 | 2017-03-11 22:28:18 +0000 | [diff] [blame] | 1946 | BASIC_CFLAGS += -DSHA1_APPLE |
David Aguilar | 6106795 | 2013-05-19 06:23:35 -0400 | [diff] [blame] | 1947 | else |
Takashi Iwai | 36f048c | 2017-08-15 14:04:16 +0200 | [diff] [blame] | 1948 | BASIC_CFLAGS += -DSHA1_DC |
| 1949 | LIB_OBJS += sha1dc_git.o |
Takashi Iwai | 3964cbb | 2017-08-15 14:04:17 +0200 | [diff] [blame] | 1950 | ifdef DC_SHA1_EXTERNAL |
Taylor Blau | 728b9ac | 2024-04-08 11:51:44 -0400 | [diff] [blame] | 1951 | ifdef DC_SHA1_SUBMODULE |
| 1952 | ifneq ($(DC_SHA1_SUBMODULE),auto) |
Takashi Iwai | 3964cbb | 2017-08-15 14:04:17 +0200 | [diff] [blame] | 1953 | $(error Only set DC_SHA1_EXTERNAL or DC_SHA1_SUBMODULE, not both) |
Taylor Blau | 728b9ac | 2024-04-08 11:51:44 -0400 | [diff] [blame] | 1954 | endif |
| 1955 | endif |
Takashi Iwai | 3964cbb | 2017-08-15 14:04:17 +0200 | [diff] [blame] | 1956 | BASIC_CFLAGS += -DDC_SHA1_EXTERNAL |
| 1957 | EXTLIBS += -lsha1detectcoll |
| 1958 | else |
Ævar Arnfjörð Bjarmason | 86cfd61 | 2017-07-01 22:05:46 +0000 | [diff] [blame] | 1959 | ifdef DC_SHA1_SUBMODULE |
| 1960 | LIB_OBJS += sha1collisiondetection/lib/sha1.o |
| 1961 | LIB_OBJS += sha1collisiondetection/lib/ubc_check.o |
| 1962 | BASIC_CFLAGS += -DDC_SHA1_SUBMODULE |
| 1963 | else |
Junio C Hamano | e6b07da | 2017-03-17 10:00:15 -0700 | [diff] [blame] | 1964 | LIB_OBJS += sha1dc/sha1.o |
| 1965 | LIB_OBJS += sha1dc/ubc_check.o |
Ævar Arnfjörð Bjarmason | 86cfd61 | 2017-07-01 22:05:46 +0000 | [diff] [blame] | 1966 | endif |
Ævar Arnfjörð Bjarmason | a010391 | 2017-05-20 11:54:28 +0000 | [diff] [blame] | 1967 | BASIC_CFLAGS += \ |
Ævar Arnfjörð Bjarmason | a010391 | 2017-05-20 11:54:28 +0000 | [diff] [blame] | 1968 | -DSHA1DC_NO_STANDARD_INCLUDES \ |
| 1969 | -DSHA1DC_INIT_SAFE_HASH_DEFAULT=0 \ |
Elijah Newren | bc5c5ec | 2023-05-16 06:33:57 +0000 | [diff] [blame] | 1970 | -DSHA1DC_CUSTOM_INCLUDE_SHA1_C="\"git-compat-util.h\"" \ |
Ævar Arnfjörð Bjarmason | a010391 | 2017-05-20 11:54:28 +0000 | [diff] [blame] | 1971 | -DSHA1DC_CUSTOM_INCLUDE_UBC_CHECK_C="\"git-compat-util.h\"" |
Nicolas Pitre | 7c6ef2f | 2005-09-20 12:27:13 -0400 | [diff] [blame] | 1972 | endif |
Nicolas Pitre | 7c6ef2f | 2005-09-20 12:27:13 -0400 | [diff] [blame] | 1973 | endif |
| 1974 | endif |
David Aguilar | 6106795 | 2013-05-19 06:23:35 -0400 | [diff] [blame] | 1975 | endif |
| 1976 | |
brian m. carlson | 4b4e291 | 2018-11-14 04:09:38 +0000 | [diff] [blame] | 1977 | ifdef OPENSSL_SHA256 |
| 1978 | EXTLIBS += $(LIB_4_CRYPTO) |
| 1979 | BASIC_CFLAGS += -DSHA256_OPENSSL |
| 1980 | else |
brian m. carlson | e555735 | 2022-07-10 13:29:07 +0000 | [diff] [blame] | 1981 | ifdef NETTLE_SHA256 |
| 1982 | BASIC_CFLAGS += -DSHA256_NETTLE |
| 1983 | EXTLIBS += -lnettle |
| 1984 | else |
brian m. carlson | 27dc04c | 2018-11-14 04:09:37 +0000 | [diff] [blame] | 1985 | ifdef GCRYPT_SHA256 |
| 1986 | BASIC_CFLAGS += -DSHA256_GCRYPT |
| 1987 | EXTLIBS += -lgcrypt |
| 1988 | else |
| 1989 | LIB_OBJS += sha256/block/sha256.o |
| 1990 | BASIC_CFLAGS += -DSHA256_BLK |
| 1991 | endif |
brian m. carlson | 4b4e291 | 2018-11-14 04:09:38 +0000 | [diff] [blame] | 1992 | endif |
brian m. carlson | e555735 | 2022-07-10 13:29:07 +0000 | [diff] [blame] | 1993 | endif |
brian m. carlson | 13eeedb | 2018-11-14 04:09:36 +0000 | [diff] [blame] | 1994 | |
Atousa Pahlevan Duprat | 001fd7a | 2015-11-04 22:38:42 -0800 | [diff] [blame] | 1995 | ifdef SHA1_MAX_BLOCK_SIZE |
| 1996 | LIB_OBJS += compat/sha1-chunked.o |
| 1997 | BASIC_CFLAGS += -DSHA1_MAX_BLOCK_SIZE="$(SHA1_MAX_BLOCK_SIZE)" |
| 1998 | endif |
Alex Riesen | fa0c87c | 2007-06-13 20:54:32 +0200 | [diff] [blame] | 1999 | ifdef NO_HSTRERROR |
| 2000 | COMPAT_CFLAGS += -DNO_HSTRERROR |
| 2001 | COMPAT_OBJS += compat/hstrerror.o |
| 2002 | endif |
René Scharfe | b21b9f1 | 2007-09-07 00:32:54 +0200 | [diff] [blame] | 2003 | ifdef NO_MEMMEM |
| 2004 | COMPAT_CFLAGS += -DNO_MEMMEM |
| 2005 | COMPAT_OBJS += compat/memmem.o |
| 2006 | endif |
Matt Kraai | 40036be | 2012-12-18 14:03:55 -0800 | [diff] [blame] | 2007 | ifdef NO_GETPAGESIZE |
| 2008 | COMPAT_CFLAGS += -DNO_GETPAGESIZE |
| 2009 | endif |
Brian Downing | 43fe901 | 2008-02-05 15:10:44 -0600 | [diff] [blame] | 2010 | ifdef INTERNAL_QSORT |
| 2011 | COMPAT_CFLAGS += -DINTERNAL_QSORT |
Brian Downing | 43fe901 | 2008-02-05 15:10:44 -0600 | [diff] [blame] | 2012 | endif |
René Scharfe | 04ee8b8 | 2017-01-22 18:51:11 +0100 | [diff] [blame] | 2013 | ifdef HAVE_ISO_QSORT_S |
| 2014 | COMPAT_CFLAGS += -DHAVE_ISO_QSORT_S |
| 2015 | else |
| 2016 | COMPAT_OBJS += compat/qsort_s.o |
| 2017 | endif |
Steffen Prohaska | 35fb0e86 | 2009-01-18 13:00:14 +0100 | [diff] [blame] | 2018 | ifdef RUNTIME_PREFIX |
| 2019 | COMPAT_CFLAGS += -DRUNTIME_PREFIX |
| 2020 | endif |
Alex Riesen | b777434 | 2007-03-07 00:44:49 +0100 | [diff] [blame] | 2021 | |
Junio C Hamano | 46059cc | 2008-11-15 04:08:14 -0800 | [diff] [blame] | 2022 | ifdef NO_PTHREADS |
Junio C Hamano | 46059cc | 2008-11-15 04:08:14 -0800 | [diff] [blame] | 2023 | BASIC_CFLAGS += -DNO_PTHREADS |
| 2024 | else |
Gary V. Vaughan | 48793cf | 2010-05-14 09:31:34 +0000 | [diff] [blame] | 2025 | BASIC_CFLAGS += $(PTHREAD_CFLAGS) |
Junio C Hamano | 46059cc | 2008-11-15 04:08:14 -0800 | [diff] [blame] | 2026 | EXTLIBS += $(PTHREAD_LIBS) |
Nicolas Pitre | 8ecce68 | 2007-09-06 02:13:11 -0400 | [diff] [blame] | 2027 | endif |
Dan McGee | 7eb151d | 2010-01-29 19:22:19 -0600 | [diff] [blame] | 2028 | |
Chris Webb | cb6a22c | 2010-04-13 10:07:13 +0100 | [diff] [blame] | 2029 | ifdef HAVE_PATHS_H |
| 2030 | BASIC_CFLAGS += -DHAVE_PATHS_H |
| 2031 | endif |
| 2032 | |
Ævar Arnfjörð Bjarmason | 5e9637c | 2011-11-18 00:14:42 +0100 | [diff] [blame] | 2033 | ifdef HAVE_LIBCHARSET_H |
| 2034 | BASIC_CFLAGS += -DHAVE_LIBCHARSET_H |
Дилян Палаузов | b522528 | 2012-02-12 17:23:36 +0100 | [diff] [blame] | 2035 | EXTLIBS += $(CHARSET_LIB) |
Ævar Arnfjörð Bjarmason | 5e9637c | 2011-11-18 00:14:42 +0100 | [diff] [blame] | 2036 | endif |
| 2037 | |
David Michael | b3e103d | 2012-12-14 14:57:01 -0500 | [diff] [blame] | 2038 | ifdef HAVE_STRINGS_H |
| 2039 | BASIC_CFLAGS += -DHAVE_STRINGS_H |
| 2040 | endif |
| 2041 | |
Jeff King | 21aeafc | 2011-12-10 05:41:01 -0500 | [diff] [blame] | 2042 | ifdef HAVE_DEV_TTY |
| 2043 | BASIC_CFLAGS += -DHAVE_DEV_TTY |
| 2044 | endif |
| 2045 | |
Alex Riesen | 81a24b5 | 2008-03-05 00:15:39 +0100 | [diff] [blame] | 2046 | ifdef DIR_HAS_BSD_GROUP_SEMANTICS |
| 2047 | COMPAT_CFLAGS += -DDIR_HAS_BSD_GROUP_SEMANTICS |
| 2048 | endif |
Johannes Sixt | 34779c5 | 2009-04-20 10:17:00 +0200 | [diff] [blame] | 2049 | ifdef UNRELIABLE_FSTAT |
| 2050 | BASIC_CFLAGS += -DUNRELIABLE_FSTAT |
| 2051 | endif |
Jeff King | 02232ad | 2009-06-16 15:07:40 -0400 | [diff] [blame] | 2052 | ifdef NO_REGEX |
| 2053 | COMPAT_CFLAGS += -Icompat/regex |
| 2054 | COMPAT_OBJS += compat/regex/regex.o |
René Scharfe | 54463d3 | 2023-01-08 01:42:04 +0100 | [diff] [blame] | 2055 | else |
| 2056 | ifdef USE_ENHANCED_BASIC_REGULAR_EXPRESSIONS |
| 2057 | COMPAT_CFLAGS += -DUSE_ENHANCED_BASIC_REGULAR_EXPRESSIONS |
| 2058 | COMPAT_OBJS += compat/regcomp_enhanced.o |
| 2059 | endif |
Jeff King | 02232ad | 2009-06-16 15:07:40 -0400 | [diff] [blame] | 2060 | endif |
Pat Thoyts | 5491e9e | 2014-08-30 23:38:59 +0200 | [diff] [blame] | 2061 | ifdef NATIVE_CRLF |
| 2062 | BASIC_CFLAGS += -DNATIVE_CRLF |
| 2063 | endif |
Nicolas Pitre | 8ecce68 | 2007-09-06 02:13:11 -0400 | [diff] [blame] | 2064 | |
Marius Storm-Olsen | f0ed822 | 2009-05-31 18:15:23 +0200 | [diff] [blame] | 2065 | ifdef USE_NED_ALLOCATOR |
René Scharfe | ca2baa3 | 2016-09-03 17:59:15 +0200 | [diff] [blame] | 2066 | COMPAT_CFLAGS += -Icompat/nedmalloc |
| 2067 | COMPAT_OBJS += compat/nedmalloc/nedmalloc.o |
| 2068 | OVERRIDE_STRDUP = YesPlease |
| 2069 | endif |
| 2070 | |
| 2071 | ifdef OVERRIDE_STRDUP |
| 2072 | COMPAT_CFLAGS += -DOVERRIDE_STRDUP |
| 2073 | COMPAT_OBJS += compat/strdup.o |
Marius Storm-Olsen | f0ed822 | 2009-05-31 18:15:23 +0200 | [diff] [blame] | 2074 | endif |
| 2075 | |
Junio C Hamano | 7b3bdbb | 2010-05-31 17:35:20 -0700 | [diff] [blame] | 2076 | ifdef GIT_TEST_CMP_USE_COPIED_CONTEXT |
| 2077 | export GIT_TEST_CMP_USE_COPIED_CONTEXT |
| 2078 | endif |
| 2079 | |
Ævar Arnfjörð Bjarmason | 5e9637c | 2011-11-18 00:14:42 +0100 | [diff] [blame] | 2080 | ifndef NO_MSGFMT_EXTENDED_OPTIONS |
Ævar Arnfjörð Bjarmason | 2f12b31 | 2021-12-17 01:10:00 +0100 | [diff] [blame] | 2081 | MSGFMT += --check |
Ævar Arnfjörð Bjarmason | 5e9637c | 2011-11-18 00:14:42 +0100 | [diff] [blame] | 2082 | endif |
| 2083 | |
Karsten Blees | 148d677 | 2014-07-12 02:05:42 +0200 | [diff] [blame] | 2084 | ifdef HAVE_CLOCK_GETTIME |
| 2085 | BASIC_CFLAGS += -DHAVE_CLOCK_GETTIME |
Karsten Blees | 148d677 | 2014-07-12 02:05:42 +0200 | [diff] [blame] | 2086 | endif |
| 2087 | |
Reuben Hawkins | a6c3c63 | 2015-01-08 12:00:56 -0800 | [diff] [blame] | 2088 | ifdef HAVE_CLOCK_MONOTONIC |
| 2089 | BASIC_CFLAGS += -DHAVE_CLOCK_MONOTONIC |
| 2090 | endif |
| 2091 | |
Neeraj Singh | abf38ab | 2022-03-10 22:43:20 +0000 | [diff] [blame] | 2092 | ifdef HAVE_SYNC_FILE_RANGE |
| 2093 | BASIC_CFLAGS += -DHAVE_SYNC_FILE_RANGE |
| 2094 | endif |
| 2095 | |
Ronald Wampler | d19e3a5 | 2016-07-07 16:45:54 -0400 | [diff] [blame] | 2096 | ifdef NEEDS_LIBRT |
| 2097 | EXTLIBS += -lrt |
| 2098 | endif |
| 2099 | |
Kyle J. McKay | 9529080 | 2015-03-07 23:14:36 -0800 | [diff] [blame] | 2100 | ifdef HAVE_BSD_SYSCTL |
| 2101 | BASIC_CFLAGS += -DHAVE_BSD_SYSCTL |
| 2102 | endif |
| 2103 | |
Dan Jacques | 226c0dd | 2018-04-10 11:05:44 -0400 | [diff] [blame] | 2104 | ifdef HAVE_BSD_KERN_PROC_SYSCTL |
| 2105 | BASIC_CFLAGS += -DHAVE_BSD_KERN_PROC_SYSCTL |
| 2106 | endif |
| 2107 | |
Jeff King | 0cc30e0 | 2015-04-16 05:01:38 -0400 | [diff] [blame] | 2108 | ifdef HAVE_GETDELIM |
| 2109 | BASIC_CFLAGS += -DHAVE_GETDELIM |
| 2110 | endif |
| 2111 | |
brian m. carlson | 05cd988 | 2022-01-17 21:56:16 +0000 | [diff] [blame] | 2112 | ifneq ($(findstring arc4random,$(CSPRNG_METHOD)),) |
| 2113 | BASIC_CFLAGS += -DHAVE_ARC4RANDOM |
| 2114 | endif |
| 2115 | |
| 2116 | ifneq ($(findstring libbsd,$(CSPRNG_METHOD)),) |
| 2117 | BASIC_CFLAGS += -DHAVE_ARC4RANDOM_LIBBSD |
| 2118 | EXTLIBS += -lbsd |
| 2119 | endif |
| 2120 | |
| 2121 | ifneq ($(findstring getrandom,$(CSPRNG_METHOD)),) |
| 2122 | BASIC_CFLAGS += -DHAVE_GETRANDOM |
| 2123 | endif |
| 2124 | |
| 2125 | ifneq ($(findstring getentropy,$(CSPRNG_METHOD)),) |
| 2126 | BASIC_CFLAGS += -DHAVE_GETENTROPY |
| 2127 | endif |
| 2128 | |
| 2129 | ifneq ($(findstring rtlgenrandom,$(CSPRNG_METHOD)),) |
| 2130 | BASIC_CFLAGS += -DHAVE_RTLGENRANDOM |
| 2131 | endif |
| 2132 | |
| 2133 | ifneq ($(findstring openssl,$(CSPRNG_METHOD)),) |
| 2134 | BASIC_CFLAGS += -DHAVE_OPENSSL_CSPRNG |
Carlo Marcelo Arenas Belón | 5b52d9f | 2022-04-04 21:28:26 -0700 | [diff] [blame] | 2135 | EXTLIBS += -lcrypto -lssl |
brian m. carlson | 05cd988 | 2022-01-17 21:56:16 +0000 | [diff] [blame] | 2136 | endif |
| 2137 | |
Dan Jacques | 226c0dd | 2018-04-10 11:05:44 -0400 | [diff] [blame] | 2138 | ifneq ($(PROCFS_EXECUTABLE_PATH),) |
| 2139 | procfs_executable_path_SQ = $(subst ','\'',$(PROCFS_EXECUTABLE_PATH)) |
| 2140 | BASIC_CFLAGS += '-DPROCFS_EXECUTABLE_PATH="$(procfs_executable_path_SQ)"' |
| 2141 | endif |
| 2142 | |
Emily Shaffer | b7e6a41 | 2021-07-21 18:27:06 -0700 | [diff] [blame] | 2143 | ifndef HAVE_PLATFORM_PROCINFO |
| 2144 | COMPAT_OBJS += compat/stub/procinfo.o |
| 2145 | endif |
| 2146 | |
Dan Jacques | 226c0dd | 2018-04-10 11:05:44 -0400 | [diff] [blame] | 2147 | ifdef HAVE_NS_GET_EXECUTABLE_PATH |
| 2148 | BASIC_CFLAGS += -DHAVE_NS_GET_EXECUTABLE_PATH |
| 2149 | endif |
| 2150 | |
Johannes Schindelin | c1be1cb | 2018-04-10 11:05:45 -0400 | [diff] [blame] | 2151 | ifdef HAVE_WPGMPTR |
| 2152 | BASIC_CFLAGS += -DHAVE_WPGMPTR |
| 2153 | endif |
| 2154 | |
Duy Nguyen | 18a4f6b | 2019-02-12 21:14:41 +0700 | [diff] [blame] | 2155 | ifdef FILENO_IS_A_MACRO |
| 2156 | COMPAT_CFLAGS += -DFILENO_IS_A_MACRO |
| 2157 | COMPAT_OBJS += compat/fileno.o |
| 2158 | endif |
| 2159 | |
Clément Chigot | 400caaf | 2019-04-25 07:01:56 +0000 | [diff] [blame] | 2160 | ifdef NEED_ACCESS_ROOT_HANDLER |
| 2161 | COMPAT_CFLAGS += -DNEED_ACCESS_ROOT_HANDLER |
| 2162 | COMPAT_OBJS += compat/access.o |
| 2163 | endif |
| 2164 | |
Jeff Hostetler | 62c7367 | 2022-03-25 18:02:51 +0000 | [diff] [blame] | 2165 | ifdef FSMONITOR_DAEMON_BACKEND |
| 2166 | COMPAT_CFLAGS += -DHAVE_FSMONITOR_DAEMON_BACKEND |
| 2167 | COMPAT_OBJS += compat/fsmonitor/fsm-listen-$(FSMONITOR_DAEMON_BACKEND).o |
Jeff Hostetler | d060555 | 2022-05-26 21:47:10 +0000 | [diff] [blame] | 2168 | COMPAT_OBJS += compat/fsmonitor/fsm-health-$(FSMONITOR_DAEMON_BACKEND).o |
Eric DeCosta | 6beb268 | 2022-10-04 17:32:27 +0000 | [diff] [blame] | 2169 | COMPAT_OBJS += compat/fsmonitor/fsm-ipc-$(FSMONITOR_DAEMON_BACKEND).o |
Jeff Hostetler | 62c7367 | 2022-03-25 18:02:51 +0000 | [diff] [blame] | 2170 | endif |
| 2171 | |
Jeff Hostetler | d33c804 | 2022-05-26 21:46:59 +0000 | [diff] [blame] | 2172 | ifdef FSMONITOR_OS_SETTINGS |
| 2173 | COMPAT_CFLAGS += -DHAVE_FSMONITOR_OS_SETTINGS |
| 2174 | COMPAT_OBJS += compat/fsmonitor/fsm-settings-$(FSMONITOR_OS_SETTINGS).o |
Eric DeCosta | 508c1a5 | 2022-10-04 17:32:26 +0000 | [diff] [blame] | 2175 | COMPAT_OBJS += compat/fsmonitor/fsm-path-utils-$(FSMONITOR_OS_SETTINGS).o |
Jeff King | 499c293 | 2009-04-03 15:32:20 -0400 | [diff] [blame] | 2176 | endif |
| 2177 | |
Johan Herland | d4e1b47 | 2009-11-18 02:42:31 +0100 | [diff] [blame] | 2178 | ifeq ($(TCLTK_PATH),) |
Stefano Lattarini | dd6fc7c | 2012-12-09 11:36:17 +0100 | [diff] [blame] | 2179 | NO_TCLTK = NoThanks |
Johan Herland | d4e1b47 | 2009-11-18 02:42:31 +0100 | [diff] [blame] | 2180 | endif |
| 2181 | |
Eric Wong | 995bc22 | 2016-08-04 11:40:25 +0000 | [diff] [blame] | 2182 | ifeq ($(PERL_PATH),) |
| 2183 | NO_PERL = NoThanks |
| 2184 | endif |
| 2185 | |
Fernando J. Pereda | 3b486cd | 2007-04-04 22:42:33 +0200 | [diff] [blame] | 2186 | ifeq ($(PYTHON_PATH),) |
Alex Riesen | b777434 | 2007-03-07 00:44:49 +0100 | [diff] [blame] | 2187 | NO_PYTHON = NoThanks |
| 2188 | endif |
John Keeping | ef49e05 | 2015-09-05 13:22:10 +0100 | [diff] [blame] | 2189 | |
Alex Riesen | a6f3709 | 2007-03-07 00:05:34 +0100 | [diff] [blame] | 2190 | ifndef PAGER_ENV |
| 2191 | PAGER_ENV = LESS=FRX LV=-c |
| 2192 | endif |
| 2193 | |
Junio C Hamano | 70de5e6 | 2012-05-02 15:12:10 -0700 | [diff] [blame] | 2194 | ifdef NO_INSTALL_HARDLINKS |
| 2195 | export NO_INSTALL_HARDLINKS |
| 2196 | endif |
| 2197 | |
Theodore Ts'o | f2d713f | 2012-02-06 01:00:17 -0500 | [diff] [blame] | 2198 | ### profile feedback build |
| 2199 | # |
| 2200 | |
| 2201 | # Can adjust this to be a global directory if you want to do extended |
| 2202 | # data gathering |
| 2203 | PROFILE_DIR := $(CURDIR) |
| 2204 | |
Johannes Sixt | e60ec75 | 2012-02-09 09:22:26 +0100 | [diff] [blame] | 2205 | ifeq ("$(PROFILE)","GEN") |
Andi Kleen | 0be314c | 2014-07-04 16:43:48 -0700 | [diff] [blame] | 2206 | BASIC_CFLAGS += -fprofile-generate=$(PROFILE_DIR) -DNO_NORETURN=1 |
Theodore Ts'o | f2d713f | 2012-02-06 01:00:17 -0500 | [diff] [blame] | 2207 | EXTLIBS += -lgcov |
Stefano Lattarini | dd6fc7c | 2012-12-09 11:36:17 +0100 | [diff] [blame] | 2208 | export CCACHE_DISABLE = t |
| 2209 | V = 1 |
Johannes Sixt | e60ec75 | 2012-02-09 09:22:26 +0100 | [diff] [blame] | 2210 | else |
| 2211 | ifneq ("$(PROFILE)","") |
Andi Kleen | 0be314c | 2014-07-04 16:43:48 -0700 | [diff] [blame] | 2212 | BASIC_CFLAGS += -fprofile-use=$(PROFILE_DIR) -fprofile-correction -DNO_NORETURN=1 |
Stefano Lattarini | dd6fc7c | 2012-12-09 11:36:17 +0100 | [diff] [blame] | 2213 | export CCACHE_DISABLE = t |
| 2214 | V = 1 |
Theodore Ts'o | f2d713f | 2012-02-06 01:00:17 -0500 | [diff] [blame] | 2215 | endif |
Johannes Sixt | e60ec75 | 2012-02-09 09:22:26 +0100 | [diff] [blame] | 2216 | endif |
Theodore Ts'o | f2d713f | 2012-02-06 01:00:17 -0500 | [diff] [blame] | 2217 | |
Pavel Roskin | addf88e | 2006-07-09 03:44:30 -0400 | [diff] [blame] | 2218 | # Shell quote (do not use $(call) to accommodate ancient setups); |
Johannes Schindelin | 39c015c | 2006-02-18 12:40:22 +0100 | [diff] [blame] | 2219 | |
Johannes Schindelin | 32043c9 | 2007-02-14 12:48:14 +0100 | [diff] [blame] | 2220 | ETC_GITCONFIG_SQ = $(subst ','\'',$(ETC_GITCONFIG)) |
Petr Onderka | 6df42ab | 2010-09-01 00:42:43 +0200 | [diff] [blame] | 2221 | ETC_GITATTRIBUTES_SQ = $(subst ','\'',$(ETC_GITATTRIBUTES)) |
Johannes Schindelin | 39c015c | 2006-02-18 12:40:22 +0100 | [diff] [blame] | 2222 | |
| 2223 | DESTDIR_SQ = $(subst ','\'',$(DESTDIR)) |
Ævar Arnfjörð Bjarmason | 256c2dc | 2021-05-05 14:21:41 +0200 | [diff] [blame] | 2224 | NO_GETTEXT_SQ = $(subst ','\'',$(NO_GETTEXT)) |
Johannes Schindelin | 39c015c | 2006-02-18 12:40:22 +0100 | [diff] [blame] | 2225 | bindir_SQ = $(subst ','\'',$(bindir)) |
Steffen Prohaska | 026fa0d | 2009-01-18 13:00:09 +0100 | [diff] [blame] | 2226 | bindir_relative_SQ = $(subst ','\'',$(bindir_relative)) |
Ævar Arnfjörð Bjarmason | 20d2a30 | 2017-12-10 21:13:33 +0000 | [diff] [blame] | 2227 | mandir_SQ = $(subst ','\'',$(mandir)) |
John Keeping | 971f853 | 2013-02-24 19:55:01 +0000 | [diff] [blame] | 2228 | mandir_relative_SQ = $(subst ','\'',$(mandir_relative)) |
| 2229 | infodir_relative_SQ = $(subst ','\'',$(infodir_relative)) |
Ævar Arnfjörð Bjarmason | 20d2a30 | 2017-12-10 21:13:33 +0000 | [diff] [blame] | 2230 | perllibdir_SQ = $(subst ','\'',$(perllibdir)) |
Ævar Arnfjörð Bjarmason | 5e9637c | 2011-11-18 00:14:42 +0100 | [diff] [blame] | 2231 | localedir_SQ = $(subst ','\'',$(localedir)) |
Dan Jacques | 07d90ea | 2018-04-10 11:05:43 -0400 | [diff] [blame] | 2232 | localedir_relative_SQ = $(subst ','\'',$(localedir_relative)) |
Johannes Schindelin | 39c015c | 2006-02-18 12:40:22 +0100 | [diff] [blame] | 2233 | gitexecdir_SQ = $(subst ','\'',$(gitexecdir)) |
Ævar Arnfjörð Bjarmason | a4d79b9 | 2018-03-13 20:39:34 +0000 | [diff] [blame] | 2234 | gitexecdir_relative_SQ = $(subst ','\'',$(gitexecdir_relative)) |
Johannes Schindelin | 39c015c | 2006-02-18 12:40:22 +0100 | [diff] [blame] | 2235 | template_dir_SQ = $(subst ','\'',$(template_dir)) |
John Keeping | 971f853 | 2013-02-24 19:55:01 +0000 | [diff] [blame] | 2236 | htmldir_relative_SQ = $(subst ','\'',$(htmldir_relative)) |
Yakov Lerner | ca3bcab | 2006-06-15 01:36:00 +0300 | [diff] [blame] | 2237 | prefix_SQ = $(subst ','\'',$(prefix)) |
Dan Jacques | 07d90ea | 2018-04-10 11:05:43 -0400 | [diff] [blame] | 2238 | perllibdir_relative_SQ = $(subst ','\'',$(perllibdir_relative)) |
Pavan Kumar Sunkara | c0cb4ed | 2010-05-28 11:55:52 +0530 | [diff] [blame] | 2239 | gitwebdir_SQ = $(subst ','\'',$(gitwebdir)) |
Ævar Arnfjörð Bjarmason | affc3b7 | 2022-06-28 12:16:00 +0200 | [diff] [blame] | 2240 | gitwebstaticdir_SQ = $(subst ','\'',$(gitwebstaticdir)) |
Johannes Schindelin | 39c015c | 2006-02-18 12:40:22 +0100 | [diff] [blame] | 2241 | |
| 2242 | SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH)) |
Jeff King | 3f824e9 | 2017-12-08 05:47:22 -0500 | [diff] [blame] | 2243 | TEST_SHELL_PATH_SQ = $(subst ','\'',$(TEST_SHELL_PATH)) |
Johannes Schindelin | 39c015c | 2006-02-18 12:40:22 +0100 | [diff] [blame] | 2244 | PERL_PATH_SQ = $(subst ','\'',$(PERL_PATH)) |
Johan Herland | d4e1b47 | 2009-11-18 02:42:31 +0100 | [diff] [blame] | 2245 | PYTHON_PATH_SQ = $(subst ','\'',$(PYTHON_PATH)) |
Eygene Ryabinkin | 81b63c7 | 2007-03-28 04:12:07 -0700 | [diff] [blame] | 2246 | TCLTK_PATH_SQ = $(subst ','\'',$(TCLTK_PATH)) |
Junio C Hamano | 09ce4bb | 2010-06-05 09:36:13 -0700 | [diff] [blame] | 2247 | DIFF_SQ = $(subst ','\'',$(DIFF)) |
Jonathan Nieder | 0386dd3 | 2013-11-15 13:10:28 -0800 | [diff] [blame] | 2248 | PERLLIB_EXTRA_SQ = $(subst ','\'',$(PERLLIB_EXTRA)) |
Johannes Schindelin | 39c015c | 2006-02-18 12:40:22 +0100 | [diff] [blame] | 2249 | |
Dan Jacques | 07d90ea | 2018-04-10 11:05:43 -0400 | [diff] [blame] | 2250 | # RUNTIME_PREFIX's resolution logic requires resource paths to be expressed |
| 2251 | # relative to each other and share an installation path. |
| 2252 | # |
| 2253 | # This is a dependency in: |
| 2254 | # - Git's binary RUNTIME_PREFIX logic in (see "exec_cmd.c"). |
| 2255 | # - The runtime prefix Perl header (see |
| 2256 | # "perl/header_templates/runtime_prefix.template.pl"). |
| 2257 | ifdef RUNTIME_PREFIX |
| 2258 | |
| 2259 | ifneq ($(filter /%,$(firstword $(gitexecdir_relative))),) |
| 2260 | $(error RUNTIME_PREFIX requires a relative gitexecdir, not: $(gitexecdir)) |
| 2261 | endif |
| 2262 | |
| 2263 | ifneq ($(filter /%,$(firstword $(localedir_relative))),) |
| 2264 | $(error RUNTIME_PREFIX requires a relative localedir, not: $(localedir)) |
| 2265 | endif |
| 2266 | |
| 2267 | ifndef NO_PERL |
| 2268 | ifneq ($(filter /%,$(firstword $(perllibdir_relative))),) |
| 2269 | $(error RUNTIME_PREFIX requires a relative perllibdir, not: $(perllibdir)) |
| 2270 | endif |
| 2271 | endif |
| 2272 | |
| 2273 | endif |
| 2274 | |
Jeff King | 3f2e229 | 2016-07-01 01:58:58 -0400 | [diff] [blame] | 2275 | # We must filter out any object files from $(GITLIBS), |
| 2276 | # as it is typically used like: |
| 2277 | # |
| 2278 | # foo: foo.o $(GITLIBS) |
| 2279 | # $(CC) $(filter %.o,$^) $(LIBS) |
| 2280 | # |
| 2281 | # where we use it as a dependency. Since we also pull object files |
| 2282 | # from the dependency list, that would make each entry appear twice. |
| 2283 | LIBS = $(filter-out %.o, $(GITLIBS)) $(EXTLIBS) |
Petr Baudis | d595a47 | 2006-06-24 18:35:12 -0700 | [diff] [blame] | 2284 | |
brian m. carlson | f18f816 | 2017-03-11 22:28:18 +0000 | [diff] [blame] | 2285 | BASIC_CFLAGS += $(COMPAT_CFLAGS) |
Jason Riedy | e40b61f | 2005-12-02 15:08:28 -0800 | [diff] [blame] | 2286 | LIB_OBJS += $(COMPAT_OBJS) |
Petr Baudis | 8d7f586 | 2006-06-25 03:47:03 +0200 | [diff] [blame] | 2287 | |
Jonathan Nieder | 8f4b576 | 2009-10-30 20:44:41 -0500 | [diff] [blame] | 2288 | # Quote for C |
| 2289 | |
| 2290 | ifdef DEFAULT_EDITOR |
| 2291 | DEFAULT_EDITOR_CQ = "$(subst ",\",$(subst \,\\,$(DEFAULT_EDITOR)))" |
| 2292 | DEFAULT_EDITOR_CQ_SQ = $(subst ','\'',$(DEFAULT_EDITOR_CQ)) |
| 2293 | |
| 2294 | BASIC_CFLAGS += -DDEFAULT_EDITOR='$(DEFAULT_EDITOR_CQ_SQ)' |
| 2295 | endif |
| 2296 | |
Junio C Hamano | a3d023d | 2009-10-30 20:45:34 -0500 | [diff] [blame] | 2297 | ifdef DEFAULT_PAGER |
| 2298 | DEFAULT_PAGER_CQ = "$(subst ",\",$(subst \,\\,$(DEFAULT_PAGER)))" |
| 2299 | DEFAULT_PAGER_CQ_SQ = $(subst ','\'',$(DEFAULT_PAGER_CQ)) |
| 2300 | |
| 2301 | BASIC_CFLAGS += -DDEFAULT_PAGER='$(DEFAULT_PAGER_CQ_SQ)' |
| 2302 | endif |
| 2303 | |
Ben Walton | b3e34dd | 2012-03-30 21:33:21 -0400 | [diff] [blame] | 2304 | ifdef SHELL_PATH |
| 2305 | SHELL_PATH_CQ = "$(subst ",\",$(subst \,\\,$(SHELL_PATH)))" |
| 2306 | SHELL_PATH_CQ_SQ = $(subst ','\'',$(SHELL_PATH_CQ)) |
| 2307 | |
| 2308 | BASIC_CFLAGS += -DSHELL_PATH='$(SHELL_PATH_CQ_SQ)' |
| 2309 | endif |
| 2310 | |
Jeff King | 42dcbb7 | 2012-06-02 15:01:12 -0400 | [diff] [blame] | 2311 | GIT_USER_AGENT_SQ = $(subst ','\'',$(GIT_USER_AGENT)) |
| 2312 | GIT_USER_AGENT_CQ = "$(subst ",\",$(subst \,\\,$(GIT_USER_AGENT)))" |
| 2313 | GIT_USER_AGENT_CQ_SQ = $(subst ','\'',$(GIT_USER_AGENT_CQ)) |
Jeff King | 620c293 | 2012-06-20 14:31:51 -0400 | [diff] [blame] | 2314 | GIT-USER-AGENT: FORCE |
| 2315 | @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] | 2316 | echo '$(GIT_USER_AGENT_SQ)' >GIT-USER-AGENT; \ |
| 2317 | fi |
Jeff King | 42dcbb7 | 2012-06-02 15:01:12 -0400 | [diff] [blame] | 2318 | |
Vincent van Ravesteijn | 1cc8af0 | 2012-06-06 20:28:16 +0000 | [diff] [blame] | 2319 | ifdef DEFAULT_HELP_FORMAT |
| 2320 | BASIC_CFLAGS += -DDEFAULT_HELP_FORMAT='"$(DEFAULT_HELP_FORMAT)"' |
| 2321 | endif |
| 2322 | |
Petr Baudis | 8d7f586 | 2006-06-25 03:47:03 +0200 | [diff] [blame] | 2323 | ALL_CFLAGS += $(BASIC_CFLAGS) |
| 2324 | ALL_LDFLAGS += $(BASIC_LDFLAGS) |
| 2325 | |
Gary V. Vaughan | d1b1a91 | 2010-05-14 09:31:36 +0000 | [diff] [blame] | 2326 | export DIFF TAR INSTALL DESTDIR SHELL_PATH |
Petr Baudis | d595a47 | 2006-06-24 18:35:12 -0700 | [diff] [blame] | 2327 | |
| 2328 | |
Petr Baudis | 28818ff | 2005-07-29 17:50:24 +0200 | [diff] [blame] | 2329 | ### Build rules |
Linus Torvalds | 8996702 | 2005-04-30 13:19:56 -0700 | [diff] [blame] | 2330 | |
Brandon Casey | c94c8e5 | 2008-08-07 14:03:42 -0500 | [diff] [blame] | 2331 | SHELL = $(SHELL_PATH) |
| 2332 | |
Theodore Ts'o | f2d713f | 2012-02-06 01:00:17 -0500 | [diff] [blame] | 2333 | all:: shell_compatibility_test |
| 2334 | |
| 2335 | ifeq "$(PROFILE)" "BUILD" |
Andi Kleen | 066dd26 | 2014-07-07 23:35:11 -0700 | [diff] [blame] | 2336 | all:: profile |
| 2337 | endif |
| 2338 | |
| 2339 | profile:: profile-clean |
Theodore Ts'o | f2d713f | 2012-02-06 01:00:17 -0500 | [diff] [blame] | 2340 | $(MAKE) PROFILE=GEN all |
| 2341 | $(MAKE) PROFILE=GEN -j1 test |
Jeff King | 93b5393 | 2014-08-19 02:12:03 -0400 | [diff] [blame] | 2342 | @if test -n "$$GIT_PERF_REPO" || test -d .git; then \ |
| 2343 | $(MAKE) PROFILE=GEN -j1 perf; \ |
| 2344 | else \ |
| 2345 | echo "Skipping profile of perf tests..."; \ |
| 2346 | fi |
Andi Kleen | 066dd26 | 2014-07-07 23:35:11 -0700 | [diff] [blame] | 2347 | $(MAKE) PROFILE=USE all |
| 2348 | |
| 2349 | profile-fast: profile-clean |
| 2350 | $(MAKE) PROFILE=GEN all |
| 2351 | $(MAKE) PROFILE=GEN -j1 perf |
| 2352 | $(MAKE) PROFILE=USE all |
| 2353 | |
Theodore Ts'o | f2d713f | 2012-02-06 01:00:17 -0500 | [diff] [blame] | 2354 | |
Johannes Schindelin | 179227d | 2020-09-21 22:28:16 +0000 | [diff] [blame] | 2355 | all:: $(ALL_COMMANDS_TO_INSTALL) $(SCRIPT_LIB) $(OTHER_PROGRAMS) GIT-BUILD-OPTIONS |
Junio C Hamano | 6fc301b | 2007-01-10 12:24:54 -0800 | [diff] [blame] | 2356 | ifneq (,$X) |
Patrick Steinhardt | 615993d | 2023-11-10 11:01:28 +0100 | [diff] [blame] | 2357 | $(QUIET_BUILT_IN)$(foreach p,$(patsubst %$X,%,$(filter %$X,$(ALL_COMMANDS_TO_INSTALL) $(OTHER_PROGRAMS))), if test ! -d '$p' && test ! '$p' -ef '$p$X'; then $(RM) '$p'; fi;) |
Junio C Hamano | 6fc301b | 2007-01-10 12:24:54 -0800 | [diff] [blame] | 2358 | endif |
Petr Baudis | 28818ff | 2005-07-29 17:50:24 +0200 | [diff] [blame] | 2359 | |
Junio C Hamano | 6fc301b | 2007-01-10 12:24:54 -0800 | [diff] [blame] | 2360 | all:: |
Eygene Ryabinkin | 3cfaf11 | 2007-03-28 04:00:23 -0700 | [diff] [blame] | 2361 | ifndef NO_TCLTK |
Junio C Hamano | e84a063 | 2008-07-28 00:02:48 -0700 | [diff] [blame] | 2362 | $(QUIET_SUBDIR0)git-gui $(QUIET_SUBDIR1) gitexecdir='$(gitexec_instdir_SQ)' all |
Junio C Hamano | 62ba514 | 2007-11-17 10:51:16 -0800 | [diff] [blame] | 2363 | $(QUIET_SUBDIR0)gitk-git $(QUIET_SUBDIR1) all |
Eygene Ryabinkin | 3cfaf11 | 2007-03-28 04:00:23 -0700 | [diff] [blame] | 2364 | endif |
Ben Walton | 502be95 | 2010-03-20 10:48:08 -0400 | [diff] [blame] | 2365 | $(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] | 2366 | |
Josh Steadmon | 8427b7e | 2024-04-24 11:14:42 -0700 | [diff] [blame] | 2367 | # If you add a new fuzzer, please also make sure to run it in |
| 2368 | # ci/run-build-and-minimal-fuzzers.sh so that we make sure it still links and |
| 2369 | # runs in the future. |
| 2370 | FUZZ_OBJS += oss-fuzz/dummy-cmd-main.o |
| 2371 | FUZZ_OBJS += oss-fuzz/fuzz-commit-graph.o |
| 2372 | FUZZ_OBJS += oss-fuzz/fuzz-config.o |
| 2373 | FUZZ_OBJS += oss-fuzz/fuzz-date.o |
| 2374 | FUZZ_OBJS += oss-fuzz/fuzz-pack-headers.o |
| 2375 | FUZZ_OBJS += oss-fuzz/fuzz-pack-idx.o |
| 2376 | .PHONY: fuzz-objs |
| 2377 | fuzz-objs: $(FUZZ_OBJS) |
| 2378 | |
| 2379 | # Always build fuzz objects even if not testing, to prevent bit-rot. |
| 2380 | all:: $(FUZZ_OBJS) |
| 2381 | |
| 2382 | FUZZ_PROGRAMS += $(patsubst %.o,%,$(filter-out %dummy-cmd-main.o,$(FUZZ_OBJS))) |
| 2383 | |
| 2384 | # Build fuzz programs when possible, even without the necessary fuzzing support, |
| 2385 | # to prevent bit-rot. |
| 2386 | ifdef LINK_FUZZ_PROGRAMS |
| 2387 | all:: $(FUZZ_PROGRAMS) |
| 2388 | endif |
| 2389 | |
Brandon Casey | 6dc4627 | 2008-08-07 14:06:26 -0500 | [diff] [blame] | 2390 | please_set_SHELL_PATH_to_a_more_modern_shell: |
| 2391 | @$$(:) |
| 2392 | |
| 2393 | shell_compatibility_test: please_set_SHELL_PATH_to_a_more_modern_shell |
| 2394 | |
Junio C Hamano | 4dc0002 | 2006-01-12 21:42:25 -0800 | [diff] [blame] | 2395 | strip: $(PROGRAMS) git$X |
Felipe Contreras | 654f23f | 2013-05-24 21:41:02 -0500 | [diff] [blame] | 2396 | $(STRIP) $(STRIP_OPTS) $^ |
Junio C Hamano | 4dc0002 | 2006-01-12 21:42:25 -0800 | [diff] [blame] | 2397 | |
Jonathan Nieder | 7b63c77 | 2012-07-06 23:19:09 -0500 | [diff] [blame] | 2398 | ### Target-specific flags and dependencies |
| 2399 | |
| 2400 | # The generic compilation pattern rule and automatically |
| 2401 | # computed header dependencies (falling back to a dependency on |
| 2402 | # LIB_H) are enough to describe how most targets should be built, |
| 2403 | # but some targets are special enough to need something a little |
| 2404 | # different. |
| 2405 | # |
| 2406 | # - When a source file "foo.c" #includes a generated header file, |
| 2407 | # we need to list that dependency for the "foo.o" target. |
| 2408 | # |
| 2409 | # We also list it from other targets that are built from foo.c |
| 2410 | # like "foo.sp" and "foo.s", even though that is easy to forget |
| 2411 | # to do because the generated header is already present around |
| 2412 | # after a regular build attempt. |
| 2413 | # |
| 2414 | # - Some code depends on configuration kept in makefile |
| 2415 | # variables. The target-specific variable EXTRA_CPPFLAGS can |
| 2416 | # be used to convey that information to the C preprocessor |
| 2417 | # using -D options. |
| 2418 | # |
| 2419 | # The "foo.o" target should have a corresponding dependency on |
| 2420 | # a file that changes when the value of the makefile variable |
| 2421 | # changes. For example, targets making use of the |
| 2422 | # $(GIT_VERSION) variable depend on GIT-VERSION-FILE. |
| 2423 | # |
| 2424 | # Technically the ".sp" and ".s" targets do not need this |
| 2425 | # dependency because they are force-built, but they get the |
| 2426 | # same dependency for consistency. This way, you do not have to |
| 2427 | # know how each target is implemented. And it means the |
| 2428 | # dependencies here will not need to change if the force-build |
| 2429 | # details change some day. |
| 2430 | |
Jeff King | be1dbd0 | 2012-06-20 14:31:55 -0400 | [diff] [blame] | 2431 | git.sp git.s git.o: GIT-PREFIX |
Jeff King | 816fb46 | 2012-06-02 14:51:42 -0400 | [diff] [blame] | 2432 | git.sp git.s git.o: EXTRA_CPPFLAGS = \ |
John Keeping | 971f853 | 2013-02-24 19:55:01 +0000 | [diff] [blame] | 2433 | '-DGIT_HTML_PATH="$(htmldir_relative_SQ)"' \ |
| 2434 | '-DGIT_MAN_PATH="$(mandir_relative_SQ)"' \ |
| 2435 | '-DGIT_INFO_PATH="$(infodir_relative_SQ)"' |
Junio C Hamano | 334d28a | 2007-06-13 01:28:21 -0700 | [diff] [blame] | 2436 | |
Fredrik Kuivinen | d9a25fc | 2011-06-22 12:50:56 +0200 | [diff] [blame] | 2437 | git$X: git.o GIT-LDFLAGS $(BUILTIN_OBJS) $(GITLIBS) |
Jeff King | 3f2e229 | 2016-07-01 01:58:58 -0400 | [diff] [blame] | 2438 | $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) \ |
| 2439 | $(filter %.o,$^) $(LIBS) |
Junio C Hamano | 6a2e50f | 2005-09-07 21:26:52 -0700 | [diff] [blame] | 2440 | |
Nguyễn Thái Ngọc Duy | 60f487a | 2018-05-10 10:46:43 +0200 | [diff] [blame] | 2441 | help.sp help.s help.o: command-list.h |
Ævar Arnfjörð Bjarmason | d3fd1a6 | 2021-12-17 01:13:01 +0100 | [diff] [blame] | 2442 | builtin/bugreport.sp builtin/bugreport.s builtin/bugreport.o: hook-list.h |
Erik Faye-Lund | 6612b9e | 2010-11-26 17:00:39 +0100 | [diff] [blame] | 2443 | |
Ævar Arnfjörð Bjarmason | d3fd1a6 | 2021-12-17 01:13:01 +0100 | [diff] [blame] | 2444 | builtin/help.sp builtin/help.s builtin/help.o: config-list.h GIT-PREFIX |
Ramsay Jones | 0bcd9ae | 2011-04-21 20:14:42 +0100 | [diff] [blame] | 2445 | builtin/help.sp builtin/help.s builtin/help.o: EXTRA_CPPFLAGS = \ |
John Keeping | 971f853 | 2013-02-24 19:55:01 +0000 | [diff] [blame] | 2446 | '-DGIT_HTML_PATH="$(htmldir_relative_SQ)"' \ |
| 2447 | '-DGIT_MAN_PATH="$(mandir_relative_SQ)"' \ |
| 2448 | '-DGIT_INFO_PATH="$(infodir_relative_SQ)"' |
Junio C Hamano | 08df617 | 2006-04-21 21:56:13 -0700 | [diff] [blame] | 2449 | |
Ævar Arnfjörð Bjarmason | 451a7db | 2021-12-17 01:19:15 +0100 | [diff] [blame] | 2450 | PAGER_ENV_SQ = $(subst ','\'',$(PAGER_ENV)) |
| 2451 | PAGER_ENV_CQ = "$(subst ",\",$(subst \,\\,$(PAGER_ENV)))" |
| 2452 | PAGER_ENV_CQ_SQ = $(subst ','\'',$(PAGER_ENV_CQ)) |
| 2453 | pager.sp pager.s pager.o: EXTRA_CPPFLAGS = \ |
| 2454 | -DPAGER_ENV='$(PAGER_ENV_CQ_SQ)' |
| 2455 | |
Jeff King | 520a6cd | 2012-06-20 14:32:22 -0400 | [diff] [blame] | 2456 | version.sp version.s version.o: GIT-VERSION-FILE GIT-USER-AGENT |
Jeff King | 816fb46 | 2012-06-02 14:51:42 -0400 | [diff] [blame] | 2457 | version.sp version.s version.o: EXTRA_CPPFLAGS = \ |
Jeff King | 620c293 | 2012-06-20 14:31:51 -0400 | [diff] [blame] | 2458 | '-DGIT_VERSION="$(GIT_VERSION)"' \ |
Johannes Schindelin | ed32b78 | 2017-12-15 00:34:38 +0100 | [diff] [blame] | 2459 | '-DGIT_USER_AGENT=$(GIT_USER_AGENT_CQ_SQ)' \ |
Johannes Schindelin | 5cf8e06 | 2018-06-27 21:35:23 +0200 | [diff] [blame] | 2460 | '-DGIT_BUILT_FROM_COMMIT="$(shell \ |
| 2461 | GIT_CEILING_DIRECTORIES="$(CURDIR)/.." \ |
| 2462 | git rev-parse -q --verify HEAD 2>/dev/null)"' |
Jeff King | 816fb46 | 2012-06-02 14:51:42 -0400 | [diff] [blame] | 2463 | |
Junio C Hamano | 9173080 | 2006-04-10 17:37:58 -0700 | [diff] [blame] | 2464 | $(BUILT_INS): git$X |
Andreas Färber | 3e073dc | 2008-08-25 17:33:03 +0200 | [diff] [blame] | 2465 | $(QUIET_BUILT_IN)$(RM) $@ && \ |
Felipe Contreras | f530aa9 | 2013-05-24 21:41:03 -0500 | [diff] [blame] | 2466 | ln $< $@ 2>/dev/null || \ |
| 2467 | ln -s $< $@ 2>/dev/null || \ |
| 2468 | cp $< $@ |
Junio C Hamano | 9173080 | 2006-04-10 17:37:58 -0700 | [diff] [blame] | 2469 | |
Emily Shaffer | 709df95 | 2020-04-16 14:18:03 -0700 | [diff] [blame] | 2470 | config-list.h: generate-configlist.sh |
| 2471 | |
SZEDER Gábor | 56550ea | 2021-04-08 23:29:15 +0200 | [diff] [blame] | 2472 | config-list.h: Documentation/*config.txt Documentation/config/*.txt |
Ævar Arnfjörð Bjarmason | 7c81295 | 2021-09-23 12:29:58 +0200 | [diff] [blame] | 2473 | $(QUIET_GEN)$(SHELL_PATH) ./generate-configlist.sh >$@ |
Emily Shaffer | 709df95 | 2020-04-16 14:18:03 -0700 | [diff] [blame] | 2474 | |
Nguyễn Thái Ngọc Duy | f318d73 | 2018-05-10 10:46:41 +0200 | [diff] [blame] | 2475 | command-list.h: generate-cmdlist.sh command-list.txt |
Junio C Hamano | 48dd1da | 2007-06-13 02:00:01 -0700 | [diff] [blame] | 2476 | |
SZEDER Gábor | 56550ea | 2021-04-08 23:29:15 +0200 | [diff] [blame] | 2477 | command-list.h: $(wildcard Documentation/git*.txt) |
Johannes Schindelin | 724d635 | 2019-04-18 06:16:40 -0700 | [diff] [blame] | 2478 | $(QUIET_GEN)$(SHELL_PATH) ./generate-cmdlist.sh \ |
| 2479 | $(patsubst %,--exclude-program %,$(EXCLUDED_PROGRAMS)) \ |
Ævar Arnfjörð Bjarmason | 7c81295 | 2021-09-23 12:29:58 +0200 | [diff] [blame] | 2480 | command-list.txt >$@ |
Fredrik Kuivinen | a87cd02 | 2006-03-09 17:24:19 +0100 | [diff] [blame] | 2481 | |
Ævar Arnfjörð Bjarmason | cfe853e | 2021-09-26 21:03:29 +0200 | [diff] [blame] | 2482 | hook-list.h: generate-hooklist.sh Documentation/githooks.txt |
| 2483 | $(QUIET_GEN)$(SHELL_PATH) ./generate-hooklist.sh >$@ |
Daniel Barkalow | 6eb7ed5 | 2005-04-23 18:47:23 -0700 | [diff] [blame] | 2484 | |
Ævar Arnfjörð Bjarmason | ab77294 | 2021-10-21 21:57:56 +0200 | [diff] [blame] | 2485 | SCRIPT_DEFINES = $(SHELL_PATH_SQ):$(DIFF_SQ):\ |
Ævar Arnfjörð Bjarmason | c7c9692 | 2021-10-21 21:57:57 +0200 | [diff] [blame] | 2486 | $(localedir_SQ):$(USE_GETTEXT_SCHEME):$(SANE_TOOL_PATH_SQ):\ |
Ævar Arnfjörð Bjarmason | ebeb39f | 2021-10-21 21:58:00 +0200 | [diff] [blame] | 2487 | $(gitwebdir_SQ):$(PERL_PATH_SQ):$(PAGER_ENV):\ |
Ævar Arnfjörð Bjarmason | 20d2a30 | 2017-12-10 21:13:33 +0000 | [diff] [blame] | 2488 | $(perllibdir_SQ) |
Jeff King | e4dd89a | 2012-06-20 14:32:16 -0400 | [diff] [blame] | 2489 | GIT-SCRIPT-DEFINES: FORCE |
| 2490 | @FLAGS='$(SCRIPT_DEFINES)'; \ |
| 2491 | if test x"$$FLAGS" != x"`cat $@ 2>/dev/null`" ; then \ |
Christian Couder | 1a59d88 | 2012-12-18 16:26:39 +0100 | [diff] [blame] | 2492 | echo >&2 " * new script parameters"; \ |
Jeff King | e4dd89a | 2012-06-20 14:32:16 -0400 | [diff] [blame] | 2493 | echo "$$FLAGS" >$@; \ |
| 2494 | fi |
| 2495 | |
Jonathan Nieder | 46bac90 | 2010-01-31 11:46:53 -0800 | [diff] [blame] | 2496 | define cmd_munge_script |
Junio C Hamano | 09ce4bb | 2010-06-05 09:36:13 -0700 | [diff] [blame] | 2497 | sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \ |
Jonathan Nieder | 46bac90 | 2010-01-31 11:46:53 -0800 | [diff] [blame] | 2498 | -e 's|@SHELL_PATH@|$(SHELL_PATH_SQ)|' \ |
Jeff King | 42dcbb7 | 2012-06-02 15:01:12 -0400 | [diff] [blame] | 2499 | -e 's|@@DIFF@@|$(DIFF_SQ)|' \ |
Ævar Arnfjörð Bjarmason | 5e9637c | 2011-11-18 00:14:42 +0100 | [diff] [blame] | 2500 | -e 's|@@LOCALEDIR@@|$(localedir_SQ)|g' \ |
Alex Riesen | ad17ea7 | 2012-01-23 14:04:29 -0800 | [diff] [blame] | 2501 | -e 's/@@USE_GETTEXT_SCHEME@@/$(USE_GETTEXT_SCHEME)/g' \ |
Jonathan Nieder | 46bac90 | 2010-01-31 11:46:53 -0800 | [diff] [blame] | 2502 | -e $(BROKEN_PATH_FIX) \ |
| 2503 | -e 's|@@GITWEBDIR@@|$(gitwebdir_SQ)|g' \ |
| 2504 | -e 's|@@PERL@@|$(PERL_PATH_SQ)|g' \ |
Jeff King | e4dd89a | 2012-06-20 14:32:16 -0400 | [diff] [blame] | 2505 | -e 's|@@PAGER_ENV@@|$(PAGER_ENV_SQ)|g' \ |
| 2506 | $@.sh >$@+ |
| 2507 | endef |
Jeff King | e4dd89a | 2012-06-20 14:32:16 -0400 | [diff] [blame] | 2508 | |
Jonathan Nieder | 64c07db | 2014-11-18 10:38:38 -0800 | [diff] [blame] | 2509 | $(SCRIPT_SH_GEN) : % : %.sh GIT-SCRIPT-DEFINES |
Jonathan Nieder | 46bac90 | 2010-01-31 11:46:53 -0800 | [diff] [blame] | 2510 | $(QUIET_GEN)$(cmd_munge_script) && \ |
Shawn O. Pearce | 74f2b2a | 2007-03-06 01:35:01 -0500 | [diff] [blame] | 2511 | chmod +x $@+ && \ |
Jim Meyering | fc36f6a | 2006-05-25 18:52:01 +0200 | [diff] [blame] | 2512 | mv $@+ $@ |
Junio C Hamano | bc6146d | 2005-09-08 18:50:33 -0700 | [diff] [blame] | 2513 | |
Jeff King | e4dd89a | 2012-06-20 14:32:16 -0400 | [diff] [blame] | 2514 | $(SCRIPT_LIB) : % : %.sh GIT-SCRIPT-DEFINES |
Jonathan Nieder | 46bac90 | 2010-01-31 11:46:53 -0800 | [diff] [blame] | 2515 | $(QUIET_GEN)$(cmd_munge_script) && \ |
| 2516 | mv $@+ $@ |
| 2517 | |
Johannes Schindelin | adb59de | 2018-11-06 06:55:50 -0800 | [diff] [blame] | 2518 | git.res: git.rc GIT-VERSION-FILE GIT-PREFIX |
Pat Thoyts | ce39c2e | 2012-05-24 00:56:24 +0100 | [diff] [blame] | 2519 | $(QUIET_RC)$(RC) \ |
Johannes Schindelin | 39bb86b | 2017-10-30 18:19:42 +0100 | [diff] [blame] | 2520 | $(join -DMAJOR= -DMINOR= -DMICRO= -DPATCHLEVEL=, $(wordlist 1, 4, \ |
| 2521 | $(shell echo $(GIT_VERSION) 0 0 0 0 | tr '.a-zA-Z-' ' '))) \ |
Steven Penny | 7c44b33 | 2017-01-07 15:41:10 -0600 | [diff] [blame] | 2522 | -DGIT_VERSION="\\\"$(GIT_VERSION)\\\"" -i $< -o $@ |
Pat Thoyts | ce39c2e | 2012-05-24 00:56:24 +0100 | [diff] [blame] | 2523 | |
Jeff King | e204b00 | 2014-11-18 12:43:09 -0500 | [diff] [blame] | 2524 | # This makes sure we depend on the NO_PERL setting itself. |
Jonathan Nieder | 64c07db | 2014-11-18 10:38:38 -0800 | [diff] [blame] | 2525 | $(SCRIPT_PERL_GEN): GIT-BUILD-OPTIONS |
Jeff King | e204b00 | 2014-11-18 12:43:09 -0500 | [diff] [blame] | 2526 | |
Dan Jacques | 07d90ea | 2018-04-10 11:05:43 -0400 | [diff] [blame] | 2527 | # Used for substitution in Perl modules. Disabled when using RUNTIME_PREFIX |
| 2528 | # since the locale directory is injected. |
| 2529 | perl_localedir_SQ = $(localedir_SQ) |
Alex Riesen | f848718 | 2006-12-04 10:50:04 +0100 | [diff] [blame] | 2530 | |
Junio C Hamano | bc6146d | 2005-09-08 18:50:33 -0700 | [diff] [blame] | 2531 | ifndef NO_PERL |
Dan Jacques | f6a0ad4 | 2018-04-10 11:05:42 -0400 | [diff] [blame] | 2532 | PERL_HEADER_TEMPLATE = perl/header_templates/fixed_prefix.template.pl |
Ævar Arnfjörð Bjarmason | 8c55753 | 2021-05-12 11:49:44 +0200 | [diff] [blame] | 2533 | PERL_DEFINES = |
Ævar Arnfjörð Bjarmason | 4070c9e | 2021-05-05 14:21:38 +0200 | [diff] [blame] | 2534 | PERL_DEFINES += $(PERL_PATH_SQ) |
| 2535 | PERL_DEFINES += $(PERLLIB_EXTRA_SQ) |
| 2536 | PERL_DEFINES += $(perllibdir_SQ) |
Dan Jacques | 07d90ea | 2018-04-10 11:05:43 -0400 | [diff] [blame] | 2537 | PERL_DEFINES += $(RUNTIME_PREFIX) |
Ævar Arnfjörð Bjarmason | 368a50d | 2021-05-05 14:21:40 +0200 | [diff] [blame] | 2538 | PERL_DEFINES += $(NO_PERL_CPAN_FALLBACKS) |
Ævar Arnfjörð Bjarmason | 256c2dc | 2021-05-05 14:21:41 +0200 | [diff] [blame] | 2539 | PERL_DEFINES += $(NO_GETTEXT) |
Dan Jacques | 07d90ea | 2018-04-10 11:05:43 -0400 | [diff] [blame] | 2540 | |
| 2541 | # Support Perl runtime prefix. In this mode, a different header is installed |
| 2542 | # into Perl scripts. |
| 2543 | ifdef RUNTIME_PREFIX |
| 2544 | |
| 2545 | PERL_HEADER_TEMPLATE = perl/header_templates/runtime_prefix.template.pl |
| 2546 | |
| 2547 | # Don't export a fixed $(localedir) path; it will be resolved by the Perl header |
| 2548 | # at runtime. |
| 2549 | perl_localedir_SQ = |
| 2550 | |
| 2551 | endif |
| 2552 | |
| 2553 | PERL_DEFINES += $(gitexecdir) $(perllibdir) $(localedir) |
| 2554 | |
Dan Jacques | f6a0ad4 | 2018-04-10 11:05:42 -0400 | [diff] [blame] | 2555 | $(SCRIPT_PERL_GEN): % : %.perl GIT-PERL-DEFINES GIT-PERL-HEADER GIT-VERSION-FILE |
Ævar Arnfjörð Bjarmason | 7b76d6b | 2021-06-29 10:44:50 +0200 | [diff] [blame] | 2556 | $(QUIET_GEN) \ |
Junio C Hamano | 998c4da | 2006-07-07 13:04:35 -0700 | [diff] [blame] | 2557 | sed -e '1{' \ |
| 2558 | -e ' s|#!.*perl|#!$(PERL_PATH_SQ)|' \ |
Alejandro R. Sedeño | 6600054 | 2018-06-25 15:13:25 -0400 | [diff] [blame] | 2559 | -e ' r GIT-PERL-HEADER' \ |
Dan Jacques | f6a0ad4 | 2018-04-10 11:05:42 -0400 | [diff] [blame] | 2560 | -e ' G' \ |
Junio C Hamano | 998c4da | 2006-07-07 13:04:35 -0700 | [diff] [blame] | 2561 | -e '}' \ |
Junio C Hamano | 3ff8cbe | 2005-10-04 12:41:35 -0700 | [diff] [blame] | 2562 | -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \ |
Felipe Contreras | f530aa9 | 2013-05-24 21:41:03 -0500 | [diff] [blame] | 2563 | $< >$@+ && \ |
Shawn O. Pearce | 74f2b2a | 2007-03-06 01:35:01 -0500 | [diff] [blame] | 2564 | chmod +x $@+ && \ |
Jim Meyering | fc36f6a | 2006-05-25 18:52:01 +0200 | [diff] [blame] | 2565 | mv $@+ $@ |
Junio C Hamano | bc6146d | 2005-09-08 18:50:33 -0700 | [diff] [blame] | 2566 | |
Dan Jacques | 07d90ea | 2018-04-10 11:05:43 -0400 | [diff] [blame] | 2567 | PERL_DEFINES := $(subst $(space),:,$(PERL_DEFINES)) |
Jonathan Nieder | 07981dc | 2013-11-18 14:23:11 -0800 | [diff] [blame] | 2568 | GIT-PERL-DEFINES: FORCE |
| 2569 | @FLAGS='$(PERL_DEFINES)'; \ |
| 2570 | if test x"$$FLAGS" != x"`cat $@ 2>/dev/null`" ; then \ |
| 2571 | echo >&2 " * new perl-specific parameters"; \ |
| 2572 | echo "$$FLAGS" >$@; \ |
| 2573 | fi |
| 2574 | |
Dan Jacques | f6a0ad4 | 2018-04-10 11:05:42 -0400 | [diff] [blame] | 2575 | GIT-PERL-HEADER: $(PERL_HEADER_TEMPLATE) GIT-PERL-DEFINES Makefile |
Ævar Arnfjörð Bjarmason | 7b76d6b | 2021-06-29 10:44:50 +0200 | [diff] [blame] | 2576 | $(QUIET_GEN) \ |
Dan Jacques | f6a0ad4 | 2018-04-10 11:05:42 -0400 | [diff] [blame] | 2577 | INSTLIBDIR='$(perllibdir_SQ)' && \ |
| 2578 | INSTLIBDIR_EXTRA='$(PERLLIB_EXTRA_SQ)' && \ |
| 2579 | INSTLIBDIR="$$INSTLIBDIR$${INSTLIBDIR_EXTRA:+:$$INSTLIBDIR_EXTRA}" && \ |
| 2580 | sed -e 's=@@PATHSEP@@=$(pathsep)=g' \ |
Jonathan Nieder | 64f982b | 2018-04-23 16:25:35 -0700 | [diff] [blame] | 2581 | -e "s=@@INSTLIBDIR@@=$$INSTLIBDIR=g" \ |
Dan Jacques | 07d90ea | 2018-04-10 11:05:43 -0400 | [diff] [blame] | 2582 | -e 's=@@PERLLIBDIR_REL@@=$(perllibdir_relative_SQ)=g' \ |
| 2583 | -e 's=@@GITEXECDIR_REL@@=$(gitexecdir_relative_SQ)=g' \ |
| 2584 | -e 's=@@LOCALEDIR_REL@@=$(localedir_relative_SQ)=g' \ |
Dan Jacques | f6a0ad4 | 2018-04-10 11:05:42 -0400 | [diff] [blame] | 2585 | $< >$@+ && \ |
| 2586 | mv $@+ $@ |
John 'Warthog9' Hawley | 62331ef | 2010-01-30 23:30:40 +0100 | [diff] [blame] | 2587 | |
Christian Hesse | d869898 | 2018-04-19 06:44:40 +0900 | [diff] [blame] | 2588 | .PHONY: perllibdir |
Christian Hesse | cfb3a47 | 2018-04-10 15:36:41 +0200 | [diff] [blame] | 2589 | perllibdir: |
| 2590 | @echo '$(perllibdir_SQ)' |
John 'Warthog9' Hawley | 62331ef | 2010-01-30 23:30:40 +0100 | [diff] [blame] | 2591 | |
Jeff King | e25c7cc | 2015-05-29 03:25:45 -0400 | [diff] [blame] | 2592 | git-instaweb: git-instaweb.sh GIT-SCRIPT-DEFINES |
Jeff King | b5295f3 | 2012-06-20 14:32:19 -0400 | [diff] [blame] | 2593 | $(QUIET_GEN)$(cmd_munge_script) && \ |
Shawn O. Pearce | 74f2b2a | 2007-03-06 01:35:01 -0500 | [diff] [blame] | 2594 | chmod +x $@+ && \ |
Eric Wong | a51d37c | 2006-07-01 15:14:14 -0700 | [diff] [blame] | 2595 | mv $@+ $@ |
Jeff King | 499c293 | 2009-04-03 15:32:20 -0400 | [diff] [blame] | 2596 | else # NO_PERL |
Jonathan Nieder | 64c07db | 2014-11-18 10:38:38 -0800 | [diff] [blame] | 2597 | $(SCRIPT_PERL_GEN) git-instaweb: % : unimplemented.sh |
Ævar Arnfjörð Bjarmason | 7b76d6b | 2021-06-29 10:44:50 +0200 | [diff] [blame] | 2598 | $(QUIET_GEN) \ |
Jeff King | 499c293 | 2009-04-03 15:32:20 -0400 | [diff] [blame] | 2599 | sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \ |
| 2600 | -e 's|@@REASON@@|NO_PERL=$(NO_PERL)|g' \ |
| 2601 | unimplemented.sh >$@+ && \ |
| 2602 | chmod +x $@+ && \ |
| 2603 | mv $@+ $@ |
| 2604 | endif # NO_PERL |
Eric Wong | a51d37c | 2006-07-01 15:14:14 -0700 | [diff] [blame] | 2605 | |
Jonathan Nieder | ca2051d | 2014-11-18 10:43:47 -0800 | [diff] [blame] | 2606 | # This makes sure we depend on the NO_PYTHON setting itself. |
| 2607 | $(SCRIPT_PYTHON_GEN): GIT-BUILD-OPTIONS |
| 2608 | |
Sverre Rabbelier | 2fe40b6 | 2009-11-18 02:42:32 +0100 | [diff] [blame] | 2609 | ifndef NO_PYTHON |
Felipe Contreras | 1b0a0f8 | 2013-05-24 21:41:01 -0500 | [diff] [blame] | 2610 | $(SCRIPT_PYTHON_GEN): GIT-CFLAGS GIT-PREFIX GIT-PYTHON-VARS |
| 2611 | $(SCRIPT_PYTHON_GEN): % : %.py |
Ævar Arnfjörð Bjarmason | 7b76d6b | 2021-06-29 10:44:50 +0200 | [diff] [blame] | 2612 | $(QUIET_GEN) \ |
Brian Gernhardt | f733f6a | 2010-04-09 11:57:45 -0400 | [diff] [blame] | 2613 | sed -e '1s|#!.*python|#!$(PYTHON_PATH_SQ)|' \ |
Felipe Contreras | f530aa9 | 2013-05-24 21:41:03 -0500 | [diff] [blame] | 2614 | $< >$@+ && \ |
Sverre Rabbelier | 2fe40b6 | 2009-11-18 02:42:32 +0100 | [diff] [blame] | 2615 | chmod +x $@+ && \ |
| 2616 | mv $@+ $@ |
| 2617 | else # NO_PYTHON |
Felipe Contreras | 1b0a0f8 | 2013-05-24 21:41:01 -0500 | [diff] [blame] | 2618 | $(SCRIPT_PYTHON_GEN): % : unimplemented.sh |
Ævar Arnfjörð Bjarmason | 7b76d6b | 2021-06-29 10:44:50 +0200 | [diff] [blame] | 2619 | $(QUIET_GEN) \ |
Sverre Rabbelier | 2fe40b6 | 2009-11-18 02:42:32 +0100 | [diff] [blame] | 2620 | sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \ |
| 2621 | -e 's|@@REASON@@|NO_PYTHON=$(NO_PYTHON)|g' \ |
| 2622 | unimplemented.sh >$@+ && \ |
| 2623 | chmod +x $@+ && \ |
| 2624 | mv $@+ $@ |
| 2625 | endif # NO_PYTHON |
| 2626 | |
Ævar Arnfjörð Bjarmason | 7b76d6b | 2021-06-29 10:44:50 +0200 | [diff] [blame] | 2627 | CONFIGURE_RECIPE = sed -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \ |
Jeff King | 7f1b697 | 2013-02-21 01:26:14 -0500 | [diff] [blame] | 2628 | configure.ac >configure.ac+ && \ |
| 2629 | autoconf -o configure configure.ac+ && \ |
| 2630 | $(RM) configure.ac+ |
| 2631 | |
Jeff King | 520a6cd | 2012-06-20 14:32:22 -0400 | [diff] [blame] | 2632 | configure: configure.ac GIT-VERSION-FILE |
Jeff King | 7f1b697 | 2013-02-21 01:26:14 -0500 | [diff] [blame] | 2633 | $(QUIET_GEN)$(CONFIGURE_RECIPE) |
Jakub Narebski | 3900145 | 2006-08-08 18:35:23 +0200 | [diff] [blame] | 2634 | |
Stefano Lattarini | 8242ff4 | 2012-07-19 09:50:02 +0200 | [diff] [blame] | 2635 | ifdef AUTOCONFIGURED |
Jonathan Nieder | 1226504 | 2013-01-02 00:25:44 -0800 | [diff] [blame] | 2636 | # We avoid depending on 'configure' here, because it gets rebuilt |
| 2637 | # every time GIT-VERSION-FILE is modified, only to update the embedded |
| 2638 | # version number string, which config.status does not care about. We |
| 2639 | # do want to recheck when the platform/environment detection logic |
| 2640 | # changes, hence this depends on configure.ac. |
| 2641 | config.status: configure.ac |
Jeff King | 7f1b697 | 2013-02-21 01:26:14 -0500 | [diff] [blame] | 2642 | $(QUIET_GEN)$(CONFIGURE_RECIPE) && \ |
Jonathan Nieder | 1226504 | 2013-01-02 00:25:44 -0800 | [diff] [blame] | 2643 | if test -f config.status; then \ |
Stefano Lattarini | 8242ff4 | 2012-07-19 09:50:02 +0200 | [diff] [blame] | 2644 | ./config.status --recheck; \ |
| 2645 | else \ |
| 2646 | ./configure; \ |
| 2647 | fi |
| 2648 | reconfigure config.mak.autogen: config.status |
| 2649 | $(QUIET_GEN)./config.status |
| 2650 | .PHONY: reconfigure # This is a convenience target. |
| 2651 | endif |
| 2652 | |
Jonathan Nieder | 3371f9b | 2011-03-27 13:13:22 -0500 | [diff] [blame] | 2653 | XDIFF_OBJS += xdiff/xdiffi.o |
Jonathan Nieder | 3371f9b | 2011-03-27 13:13:22 -0500 | [diff] [blame] | 2654 | XDIFF_OBJS += xdiff/xemit.o |
Denton Liu | 805d9ea | 2020-03-21 05:21:20 -0400 | [diff] [blame] | 2655 | XDIFF_OBJS += xdiff/xhistogram.o |
Jonathan Nieder | 3371f9b | 2011-03-27 13:13:22 -0500 | [diff] [blame] | 2656 | XDIFF_OBJS += xdiff/xmerge.o |
| 2657 | XDIFF_OBJS += xdiff/xpatience.o |
Denton Liu | 805d9ea | 2020-03-21 05:21:20 -0400 | [diff] [blame] | 2658 | XDIFF_OBJS += xdiff/xprepare.o |
| 2659 | XDIFF_OBJS += xdiff/xutils.o |
Ævar Arnfjörð Bjarmason | 029bac0 | 2021-02-23 12:41:31 +0100 | [diff] [blame] | 2660 | .PHONY: xdiff-objs |
| 2661 | xdiff-objs: $(XDIFF_OBJS) |
Jonathan Nieder | 3371f9b | 2011-03-27 13:13:22 -0500 | [diff] [blame] | 2662 | |
Han-Wen Nienhuys | ef8a6c6 | 2021-10-07 20:25:00 +0000 | [diff] [blame] | 2663 | REFTABLE_OBJS += reftable/basics.o |
| 2664 | REFTABLE_OBJS += reftable/error.o |
Han-Wen Nienhuys | e581fd7 | 2021-10-07 20:25:04 +0000 | [diff] [blame] | 2665 | REFTABLE_OBJS += reftable/block.o |
Han-Wen Nienhuys | 1214aa8 | 2021-10-07 20:25:01 +0000 | [diff] [blame] | 2666 | REFTABLE_OBJS += reftable/blocksource.o |
Han-Wen Nienhuys | 46bc0e7 | 2021-10-07 20:25:08 +0000 | [diff] [blame] | 2667 | REFTABLE_OBJS += reftable/iter.o |
Han-Wen Nienhuys | ef8a6c6 | 2021-10-07 20:25:00 +0000 | [diff] [blame] | 2668 | REFTABLE_OBJS += reftable/publicbasics.o |
Han-Wen Nienhuys | 1ae2b8c | 2021-10-07 20:25:11 +0000 | [diff] [blame] | 2669 | REFTABLE_OBJS += reftable/merged.o |
Han-Wen Nienhuys | 3b34f63 | 2021-10-07 20:25:10 +0000 | [diff] [blame] | 2670 | REFTABLE_OBJS += reftable/pq.o |
Han-Wen Nienhuys | 46bc0e7 | 2021-10-07 20:25:08 +0000 | [diff] [blame] | 2671 | REFTABLE_OBJS += reftable/reader.o |
Han-Wen Nienhuys | e303bf2 | 2021-10-07 20:25:02 +0000 | [diff] [blame] | 2672 | REFTABLE_OBJS += reftable/record.o |
Han-Wen Nienhuys | 17df8db | 2021-10-07 20:25:07 +0000 | [diff] [blame] | 2673 | REFTABLE_OBJS += reftable/generic.o |
| 2674 | REFTABLE_OBJS += reftable/stack.o |
Han-Wen Nienhuys | 35425d1 | 2021-10-07 20:25:05 +0000 | [diff] [blame] | 2675 | REFTABLE_OBJS += reftable/tree.o |
Han-Wen Nienhuys | f14bd71 | 2021-10-07 20:25:06 +0000 | [diff] [blame] | 2676 | REFTABLE_OBJS += reftable/writer.o |
Han-Wen Nienhuys | ef8a6c6 | 2021-10-07 20:25:00 +0000 | [diff] [blame] | 2677 | |
Han-Wen Nienhuys | e581fd7 | 2021-10-07 20:25:04 +0000 | [diff] [blame] | 2678 | REFTABLE_TEST_OBJS += reftable/block_test.o |
Han-Wen Nienhuys | d860c86 | 2021-10-07 20:25:15 +0000 | [diff] [blame] | 2679 | REFTABLE_TEST_OBJS += reftable/dump.o |
Han-Wen Nienhuys | 1ae2b8c | 2021-10-07 20:25:11 +0000 | [diff] [blame] | 2680 | REFTABLE_TEST_OBJS += reftable/merged_test.o |
Han-Wen Nienhuys | 3b34f63 | 2021-10-07 20:25:10 +0000 | [diff] [blame] | 2681 | REFTABLE_TEST_OBJS += reftable/pq_test.o |
Han-Wen Nienhuys | e303bf2 | 2021-10-07 20:25:02 +0000 | [diff] [blame] | 2682 | REFTABLE_TEST_OBJS += reftable/record_test.o |
Han-Wen Nienhuys | ffc97f1 | 2021-10-07 20:25:09 +0000 | [diff] [blame] | 2683 | REFTABLE_TEST_OBJS += reftable/readwrite_test.o |
Han-Wen Nienhuys | e48d427 | 2021-10-07 20:25:13 +0000 | [diff] [blame] | 2684 | REFTABLE_TEST_OBJS += reftable/stack_test.o |
Han-Wen Nienhuys | ef8a6c6 | 2021-10-07 20:25:00 +0000 | [diff] [blame] | 2685 | REFTABLE_TEST_OBJS += reftable/test_framework.o |
Han-Wen Nienhuys | 35425d1 | 2021-10-07 20:25:05 +0000 | [diff] [blame] | 2686 | REFTABLE_TEST_OBJS += reftable/tree_test.o |
Han-Wen Nienhuys | ef8a6c6 | 2021-10-07 20:25:00 +0000 | [diff] [blame] | 2687 | |
Nguyễn Thái Ngọc Duy | efd71f8 | 2018-03-24 08:44:30 +0100 | [diff] [blame] | 2688 | TEST_OBJS := $(patsubst %$X,%.o,$(TEST_PROGRAMS)) $(patsubst %,t/helper/%,$(TEST_BUILTINS_OBJS)) |
Han-Wen Nienhuys | ef8a6c6 | 2021-10-07 20:25:00 +0000 | [diff] [blame] | 2689 | |
Ævar Arnfjörð Bjarmason | 029bac0 | 2021-02-23 12:41:31 +0100 | [diff] [blame] | 2690 | .PHONY: test-objs |
| 2691 | test-objs: $(TEST_OBJS) |
Ævar Arnfjörð Bjarmason | 752b3ef | 2021-02-23 12:41:28 +0100 | [diff] [blame] | 2692 | |
Ævar Arnfjörð Bjarmason | abc3c87 | 2021-02-23 12:41:30 +0100 | [diff] [blame] | 2693 | GIT_OBJS += $(LIB_OBJS) |
| 2694 | GIT_OBJS += $(BUILTIN_OBJS) |
| 2695 | GIT_OBJS += common-main.o |
| 2696 | GIT_OBJS += git.o |
Ævar Arnfjörð Bjarmason | 029bac0 | 2021-02-23 12:41:31 +0100 | [diff] [blame] | 2697 | .PHONY: git-objs |
| 2698 | git-objs: $(GIT_OBJS) |
Ævar Arnfjörð Bjarmason | abc3c87 | 2021-02-23 12:41:30 +0100 | [diff] [blame] | 2699 | |
Victoria Dye | 7b5c93c | 2022-09-02 15:56:43 +0000 | [diff] [blame] | 2700 | SCALAR_OBJS += scalar.o |
| 2701 | .PHONY: scalar-objs |
| 2702 | scalar-objs: $(SCALAR_OBJS) |
| 2703 | |
Ævar Arnfjörð Bjarmason | abc3c87 | 2021-02-23 12:41:30 +0100 | [diff] [blame] | 2704 | OBJECTS += $(GIT_OBJS) |
Victoria Dye | 7b5c93c | 2022-09-02 15:56:43 +0000 | [diff] [blame] | 2705 | OBJECTS += $(SCALAR_OBJS) |
Ævar Arnfjörð Bjarmason | 752b3ef | 2021-02-23 12:41:28 +0100 | [diff] [blame] | 2706 | OBJECTS += $(PROGRAM_OBJS) |
| 2707 | OBJECTS += $(TEST_OBJS) |
| 2708 | OBJECTS += $(XDIFF_OBJS) |
| 2709 | OBJECTS += $(FUZZ_OBJS) |
Han-Wen Nienhuys | ef8a6c6 | 2021-10-07 20:25:00 +0000 | [diff] [blame] | 2710 | OBJECTS += $(REFTABLE_OBJS) $(REFTABLE_TEST_OBJS) |
Phillip Wood | e137fe3 | 2023-11-09 10:50:43 -0800 | [diff] [blame] | 2711 | OBJECTS += $(UNIT_TEST_OBJS) |
Han-Wen Nienhuys | ef8a6c6 | 2021-10-07 20:25:00 +0000 | [diff] [blame] | 2712 | |
Jonathan Nieder | 60d24dd | 2012-07-06 22:39:18 -0500 | [diff] [blame] | 2713 | ifndef NO_CURL |
| 2714 | OBJECTS += http.o http-walker.o remote-curl.o |
| 2715 | endif |
Johannes Schindelin | 0a43fb2 | 2021-12-03 13:34:16 +0000 | [diff] [blame] | 2716 | |
Ævar Arnfjörð Bjarmason | 029bac0 | 2021-02-23 12:41:31 +0100 | [diff] [blame] | 2717 | .PHONY: objects |
| 2718 | objects: $(OBJECTS) |
Jonathan Nieder | c373991 | 2010-01-26 09:52:11 -0600 | [diff] [blame] | 2719 | |
Jonathan Nieder | ec5e0bb | 2010-01-31 15:23:53 -0600 | [diff] [blame] | 2720 | dep_files := $(foreach f,$(OBJECTS),$(dir $f).depend/$(notdir $f).d) |
Jonathan Nieder | 010acc1 | 2010-01-31 15:37:25 -0600 | [diff] [blame] | 2721 | dep_dirs := $(addsuffix .depend,$(sort $(dir $(OBJECTS)))) |
Jonathan Nieder | beeb456 | 2010-01-26 09:49:33 -0600 | [diff] [blame] | 2722 | |
Jonathan Nieder | 024c843 | 2011-11-18 03:58:21 -0600 | [diff] [blame] | 2723 | ifeq ($(COMPUTE_HEADER_DEPENDENCIES),yes) |
Jonathan Nieder | dfea575 | 2010-01-26 09:52:49 -0600 | [diff] [blame] | 2724 | $(dep_dirs): |
Junio C Hamano | eb0e0dd | 2011-10-05 12:36:21 -0700 | [diff] [blame] | 2725 | @mkdir -p $@ |
Jonathan Nieder | dfea575 | 2010-01-26 09:52:49 -0600 | [diff] [blame] | 2726 | |
| 2727 | missing_dep_dirs := $(filter-out $(wildcard $(dep_dirs)),$(dep_dirs)) |
Jonathan Nieder | ec5e0bb | 2010-01-31 15:23:53 -0600 | [diff] [blame] | 2728 | dep_file = $(dir $@).depend/$(notdir $@).d |
Jonathan Nieder | 6978934 | 2011-11-18 17:23:24 -0600 | [diff] [blame] | 2729 | dep_args = -MF $(dep_file) -MQ $@ -MMD -MP |
Jonathan Nieder | f2fabbf | 2010-01-26 09:57:15 -0600 | [diff] [blame] | 2730 | endif |
| 2731 | |
Jonathan Nieder | 024c843 | 2011-11-18 03:58:21 -0600 | [diff] [blame] | 2732 | ifneq ($(COMPUTE_HEADER_DEPENDENCIES),yes) |
Jonathan Nieder | dfea575 | 2010-01-26 09:52:49 -0600 | [diff] [blame] | 2733 | missing_dep_dirs = |
Jonathan Nieder | f2fabbf | 2010-01-26 09:57:15 -0600 | [diff] [blame] | 2734 | dep_args = |
Jonathan Nieder | dfea575 | 2010-01-26 09:52:49 -0600 | [diff] [blame] | 2735 | endif |
Jonathan Nieder | f2fabbf | 2010-01-26 09:57:15 -0600 | [diff] [blame] | 2736 | |
Philippe Blain | 3821c38 | 2020-09-03 22:13:38 +0000 | [diff] [blame] | 2737 | compdb_dir = compile_commands |
| 2738 | |
| 2739 | ifeq ($(GENERATE_COMPILATION_DATABASE),yes) |
| 2740 | missing_compdb_dir = $(compdb_dir) |
| 2741 | $(missing_compdb_dir): |
| 2742 | @mkdir -p $@ |
| 2743 | |
| 2744 | compdb_file = $(compdb_dir)/$(subst /,-,$@.json) |
| 2745 | compdb_args = -MJ $(compdb_file) |
| 2746 | else |
| 2747 | missing_compdb_dir = |
| 2748 | compdb_args = |
| 2749 | endif |
| 2750 | |
Ævar Arnfjörð Bjarmason | 3221597 | 2022-08-31 11:18:44 +0200 | [diff] [blame] | 2751 | $(OBJECTS): %.o: %.c GIT-CFLAGS $(missing_dep_dirs) $(missing_compdb_dir) |
Philippe Blain | 3821c38 | 2020-09-03 22:13:38 +0000 | [diff] [blame] | 2752 | $(QUIET_CC)$(CC) -o $*.o -c $(dep_args) $(compdb_args) $(ALL_CFLAGS) $(EXTRA_CPPFLAGS) $< |
Jonathan Nieder | f2fabbf | 2010-01-26 09:57:15 -0600 | [diff] [blame] | 2753 | |
Jonathan Nieder | 13fca9f | 2010-01-06 02:06:58 -0600 | [diff] [blame] | 2754 | %.s: %.c GIT-CFLAGS FORCE |
Jonathan Nieder | 1015cc4 | 2012-07-22 18:47:26 -0500 | [diff] [blame] | 2755 | $(QUIET_CC)$(CC) -o $@ -S $(ALL_CFLAGS) $(EXTRA_CPPFLAGS) $< |
Jonathan Nieder | f2fabbf | 2010-01-26 09:57:15 -0600 | [diff] [blame] | 2756 | |
| 2757 | ifdef USE_COMPUTED_HEADER_DEPENDENCIES |
| 2758 | # Take advantage of gcc's on-the-fly dependency generation |
Josh Soref | d05b08c | 2023-11-24 03:35:13 +0000 | [diff] [blame] | 2759 | # See <https://gcc.gnu.org/gcc-3.0/features.html>. |
Jonathan Nieder | f2fabbf | 2010-01-26 09:57:15 -0600 | [diff] [blame] | 2760 | dep_files_present := $(wildcard $(dep_files)) |
| 2761 | ifneq ($(dep_files_present),) |
| 2762 | include $(dep_files_present) |
| 2763 | endif |
| 2764 | else |
Johannes Schindelin | 92b88eb | 2019-03-04 05:47:06 -0800 | [diff] [blame] | 2765 | $(OBJECTS): $(LIB_H) $(GENERATED_H) |
Jonathan Nieder | dfea575 | 2010-01-26 09:52:49 -0600 | [diff] [blame] | 2766 | endif |
Pavel Roskin | b05701c | 2005-08-06 01:36:15 -0400 | [diff] [blame] | 2767 | |
Philippe Blain | 3821c38 | 2020-09-03 22:13:38 +0000 | [diff] [blame] | 2768 | ifeq ($(GENERATE_COMPILATION_DATABASE),yes) |
| 2769 | all:: compile_commands.json |
| 2770 | compile_commands.json: |
Philippe Blain | 3821c38 | 2020-09-03 22:13:38 +0000 | [diff] [blame] | 2771 | $(QUIET_GEN)sed -e '1s/^/[/' -e '$$s/,$$/]/' $(compdb_dir)/*.o.json > $@+ |
| 2772 | @if test -s $@+; then mv $@+ $@; else $(RM) $@+; fi |
| 2773 | endif |
| 2774 | |
Stefan Beller | d807c4a | 2018-04-10 14:26:18 -0700 | [diff] [blame] | 2775 | exec-cmd.sp exec-cmd.s exec-cmd.o: GIT-PREFIX |
| 2776 | exec-cmd.sp exec-cmd.s exec-cmd.o: EXTRA_CPPFLAGS = \ |
Jonathan Nieder | 373a5ed | 2010-01-06 02:05:04 -0600 | [diff] [blame] | 2777 | '-DGIT_EXEC_PATH="$(gitexecdir_SQ)"' \ |
Dan Jacques | 226c0dd | 2018-04-10 11:05:44 -0400 | [diff] [blame] | 2778 | '-DGIT_LOCALE_PATH="$(localedir_relative_SQ)"' \ |
Jonathan Nieder | 373a5ed | 2010-01-06 02:05:04 -0600 | [diff] [blame] | 2779 | '-DBINDIR="$(bindir_relative_SQ)"' \ |
Philip Oakley | 4d5b4c2 | 2018-04-21 13:18:42 +0200 | [diff] [blame] | 2780 | '-DFALLBACK_RUNTIME_PREFIX="$(prefix_SQ)"' |
Steffen Prohaska | 026fa0d | 2009-01-18 13:00:09 +0100 | [diff] [blame] | 2781 | |
Elijah Newren | e8cf8ef | 2023-05-16 06:33:44 +0000 | [diff] [blame] | 2782 | setup.sp setup.s setup.o: GIT-PREFIX |
| 2783 | setup.sp setup.s setup.o: EXTRA_CPPFLAGS = \ |
Jonathan Nieder | 373a5ed | 2010-01-06 02:05:04 -0600 | [diff] [blame] | 2784 | -DDEFAULT_GIT_TEMPLATE_DIR='"$(template_dir_SQ)"' |
Michal Ostrowski | 77cb17e | 2006-01-10 21:12:17 -0500 | [diff] [blame] | 2785 | |
Jeff King | be1dbd0 | 2012-06-20 14:31:55 -0400 | [diff] [blame] | 2786 | config.sp config.s config.o: GIT-PREFIX |
Ramsay Jones | 0bcd9ae | 2011-04-21 20:14:42 +0100 | [diff] [blame] | 2787 | config.sp config.s config.o: EXTRA_CPPFLAGS = \ |
| 2788 | -DETC_GITCONFIG='"$(ETC_GITCONFIG_SQ)"' |
Johannes Sixt | 506b17b | 2007-11-13 21:05:05 +0100 | [diff] [blame] | 2789 | |
Jeff King | be1dbd0 | 2012-06-20 14:31:55 -0400 | [diff] [blame] | 2790 | attr.sp attr.s attr.o: GIT-PREFIX |
Ramsay Jones | 0bcd9ae | 2011-04-21 20:14:42 +0100 | [diff] [blame] | 2791 | attr.sp attr.s attr.o: EXTRA_CPPFLAGS = \ |
| 2792 | -DETC_GITATTRIBUTES='"$(ETC_GITATTRIBUTES_SQ)"' |
Petr Onderka | 6df42ab | 2010-09-01 00:42:43 +0200 | [diff] [blame] | 2793 | |
Jeff King | be1dbd0 | 2012-06-20 14:31:55 -0400 | [diff] [blame] | 2794 | gettext.sp gettext.s gettext.o: GIT-PREFIX |
Ævar Arnfjörð Bjarmason | 5e9637c | 2011-11-18 00:14:42 +0100 | [diff] [blame] | 2795 | gettext.sp gettext.s gettext.o: EXTRA_CPPFLAGS = \ |
Dan Jacques | 226c0dd | 2018-04-10 11:05:44 -0400 | [diff] [blame] | 2796 | -DGIT_LOCALE_PATH='"$(localedir_relative_SQ)"' |
Ævar Arnfjörð Bjarmason | 5e9637c | 2011-11-18 00:14:42 +0100 | [diff] [blame] | 2797 | |
Ramsay Jones | 15caca2 | 2019-02-05 02:27:48 +0000 | [diff] [blame] | 2798 | http-push.sp http.sp http-walker.sp remote-curl.sp imap-send.sp: SP_EXTRA_FLAGS += \ |
Ramsay Jones | 9371322 | 2013-10-06 21:52:21 +0100 | [diff] [blame] | 2799 | -DCURL_DISABLE_TYPECHECK |
| 2800 | |
Ramsay Jones | 15caca2 | 2019-02-05 02:27:48 +0000 | [diff] [blame] | 2801 | pack-revindex.sp: SP_EXTRA_FLAGS += -Wno-memcpy-max-count |
Ramsay Jones | 54360a1 | 2018-02-12 00:21:02 +0000 | [diff] [blame] | 2802 | |
Nick Hengeveld | 8d9fbe5 | 2006-04-04 05:33:18 -0700 | [diff] [blame] | 2803 | ifdef NO_EXPAT |
Ramsay Jones | 0bcd9ae | 2011-04-21 20:14:42 +0100 | [diff] [blame] | 2804 | 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] | 2805 | endif |
| 2806 | |
Ævar Arnfjörð Bjarmason | a997bf4 | 2010-08-17 09:24:39 +0000 | [diff] [blame] | 2807 | ifdef NO_REGEX |
Ramsay Jones | 0bcd9ae | 2011-04-21 20:14:42 +0100 | [diff] [blame] | 2808 | compat/regex/regex.sp compat/regex/regex.o: EXTRA_CPPFLAGS = \ |
| 2809 | -DGAWK -DNO_MBSUPPORT |
Ævar Arnfjörð Bjarmason | a997bf4 | 2010-08-17 09:24:39 +0000 | [diff] [blame] | 2810 | endif |
| 2811 | |
René Scharfe | d555ff5 | 2010-09-11 11:59:18 +0200 | [diff] [blame] | 2812 | ifdef USE_NED_ALLOCATOR |
Ramsay Jones | 0bcd9ae | 2011-04-21 20:14:42 +0100 | [diff] [blame] | 2813 | compat/nedmalloc/nedmalloc.sp compat/nedmalloc/nedmalloc.o: EXTRA_CPPFLAGS = \ |
René Scharfe | ca2baa3 | 2016-09-03 17:59:15 +0200 | [diff] [blame] | 2814 | -DNDEBUG -DREPLACE_SYSTEM_ALLOCATOR |
Ramsay Jones | 15caca2 | 2019-02-05 02:27:48 +0000 | [diff] [blame] | 2815 | compat/nedmalloc/nedmalloc.sp: SP_EXTRA_FLAGS += -Wno-non-pointer-null |
René Scharfe | d555ff5 | 2010-09-11 11:59:18 +0200 | [diff] [blame] | 2816 | endif |
| 2817 | |
Johannes Schindelin | 4b8a271 | 2023-08-09 16:54:46 +0000 | [diff] [blame] | 2818 | headless-git.o: compat/win32/headless.c GIT-CFLAGS |
| 2819 | $(QUIET_CC)$(CC) $(ALL_CFLAGS) $(COMPAT_CFLAGS) \ |
| 2820 | -fno-stack-protector -o $@ -c -Wall -Wwrite-strings $< |
| 2821 | |
| 2822 | headless-git$X: headless-git.o git.res GIT-LDFLAGS |
| 2823 | $(QUIET_LINK)$(CC) $(ALL_CFLAGS) $(ALL_LDFLAGS) -mwindows -o $@ $< git.res |
| 2824 | |
Fredrik Kuivinen | d9a25fc | 2011-06-22 12:50:56 +0200 | [diff] [blame] | 2825 | git-%$X: %.o GIT-LDFLAGS $(GITLIBS) |
Shawn O. Pearce | 74f2b2a | 2007-03-06 01:35:01 -0500 | [diff] [blame] | 2826 | $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS) |
Daniel Barkalow | 6eb7ed5 | 2005-04-23 18:47:23 -0700 | [diff] [blame] | 2827 | |
Bernhard Reiter | 1e16b25 | 2014-11-09 15:55:53 +0100 | [diff] [blame] | 2828 | 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] | 2829 | $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \ |
Steven Penny | aa38ad2 | 2017-01-08 00:12:38 -0600 | [diff] [blame] | 2830 | $(IMAP_SEND_LDFLAGS) $(LIBS) |
Mike McCormack | f2561fd | 2006-03-10 14:32:50 +0900 | [diff] [blame] | 2831 | |
John Keeping | fd78ced | 2014-01-25 13:11:44 +0000 | [diff] [blame] | 2832 | 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] | 2833 | $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \ |
Remi Pommarel | 9eaa78b | 2015-10-21 19:01:13 +0200 | [diff] [blame] | 2834 | $(CURL_LIBCURL) $(LIBS) |
John Keeping | fd78ced | 2014-01-25 13:11:44 +0000 | [diff] [blame] | 2835 | 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] | 2836 | $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \ |
Remi Pommarel | 9eaa78b | 2015-10-21 19:01:13 +0200 | [diff] [blame] | 2837 | $(CURL_LIBCURL) $(EXPAT_LIBEXPAT) $(LIBS) |
Johannes Schindelin | 39c015c | 2006-02-18 12:40:22 +0100 | [diff] [blame] | 2838 | |
Ilari Liusvaara | 28ca0c9 | 2009-12-09 17:26:34 +0200 | [diff] [blame] | 2839 | $(REMOTE_CURL_ALIASES): $(REMOTE_CURL_PRIMARY) |
| 2840 | $(QUIET_LNCP)$(RM) $@ && \ |
| 2841 | ln $< $@ 2>/dev/null || \ |
| 2842 | ln -s $< $@ 2>/dev/null || \ |
| 2843 | cp $< $@ |
| 2844 | |
Fredrik Kuivinen | d9a25fc | 2011-06-22 12:50:56 +0200 | [diff] [blame] | 2845 | $(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] | 2846 | $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \ |
Remi Pommarel | 9eaa78b | 2015-10-21 19:01:13 +0200 | [diff] [blame] | 2847 | $(CURL_LIBCURL) $(EXPAT_LIBEXPAT) $(LIBS) |
Daniel Barkalow | a2d725b | 2009-08-05 01:01:56 -0400 | [diff] [blame] | 2848 | |
Victoria Dye | 7b5c93c | 2022-09-02 15:56:43 +0000 | [diff] [blame] | 2849 | scalar$X: scalar.o GIT-LDFLAGS $(GITLIBS) |
Johannes Schindelin | 0a43fb2 | 2021-12-03 13:34:16 +0000 | [diff] [blame] | 2850 | $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) \ |
| 2851 | $(filter %.o,$^) $(LIBS) |
| 2852 | |
Petr Baudis | 28818ff | 2005-07-29 17:50:24 +0200 | [diff] [blame] | 2853 | $(LIB_FILE): $(LIB_OBJS) |
SZEDER Gábor | 325b06d | 2021-08-18 23:36:11 +0200 | [diff] [blame] | 2854 | $(QUIET_AR)$(RM) $@ && $(AR) $(ARFLAGS) $@ $^ |
Petr Baudis | 28818ff | 2005-07-29 17:50:24 +0200 | [diff] [blame] | 2855 | |
Linus Torvalds | 3443546 | 2006-03-24 20:13:22 -0800 | [diff] [blame] | 2856 | $(XDIFF_LIB): $(XDIFF_OBJS) |
SZEDER Gábor | 325b06d | 2021-08-18 23:36:11 +0200 | [diff] [blame] | 2857 | $(QUIET_AR)$(RM) $@ && $(AR) $(ARFLAGS) $@ $^ |
Linus Torvalds | 3443546 | 2006-03-24 20:13:22 -0800 | [diff] [blame] | 2858 | |
Han-Wen Nienhuys | ef8a6c6 | 2021-10-07 20:25:00 +0000 | [diff] [blame] | 2859 | $(REFTABLE_LIB): $(REFTABLE_OBJS) |
| 2860 | $(QUIET_AR)$(RM) $@ && $(AR) $(ARFLAGS) $@ $^ |
| 2861 | |
| 2862 | $(REFTABLE_TEST_LIB): $(REFTABLE_TEST_OBJS) |
| 2863 | $(QUIET_AR)$(RM) $@ && $(AR) $(ARFLAGS) $@ $^ |
| 2864 | |
Jonathan Nieder | 5b58619 | 2012-03-31 03:44:53 -0500 | [diff] [blame] | 2865 | export DEFAULT_EDITOR DEFAULT_PAGER |
| 2866 | |
Johannes Schindelin | faa7a09 | 2019-04-18 06:16:44 -0700 | [diff] [blame] | 2867 | Documentation/GIT-EXCLUDED-PROGRAMS: FORCE |
| 2868 | @EXCLUDED='EXCLUDED_PROGRAMS := $(EXCLUDED_PROGRAMS)'; \ |
| 2869 | if test x"$$EXCLUDED" != \ |
| 2870 | x"`cat Documentation/GIT-EXCLUDED-PROGRAMS 2>/dev/null`" ; then \ |
| 2871 | echo >&2 " * new documentation flags"; \ |
| 2872 | echo "$$EXCLUDED" >Documentation/GIT-EXCLUDED-PROGRAMS; \ |
| 2873 | fi |
| 2874 | |
SZEDER Gábor | 2530afd | 2018-02-15 03:14:10 +0100 | [diff] [blame] | 2875 | .PHONY: doc man man-perl html info pdf |
| 2876 | doc: man-perl |
Petr Baudis | 28818ff | 2005-07-29 17:50:24 +0200 | [diff] [blame] | 2877 | $(MAKE) -C Documentation all |
| 2878 | |
SZEDER Gábor | 2530afd | 2018-02-15 03:14:10 +0100 | [diff] [blame] | 2879 | man: man-perl |
Michael J Gruber | 414851a | 2008-09-10 10:19:34 +0200 | [diff] [blame] | 2880 | $(MAKE) -C Documentation man |
| 2881 | |
SZEDER Gábor | 2530afd | 2018-02-15 03:14:10 +0100 | [diff] [blame] | 2882 | man-perl: perl/build/man/man3/Git.3pm |
| 2883 | |
Michael J Gruber | 414851a | 2008-09-10 10:19:34 +0200 | [diff] [blame] | 2884 | html: |
| 2885 | $(MAKE) -C Documentation html |
| 2886 | |
David Kastrup | 4739809 | 2007-08-06 12:22:57 +0200 | [diff] [blame] | 2887 | info: |
| 2888 | $(MAKE) -C Documentation info |
| 2889 | |
Miklos Vajna | a325a1a | 2008-12-10 23:44:50 +0100 | [diff] [blame] | 2890 | pdf: |
| 2891 | $(MAKE) -C Documentation pdf |
| 2892 | |
Ævar Arnfjörð Bjarmason | cd5513a | 2011-02-22 23:41:23 +0000 | [diff] [blame] | 2893 | XGETTEXT_FLAGS = \ |
| 2894 | --force-po \ |
Jiang Xin | 47fbfde | 2014-04-17 13:37:18 +0800 | [diff] [blame] | 2895 | --add-comments=TRANSLATORS: \ |
Ævar Arnfjörð Bjarmason | cd5513a | 2011-02-22 23:41:23 +0000 | [diff] [blame] | 2896 | --msgid-bugs-address="Git Mailing List <git@vger.kernel.org>" \ |
Ævar Arnfjörð Bjarmason | 6dd9a91 | 2022-05-26 22:50:29 +0800 | [diff] [blame] | 2897 | --package-name=Git |
Ævar Arnfjörð Bjarmason | ff46a49 | 2011-04-10 19:37:01 +0000 | [diff] [blame] | 2898 | XGETTEXT_FLAGS_C = $(XGETTEXT_FLAGS) --language=C \ |
| 2899 | --keyword=_ --keyword=N_ --keyword="Q_:1,2" |
Jiang Xin | c2d140d | 2012-07-25 22:53:07 +0800 | [diff] [blame] | 2900 | XGETTEXT_FLAGS_SH = $(XGETTEXT_FLAGS) --language=Shell \ |
| 2901 | --keyword=gettextln --keyword=eval_gettextln |
Vasco Almeida | c4a85c3 | 2016-12-14 11:54:29 -0100 | [diff] [blame] | 2902 | XGETTEXT_FLAGS_PERL = $(XGETTEXT_FLAGS) --language=Perl \ |
Vasco Almeida | 0539d5e | 2016-12-14 11:54:30 -0100 | [diff] [blame] | 2903 | --keyword=__ --keyword=N__ --keyword="__n:1,2" |
Jiang Xin | fbb3d32 | 2022-05-26 22:50:33 +0800 | [diff] [blame] | 2904 | MSGMERGE_FLAGS = --add-location --backup=off --update |
Victoria Dye | 7b5c93c | 2022-09-02 15:56:43 +0000 | [diff] [blame] | 2905 | LOCALIZED_C = $(sort $(FOUND_C_SOURCES) $(FOUND_H_SOURCES) $(GENERATED_H)) |
Jiang Xin | ea3f639 | 2022-05-26 22:50:26 +0800 | [diff] [blame] | 2906 | LOCALIZED_SH = $(sort $(SCRIPT_SH) git-sh-setup.sh) |
| 2907 | LOCALIZED_PERL = $(sort $(SCRIPT_PERL)) |
Ævar Arnfjörð Bjarmason | 5e9637c | 2011-11-18 00:14:42 +0100 | [diff] [blame] | 2908 | |
| 2909 | ifdef XGETTEXT_INCLUDE_TESTS |
| 2910 | LOCALIZED_C += t/t0200/test.c |
| 2911 | LOCALIZED_SH += t/t0200/test.sh |
| 2912 | LOCALIZED_PERL += t/t0200/test.perl |
| 2913 | endif |
Ævar Arnfjörð Bjarmason | cd5513a | 2011-02-22 23:41:23 +0000 | [diff] [blame] | 2914 | |
Ævar Arnfjörð Bjarmason | 1cc0425 | 2022-05-26 22:50:28 +0800 | [diff] [blame] | 2915 | ## We generate intermediate .build/pot/po/%.po files containing a |
| 2916 | ## extract of the translations we find in each file in the source |
| 2917 | ## tree. We will assemble them using msgcat to create the final |
| 2918 | ## "po/git.pot" file. |
| 2919 | LOCALIZED_ALL_GEN_PO = |
| 2920 | |
| 2921 | LOCALIZED_C_GEN_PO = $(LOCALIZED_C:%=.build/pot/po/%.po) |
| 2922 | LOCALIZED_ALL_GEN_PO += $(LOCALIZED_C_GEN_PO) |
| 2923 | |
| 2924 | LOCALIZED_SH_GEN_PO = $(LOCALIZED_SH:%=.build/pot/po/%.po) |
| 2925 | LOCALIZED_ALL_GEN_PO += $(LOCALIZED_SH_GEN_PO) |
| 2926 | |
| 2927 | LOCALIZED_PERL_GEN_PO = $(LOCALIZED_PERL:%=.build/pot/po/%.po) |
| 2928 | LOCALIZED_ALL_GEN_PO += $(LOCALIZED_PERL_GEN_PO) |
| 2929 | |
Junio C Hamano | fc0fd5b | 2017-07-20 11:57:01 -0700 | [diff] [blame] | 2930 | ## Gettext tools cannot work with our own custom PRItime type, so |
| 2931 | ## we replace PRItime with PRIuMAX. We need to update this to |
| 2932 | ## PRIdMAX if we switch to a signed type later. |
Ævar Arnfjörð Bjarmason | 1cc0425 | 2022-05-26 22:50:28 +0800 | [diff] [blame] | 2933 | $(LOCALIZED_C_GEN_PO): .build/pot/po/%.po: % |
| 2934 | $(call mkdir_p_parent_template) |
| 2935 | $(QUIET_XGETTEXT) \ |
| 2936 | if grep -q PRItime $<; then \ |
| 2937 | (\ |
| 2938 | sed -e 's|PRItime|PRIuMAX|g' <$< \ |
| 2939 | >.build/pot/po/$< && \ |
| 2940 | cd .build/pot/po && \ |
| 2941 | $(XGETTEXT) --omit-header \ |
| 2942 | -o $(@:.build/pot/po/%=%) \ |
| 2943 | $(XGETTEXT_FLAGS_C) $< && \ |
| 2944 | rm $<; \ |
| 2945 | ); \ |
| 2946 | else \ |
| 2947 | $(XGETTEXT) --omit-header \ |
| 2948 | -o $@ $(XGETTEXT_FLAGS_C) $<; \ |
| 2949 | fi |
Junio C Hamano | fc0fd5b | 2017-07-20 11:57:01 -0700 | [diff] [blame] | 2950 | |
Ævar Arnfjörð Bjarmason | 1cc0425 | 2022-05-26 22:50:28 +0800 | [diff] [blame] | 2951 | $(LOCALIZED_SH_GEN_PO): .build/pot/po/%.po: % |
| 2952 | $(call mkdir_p_parent_template) |
| 2953 | $(QUIET_XGETTEXT)$(XGETTEXT) --omit-header \ |
| 2954 | -o$@ $(XGETTEXT_FLAGS_SH) $< |
Junio C Hamano | fc0fd5b | 2017-07-20 11:57:01 -0700 | [diff] [blame] | 2955 | |
Ævar Arnfjörð Bjarmason | 1cc0425 | 2022-05-26 22:50:28 +0800 | [diff] [blame] | 2956 | $(LOCALIZED_PERL_GEN_PO): .build/pot/po/%.po: % |
| 2957 | $(call mkdir_p_parent_template) |
| 2958 | $(QUIET_XGETTEXT)$(XGETTEXT) --omit-header \ |
| 2959 | -o$@ $(XGETTEXT_FLAGS_PERL) $< |
Junio C Hamano | fc0fd5b | 2017-07-20 11:57:01 -0700 | [diff] [blame] | 2960 | |
Ævar Arnfjörð Bjarmason | 1cc0425 | 2022-05-26 22:50:28 +0800 | [diff] [blame] | 2961 | define gen_pot_header |
| 2962 | $(XGETTEXT) $(XGETTEXT_FLAGS_C) \ |
| 2963 | -o - /dev/null | \ |
| 2964 | sed -e 's|charset=CHARSET|charset=UTF-8|' \ |
| 2965 | -e 's|\(Last-Translator: \)FULL NAME <.*>|\1make by the Makefile|' \ |
| 2966 | -e 's|\(Language-Team: \)LANGUAGE <.*>|\1Git Mailing List <git@vger.kernel.org>|' \ |
| 2967 | >$@ && \ |
| 2968 | echo '"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\\n"' >>$@ |
| 2969 | endef |
Junio C Hamano | fc0fd5b | 2017-07-20 11:57:01 -0700 | [diff] [blame] | 2970 | |
Ævar Arnfjörð Bjarmason | 1cc0425 | 2022-05-26 22:50:28 +0800 | [diff] [blame] | 2971 | .build/pot/git.header: $(LOCALIZED_ALL_GEN_PO) |
| 2972 | $(call mkdir_p_parent_template) |
| 2973 | $(QUIET_GEN)$(gen_pot_header) |
| 2974 | |
Ævar Arnfjörð Bjarmason | 5377abc | 2022-05-26 22:50:32 +0800 | [diff] [blame] | 2975 | po/git.pot: .build/pot/git.header $(LOCALIZED_ALL_GEN_PO) |
| 2976 | $(QUIET_GEN)$(MSGCAT) $^ >$@ |
Ævar Arnfjörð Bjarmason | cd5513a | 2011-02-22 23:41:23 +0000 | [diff] [blame] | 2977 | |
Elia Pinto | e6be265 | 2015-12-15 15:21:00 +0000 | [diff] [blame] | 2978 | .PHONY: pot |
Ævar Arnfjörð Bjarmason | cd5513a | 2011-02-22 23:41:23 +0000 | [diff] [blame] | 2979 | pot: po/git.pot |
| 2980 | |
Jiang Xin | fbb3d32 | 2022-05-26 22:50:33 +0800 | [diff] [blame] | 2981 | define check_po_file_envvar |
| 2982 | $(if $(PO_FILE), \ |
| 2983 | $(if $(filter po/%.po,$(PO_FILE)), , \ |
| 2984 | $(error PO_FILE should match pattern: "po/%.po")), \ |
| 2985 | $(error PO_FILE is not defined)) |
| 2986 | endef |
| 2987 | |
| 2988 | .PHONY: po-update |
| 2989 | po-update: po/git.pot |
| 2990 | $(check_po_file_envvar) |
| 2991 | @if test ! -e $(PO_FILE); then \ |
| 2992 | echo >&2 "error: $(PO_FILE) does not exist"; \ |
Ævar Arnfjörð Bjarmason | b9832f7 | 2022-05-26 22:50:34 +0800 | [diff] [blame] | 2993 | echo >&2 'To create an initial po file, use: "make po-init PO_FILE=po/XX.po"'; \ |
Jiang Xin | fbb3d32 | 2022-05-26 22:50:33 +0800 | [diff] [blame] | 2994 | exit 1; \ |
| 2995 | fi |
| 2996 | $(QUIET_MSGMERGE)$(MSGMERGE) $(MSGMERGE_FLAGS) $(PO_FILE) po/git.pot |
| 2997 | |
Ævar Arnfjörð Bjarmason | 6dd9a91 | 2022-05-26 22:50:29 +0800 | [diff] [blame] | 2998 | .PHONY: check-pot |
| 2999 | check-pot: $(LOCALIZED_ALL_GEN_PO) |
| 3000 | |
Ævar Arnfjörð Bjarmason | b9832f7 | 2022-05-26 22:50:34 +0800 | [diff] [blame] | 3001 | ### TODO FIXME: Translating everything in these files is a bad |
| 3002 | ### heuristic for "core", as we'll translate obscure error() messages |
| 3003 | ### along with commonly seen i18n messages. A better heuristic would |
| 3004 | ### be to e.g. use spatch to first remove error/die/warning |
| 3005 | ### etc. messages. |
| 3006 | LOCALIZED_C_CORE = |
| 3007 | LOCALIZED_C_CORE += builtin/checkout.c |
| 3008 | LOCALIZED_C_CORE += builtin/clone.c |
| 3009 | LOCALIZED_C_CORE += builtin/index-pack.c |
| 3010 | LOCALIZED_C_CORE += builtin/push.c |
| 3011 | LOCALIZED_C_CORE += builtin/reset.c |
| 3012 | LOCALIZED_C_CORE += remote.c |
| 3013 | LOCALIZED_C_CORE += wt-status.c |
| 3014 | |
| 3015 | LOCALIZED_C_CORE_GEN_PO = $(LOCALIZED_C_CORE:%=.build/pot/po/%.po) |
| 3016 | |
| 3017 | .build/pot/git-core.header: $(LOCALIZED_C_CORE_GEN_PO) |
| 3018 | $(call mkdir_p_parent_template) |
| 3019 | $(QUIET_GEN)$(gen_pot_header) |
| 3020 | |
| 3021 | po/git-core.pot: .build/pot/git-core.header $(LOCALIZED_C_CORE_GEN_PO) |
| 3022 | $(QUIET_GEN)$(MSGCAT) $^ >$@ |
| 3023 | |
| 3024 | .PHONY: po-init |
| 3025 | po-init: po/git-core.pot |
| 3026 | $(check_po_file_envvar) |
| 3027 | @if test -e $(PO_FILE); then \ |
| 3028 | echo >&2 "error: $(PO_FILE) exists already"; \ |
| 3029 | exit 1; \ |
| 3030 | fi |
| 3031 | $(QUIET_MSGINIT)msginit \ |
| 3032 | --input=$< \ |
| 3033 | --output=$(PO_FILE) \ |
| 3034 | --no-translator \ |
| 3035 | --locale=$(PO_FILE:po/%.po=%) |
| 3036 | |
| 3037 | ## po/*.po files & their rules |
Johannes Schindelin | 4348824 | 2021-07-04 22:55:12 +0000 | [diff] [blame] | 3038 | ifdef NO_GETTEXT |
| 3039 | POFILES := |
| 3040 | MOFILES := |
| 3041 | else |
Ævar Arnfjörð Bjarmason | 5e9637c | 2011-11-18 00:14:42 +0100 | [diff] [blame] | 3042 | POFILES := $(wildcard po/*.po) |
| 3043 | MOFILES := $(patsubst po/%.po,po/build/locale/%/LC_MESSAGES/git.mo,$(POFILES)) |
| 3044 | |
Ævar Arnfjörð Bjarmason | 5e9637c | 2011-11-18 00:14:42 +0100 | [diff] [blame] | 3045 | all:: $(MOFILES) |
| 3046 | endif |
| 3047 | |
| 3048 | po/build/locale/%/LC_MESSAGES/git.mo: po/%.po |
Ævar Arnfjörð Bjarmason | 0b6d0bc | 2022-03-03 17:04:19 +0100 | [diff] [blame] | 3049 | $(call mkdir_p_parent_template) |
| 3050 | $(QUIET_MSGFMT)$(MSGFMT) -o $@ $< |
Ævar Arnfjörð Bjarmason | 5e9637c | 2011-11-18 00:14:42 +0100 | [diff] [blame] | 3051 | |
Ævar Arnfjörð Bjarmason | 805a378 | 2017-12-22 11:07:21 -0800 | [diff] [blame] | 3052 | LIB_PERL := $(wildcard perl/Git.pm perl/Git/*.pm perl/Git/*/*.pm perl/Git/*/*/*.pm) |
| 3053 | 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] | 3054 | LIB_CPAN := $(wildcard perl/FromCPAN/*.pm perl/FromCPAN/*/*.pm) |
| 3055 | 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] | 3056 | |
| 3057 | ifndef NO_PERL |
Ævar Arnfjörð Bjarmason | 805a378 | 2017-12-22 11:07:21 -0800 | [diff] [blame] | 3058 | all:: $(LIB_PERL_GEN) |
Todd Zullinger | 075321c | 2018-03-03 15:38:16 +0000 | [diff] [blame] | 3059 | ifndef NO_PERL_CPAN_FALLBACKS |
Ævar Arnfjörð Bjarmason | 382029f | 2018-03-03 15:38:15 +0000 | [diff] [blame] | 3060 | all:: $(LIB_CPAN_GEN) |
Ævar Arnfjörð Bjarmason | 20d2a30 | 2017-12-10 21:13:33 +0000 | [diff] [blame] | 3061 | endif |
Ævar Arnfjörð Bjarmason | 1aca69c | 2018-03-03 15:38:17 +0000 | [diff] [blame] | 3062 | NO_PERL_CPAN_FALLBACKS_SQ = $(subst ','\'',$(NO_PERL_CPAN_FALLBACKS)) |
Ævar Arnfjörð Bjarmason | 20d2a30 | 2017-12-10 21:13:33 +0000 | [diff] [blame] | 3063 | endif |
| 3064 | |
Ævar Arnfjörð Bjarmason | 3d49f72 | 2021-05-05 14:21:39 +0200 | [diff] [blame] | 3065 | perl/build/lib/%.pm: perl/%.pm GIT-PERL-DEFINES |
Ævar Arnfjörð Bjarmason | 0b6d0bc | 2022-03-03 17:04:19 +0100 | [diff] [blame] | 3066 | $(call mkdir_p_parent_template) |
| 3067 | $(QUIET_GEN) \ |
Dan Jacques | 07d90ea | 2018-04-10 11:05:43 -0400 | [diff] [blame] | 3068 | sed -e 's|@@LOCALEDIR@@|$(perl_localedir_SQ)|g' \ |
Ævar Arnfjörð Bjarmason | 256c2dc | 2021-05-05 14:21:41 +0200 | [diff] [blame] | 3069 | -e 's|@@NO_GETTEXT@@|$(NO_GETTEXT_SQ)|g' \ |
Ævar Arnfjörð Bjarmason | 1aca69c | 2018-03-03 15:38:17 +0000 | [diff] [blame] | 3070 | -e 's|@@NO_PERL_CPAN_FALLBACKS@@|$(NO_PERL_CPAN_FALLBACKS_SQ)|g' \ |
| 3071 | < $< > $@ |
Ævar Arnfjörð Bjarmason | 20d2a30 | 2017-12-10 21:13:33 +0000 | [diff] [blame] | 3072 | |
| 3073 | perl/build/man/man3/Git.3pm: perl/Git.pm |
Ævar Arnfjörð Bjarmason | 0b6d0bc | 2022-03-03 17:04:19 +0100 | [diff] [blame] | 3074 | $(call mkdir_p_parent_template) |
| 3075 | $(QUIET_GEN)pod2man $< $@ |
Ævar Arnfjörð Bjarmason | 20d2a30 | 2017-12-10 21:13:33 +0000 | [diff] [blame] | 3076 | |
Ævar Arnfjörð Bjarmason | 7171221 | 2021-07-22 01:23:04 +0200 | [diff] [blame] | 3077 | $(ETAGS_TARGET): $(FOUND_SOURCE_FILES) |
Ævar Arnfjörð Bjarmason | 8990624 | 2021-08-05 00:54:40 +0200 | [diff] [blame] | 3078 | $(QUIET_GEN)$(RM) $@+ && \ |
| 3079 | echo $(FOUND_SOURCE_FILES) | xargs etags -a -o $@+ && \ |
| 3080 | mv $@+ $@ |
Petr Baudis | 28818ff | 2005-07-29 17:50:24 +0200 | [diff] [blame] | 3081 | |
Ævar Arnfjörð Bjarmason | 7171221 | 2021-07-22 01:23:04 +0200 | [diff] [blame] | 3082 | tags: $(FOUND_SOURCE_FILES) |
Ævar Arnfjörð Bjarmason | 8990624 | 2021-08-05 00:54:40 +0200 | [diff] [blame] | 3083 | $(QUIET_GEN)$(RM) $@+ && \ |
| 3084 | echo $(FOUND_SOURCE_FILES) | xargs ctags -a -o $@+ && \ |
| 3085 | mv $@+ $@ |
Petr Baudis | 28818ff | 2005-07-29 17:50:24 +0200 | [diff] [blame] | 3086 | |
Ævar Arnfjörð Bjarmason | 7171221 | 2021-07-22 01:23:04 +0200 | [diff] [blame] | 3087 | cscope.out: $(FOUND_SOURCE_FILES) |
Ævar Arnfjörð Bjarmason | 8990624 | 2021-08-05 00:54:40 +0200 | [diff] [blame] | 3088 | $(QUIET_GEN)$(RM) $@+ && \ |
| 3089 | echo $(FOUND_SOURCE_FILES) | xargs cscope -f$@+ -b && \ |
| 3090 | mv $@+ $@ |
Ævar Arnfjörð Bjarmason | 7171221 | 2021-07-22 01:23:04 +0200 | [diff] [blame] | 3091 | |
| 3092 | .PHONY: cscope |
| 3093 | cscope: cscope.out |
Kristof Provost | a2a9150 | 2007-10-06 16:24:42 +0200 | [diff] [blame] | 3094 | |
Yakov Lerner | ca3bcab | 2006-06-15 01:36:00 +0300 | [diff] [blame] | 3095 | ### Detect prefix changes |
Jeff King | be1dbd0 | 2012-06-20 14:31:55 -0400 | [diff] [blame] | 3096 | TRACK_PREFIX = $(bindir_SQ):$(gitexecdir_SQ):$(template_dir_SQ):$(prefix_SQ):\ |
| 3097 | $(localedir_SQ) |
| 3098 | |
| 3099 | GIT-PREFIX: FORCE |
| 3100 | @FLAGS='$(TRACK_PREFIX)'; \ |
| 3101 | if test x"$$FLAGS" != x"`cat GIT-PREFIX 2>/dev/null`" ; then \ |
Christian Couder | 1a59d88 | 2012-12-18 16:26:39 +0100 | [diff] [blame] | 3102 | echo >&2 " * new prefix flags"; \ |
Jeff King | be1dbd0 | 2012-06-20 14:31:55 -0400 | [diff] [blame] | 3103 | echo "$$FLAGS" >GIT-PREFIX; \ |
| 3104 | fi |
| 3105 | |
| 3106 | TRACK_CFLAGS = $(CC):$(subst ','\'',$(ALL_CFLAGS)):$(USE_GETTEXT_SCHEME) |
Yakov Lerner | ca3bcab | 2006-06-15 01:36:00 +0300 | [diff] [blame] | 3107 | |
Jonathan Nieder | 13fca9f | 2010-01-06 02:06:58 -0600 | [diff] [blame] | 3108 | GIT-CFLAGS: FORCE |
Yakov Lerner | ca3bcab | 2006-06-15 01:36:00 +0300 | [diff] [blame] | 3109 | @FLAGS='$(TRACK_CFLAGS)'; \ |
| 3110 | if test x"$$FLAGS" != x"`cat GIT-CFLAGS 2>/dev/null`" ; then \ |
Christian Couder | 1a59d88 | 2012-12-18 16:26:39 +0100 | [diff] [blame] | 3111 | echo >&2 " * new build flags"; \ |
Yakov Lerner | ca3bcab | 2006-06-15 01:36:00 +0300 | [diff] [blame] | 3112 | echo "$$FLAGS" >GIT-CFLAGS; \ |
| 3113 | fi |
| 3114 | |
Fredrik Kuivinen | d9a25fc | 2011-06-22 12:50:56 +0200 | [diff] [blame] | 3115 | TRACK_LDFLAGS = $(subst ','\'',$(ALL_LDFLAGS)) |
| 3116 | |
| 3117 | GIT-LDFLAGS: FORCE |
| 3118 | @FLAGS='$(TRACK_LDFLAGS)'; \ |
| 3119 | if test x"$$FLAGS" != x"`cat GIT-LDFLAGS 2>/dev/null`" ; then \ |
Christian Couder | 1a59d88 | 2012-12-18 16:26:39 +0100 | [diff] [blame] | 3120 | echo >&2 " * new link flags"; \ |
Fredrik Kuivinen | d9a25fc | 2011-06-22 12:50:56 +0200 | [diff] [blame] | 3121 | echo "$$FLAGS" >GIT-LDFLAGS; \ |
| 3122 | fi |
| 3123 | |
Junio C Hamano | bfce508 | 2008-07-25 12:35:10 -0700 | [diff] [blame] | 3124 | # We need to apply sq twice, once to protect from the shell |
| 3125 | # that runs GIT-BUILD-OPTIONS, and then again to protect it |
| 3126 | # and the first level quoting from the shell that runs "echo". |
Jonathan Nieder | 13fca9f | 2010-01-06 02:06:58 -0600 | [diff] [blame] | 3127 | GIT-BUILD-OPTIONS: FORCE |
Jeff King | a2d25ef | 2015-05-29 03:26:30 -0400 | [diff] [blame] | 3128 | @echo SHELL_PATH=\''$(subst ','\'',$(SHELL_PATH_SQ))'\' >$@+ |
Jeff King | 3f824e9 | 2017-12-08 05:47:22 -0500 | [diff] [blame] | 3129 | @echo TEST_SHELL_PATH=\''$(subst ','\'',$(TEST_SHELL_PATH_SQ))'\' >>$@+ |
Jeff King | a2d25ef | 2015-05-29 03:26:30 -0400 | [diff] [blame] | 3130 | @echo PERL_PATH=\''$(subst ','\'',$(PERL_PATH_SQ))'\' >>$@+ |
| 3131 | @echo DIFF=\''$(subst ','\'',$(subst ','\'',$(DIFF)))'\' >>$@+ |
| 3132 | @echo PYTHON_PATH=\''$(subst ','\'',$(PYTHON_PATH_SQ))'\' >>$@+ |
| 3133 | @echo TAR=\''$(subst ','\'',$(subst ','\'',$(TAR)))'\' >>$@+ |
| 3134 | @echo NO_CURL=\''$(subst ','\'',$(subst ','\'',$(NO_CURL)))'\' >>$@+ |
Junio C Hamano | 0d5d7db | 2015-06-16 14:27:06 -0700 | [diff] [blame] | 3135 | @echo NO_EXPAT=\''$(subst ','\'',$(subst ','\'',$(NO_EXPAT)))'\' >>$@+ |
Ævar Arnfjörð Bjarmason | 94da919 | 2017-06-01 18:20:56 +0000 | [diff] [blame] | 3136 | @echo USE_LIBPCRE2=\''$(subst ','\'',$(subst ','\'',$(USE_LIBPCRE2)))'\' >>$@+ |
Jeff King | a2d25ef | 2015-05-29 03:26:30 -0400 | [diff] [blame] | 3137 | @echo NO_PERL=\''$(subst ','\'',$(subst ','\'',$(NO_PERL)))'\' >>$@+ |
Ævar Arnfjörð Bjarmason | 68c7d27 | 2017-05-25 19:45:31 +0000 | [diff] [blame] | 3138 | @echo NO_PTHREADS=\''$(subst ','\'',$(subst ','\'',$(NO_PTHREADS)))'\' >>$@+ |
Jeff King | a2d25ef | 2015-05-29 03:26:30 -0400 | [diff] [blame] | 3139 | @echo NO_PYTHON=\''$(subst ','\'',$(subst ','\'',$(NO_PYTHON)))'\' >>$@+ |
Diomidis Spinellis | 1819ad3 | 2022-08-26 11:58:15 +0300 | [diff] [blame] | 3140 | @echo NO_REGEX=\''$(subst ','\'',$(subst ','\'',$(NO_REGEX)))'\' >>$@+ |
Jeff King | a2d25ef | 2015-05-29 03:26:30 -0400 | [diff] [blame] | 3141 | @echo NO_UNIX_SOCKETS=\''$(subst ','\'',$(subst ','\'',$(NO_UNIX_SOCKETS)))'\' >>$@+ |
Eric Wong | 995bc22 | 2016-08-04 11:40:25 +0000 | [diff] [blame] | 3142 | @echo PAGER_ENV=\''$(subst ','\'',$(subst ','\'',$(PAGER_ENV)))'\' >>$@+ |
Ævar Arnfjörð Bjarmason | 2cdc292 | 2021-09-23 11:20:45 +0200 | [diff] [blame] | 3143 | @echo SANITIZE_LEAK=\''$(subst ','\'',$(subst ','\'',$(SANITIZE_LEAK)))'\' >>$@+ |
Phillip Wood | 067109a | 2022-04-09 12:28:37 +0000 | [diff] [blame] | 3144 | @echo SANITIZE_ADDRESS=\''$(subst ','\'',$(subst ','\'',$(SANITIZE_ADDRESS)))'\' >>$@+ |
Johannes Schindelin | 8abfdf4 | 2018-11-14 08:32:11 -0800 | [diff] [blame] | 3145 | @echo X=\'$(X)\' >>$@+ |
Jeff Hostetler | 62c7367 | 2022-03-25 18:02:51 +0000 | [diff] [blame] | 3146 | ifdef FSMONITOR_DAEMON_BACKEND |
| 3147 | @echo FSMONITOR_DAEMON_BACKEND=\''$(subst ','\'',$(subst ','\'',$(FSMONITOR_DAEMON_BACKEND)))'\' >>$@+ |
| 3148 | endif |
Jeff Hostetler | d33c804 | 2022-05-26 21:46:59 +0000 | [diff] [blame] | 3149 | ifdef FSMONITOR_OS_SETTINGS |
| 3150 | @echo FSMONITOR_OS_SETTINGS=\''$(subst ','\'',$(subst ','\'',$(FSMONITOR_OS_SETTINGS)))'\' >>$@+ |
| 3151 | endif |
John Keeping | 2d14e13 | 2013-04-29 19:16:21 +0100 | [diff] [blame] | 3152 | ifdef TEST_OUTPUT_DIRECTORY |
Jeff King | a2d25ef | 2015-05-29 03:26:30 -0400 | [diff] [blame] | 3153 | @echo TEST_OUTPUT_DIRECTORY=\''$(subst ','\'',$(subst ','\'',$(TEST_OUTPUT_DIRECTORY)))'\' >>$@+ |
John Keeping | 2d14e13 | 2013-04-29 19:16:21 +0100 | [diff] [blame] | 3154 | endif |
Thomas Rast | 342e9ef | 2012-02-17 11:25:09 +0100 | [diff] [blame] | 3155 | ifdef GIT_TEST_OPTS |
Jeff King | a2d25ef | 2015-05-29 03:26:30 -0400 | [diff] [blame] | 3156 | @echo GIT_TEST_OPTS=\''$(subst ','\'',$(subst ','\'',$(GIT_TEST_OPTS)))'\' >>$@+ |
Thomas Rast | 342e9ef | 2012-02-17 11:25:09 +0100 | [diff] [blame] | 3157 | endif |
Junio C Hamano | 5e87eae | 2010-06-11 09:40:25 -0700 | [diff] [blame] | 3158 | ifdef GIT_TEST_CMP |
Jeff King | a2d25ef | 2015-05-29 03:26:30 -0400 | [diff] [blame] | 3159 | @echo GIT_TEST_CMP=\''$(subst ','\'',$(subst ','\'',$(GIT_TEST_CMP)))'\' >>$@+ |
Junio C Hamano | 5e87eae | 2010-06-11 09:40:25 -0700 | [diff] [blame] | 3160 | endif |
| 3161 | ifdef GIT_TEST_CMP_USE_COPIED_CONTEXT |
Jeff King | a2d25ef | 2015-05-29 03:26:30 -0400 | [diff] [blame] | 3162 | @echo GIT_TEST_CMP_USE_COPIED_CONTEXT=YesPlease >>$@+ |
Junio C Hamano | 5e87eae | 2010-06-11 09:40:25 -0700 | [diff] [blame] | 3163 | endif |
Đoàn Trần Công Danh | 482c962 | 2021-06-08 13:56:28 +0700 | [diff] [blame] | 3164 | ifdef GIT_TEST_UTF8_LOCALE |
| 3165 | @echo GIT_TEST_UTF8_LOCALE=\''$(subst ','\'',$(subst ','\'',$(GIT_TEST_UTF8_LOCALE)))'\' >>$@+ |
| 3166 | endif |
Jeff King | a2d25ef | 2015-05-29 03:26:30 -0400 | [diff] [blame] | 3167 | @echo NO_GETTEXT=\''$(subst ','\'',$(subst ','\'',$(NO_GETTEXT)))'\' >>$@+ |
Thomas Rast | 342e9ef | 2012-02-17 11:25:09 +0100 | [diff] [blame] | 3168 | ifdef GIT_PERF_REPEAT_COUNT |
Jeff King | a2d25ef | 2015-05-29 03:26:30 -0400 | [diff] [blame] | 3169 | @echo GIT_PERF_REPEAT_COUNT=\''$(subst ','\'',$(subst ','\'',$(GIT_PERF_REPEAT_COUNT)))'\' >>$@+ |
Thomas Rast | 342e9ef | 2012-02-17 11:25:09 +0100 | [diff] [blame] | 3170 | endif |
| 3171 | ifdef GIT_PERF_REPO |
Jeff King | a2d25ef | 2015-05-29 03:26:30 -0400 | [diff] [blame] | 3172 | @echo GIT_PERF_REPO=\''$(subst ','\'',$(subst ','\'',$(GIT_PERF_REPO)))'\' >>$@+ |
Thomas Rast | 342e9ef | 2012-02-17 11:25:09 +0100 | [diff] [blame] | 3173 | endif |
| 3174 | ifdef GIT_PERF_LARGE_REPO |
Jeff King | a2d25ef | 2015-05-29 03:26:30 -0400 | [diff] [blame] | 3175 | @echo GIT_PERF_LARGE_REPO=\''$(subst ','\'',$(subst ','\'',$(GIT_PERF_LARGE_REPO)))'\' >>$@+ |
Thomas Rast | 342e9ef | 2012-02-17 11:25:09 +0100 | [diff] [blame] | 3176 | endif |
| 3177 | ifdef GIT_PERF_MAKE_OPTS |
Jeff King | a2d25ef | 2015-05-29 03:26:30 -0400 | [diff] [blame] | 3178 | @echo GIT_PERF_MAKE_OPTS=\''$(subst ','\'',$(subst ','\'',$(GIT_PERF_MAKE_OPTS)))'\' >>$@+ |
Thomas Rast | 342e9ef | 2012-02-17 11:25:09 +0100 | [diff] [blame] | 3179 | endif |
Ævar Arnfjörð Bjarmason | 88b6197 | 2017-05-20 21:42:18 +0000 | [diff] [blame] | 3180 | ifdef GIT_PERF_MAKE_COMMAND |
| 3181 | @echo GIT_PERF_MAKE_COMMAND=\''$(subst ','\'',$(subst ','\'',$(GIT_PERF_MAKE_COMMAND)))'\' >>$@+ |
| 3182 | endif |
Jeff King | 3d89361 | 2017-02-25 04:37:07 -0500 | [diff] [blame] | 3183 | ifdef GIT_INTEROP_MAKE_OPTS |
| 3184 | @echo GIT_INTEROP_MAKE_OPTS=\''$(subst ','\'',$(subst ','\'',$(GIT_INTEROP_MAKE_OPTS)))'\' >>$@+ |
| 3185 | endif |
Ben Peart | 1f357b0 | 2018-09-18 23:29:36 +0000 | [diff] [blame] | 3186 | ifdef GIT_TEST_INDEX_VERSION |
| 3187 | @echo GIT_TEST_INDEX_VERSION=\''$(subst ','\'',$(subst ','\'',$(GIT_TEST_INDEX_VERSION)))'\' >>$@+ |
Thomas Gummerer | 5d9fc88 | 2014-02-23 21:49:58 +0100 | [diff] [blame] | 3188 | endif |
Jeff King | 5338ed2 | 2020-10-21 23:24:00 -0400 | [diff] [blame] | 3189 | ifdef GIT_TEST_PERL_FATAL_WARNINGS |
| 3190 | @echo GIT_TEST_PERL_FATAL_WARNINGS=\''$(subst ','\'',$(subst ','\'',$(GIT_TEST_PERL_FATAL_WARNINGS)))'\' >>$@+ |
| 3191 | endif |
Johannes Schindelin | b7d11a0 | 2021-07-24 22:06:49 +0000 | [diff] [blame] | 3192 | ifdef RUNTIME_PREFIX |
| 3193 | @echo RUNTIME_PREFIX=\'true\' >>$@+ |
| 3194 | else |
| 3195 | @echo RUNTIME_PREFIX=\'false\' >>$@+ |
| 3196 | endif |
Jeff King | a2d25ef | 2015-05-29 03:26:30 -0400 | [diff] [blame] | 3197 | @if cmp $@+ $@ >/dev/null 2>&1; then $(RM) $@+; else mv $@+ $@; fi |
Johannes Schindelin | ee9e66e | 2022-10-18 10:59:04 +0000 | [diff] [blame] | 3198 | @if test -f GIT-BUILD-DIR; then rm GIT-BUILD-DIR; fi |
Jeff King | 7cf7f54 | 2008-02-24 14:40:45 -0500 | [diff] [blame] | 3199 | |
Christian Couder | 96a4647 | 2012-12-18 16:26:38 +0100 | [diff] [blame] | 3200 | ### Detect Python interpreter path changes |
| 3201 | ifndef NO_PYTHON |
| 3202 | TRACK_PYTHON = $(subst ','\'',-DPYTHON_PATH='$(PYTHON_PATH_SQ)') |
Eygene Ryabinkin | 6bdb18a | 2007-03-28 04:22:02 -0700 | [diff] [blame] | 3203 | |
Christian Couder | 96a4647 | 2012-12-18 16:26:38 +0100 | [diff] [blame] | 3204 | GIT-PYTHON-VARS: FORCE |
| 3205 | @VARS='$(TRACK_PYTHON)'; \ |
Eygene Ryabinkin | 6bdb18a | 2007-03-28 04:22:02 -0700 | [diff] [blame] | 3206 | if test x"$$VARS" != x"`cat $@ 2>/dev/null`" ; then \ |
Christian Couder | 1a59d88 | 2012-12-18 16:26:39 +0100 | [diff] [blame] | 3207 | echo >&2 " * new Python interpreter location"; \ |
Eygene Ryabinkin | 6bdb18a | 2007-03-28 04:22:02 -0700 | [diff] [blame] | 3208 | echo "$$VARS" >$@; \ |
| 3209 | fi |
Eygene Ryabinkin | 6bdb18a | 2007-03-28 04:22:02 -0700 | [diff] [blame] | 3210 | endif |
| 3211 | |
Matthew Ogilvie | ea92519 | 2009-12-02 22:14:05 -0700 | [diff] [blame] | 3212 | test_bindir_programs := $(patsubst %,bin-wrappers/%,$(BINDIR_PROGRAMS_NEED_X) $(BINDIR_PROGRAMS_NO_X) $(TEST_PROGRAMS_NEED_X)) |
| 3213 | |
Phillip Wood | e137fe3 | 2023-11-09 10:50:43 -0800 | [diff] [blame] | 3214 | all:: $(TEST_PROGRAMS) $(test_bindir_programs) $(UNIT_TEST_PROGS) |
Matthew Ogilvie | ea92519 | 2009-12-02 22:14:05 -0700 | [diff] [blame] | 3215 | |
| 3216 | bin-wrappers/%: wrap-for-bin.sh |
Ævar Arnfjörð Bjarmason | 0b6d0bc | 2022-03-03 17:04:19 +0100 | [diff] [blame] | 3217 | $(call mkdir_p_parent_template) |
Matthew Ogilvie | ea92519 | 2009-12-02 22:14:05 -0700 | [diff] [blame] | 3218 | $(QUIET_GEN)sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \ |
| 3219 | -e 's|@@BUILD_DIR@@|$(shell pwd)|' \ |
Victoria Dye | 7b5c93c | 2022-09-02 15:56:43 +0000 | [diff] [blame] | 3220 | -e 's|@@PROG@@|$(patsubst test-%,t/helper/test-%,$(@F))$(if $(filter-out $(BINDIR_PROGRAMS_NO_X),$(@F)),$(X),)|' < $< > $@ && \ |
Matthew Ogilvie | ea92519 | 2009-12-02 22:14:05 -0700 | [diff] [blame] | 3221 | chmod +x $@ |
Junio C Hamano | 96651ef | 2007-04-28 15:32:49 -0700 | [diff] [blame] | 3222 | |
Johannes Schindelin | abb7c7b | 2006-02-18 13:01:18 +0100 | [diff] [blame] | 3223 | # GNU make supports exporting all variables by "export" without parameters. |
| 3224 | # However, the environment gets quite big, and some programs have problems |
| 3225 | # with that. |
| 3226 | |
Johannes Schindelin | 140245b | 2006-07-07 13:26:31 +0200 | [diff] [blame] | 3227 | export NO_SVN_TESTS |
Ramsay Jones | 1266686 | 2012-10-06 18:33:08 +0100 | [diff] [blame] | 3228 | export TEST_NO_MALLOC_CHECK |
Johannes Schindelin | abb7c7b | 2006-02-18 13:01:18 +0100 | [diff] [blame] | 3229 | |
Jonathan Nieder | 225f78c | 2010-01-26 10:08:44 -0600 | [diff] [blame] | 3230 | ### Testing rules |
| 3231 | |
Junio C Hamano | 96651ef | 2007-04-28 15:32:49 -0700 | [diff] [blame] | 3232 | test: all |
Petr Baudis | 28818ff | 2005-07-29 17:50:24 +0200 | [diff] [blame] | 3233 | $(MAKE) -C t/ all |
| 3234 | |
Thomas Rast | 342e9ef | 2012-02-17 11:25:09 +0100 | [diff] [blame] | 3235 | perf: all |
| 3236 | $(MAKE) -C t/perf/ all |
| 3237 | |
| 3238 | .PHONY: test perf |
| 3239 | |
Jonathan Nieder | daa99a9 | 2010-01-26 09:45:54 -0600 | [diff] [blame] | 3240 | .PRECIOUS: $(TEST_OBJS) |
Junio C Hamano | fa8fe28 | 2007-08-30 19:14:31 -0700 | [diff] [blame] | 3241 | |
Josh Steadmon | 80bb227 | 2024-05-06 12:57:31 -0700 | [diff] [blame] | 3242 | t/helper/test-tool$X: $(patsubst %,t/helper/%,$(TEST_BUILTINS_OBJS)) $(UNIT_TEST_DIR)/test-lib.o |
Nguyễn Thái Ngọc Duy | efd71f8 | 2018-03-24 08:44:30 +0100 | [diff] [blame] | 3243 | |
Han-Wen Nienhuys | ef8a6c6 | 2021-10-07 20:25:00 +0000 | [diff] [blame] | 3244 | t/helper/test-%$X: t/helper/test-%.o GIT-LDFLAGS $(GITLIBS) $(REFTABLE_TEST_LIB) |
David Barr | 1d73b52 | 2010-08-09 17:34:42 -0500 | [diff] [blame] | 3245 | $(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] | 3246 | |
Nguyễn Thái Ngọc Duy | dae2ff9 | 2018-03-24 08:44:32 +0100 | [diff] [blame] | 3247 | check-sha1:: t/helper/test-tool$X |
Nguyễn Thái Ngọc Duy | e6e7530 | 2016-04-13 20:22:42 +0700 | [diff] [blame] | 3248 | t/helper/test-sha1.sh |
Junio C Hamano | b65bc21 | 2006-06-24 00:59:49 -0700 | [diff] [blame] | 3249 | |
Ævar Arnfjörð Bjarmason | 3221597 | 2022-08-31 11:18:44 +0200 | [diff] [blame] | 3250 | SP_OBJ = $(patsubst %.o,%.sp,$(OBJECTS)) |
Ramsay Jones | 0bcd9ae | 2011-04-21 20:14:42 +0100 | [diff] [blame] | 3251 | |
Ævar Arnfjörð Bjarmason | 8a7a90b | 2021-10-21 22:00:14 +0200 | [diff] [blame] | 3252 | $(SP_OBJ): %.sp: %.c %.o |
Ramsay Jones | 0bcd9ae | 2011-04-21 20:14:42 +0100 | [diff] [blame] | 3253 | $(QUIET_SP)cgcc -no-compile $(ALL_CFLAGS) $(EXTRA_CPPFLAGS) \ |
Ævar Arnfjörð Bjarmason | c234e8a | 2021-09-23 02:07:16 +0200 | [diff] [blame] | 3254 | -Wsparse-error \ |
| 3255 | $(SPARSE_FLAGS) $(SP_EXTRA_FLAGS) $< && \ |
| 3256 | >$@ |
Ramsay Jones | 0bcd9ae | 2011-04-21 20:14:42 +0100 | [diff] [blame] | 3257 | |
Ævar Arnfjörð Bjarmason | c234e8a | 2021-09-23 02:07:16 +0200 | [diff] [blame] | 3258 | .PHONY: sparse |
Ramsay Jones | 0bcd9ae | 2011-04-21 20:14:42 +0100 | [diff] [blame] | 3259 | sparse: $(SP_OBJ) |
| 3260 | |
Ævar Arnfjörð Bjarmason | 7c3c0a9 | 2021-09-23 12:29:57 +0200 | [diff] [blame] | 3261 | EXCEPT_HDRS := $(GENERATED_H) unicode-width.h compat/% xdiff/% |
Eric Wong | bda9c12 | 2023-08-01 02:54:54 +0000 | [diff] [blame] | 3262 | ifndef OPENSSL_SHA1 |
| 3263 | EXCEPT_HDRS += sha1/openssl.h |
| 3264 | endif |
Eric Wong | 3e440ea | 2023-08-01 02:54:53 +0000 | [diff] [blame] | 3265 | ifndef OPENSSL_SHA256 |
| 3266 | EXCEPT_HDRS += sha256/openssl.h |
| 3267 | endif |
brian m. carlson | e555735 | 2022-07-10 13:29:07 +0000 | [diff] [blame] | 3268 | ifndef NETTLE_SHA256 |
| 3269 | EXCEPT_HDRS += sha256/nettle.h |
| 3270 | endif |
Ramsay Jones | f23aa18 | 2019-03-06 00:11:13 +0000 | [diff] [blame] | 3271 | ifndef GCRYPT_SHA256 |
| 3272 | EXCEPT_HDRS += sha256/gcrypt.h |
| 3273 | endif |
Denton Liu | cf6a2d2 | 2019-09-16 12:23:08 -0700 | [diff] [blame] | 3274 | CHK_HDRS = $(filter-out $(EXCEPT_HDRS),$(LIB_H)) |
Ramsay Jones | ebb7baf | 2018-09-19 01:07:08 +0100 | [diff] [blame] | 3275 | HCO = $(patsubst %.h,%.hco,$(CHK_HDRS)) |
Denton Liu | b503a2d | 2019-09-25 01:21:01 -0700 | [diff] [blame] | 3276 | HCC = $(HCO:hco=hcc) |
Ramsay Jones | ebb7baf | 2018-09-19 01:07:08 +0100 | [diff] [blame] | 3277 | |
Denton Liu | b503a2d | 2019-09-25 01:21:01 -0700 | [diff] [blame] | 3278 | %.hcc: %.h |
| 3279 | @echo '#include "git-compat-util.h"' >$@ |
| 3280 | @echo '#include "$<"' >>$@ |
| 3281 | |
| 3282 | $(HCO): %.hco: %.hcc FORCE |
| 3283 | $(QUIET_HDR)$(CC) $(ALL_CFLAGS) -o /dev/null -c -xc $< |
Ramsay Jones | ebb7baf | 2018-09-19 01:07:08 +0100 | [diff] [blame] | 3284 | |
| 3285 | .PHONY: hdr-check $(HCO) |
| 3286 | hdr-check: $(HCO) |
| 3287 | |
Brandon Williams | 2118805 | 2017-08-14 14:30:46 -0700 | [diff] [blame] | 3288 | .PHONY: style |
| 3289 | style: |
| 3290 | git clang-format --style file --diff --extensions c,h |
| 3291 | |
Ævar Arnfjörð Bjarmason | ea47e59 | 2021-09-23 12:29:56 +0200 | [diff] [blame] | 3292 | .PHONY: check |
Ævar Arnfjörð Bjarmason | 7c3c0a9 | 2021-09-23 12:29:57 +0200 | [diff] [blame] | 3293 | check: $(GENERATED_H) |
Ramsay Jones | f228d1f | 2011-04-07 19:22:18 +0100 | [diff] [blame] | 3294 | @if sparse; \ |
Junio C Hamano | 912f998 | 2008-11-11 13:12:17 -0800 | [diff] [blame] | 3295 | then \ |
Junio C Hamano | d55de70 | 2016-04-05 00:02:14 -0700 | [diff] [blame] | 3296 | echo >&2 "Use 'make sparse' instead"; \ |
Ramsay Jones | 0bcd9ae | 2011-04-21 20:14:42 +0100 | [diff] [blame] | 3297 | $(MAKE) --no-print-directory sparse; \ |
Junio C Hamano | 912f998 | 2008-11-11 13:12:17 -0800 | [diff] [blame] | 3298 | else \ |
Junio C Hamano | d55de70 | 2016-04-05 00:02:14 -0700 | [diff] [blame] | 3299 | echo >&2 "Did you mean 'make test'?"; \ |
Junio C Hamano | 912f998 | 2008-11-11 13:12:17 -0800 | [diff] [blame] | 3300 | exit 1; \ |
| 3301 | fi |
Petr Baudis | 28818ff | 2005-07-29 17:50:24 +0200 | [diff] [blame] | 3302 | |
Ævar Arnfjörð Bjarmason | d0e624a | 2022-11-01 23:35:54 +0100 | [diff] [blame] | 3303 | COCCI_GEN_ALL = .build/contrib/coccinelle/ALL.cocci |
Ævar Arnfjörð Bjarmason | e603a14 | 2022-11-01 23:35:45 +0100 | [diff] [blame] | 3304 | COCCI_GLOB = $(wildcard contrib/coccinelle/*.cocci) |
Ævar Arnfjörð Bjarmason | 202086b | 2022-11-01 23:35:52 +0100 | [diff] [blame] | 3305 | COCCI_RULES_TRACKED = $(COCCI_GLOB:%=.build/%) |
Ævar Arnfjörð Bjarmason | d0e624a | 2022-11-01 23:35:54 +0100 | [diff] [blame] | 3306 | COCCI_RULES_TRACKED_NO_PENDING = $(filter-out %.pending.cocci,$(COCCI_RULES_TRACKED)) |
Ævar Arnfjörð Bjarmason | 202086b | 2022-11-01 23:35:52 +0100 | [diff] [blame] | 3307 | COCCI_RULES = |
Ævar Arnfjörð Bjarmason | d0e624a | 2022-11-01 23:35:54 +0100 | [diff] [blame] | 3308 | COCCI_RULES += $(COCCI_GEN_ALL) |
Ævar Arnfjörð Bjarmason | 202086b | 2022-11-01 23:35:52 +0100 | [diff] [blame] | 3309 | COCCI_RULES += $(COCCI_RULES_TRACKED) |
| 3310 | COCCI_NAMES = |
| 3311 | COCCI_NAMES += $(COCCI_RULES:.build/contrib/coccinelle/%.cocci=%) |
Ævar Arnfjörð Bjarmason | e603a14 | 2022-11-01 23:35:45 +0100 | [diff] [blame] | 3312 | |
| 3313 | COCCICHECK_PENDING = $(filter %.pending.cocci,$(COCCI_RULES)) |
| 3314 | COCCICHECK = $(filter-out $(COCCICHECK_PENDING),$(COCCI_RULES)) |
| 3315 | |
| 3316 | COCCICHECK_PATCHES = $(COCCICHECK:%=%.patch) |
| 3317 | COCCICHECK_PATCHES_PENDING = $(COCCICHECK_PENDING:%=%.patch) |
| 3318 | |
Ævar Arnfjörð Bjarmason | 202086b | 2022-11-01 23:35:52 +0100 | [diff] [blame] | 3319 | COCCICHECK_PATCHES_INTREE = $(COCCICHECK_PATCHES:.build/%=%) |
| 3320 | COCCICHECK_PATCHES_PENDING_INTREE = $(COCCICHECK_PATCHES_PENDING:.build/%=%) |
| 3321 | |
Ævar Arnfjörð Bjarmason | f1c903d | 2022-11-01 23:35:50 +0100 | [diff] [blame] | 3322 | # It's expensive to compute the many=many rules below, only eval them |
| 3323 | # on $(MAKECMDGOALS) that match these $(COCCI_RULES) |
| 3324 | COCCI_RULES_GLOB = |
| 3325 | COCCI_RULES_GLOB += cocci% |
| 3326 | COCCI_RULES_GLOB += .build/contrib/coccinelle/% |
| 3327 | COCCI_RULES_GLOB += $(COCCICHECK_PATCHES) |
| 3328 | COCCI_RULES_GLOB += $(COCCICHEC_PATCHES_PENDING) |
Ævar Arnfjörð Bjarmason | 202086b | 2022-11-01 23:35:52 +0100 | [diff] [blame] | 3329 | COCCI_RULES_GLOB += $(COCCICHECK_PATCHES_INTREE) |
| 3330 | COCCI_RULES_GLOB += $(COCCICHECK_PATCHES_PENDING_INTREE) |
Ævar Arnfjörð Bjarmason | f1c903d | 2022-11-01 23:35:50 +0100 | [diff] [blame] | 3331 | COCCI_GOALS = $(filter $(COCCI_RULES_GLOB),$(MAKECMDGOALS)) |
| 3332 | |
Ævar Arnfjörð Bjarmason | f7ff659 | 2022-07-05 15:46:57 +0200 | [diff] [blame] | 3333 | COCCI_TEST_RES = $(wildcard contrib/coccinelle/tests/*.res) |
| 3334 | |
Ævar Arnfjörð Bjarmason | 202086b | 2022-11-01 23:35:52 +0100 | [diff] [blame] | 3335 | $(COCCI_RULES_TRACKED): .build/% : % |
| 3336 | $(call mkdir_p_parent_template) |
| 3337 | $(QUIET_CP)cp $< $@ |
| 3338 | |
Ævar Arnfjörð Bjarmason | f1c903d | 2022-11-01 23:35:50 +0100 | [diff] [blame] | 3339 | .build/contrib/coccinelle/FOUND_H_SOURCES: $(FOUND_H_SOURCES) |
| 3340 | $(call mkdir_p_parent_template) |
| 3341 | $(QUIET_GEN) >$@ |
| 3342 | |
Ævar Arnfjörð Bjarmason | d0e624a | 2022-11-01 23:35:54 +0100 | [diff] [blame] | 3343 | $(COCCI_GEN_ALL): $(COCCI_RULES_TRACKED_NO_PENDING) |
| 3344 | $(call mkdir_p_parent_template) |
| 3345 | $(QUIET_SPATCH_CAT)cat $^ >$@ |
| 3346 | |
Ævar Arnfjörð Bjarmason | 316e388 | 2022-11-01 23:35:51 +0100 | [diff] [blame] | 3347 | ifeq ($(COMPUTE_HEADER_DEPENDENCIES),no) |
| 3348 | SPATCH_USE_O_DEPENDENCIES = |
| 3349 | endif |
Ævar Arnfjörð Bjarmason | f1c903d | 2022-11-01 23:35:50 +0100 | [diff] [blame] | 3350 | define cocci-rule |
| 3351 | |
| 3352 | ## Rule for .build/$(1).patch/$(2); Params: |
Ævar Arnfjörð Bjarmason | 0d12792 | 2022-11-10 17:14:18 +0100 | [diff] [blame] | 3353 | # $(1) = e.g. ".build/contrib/coccinelle/free.cocci" |
Ævar Arnfjörð Bjarmason | f1c903d | 2022-11-01 23:35:50 +0100 | [diff] [blame] | 3354 | # $(2) = e.g. "grep.c" |
Ævar Arnfjörð Bjarmason | 316e388 | 2022-11-01 23:35:51 +0100 | [diff] [blame] | 3355 | # $(3) = e.g. "grep.o" |
Ævar Arnfjörð Bjarmason | 0d12792 | 2022-11-10 17:14:18 +0100 | [diff] [blame] | 3356 | COCCI_$(1:.build/contrib/coccinelle/%.cocci=%) += $(1).d/$(2).patch |
| 3357 | $(1).d/$(2).patch: GIT-SPATCH-DEFINES |
| 3358 | $(1).d/$(2).patch: $(if $(and $(SPATCH_USE_O_DEPENDENCIES),$(wildcard $(3))),$(3),.build/contrib/coccinelle/FOUND_H_SOURCES) |
| 3359 | $(1).d/$(2).patch: $(1) |
| 3360 | $(1).d/$(2).patch: $(1).d/%.patch : % |
Ævar Arnfjörð Bjarmason | f1c903d | 2022-11-01 23:35:50 +0100 | [diff] [blame] | 3361 | $$(call mkdir_p_parent_template) |
| 3362 | $$(QUIET_SPATCH)if ! $$(SPATCH) $$(SPATCH_FLAGS) \ |
| 3363 | $$(SPATCH_INCLUDE_FLAGS) \ |
| 3364 | --sp-file $(1) --patch . $$< \ |
| 3365 | >$$@ 2>$$@.log; \ |
Jeff King | f5c2bc2 | 2017-03-10 03:31:18 -0500 | [diff] [blame] | 3366 | then \ |
Ævar Arnfjörð Bjarmason | f1c903d | 2022-11-01 23:35:50 +0100 | [diff] [blame] | 3367 | echo "ERROR when applying '$(1)' to '$$<'; '$$@.log' follows:"; \ |
| 3368 | cat $$@.log; \ |
Jeff King | f5c2bc2 | 2017-03-10 03:31:18 -0500 | [diff] [blame] | 3369 | exit 1; \ |
René Scharfe | 63f0a75 | 2016-09-15 20:30:56 +0200 | [diff] [blame] | 3370 | fi |
Ævar Arnfjörð Bjarmason | f1c903d | 2022-11-01 23:35:50 +0100 | [diff] [blame] | 3371 | endef |
| 3372 | |
| 3373 | define cocci-matrix |
| 3374 | |
Ævar Arnfjörð Bjarmason | 316e388 | 2022-11-01 23:35:51 +0100 | [diff] [blame] | 3375 | $(foreach s,$(COCCI_SOURCES),$(call cocci-rule,$(c),$(s),$(s:%.c=%.o))) |
Ævar Arnfjörð Bjarmason | f1c903d | 2022-11-01 23:35:50 +0100 | [diff] [blame] | 3376 | endef |
| 3377 | |
| 3378 | ifdef COCCI_GOALS |
| 3379 | $(eval $(foreach c,$(COCCI_RULES),$(call cocci-matrix,$(c)))) |
| 3380 | endif |
| 3381 | |
| 3382 | define spatch-rule |
| 3383 | |
Ævar Arnfjörð Bjarmason | 202086b | 2022-11-01 23:35:52 +0100 | [diff] [blame] | 3384 | .build/contrib/coccinelle/$(1).cocci.patch: $$(COCCI_$(1)) |
Ævar Arnfjörð Bjarmason | f1c903d | 2022-11-01 23:35:50 +0100 | [diff] [blame] | 3385 | $$(QUIET_SPATCH_CAT)cat $$^ >$$@ && \ |
| 3386 | if test -s $$@; \ |
| 3387 | then \ |
| 3388 | echo ' ' SPATCH result: $$@; \ |
| 3389 | fi |
Ævar Arnfjörð Bjarmason | 202086b | 2022-11-01 23:35:52 +0100 | [diff] [blame] | 3390 | contrib/coccinelle/$(1).cocci.patch: .build/contrib/coccinelle/$(1).cocci.patch |
| 3391 | $$(QUIET_CP)cp $$< $$@ |
| 3392 | |
Ævar Arnfjörð Bjarmason | f1c903d | 2022-11-01 23:35:50 +0100 | [diff] [blame] | 3393 | endef |
| 3394 | |
| 3395 | ifdef COCCI_GOALS |
| 3396 | $(eval $(foreach n,$(COCCI_NAMES),$(call spatch-rule,$(n)))) |
| 3397 | endif |
Ævar Arnfjörð Bjarmason | f7ff659 | 2022-07-05 15:46:57 +0200 | [diff] [blame] | 3398 | |
| 3399 | COCCI_TEST_RES_GEN = $(addprefix .build/,$(COCCI_TEST_RES)) |
Ævar Arnfjörð Bjarmason | 09d9a69 | 2022-11-01 23:35:46 +0100 | [diff] [blame] | 3400 | $(COCCI_TEST_RES_GEN): GIT-SPATCH-DEFINES |
Ævar Arnfjörð Bjarmason | f7ff659 | 2022-07-05 15:46:57 +0200 | [diff] [blame] | 3401 | $(COCCI_TEST_RES_GEN): .build/%.res : %.c |
| 3402 | $(COCCI_TEST_RES_GEN): .build/%.res : %.res |
Ævar Arnfjörð Bjarmason | d0e624a | 2022-11-01 23:35:54 +0100 | [diff] [blame] | 3403 | ifdef SPATCH_CONCAT_COCCI |
| 3404 | $(COCCI_TEST_RES_GEN): .build/contrib/coccinelle/tests/%.res : $(COCCI_GEN_ALL) |
| 3405 | else |
Ævar Arnfjörð Bjarmason | f7ff659 | 2022-07-05 15:46:57 +0200 | [diff] [blame] | 3406 | $(COCCI_TEST_RES_GEN): .build/contrib/coccinelle/tests/%.res : contrib/coccinelle/%.cocci |
Ævar Arnfjörð Bjarmason | d0e624a | 2022-11-01 23:35:54 +0100 | [diff] [blame] | 3407 | endif |
Ævar Arnfjörð Bjarmason | f7ff659 | 2022-07-05 15:46:57 +0200 | [diff] [blame] | 3408 | $(call mkdir_p_parent_template) |
Ævar Arnfjörð Bjarmason | b75f270 | 2022-11-01 23:35:48 +0100 | [diff] [blame] | 3409 | $(QUIET_SPATCH_TEST)$(SPATCH) $(SPATCH_TEST_FLAGS) \ |
Ævar Arnfjörð Bjarmason | f7ff659 | 2022-07-05 15:46:57 +0200 | [diff] [blame] | 3410 | --very-quiet --no-show-diff \ |
| 3411 | --sp-file $< -o $@ \ |
| 3412 | $(@:.build/%.res=%.c) && \ |
| 3413 | cmp $(@:.build/%=%) $@ || \ |
| 3414 | git -P diff --no-index $(@:.build/%=%) $@ 2>/dev/null; \ |
| 3415 | |
| 3416 | .PHONY: coccicheck-test |
| 3417 | coccicheck-test: $(COCCI_TEST_RES_GEN) |
| 3418 | |
Ævar Arnfjörð Bjarmason | 7a9a10b | 2022-07-05 15:46:58 +0200 | [diff] [blame] | 3419 | coccicheck: coccicheck-test |
Ævar Arnfjörð Bjarmason | d0e624a | 2022-11-01 23:35:54 +0100 | [diff] [blame] | 3420 | ifdef SPATCH_CONCAT_COCCI |
| 3421 | coccicheck: contrib/coccinelle/ALL.cocci.patch |
| 3422 | else |
Ævar Arnfjörð Bjarmason | 202086b | 2022-11-01 23:35:52 +0100 | [diff] [blame] | 3423 | coccicheck: $(COCCICHECK_PATCHES_INTREE) |
Ævar Arnfjörð Bjarmason | d0e624a | 2022-11-01 23:35:54 +0100 | [diff] [blame] | 3424 | endif |
René Scharfe | 63f0a75 | 2016-09-15 20:30:56 +0200 | [diff] [blame] | 3425 | |
SZEDER Gábor | dd5d052 | 2018-11-09 16:10:52 -0800 | [diff] [blame] | 3426 | # See contrib/coccinelle/README |
Ævar Arnfjörð Bjarmason | 7a9a10b | 2022-07-05 15:46:58 +0200 | [diff] [blame] | 3427 | coccicheck-pending: coccicheck-test |
Ævar Arnfjörð Bjarmason | 202086b | 2022-11-01 23:35:52 +0100 | [diff] [blame] | 3428 | coccicheck-pending: $(COCCICHECK_PATCHES_PENDING_INTREE) |
SZEDER Gábor | dd5d052 | 2018-11-09 16:10:52 -0800 | [diff] [blame] | 3429 | |
| 3430 | .PHONY: coccicheck coccicheck-pending |
Petr Baudis | 28818ff | 2005-07-29 17:50:24 +0200 | [diff] [blame] | 3431 | |
Ævar Arnfjörð Bjarmason | affc3b7 | 2022-06-28 12:16:00 +0200 | [diff] [blame] | 3432 | # "Sub"-Makefiles, not really because they can't be run stand-alone, |
| 3433 | # only there to contain directory-specific rules and variables |
| 3434 | ## gitweb/Makefile inclusion: |
| 3435 | MAK_DIR_GITWEB = gitweb/ |
| 3436 | include gitweb/Makefile |
| 3437 | |
| 3438 | .PHONY: gitweb |
| 3439 | gitweb: $(MAK_DIR_GITWEB_ALL) |
Ævar Arnfjörð Bjarmason | a35258c | 2022-06-28 12:16:02 +0200 | [diff] [blame] | 3440 | ifndef NO_GITWEB |
SZEDER Gábor | d3b8274 | 2022-06-28 12:16:01 +0200 | [diff] [blame] | 3441 | all:: gitweb |
Ævar Arnfjörð Bjarmason | a35258c | 2022-06-28 12:16:02 +0200 | [diff] [blame] | 3442 | endif |
Ævar Arnfjörð Bjarmason | affc3b7 | 2022-06-28 12:16:00 +0200 | [diff] [blame] | 3443 | |
Petr Baudis | 28818ff | 2005-07-29 17:50:24 +0200 | [diff] [blame] | 3444 | ### Installation rules |
| 3445 | |
Junio C Hamano | 0c0ead7 | 2009-02-05 00:04:17 -0800 | [diff] [blame] | 3446 | ifneq ($(filter /%,$(firstword $(template_dir))),) |
Johannes Sixt | 0b50b86 | 2008-01-01 22:15:21 +0100 | [diff] [blame] | 3447 | template_instdir = $(template_dir) |
Steffen Prohaska | 026fa0d | 2009-01-18 13:00:09 +0100 | [diff] [blame] | 3448 | else |
| 3449 | template_instdir = $(prefix)/$(template_dir) |
Johannes Sixt | 0b50b86 | 2008-01-01 22:15:21 +0100 | [diff] [blame] | 3450 | endif |
| 3451 | export template_instdir |
| 3452 | |
Junio C Hamano | 0c0ead7 | 2009-02-05 00:04:17 -0800 | [diff] [blame] | 3453 | ifneq ($(filter /%,$(firstword $(gitexecdir))),) |
Johannes Sixt | 49fa65a | 2008-07-23 21:12:18 +0200 | [diff] [blame] | 3454 | gitexec_instdir = $(gitexecdir) |
Steffen Prohaska | 026fa0d | 2009-01-18 13:00:09 +0100 | [diff] [blame] | 3455 | else |
| 3456 | gitexec_instdir = $(prefix)/$(gitexecdir) |
Johannes Sixt | 49fa65a | 2008-07-23 21:12:18 +0200 | [diff] [blame] | 3457 | endif |
| 3458 | gitexec_instdir_SQ = $(subst ','\'',$(gitexec_instdir)) |
| 3459 | export gitexec_instdir |
| 3460 | |
David Aguilar | bc7a96a | 2011-08-18 00:23:46 -0700 | [diff] [blame] | 3461 | ifneq ($(filter /%,$(firstword $(mergetoolsdir))),) |
| 3462 | mergetools_instdir = $(mergetoolsdir) |
| 3463 | else |
| 3464 | mergetools_instdir = $(prefix)/$(mergetoolsdir) |
| 3465 | endif |
| 3466 | mergetools_instdir_SQ = $(subst ','\'',$(mergetools_instdir)) |
| 3467 | |
Bagas Sanjaya | 3231f41 | 2021-09-05 12:17:56 -0700 | [diff] [blame] | 3468 | install_bindir_xprograms := $(patsubst %,%$X,$(BINDIR_PROGRAMS_NEED_X)) |
| 3469 | install_bindir_programs := $(install_bindir_xprograms) $(BINDIR_PROGRAMS_NO_X) |
Matthew Ogilvie | ea92519 | 2009-12-02 22:14:05 -0700 | [diff] [blame] | 3470 | |
Elia Pinto | e6be265 | 2015-12-15 15:21:00 +0000 | [diff] [blame] | 3471 | .PHONY: profile-install profile-fast-install |
Andi Kleen | 066dd26 | 2014-07-07 23:35:11 -0700 | [diff] [blame] | 3472 | profile-install: profile |
| 3473 | $(MAKE) install |
| 3474 | |
| 3475 | profile-fast-install: profile-fast |
| 3476 | $(MAKE) install |
| 3477 | |
Bagas Sanjaya | 3231f41 | 2021-09-05 12:17:56 -0700 | [diff] [blame] | 3478 | INSTALL_STRIP = |
| 3479 | |
Andreas Ericsson | d6ebd25 | 2005-11-22 00:44:15 +0100 | [diff] [blame] | 3480 | install: all |
Robert Schiele | 4165076 | 2007-12-01 18:05:40 +0100 | [diff] [blame] | 3481 | $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(bindir_SQ)' |
Johannes Sixt | 49fa65a | 2008-07-23 21:12:18 +0200 | [diff] [blame] | 3482 | $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(gitexec_instdir_SQ)' |
Bagas Sanjaya | 3231f41 | 2021-09-05 12:17:56 -0700 | [diff] [blame] | 3483 | $(INSTALL) $(INSTALL_STRIP) $(PROGRAMS) '$(DESTDIR_SQ)$(gitexec_instdir_SQ)' |
| 3484 | $(INSTALL) $(SCRIPTS) '$(DESTDIR_SQ)$(gitexec_instdir_SQ)' |
Jonathan Nieder | 46bac90 | 2010-01-31 11:46:53 -0800 | [diff] [blame] | 3485 | $(INSTALL) -m 644 $(SCRIPT_LIB) '$(DESTDIR_SQ)$(gitexec_instdir_SQ)' |
Bagas Sanjaya | 3231f41 | 2021-09-05 12:17:56 -0700 | [diff] [blame] | 3486 | $(INSTALL) $(INSTALL_STRIP) $(install_bindir_xprograms) '$(DESTDIR_SQ)$(bindir_SQ)' |
| 3487 | $(INSTALL) $(BINDIR_PROGRAMS_NO_X) '$(DESTDIR_SQ)$(bindir_SQ)' |
| 3488 | |
Jeff Hostetler | dce7d29 | 2019-06-25 07:49:39 -0700 | [diff] [blame] | 3489 | ifdef MSVC |
| 3490 | # We DO NOT install the individual foo.o.pdb files because they |
| 3491 | # have already been rolled up into the exe's pdb file. |
| 3492 | # We DO NOT have pdb files for the builtin commands (like git-status.exe) |
| 3493 | # because it is just a copy/hardlink of git.exe, rather than a unique binary. |
Johannes Schindelin | a8b5355 | 2020-09-21 22:28:15 +0000 | [diff] [blame] | 3494 | $(INSTALL) $(patsubst %.exe,%.pdb,$(filter-out $(BUILT_INS),$(patsubst %,%$X,$(BINDIR_PROGRAMS_NEED_X)))) '$(DESTDIR_SQ)$(bindir_SQ)' |
| 3495 | $(INSTALL) $(patsubst %.exe,%.pdb,$(filter-out $(BUILT_INS) $(REMOTE_CURL_ALIASES),$(PROGRAMS))) '$(DESTDIR_SQ)$(gitexec_instdir_SQ)' |
Jeff Hostetler | dce7d29 | 2019-06-25 07:49:39 -0700 | [diff] [blame] | 3496 | ifndef DEBUG |
| 3497 | $(INSTALL) $(vcpkg_rel_bin)/*.dll '$(DESTDIR_SQ)$(bindir_SQ)' |
| 3498 | $(INSTALL) $(vcpkg_rel_bin)/*.pdb '$(DESTDIR_SQ)$(bindir_SQ)' |
| 3499 | else |
| 3500 | $(INSTALL) $(vcpkg_dbg_bin)/*.dll '$(DESTDIR_SQ)$(bindir_SQ)' |
| 3501 | $(INSTALL) $(vcpkg_dbg_bin)/*.pdb '$(DESTDIR_SQ)$(bindir_SQ)' |
| 3502 | endif |
| 3503 | endif |
Ramsay Allan Jones | 7ffe709 | 2006-07-29 17:25:03 +0100 | [diff] [blame] | 3504 | $(MAKE) -C templates DESTDIR='$(DESTDIR_SQ)' install |
David Aguilar | bc7a96a | 2011-08-18 00:23:46 -0700 | [diff] [blame] | 3505 | $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(mergetools_instdir_SQ)' |
Jonathan Nieder | 53b7425 | 2011-10-09 04:17:07 -0500 | [diff] [blame] | 3506 | $(INSTALL) -m 644 mergetools/* '$(DESTDIR_SQ)$(mergetools_instdir_SQ)' |
Ævar Arnfjörð Bjarmason | 5e9637c | 2011-11-18 00:14:42 +0100 | [diff] [blame] | 3507 | ifndef NO_GETTEXT |
| 3508 | $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(localedir_SQ)' |
| 3509 | (cd po/build/locale && $(TAR) cf - .) | \ |
| 3510 | (cd '$(DESTDIR_SQ)$(localedir_SQ)' && umask 022 && $(TAR) xof -) |
| 3511 | endif |
Junio C Hamano | 5be3b17 | 2009-04-22 22:42:28 -0700 | [diff] [blame] | 3512 | ifndef NO_PERL |
Ævar Arnfjörð Bjarmason | 20d2a30 | 2017-12-10 21:13:33 +0000 | [diff] [blame] | 3513 | $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perllibdir_SQ)' |
| 3514 | (cd perl/build/lib && $(TAR) cf - .) | \ |
| 3515 | (cd '$(DESTDIR_SQ)$(perllibdir_SQ)' && umask 022 && $(TAR) xof -) |
Junio C Hamano | 5be3b17 | 2009-04-22 22:42:28 -0700 | [diff] [blame] | 3516 | endif |
Eygene Ryabinkin | 3cfaf11 | 2007-03-28 04:00:23 -0700 | [diff] [blame] | 3517 | ifndef NO_TCLTK |
Junio C Hamano | 62ba514 | 2007-11-17 10:51:16 -0800 | [diff] [blame] | 3518 | $(MAKE) -C gitk-git install |
Johannes Sixt | 49fa65a | 2008-07-23 21:12:18 +0200 | [diff] [blame] | 3519 | $(MAKE) -C git-gui gitexecdir='$(gitexec_instdir_SQ)' install |
Eygene Ryabinkin | 3cfaf11 | 2007-03-28 04:00:23 -0700 | [diff] [blame] | 3520 | endif |
Junio C Hamano | 6fc301b | 2007-01-10 12:24:54 -0800 | [diff] [blame] | 3521 | ifneq (,$X) |
Victoria Dye | 7b5c93c | 2022-09-02 15:56:43 +0000 | [diff] [blame] | 3522 | $(foreach p,$(patsubst %$X,%,$(filter %$X,$(ALL_COMMANDS_TO_INSTALL) $(OTHER_PROGRAMS))), 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] | 3523 | endif |
Ilari Liusvaara | 28ca0c9 | 2009-12-09 17:26:34 +0200 | [diff] [blame] | 3524 | |
Johannes Sixt | 46beb55 | 2008-07-21 21:19:51 +0200 | [diff] [blame] | 3525 | bindir=$$(cd '$(DESTDIR_SQ)$(bindir_SQ)' && pwd) && \ |
Johannes Sixt | 49fa65a | 2008-07-23 21:12:18 +0200 | [diff] [blame] | 3526 | execdir=$$(cd '$(DESTDIR_SQ)$(gitexec_instdir_SQ)' && pwd) && \ |
Ævar Arnfjörð Bjarmason | ad87460 | 2018-03-13 20:39:35 +0000 | [diff] [blame] | 3527 | destdir_from_execdir_SQ=$$(echo '$(gitexecdir_relative_SQ)' | sed -e 's|[^/][^/]*|..|g') && \ |
Junio C Hamano | 6edd149 | 2009-07-10 20:17:33 -0700 | [diff] [blame] | 3528 | { test "$$bindir/" = "$$execdir/" || \ |
Victoria Dye | 7b5c93c | 2022-09-02 15:56:43 +0000 | [diff] [blame] | 3529 | for p in $(OTHER_PROGRAMS) $(filter $(install_bindir_programs),$(ALL_PROGRAMS)); do \ |
Brandon Casey | 76d079a | 2010-07-23 12:50:45 -0500 | [diff] [blame] | 3530 | $(RM) "$$execdir/$$p" && \ |
Ævar Arnfjörð Bjarmason | ad87460 | 2018-03-13 20:39:35 +0000 | [diff] [blame] | 3531 | test -n "$(INSTALL_SYMLINKS)" && \ |
| 3532 | ln -s "$$destdir_from_execdir_SQ/$(bindir_relative_SQ)/$$p" "$$execdir/$$p" || \ |
| 3533 | { test -z "$(NO_INSTALL_HARDLINKS)$(NO_CROSS_DIRECTORY_HARDLINKS)" && \ |
| 3534 | ln "$$bindir/$$p" "$$execdir/$$p" 2>/dev/null || \ |
| 3535 | cp "$$bindir/$$p" "$$execdir/$$p" || exit; } \ |
Brandon Casey | 76d079a | 2010-07-23 12:50:45 -0500 | [diff] [blame] | 3536 | done; \ |
| 3537 | } && \ |
Brandon Casey | 40919c4 | 2010-07-23 12:50:44 -0500 | [diff] [blame] | 3538 | for p in $(filter $(install_bindir_programs),$(BUILT_INS)); do \ |
| 3539 | $(RM) "$$bindir/$$p" && \ |
Johannes Schindelin | 907e637 | 2020-10-21 15:13:31 +0000 | [diff] [blame] | 3540 | test -n "$(INSTALL_SYMLINKS)" && \ |
| 3541 | ln -s "git$X" "$$bindir/$$p" || \ |
| 3542 | { test -z "$(NO_INSTALL_HARDLINKS)" && \ |
| 3543 | ln "$$bindir/git$X" "$$bindir/$$p" 2>/dev/null || \ |
| 3544 | ln -s "git$X" "$$bindir/$$p" 2>/dev/null || \ |
| 3545 | cp "$$bindir/git$X" "$$bindir/$$p" || exit; }; \ |
Brandon Casey | 40919c4 | 2010-07-23 12:50:44 -0500 | [diff] [blame] | 3546 | done && \ |
Brandon Casey | ba2b4d7 | 2010-07-02 11:50:28 -0700 | [diff] [blame] | 3547 | for p in $(BUILT_INS); do \ |
Brandon Casey | b56c79c | 2009-01-19 19:44:03 -0600 | [diff] [blame] | 3548 | $(RM) "$$execdir/$$p" && \ |
Johannes Schindelin | 179227d | 2020-09-21 22:28:16 +0000 | [diff] [blame] | 3549 | if test -z "$(SKIP_DASHED_BUILT_INS)"; \ |
| 3550 | then \ |
| 3551 | test -n "$(INSTALL_SYMLINKS)" && \ |
| 3552 | ln -s "$$destdir_from_execdir_SQ/$(bindir_relative_SQ)/git$X" "$$execdir/$$p" || \ |
| 3553 | { test -z "$(NO_INSTALL_HARDLINKS)" && \ |
| 3554 | ln "$$execdir/git$X" "$$execdir/$$p" 2>/dev/null || \ |
| 3555 | ln -s "git$X" "$$execdir/$$p" 2>/dev/null || \ |
| 3556 | cp "$$execdir/git$X" "$$execdir/$$p" || exit; }; \ |
| 3557 | fi \ |
Brandon Casey | ba2b4d7 | 2010-07-02 11:50:28 -0700 | [diff] [blame] | 3558 | done && \ |
Brandon Casey | 49a43f5 | 2010-07-06 14:56:51 -0700 | [diff] [blame] | 3559 | remote_curl_aliases="$(REMOTE_CURL_ALIASES)" && \ |
| 3560 | for p in $$remote_curl_aliases; do \ |
Ilari Liusvaara | 28ca0c9 | 2009-12-09 17:26:34 +0200 | [diff] [blame] | 3561 | $(RM) "$$execdir/$$p" && \ |
Ævar Arnfjörð Bjarmason | ad87460 | 2018-03-13 20:39:35 +0000 | [diff] [blame] | 3562 | test -n "$(INSTALL_SYMLINKS)" && \ |
| 3563 | ln -s "git-remote-http$X" "$$execdir/$$p" || \ |
| 3564 | { test -z "$(NO_INSTALL_HARDLINKS)" && \ |
| 3565 | ln "$$execdir/git-remote-http$X" "$$execdir/$$p" 2>/dev/null || \ |
| 3566 | ln -s "git-remote-http$X" "$$execdir/$$p" 2>/dev/null || \ |
| 3567 | cp "$$execdir/git-remote-http$X" "$$execdir/$$p" || exit; } \ |
Ævar Arnfjörð Bjarmason | 72b113e | 2021-09-06 09:55:33 +0200 | [diff] [blame] | 3568 | done |
Petr Baudis | 28818ff | 2005-07-29 17:50:24 +0200 | [diff] [blame] | 3569 | |
Ævar Arnfjörð Bjarmason | affc3b7 | 2022-06-28 12:16:00 +0200 | [diff] [blame] | 3570 | .PHONY: 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] | 3571 | .PHONY: quick-install-doc quick-install-man quick-install-html |
Jakub Narebski | 152d943 | 2010-05-01 22:36:15 +0200 | [diff] [blame] | 3572 | |
Ævar Arnfjörð Bjarmason | 20d2a30 | 2017-12-10 21:13:33 +0000 | [diff] [blame] | 3573 | install-doc: install-man-perl |
Petr Baudis | 28818ff | 2005-07-29 17:50:24 +0200 | [diff] [blame] | 3574 | $(MAKE) -C Documentation install |
| 3575 | |
Ævar Arnfjörð Bjarmason | 20d2a30 | 2017-12-10 21:13:33 +0000 | [diff] [blame] | 3576 | install-man: install-man-perl |
Markus Heidelberg | b1a46b7 | 2008-11-02 18:53:03 +0100 | [diff] [blame] | 3577 | $(MAKE) -C Documentation install-man |
| 3578 | |
SZEDER Gábor | 2530afd | 2018-02-15 03:14:10 +0100 | [diff] [blame] | 3579 | install-man-perl: man-perl |
Ævar Arnfjörð Bjarmason | 20d2a30 | 2017-12-10 21:13:33 +0000 | [diff] [blame] | 3580 | $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(mandir_SQ)/man3' |
| 3581 | (cd perl/build/man/man3 && $(TAR) cf - .) | \ |
| 3582 | (cd '$(DESTDIR_SQ)$(mandir_SQ)/man3' && umask 022 && $(TAR) xof -) |
| 3583 | |
Teemu Likonen | ae081f3 | 2008-06-10 11:34:25 +0300 | [diff] [blame] | 3584 | install-html: |
| 3585 | $(MAKE) -C Documentation install-html |
| 3586 | |
David Kastrup | 4739809 | 2007-08-06 12:22:57 +0200 | [diff] [blame] | 3587 | install-info: |
| 3588 | $(MAKE) -C Documentation install-info |
| 3589 | |
Miklos Vajna | a325a1a | 2008-12-10 23:44:50 +0100 | [diff] [blame] | 3590 | install-pdf: |
| 3591 | $(MAKE) -C Documentation install-pdf |
| 3592 | |
Eric Wong | 6538d1e | 2006-12-23 08:26:09 -0800 | [diff] [blame] | 3593 | quick-install-doc: |
| 3594 | $(MAKE) -C Documentation quick-install |
Petr Baudis | 28818ff | 2005-07-29 17:50:24 +0200 | [diff] [blame] | 3595 | |
Markus Heidelberg | b1a46b7 | 2008-11-02 18:53:03 +0100 | [diff] [blame] | 3596 | quick-install-man: |
| 3597 | $(MAKE) -C Documentation quick-install-man |
| 3598 | |
Michael J Gruber | 6fe570d | 2008-09-09 22:44:17 +0200 | [diff] [blame] | 3599 | quick-install-html: |
| 3600 | $(MAKE) -C Documentation quick-install-html |
| 3601 | |
Petr Baudis | 28818ff | 2005-07-29 17:50:24 +0200 | [diff] [blame] | 3602 | |
| 3603 | |
| 3604 | ### Maintainer's dist rules |
| 3605 | |
Stefano Lattarini | dd6fc7c | 2012-12-09 11:36:17 +0100 | [diff] [blame] | 3606 | GIT_TARNAME = git-$(GIT_VERSION) |
René Scharfe | df368fa | 2020-09-19 23:23:50 +0200 | [diff] [blame] | 3607 | GIT_ARCHIVE_EXTRA_FILES = \ |
| 3608 | --prefix=$(GIT_TARNAME)/ \ |
| 3609 | --add-file=configure \ |
Ramsay Jones | c531203 | 2020-12-08 22:36:33 +0000 | [diff] [blame] | 3610 | --add-file=.dist-tmp-dir/version \ |
René Scharfe | df368fa | 2020-09-19 23:23:50 +0200 | [diff] [blame] | 3611 | --prefix=$(GIT_TARNAME)/git-gui/ \ |
Ramsay Jones | c531203 | 2020-12-08 22:36:33 +0000 | [diff] [blame] | 3612 | --add-file=.dist-tmp-dir/git-gui/version |
René Scharfe | df368fa | 2020-09-19 23:23:50 +0200 | [diff] [blame] | 3613 | ifdef DC_SHA1_SUBMODULE |
| 3614 | GIT_ARCHIVE_EXTRA_FILES += \ |
| 3615 | --prefix=$(GIT_TARNAME)/sha1collisiondetection/ \ |
| 3616 | --add-file=sha1collisiondetection/LICENSE.txt \ |
| 3617 | --prefix=$(GIT_TARNAME)/sha1collisiondetection/lib/ \ |
| 3618 | --add-file=sha1collisiondetection/lib/sha1.c \ |
| 3619 | --add-file=sha1collisiondetection/lib/sha1.h \ |
| 3620 | --add-file=sha1collisiondetection/lib/ubc_check.c \ |
| 3621 | --add-file=sha1collisiondetection/lib/ubc_check.h |
| 3622 | endif |
Dennis Kaarsemaker | ef642ff | 2016-04-27 19:54:35 +0200 | [diff] [blame] | 3623 | dist: git-archive$(X) configure |
Ramsay Jones | c531203 | 2020-12-08 22:36:33 +0000 | [diff] [blame] | 3624 | @$(RM) -r .dist-tmp-dir |
| 3625 | @mkdir .dist-tmp-dir |
| 3626 | @echo $(GIT_VERSION) > .dist-tmp-dir/version |
| 3627 | @$(MAKE) -C git-gui TARDIR=../.dist-tmp-dir/git-gui dist-version |
René Scharfe | df368fa | 2020-09-19 23:23:50 +0200 | [diff] [blame] | 3628 | ./git-archive --format=tar \ |
| 3629 | $(GIT_ARCHIVE_EXTRA_FILES) \ |
| 3630 | --prefix=$(GIT_TARNAME)/ HEAD^{tree} > $(GIT_TARNAME).tar |
Ramsay Jones | c531203 | 2020-12-08 22:36:33 +0000 | [diff] [blame] | 3631 | @$(RM) -r .dist-tmp-dir |
Eric W. Biederman | 9dce3c0 | 2005-07-14 19:20:50 -0600 | [diff] [blame] | 3632 | gzip -f -9 $(GIT_TARNAME).tar |
Chris Wright | a9db297 | 2005-07-07 13:09:50 -0700 | [diff] [blame] | 3633 | |
Junio C Hamano | ab21433 | 2016-04-04 23:42:41 -0700 | [diff] [blame] | 3634 | rpm:: |
| 3635 | @echo >&2 "Use distro packaged sources to run rpmbuild" |
| 3636 | @false |
| 3637 | .PHONY: rpm |
Chris Wright | a9db297 | 2005-07-07 13:09:50 -0700 | [diff] [blame] | 3638 | |
Johannes Schindelin | 4668931 | 2019-10-04 08:09:36 -0700 | [diff] [blame] | 3639 | ifneq ($(INCLUDE_DLLS_IN_ARTIFACTS),) |
Johannes Schindelin | ca76cca | 2023-09-25 11:20:33 +0000 | [diff] [blame] | 3640 | OTHER_PROGRAMS += $(shell echo *.dll t/helper/*.dll t/unit-tests/bin/*.dll) |
Johannes Schindelin | 4668931 | 2019-10-04 08:09:36 -0700 | [diff] [blame] | 3641 | endif |
| 3642 | |
Johannes Schindelin | 179227d | 2020-09-21 22:28:16 +0000 | [diff] [blame] | 3643 | artifacts-tar:: $(ALL_COMMANDS_TO_INSTALL) $(SCRIPT_LIB) $(OTHER_PROGRAMS) \ |
Johannes Schindelin | b819f1d | 2019-01-29 06:19:38 -0800 | [diff] [blame] | 3644 | GIT-BUILD-OPTIONS $(TEST_PROGRAMS) $(test_bindir_programs) \ |
Phillip Wood | e137fe3 | 2023-11-09 10:50:43 -0800 | [diff] [blame] | 3645 | $(UNIT_TEST_PROGS) $(MOFILES) |
Johannes Schindelin | b819f1d | 2019-01-29 06:19:38 -0800 | [diff] [blame] | 3646 | $(QUIET_SUBDIR0)templates $(QUIET_SUBDIR1) \ |
| 3647 | SHELL_PATH='$(SHELL_PATH_SQ)' PERL_PATH='$(PERL_PATH_SQ)' |
| 3648 | test -n "$(ARTIFACTS_DIRECTORY)" |
| 3649 | mkdir -p "$(ARTIFACTS_DIRECTORY)" |
| 3650 | $(TAR) czf "$(ARTIFACTS_DIRECTORY)/artifacts.tar.gz" $^ templates/blt/ |
| 3651 | .PHONY: artifacts-tar |
| 3652 | |
Tilman Sauerbeck | 52db049 | 2006-05-18 12:57:04 +0200 | [diff] [blame] | 3653 | htmldocs = git-htmldocs-$(GIT_VERSION) |
| 3654 | manpages = git-manpages-$(GIT_VERSION) |
Elia Pinto | e6be265 | 2015-12-15 15:21:00 +0000 | [diff] [blame] | 3655 | .PHONY: dist-doc distclean |
René Scharfe | 93e7031 | 2020-10-10 18:45:18 +0200 | [diff] [blame] | 3656 | dist-doc: git$X |
Emil Medve | 4cb08df | 2007-07-14 12:51:44 -0500 | [diff] [blame] | 3657 | $(RM) -r .doc-tmp-dir |
Tilman Sauerbeck | 52db049 | 2006-05-18 12:57:04 +0200 | [diff] [blame] | 3658 | mkdir .doc-tmp-dir |
| 3659 | $(MAKE) -C Documentation WEBDOC_DEST=../.doc-tmp-dir install-webdoc |
René Scharfe | 93e7031 | 2020-10-10 18:45:18 +0200 | [diff] [blame] | 3660 | ./git -C .doc-tmp-dir init |
| 3661 | ./git -C .doc-tmp-dir add . |
| 3662 | ./git -C .doc-tmp-dir commit -m htmldocs |
| 3663 | ./git -C .doc-tmp-dir archive --format=tar --prefix=./ HEAD^{tree} \ |
| 3664 | > $(htmldocs).tar |
Tilman Sauerbeck | 52db049 | 2006-05-18 12:57:04 +0200 | [diff] [blame] | 3665 | gzip -n -9 -f $(htmldocs).tar |
| 3666 | : |
Emil Medve | 4cb08df | 2007-07-14 12:51:44 -0500 | [diff] [blame] | 3667 | $(RM) -r .doc-tmp-dir |
Junio C Hamano | 4392da4 | 2007-04-19 20:47:04 -0700 | [diff] [blame] | 3668 | 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] | 3669 | $(MAKE) -C Documentation DESTDIR=./ \ |
Jakub Narebski | 7b8cf0c | 2006-06-29 23:26:54 +0200 | [diff] [blame] | 3670 | man1dir=../.doc-tmp-dir/man1 \ |
Junio C Hamano | 4392da4 | 2007-04-19 20:47:04 -0700 | [diff] [blame] | 3671 | man5dir=../.doc-tmp-dir/man5 \ |
Jakub Narebski | 7b8cf0c | 2006-06-29 23:26:54 +0200 | [diff] [blame] | 3672 | man7dir=../.doc-tmp-dir/man7 \ |
Tilman Sauerbeck | 52db049 | 2006-05-18 12:57:04 +0200 | [diff] [blame] | 3673 | install |
René Scharfe | 93e7031 | 2020-10-10 18:45:18 +0200 | [diff] [blame] | 3674 | ./git -C .doc-tmp-dir init |
| 3675 | ./git -C .doc-tmp-dir add . |
| 3676 | ./git -C .doc-tmp-dir commit -m manpages |
| 3677 | ./git -C .doc-tmp-dir archive --format=tar --prefix=./ HEAD^{tree} \ |
| 3678 | > $(manpages).tar |
Tilman Sauerbeck | 52db049 | 2006-05-18 12:57:04 +0200 | [diff] [blame] | 3679 | gzip -n -9 -f $(manpages).tar |
Emil Medve | 4cb08df | 2007-07-14 12:51:44 -0500 | [diff] [blame] | 3680 | $(RM) -r .doc-tmp-dir |
Tilman Sauerbeck | 52db049 | 2006-05-18 12:57:04 +0200 | [diff] [blame] | 3681 | |
Petr Baudis | 28818ff | 2005-07-29 17:50:24 +0200 | [diff] [blame] | 3682 | ### Cleaning rules |
Eric W. Biederman | 87a81c8 | 2005-07-14 19:21:57 -0600 | [diff] [blame] | 3683 | |
Mathias Megyei | 922aa80 | 2007-10-04 23:49:19 +0200 | [diff] [blame] | 3684 | distclean: clean |
| 3685 | $(RM) configure |
Stefano Lattarini | dc7ace5 | 2012-07-19 09:50:01 +0200 | [diff] [blame] | 3686 | $(RM) config.log config.status config.cache |
| 3687 | $(RM) config.mak.autogen config.mak.append |
| 3688 | $(RM) -r autom4te.cache |
Mathias Megyei | 922aa80 | 2007-10-04 23:49:19 +0200 | [diff] [blame] | 3689 | |
Theodore Ts'o | f2d713f | 2012-02-06 01:00:17 -0500 | [diff] [blame] | 3690 | profile-clean: |
| 3691 | $(RM) $(addsuffix *.gcda,$(addprefix $(PROFILE_DIR)/, $(object_dirs))) |
| 3692 | $(RM) $(addsuffix *.gcno,$(addprefix $(PROFILE_DIR)/, $(object_dirs))) |
| 3693 | |
SZEDER Gábor | 1a96638 | 2018-07-23 15:51:00 +0200 | [diff] [blame] | 3694 | cocciclean: |
Ævar Arnfjörð Bjarmason | 09d9a69 | 2022-11-01 23:35:46 +0100 | [diff] [blame] | 3695 | $(RM) GIT-SPATCH-DEFINES |
Ævar Arnfjörð Bjarmason | f7ff659 | 2022-07-05 15:46:57 +0200 | [diff] [blame] | 3696 | $(RM) -r .build/contrib/coccinelle |
Ævar Arnfjörð Bjarmason | f1c903d | 2022-11-01 23:35:50 +0100 | [diff] [blame] | 3697 | $(RM) contrib/coccinelle/*.cocci.patch |
SZEDER Gábor | 1a96638 | 2018-07-23 15:51:00 +0200 | [diff] [blame] | 3698 | |
| 3699 | clean: profile-clean coverage-clean cocciclean |
Jeff King | 5d5ca1b | 2024-01-30 00:38:56 -0500 | [diff] [blame] | 3700 | $(RM) -r .build $(UNIT_TEST_BIN) |
Ævar Arnfjörð Bjarmason | b9832f7 | 2022-05-26 22:50:34 +0800 | [diff] [blame] | 3701 | $(RM) po/git.pot po/git-core.pot |
Ævar Arnfjörð Bjarmason | af0aa69 | 2022-07-05 15:46:56 +0200 | [diff] [blame] | 3702 | $(RM) git.res |
Junio C Hamano | 7897d84 | 2016-04-15 10:06:52 -0700 | [diff] [blame] | 3703 | $(RM) $(OBJECTS) |
Johannes Schindelin | 4b8a271 | 2023-08-09 16:54:46 +0000 | [diff] [blame] | 3704 | $(RM) headless-git.o |
Han-Wen Nienhuys | ef8a6c6 | 2021-10-07 20:25:00 +0000 | [diff] [blame] | 3705 | $(RM) $(LIB_FILE) $(XDIFF_LIB) $(REFTABLE_LIB) $(REFTABLE_TEST_LIB) |
Victoria Dye | 7b5c93c | 2022-09-02 15:56:43 +0000 | [diff] [blame] | 3706 | $(RM) $(ALL_PROGRAMS) $(SCRIPT_LIB) $(BUILT_INS) $(OTHER_PROGRAMS) |
Jeff King | 5d5ca1b | 2024-01-30 00:38:56 -0500 | [diff] [blame] | 3707 | $(RM) $(TEST_PROGRAMS) |
Josh Steadmon | 5e47215 | 2018-10-12 17:58:40 -0700 | [diff] [blame] | 3708 | $(RM) $(FUZZ_PROGRAMS) |
Ævar Arnfjörð Bjarmason | c234e8a | 2021-09-23 02:07:16 +0200 | [diff] [blame] | 3709 | $(RM) $(SP_OBJ) |
Denton Liu | b503a2d | 2019-09-25 01:21:01 -0700 | [diff] [blame] | 3710 | $(RM) $(HCC) |
Philippe Blain | 3821c38 | 2020-09-03 22:13:38 +0000 | [diff] [blame] | 3711 | $(RM) -r bin-wrappers $(dep_dirs) $(compdb_dir) compile_commands.json |
Ævar Arnfjörð Bjarmason | 5e9637c | 2011-11-18 00:14:42 +0100 | [diff] [blame] | 3712 | $(RM) -r po/build/ |
Junio C Hamano | f371984 | 2019-12-13 15:15:34 -0800 | [diff] [blame] | 3713 | $(RM) *.pyc *.pyo */*.pyc */*.pyo $(GENERATED_H) $(ETAGS_TARGET) tags cscope* |
Ramsay Jones | c531203 | 2020-12-08 22:36:33 +0000 | [diff] [blame] | 3714 | $(RM) -r .dist-tmp-dir .doc-tmp-dir |
Ramsay Jones | 98836a8 | 2020-12-08 22:35:27 +0000 | [diff] [blame] | 3715 | $(RM) $(GIT_TARNAME).tar.gz |
Emil Medve | 4cb08df | 2007-07-14 12:51:44 -0500 | [diff] [blame] | 3716 | $(RM) $(htmldocs).tar.gz $(manpages).tar.gz |
Thomas Glanzmann | ca67f00 | 2005-05-22 20:27:28 +0200 | [diff] [blame] | 3717 | $(MAKE) -C Documentation/ clean |
Johannes Schindelin | faa7a09 | 2019-04-18 06:16:44 -0700 | [diff] [blame] | 3718 | $(RM) Documentation/GIT-EXCLUDED-PROGRAMS |
Jeff King | 499c293 | 2009-04-03 15:32:20 -0400 | [diff] [blame] | 3719 | ifndef NO_PERL |
Ævar Arnfjörð Bjarmason | 20d2a30 | 2017-12-10 21:13:33 +0000 | [diff] [blame] | 3720 | $(RM) -r perl/build/ |
Jeff King | 499c293 | 2009-04-03 15:32:20 -0400 | [diff] [blame] | 3721 | endif |
Petr Baudis | b1edc53 | 2006-06-24 04:34:29 +0200 | [diff] [blame] | 3722 | $(MAKE) -C templates/ clean |
Junio C Hamano | 4b7581f | 2005-08-02 17:24:11 -0700 | [diff] [blame] | 3723 | $(MAKE) -C t/ clean |
Eygene Ryabinkin | 3cfaf11 | 2007-03-28 04:00:23 -0700 | [diff] [blame] | 3724 | ifndef NO_TCLTK |
Junio C Hamano | 62ba514 | 2007-11-17 10:51:16 -0800 | [diff] [blame] | 3725 | $(MAKE) -C gitk-git clean |
Eygene Ryabinkin | 3cfaf11 | 2007-03-28 04:00:23 -0700 | [diff] [blame] | 3726 | $(MAKE) -C git-gui clean |
| 3727 | endif |
Christian Couder | 8f26aa4 | 2012-12-18 16:26:37 +0100 | [diff] [blame] | 3728 | $(RM) GIT-VERSION-FILE GIT-CFLAGS GIT-LDFLAGS GIT-BUILD-OPTIONS |
Jonathan Nieder | 07981dc | 2013-11-18 14:23:11 -0800 | [diff] [blame] | 3729 | $(RM) GIT-USER-AGENT GIT-PREFIX |
Dan Jacques | f6a0ad4 | 2018-04-10 11:05:42 -0400 | [diff] [blame] | 3730 | $(RM) GIT-SCRIPT-DEFINES GIT-PERL-DEFINES GIT-PERL-HEADER GIT-PYTHON-VARS |
Jeff Hostetler | dce7d29 | 2019-06-25 07:49:39 -0700 | [diff] [blame] | 3731 | ifdef MSVC |
| 3732 | $(RM) $(patsubst %.o,%.o.pdb,$(OBJECTS)) |
Johannes Schindelin | 4b8a271 | 2023-08-09 16:54:46 +0000 | [diff] [blame] | 3733 | $(RM) headless-git.o.pdb |
Jeff Hostetler | dce7d29 | 2019-06-25 07:49:39 -0700 | [diff] [blame] | 3734 | $(RM) $(patsubst %.exe,%.pdb,$(OTHER_PROGRAMS)) |
| 3735 | $(RM) $(patsubst %.exe,%.iobj,$(OTHER_PROGRAMS)) |
| 3736 | $(RM) $(patsubst %.exe,%.ipdb,$(OTHER_PROGRAMS)) |
| 3737 | $(RM) $(patsubst %.exe,%.pdb,$(PROGRAMS)) |
| 3738 | $(RM) $(patsubst %.exe,%.iobj,$(PROGRAMS)) |
| 3739 | $(RM) $(patsubst %.exe,%.ipdb,$(PROGRAMS)) |
| 3740 | $(RM) $(patsubst %.exe,%.pdb,$(TEST_PROGRAMS)) |
| 3741 | $(RM) $(patsubst %.exe,%.iobj,$(TEST_PROGRAMS)) |
| 3742 | $(RM) $(patsubst %.exe,%.ipdb,$(TEST_PROGRAMS)) |
| 3743 | $(RM) compat/vcbuild/MSVC-DEFS-GEN |
| 3744 | endif |
Junio C Hamano | 9b88fce | 2005-12-27 14:40:17 -0800 | [diff] [blame] | 3745 | |
SZEDER Gábor | 1a96638 | 2018-07-23 15:51:00 +0200 | [diff] [blame] | 3746 | .PHONY: all install profile-clean cocciclean clean strip |
Brandon Casey | 6dc4627 | 2008-08-07 14:06:26 -0500 | [diff] [blame] | 3747 | .PHONY: shell_compatibility_test please_set_SHELL_PATH_to_a_more_modern_shell |
Ævar Arnfjörð Bjarmason | 922f8bb | 2021-06-29 13:12:55 +0200 | [diff] [blame] | 3748 | .PHONY: FORCE |
Junio C Hamano | d89056c | 2005-12-19 17:59:58 -0800 | [diff] [blame] | 3749 | |
Junio C Hamano | 8c989ec | 2006-04-13 00:17:19 -0700 | [diff] [blame] | 3750 | ### Check documentation |
| 3751 | # |
Johannes Schindelin | 179227d | 2020-09-21 22:28:16 +0000 | [diff] [blame] | 3752 | ALL_COMMANDS = $(ALL_COMMANDS_TO_INSTALL) $(SCRIPT_LIB) |
Jeff King | cf6aaff | 2012-08-08 16:56:04 -0400 | [diff] [blame] | 3753 | ALL_COMMANDS += git |
Denton Liu | 805d9ea | 2020-03-21 05:21:20 -0400 | [diff] [blame] | 3754 | ALL_COMMANDS += git-citool |
| 3755 | ALL_COMMANDS += git-gui |
Jeff King | cf6aaff | 2012-08-08 16:56:04 -0400 | [diff] [blame] | 3756 | ALL_COMMANDS += gitk |
| 3757 | ALL_COMMANDS += gitweb |
Victoria Dye | 7b5c93c | 2022-09-02 15:56:43 +0000 | [diff] [blame] | 3758 | ALL_COMMANDS += scalar |
Elia Pinto | e6be265 | 2015-12-15 15:21:00 +0000 | [diff] [blame] | 3759 | |
| 3760 | .PHONY: check-docs |
Junio C Hamano | 8c989ec | 2006-04-13 00:17:19 -0700 | [diff] [blame] | 3761 | check-docs:: |
Junio C Hamano | ab81411 | 2016-05-04 14:34:23 -0700 | [diff] [blame] | 3762 | $(MAKE) -C Documentation lint-docs |
Junio C Hamano | c74390e | 2006-11-05 11:26:21 -0800 | [diff] [blame] | 3763 | |
| 3764 | ### Make sure built-ins do not have dups and listed in git.c |
| 3765 | # |
| 3766 | check-builtins:: |
| 3767 | ./check-builtins.sh |
Junio C Hamano | 11c57e6 | 2008-01-14 15:10:38 -0800 | [diff] [blame] | 3768 | |
Thomas Rast | 901c369 | 2009-02-19 12:13:35 +0100 | [diff] [blame] | 3769 | ### Test suite coverage testing |
| 3770 | # |
Thomas Rast | 0c38a95 | 2013-05-13 23:27:25 +0200 | [diff] [blame] | 3771 | .PHONY: coverage coverage-clean coverage-compile coverage-test coverage-report |
Elia Pinto | e6be265 | 2015-12-15 15:21:00 +0000 | [diff] [blame] | 3772 | .PHONY: coverage-untested-functions cover_db cover_db_html |
Thomas Rast | dcbe7f1 | 2013-05-13 23:27:26 +0200 | [diff] [blame] | 3773 | .PHONY: coverage-clean-results |
Thomas Rast | 901c369 | 2009-02-19 12:13:35 +0100 | [diff] [blame] | 3774 | |
| 3775 | coverage: |
Thomas Rast | 0c38a95 | 2013-05-13 23:27:25 +0200 | [diff] [blame] | 3776 | $(MAKE) coverage-test |
Thomas Rast | 5ce4367 | 2013-05-13 23:27:28 +0200 | [diff] [blame] | 3777 | $(MAKE) coverage-untested-functions |
Thomas Rast | 901c369 | 2009-02-19 12:13:35 +0100 | [diff] [blame] | 3778 | |
Ævar Arnfjörð Bjarmason | bc548ef | 2010-07-25 19:52:40 +0000 | [diff] [blame] | 3779 | object_dirs := $(sort $(dir $(OBJECTS))) |
Thomas Rast | dcbe7f1 | 2013-05-13 23:27:26 +0200 | [diff] [blame] | 3780 | coverage-clean-results: |
Ævar Arnfjörð Bjarmason | bc548ef | 2010-07-25 19:52:40 +0000 | [diff] [blame] | 3781 | $(RM) $(addsuffix *.gcov,$(object_dirs)) |
| 3782 | $(RM) $(addsuffix *.gcda,$(object_dirs)) |
Ævar Arnfjörð Bjarmason | bc548ef | 2010-07-25 19:52:40 +0000 | [diff] [blame] | 3783 | $(RM) coverage-untested-functions |
Ævar Arnfjörð Bjarmason | 7432bd5 | 2010-07-25 19:52:42 +0000 | [diff] [blame] | 3784 | $(RM) -r cover_db/ |
Ævar Arnfjörð Bjarmason | df07acf | 2010-07-25 19:52:43 +0000 | [diff] [blame] | 3785 | $(RM) -r cover_db_html/ |
Elia Pinto | 96ddfec | 2022-04-14 02:25:13 +0000 | [diff] [blame] | 3786 | $(RM) coverage-test.made |
Thomas Rast | 901c369 | 2009-02-19 12:13:35 +0100 | [diff] [blame] | 3787 | |
Thomas Rast | dcbe7f1 | 2013-05-13 23:27:26 +0200 | [diff] [blame] | 3788 | coverage-clean: coverage-clean-results |
| 3789 | $(RM) $(addsuffix *.gcno,$(object_dirs)) |
| 3790 | |
Thomas Rast | 901c369 | 2009-02-19 12:13:35 +0100 | [diff] [blame] | 3791 | COVERAGE_CFLAGS = $(CFLAGS) -O0 -ftest-coverage -fprofile-arcs |
| 3792 | COVERAGE_LDFLAGS = $(CFLAGS) -O0 -lgcov |
Ævar Arnfjörð Bjarmason | bc548ef | 2010-07-25 19:52:40 +0000 | [diff] [blame] | 3793 | GCOVFLAGS = --preserve-paths --branch-probabilities --all-blocks |
Thomas Rast | 901c369 | 2009-02-19 12:13:35 +0100 | [diff] [blame] | 3794 | |
Thomas Rast | 0c38a95 | 2013-05-13 23:27:25 +0200 | [diff] [blame] | 3795 | coverage-compile: |
Thomas Rast | 901c369 | 2009-02-19 12:13:35 +0100 | [diff] [blame] | 3796 | $(MAKE) CFLAGS="$(COVERAGE_CFLAGS)" LDFLAGS="$(COVERAGE_LDFLAGS)" all |
Thomas Rast | 0c38a95 | 2013-05-13 23:27:25 +0200 | [diff] [blame] | 3797 | |
| 3798 | coverage-test: coverage-clean-results coverage-compile |
Thomas Rast | 901c369 | 2009-02-19 12:13:35 +0100 | [diff] [blame] | 3799 | $(MAKE) CFLAGS="$(COVERAGE_CFLAGS)" LDFLAGS="$(COVERAGE_LDFLAGS)" \ |
Thomas Rast | c14cc77 | 2013-05-13 23:27:27 +0200 | [diff] [blame] | 3800 | DEFAULT_TEST_TARGET=test -j1 test |
Elia Pinto | 96ddfec | 2022-04-14 02:25:13 +0000 | [diff] [blame] | 3801 | touch coverage-test.made |
| 3802 | |
| 3803 | coverage-test.made: |
| 3804 | $(MAKE) coverage-test |
Thomas Rast | 901c369 | 2009-02-19 12:13:35 +0100 | [diff] [blame] | 3805 | |
Derrick Stolee | 2299120 | 2019-01-29 09:05:18 -0800 | [diff] [blame] | 3806 | coverage-prove: coverage-clean-results coverage-compile |
| 3807 | $(MAKE) CFLAGS="$(COVERAGE_CFLAGS)" LDFLAGS="$(COVERAGE_LDFLAGS)" \ |
| 3808 | DEFAULT_TEST_TARGET=prove GIT_PROVE_OPTS="$(GIT_PROVE_OPTS) -j1" \ |
| 3809 | -j1 test |
| 3810 | |
Elia Pinto | 96ddfec | 2022-04-14 02:25:13 +0000 | [diff] [blame] | 3811 | coverage-report: coverage-test.made |
Ævar Arnfjörð Bjarmason | bc548ef | 2010-07-25 19:52:40 +0000 | [diff] [blame] | 3812 | $(QUIET_GCOV)for dir in $(object_dirs); do \ |
Thomas Rast | e146d17 | 2010-07-26 09:43:41 +0200 | [diff] [blame] | 3813 | $(GCOV) $(GCOVFLAGS) --object-directory=$$dir $$dir*.c || exit; \ |
Ævar Arnfjörð Bjarmason | bc548ef | 2010-07-25 19:52:40 +0000 | [diff] [blame] | 3814 | done |
Ævar Arnfjörð Bjarmason | b5eed98 | 2010-07-25 19:52:41 +0000 | [diff] [blame] | 3815 | |
| 3816 | coverage-untested-functions: coverage-report |
Thomas Rast | 901c369 | 2009-02-19 12:13:35 +0100 | [diff] [blame] | 3817 | grep '^function.*called 0 ' *.c.gcov \ |
| 3818 | | sed -e 's/\([^:]*\)\.gcov: *function \([^ ]*\) called.*/\1: \2/' \ |
Ævar Arnfjörð Bjarmason | bc548ef | 2010-07-25 19:52:40 +0000 | [diff] [blame] | 3819 | > coverage-untested-functions |
Ævar Arnfjörð Bjarmason | 7432bd5 | 2010-07-25 19:52:42 +0000 | [diff] [blame] | 3820 | |
| 3821 | cover_db: coverage-report |
| 3822 | gcov2perl -db cover_db *.gcov |
Ævar Arnfjörð Bjarmason | df07acf | 2010-07-25 19:52:43 +0000 | [diff] [blame] | 3823 | |
| 3824 | cover_db_html: cover_db |
| 3825 | cover -report html -outputdir cover_db_html cover_db |
Andi Kleen | 7ddc271 | 2011-06-18 18:07:05 -0700 | [diff] [blame] | 3826 | |
Josh Steadmon | 5e47215 | 2018-10-12 17:58:40 -0700 | [diff] [blame] | 3827 | |
| 3828 | ### Fuzz testing |
| 3829 | # |
| 3830 | # Building fuzz targets generally requires a special set of compiler flags that |
| 3831 | # are not necessarily appropriate for general builds, and that vary greatly |
| 3832 | # depending on the compiler version used. |
| 3833 | # |
Andrzej Hunt | 68b5c3a | 2021-03-08 17:14:42 +0000 | [diff] [blame] | 3834 | # An example command to build against libFuzzer from LLVM 11.0.0: |
Josh Steadmon | 5e47215 | 2018-10-12 17:58:40 -0700 | [diff] [blame] | 3835 | # |
Josh Steadmon | 8427b7e | 2024-04-24 11:14:42 -0700 | [diff] [blame] | 3836 | # make CC=clang FUZZ_CXX=clang++ \ |
Andrzej Hunt | 68b5c3a | 2021-03-08 17:14:42 +0000 | [diff] [blame] | 3837 | # CFLAGS="-fsanitize=fuzzer-no-link,address" \ |
Josh Steadmon | 8b9a42b | 2024-01-19 13:38:12 -0800 | [diff] [blame] | 3838 | # LIB_FUZZING_ENGINE="-fsanitize=fuzzer,address" \ |
Josh Steadmon | 5e47215 | 2018-10-12 17:58:40 -0700 | [diff] [blame] | 3839 | # fuzz-all |
| 3840 | # |
Josh Steadmon | 8427b7e | 2024-04-24 11:14:42 -0700 | [diff] [blame] | 3841 | FUZZ_CXX ?= $(CC) |
Josh Steadmon | 8b9a42b | 2024-01-19 13:38:12 -0800 | [diff] [blame] | 3842 | FUZZ_CXXFLAGS ?= $(ALL_CFLAGS) |
Josh Steadmon | 927c77e | 2018-11-14 11:41:47 -0800 | [diff] [blame] | 3843 | |
Josh Steadmon | 5e47215 | 2018-10-12 17:58:40 -0700 | [diff] [blame] | 3844 | .PHONY: fuzz-all |
Josh Steadmon | 8427b7e | 2024-04-24 11:14:42 -0700 | [diff] [blame] | 3845 | fuzz-all: $(FUZZ_PROGRAMS) |
Josh Steadmon | 5e47215 | 2018-10-12 17:58:40 -0700 | [diff] [blame] | 3846 | |
Josh Steadmon | 8b9a42b | 2024-01-19 13:38:12 -0800 | [diff] [blame] | 3847 | $(FUZZ_PROGRAMS): %: %.o oss-fuzz/dummy-cmd-main.o $(GITLIBS) GIT-LDFLAGS |
Josh Steadmon | 8427b7e | 2024-04-24 11:14:42 -0700 | [diff] [blame] | 3848 | $(QUIET_LINK)$(FUZZ_CXX) $(FUZZ_CXXFLAGS) -o $@ $(ALL_LDFLAGS) \ |
Josh Steadmon | 8b9a42b | 2024-01-19 13:38:12 -0800 | [diff] [blame] | 3849 | -Wl,--allow-multiple-definition \ |
| 3850 | $(filter %.o,$^) $(filter %.a,$^) $(LIBS) $(LIB_FUZZING_ENGINE) |
Josh Steadmon | 5e47215 | 2018-10-12 17:58:40 -0700 | [diff] [blame] | 3851 | |
Jeff King | 318ecda | 2024-01-30 00:37:40 -0500 | [diff] [blame] | 3852 | $(UNIT_TEST_PROGS): $(UNIT_TEST_BIN)/%$X: $(UNIT_TEST_DIR)/%.o $(UNIT_TEST_DIR)/test-lib.o $(GITLIBS) GIT-LDFLAGS |
| 3853 | $(call mkdir_p_parent_template) |
Phillip Wood | e137fe3 | 2023-11-09 10:50:43 -0800 | [diff] [blame] | 3854 | $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) \ |
| 3855 | $(filter %.o,$^) $(filter %.a,$^) $(LIBS) |
| 3856 | |
| 3857 | .PHONY: build-unit-tests unit-tests |
| 3858 | build-unit-tests: $(UNIT_TEST_PROGS) |
Josh Steadmon | 5bbc8c9 | 2024-05-06 12:57:35 -0700 | [diff] [blame] | 3859 | unit-tests: $(UNIT_TEST_PROGS) t/helper/test-tool$X |
Phillip Wood | e137fe3 | 2023-11-09 10:50:43 -0800 | [diff] [blame] | 3860 | $(MAKE) -C t/ unit-tests |