1# The default target of this Makefile is... 2all:: 3 4# Define V=1 to have a more verbose compile. 5# 6# Define SHELL_PATH to a POSIX shell if your /bin/sh is broken. 7# 8# Define SANE_TOOL_PATH to a colon-separated list of paths to prepend 9# to PATH if your tools in /usr/bin are broken. 10# 11# Define SOCKLEN_T to a suitable type (such as 'size_t') if your 12# system headers do not define a socklen_t type. 13# 14# Define INLINE to a suitable substitute (such as '__inline' or '') if git 15# fails to compile with errors about undefined inline functions or similar. 16# 17# Define SNPRINTF_RETURNS_BOGUS if you are on a system which snprintf() 18# or vsnprintf() return -1 instead of number of characters which would 19# have been written to the final string if enough space had been available. 20# 21# Define FREAD_READS_DIRECTORIES if you are on a system which succeeds 22# when attempting to read from an fopen'ed directory (or even to fopen 23# it at all). 24# 25# Define NO_OPENSSL environment variable if you do not have OpenSSL. 26# 27# Define USE_LIBPCRE if you have and want to use libpcre. Various 28# commands such as log and grep offer runtime options to use 29# Perl-compatible regular expressions instead of standard or extended 30# POSIX regular expressions. 31# 32# USE_LIBPCRE is a synonym for USE_LIBPCRE2, define USE_LIBPCRE1 33# instead if you'd like to use the legacy version 1 of the PCRE 34# library. Support for version 1 will likely be removed in some future 35# release of Git, as upstream has all but abandoned it. 36# 37# When using USE_LIBPCRE1, define NO_LIBPCRE1_JIT if the PCRE v1 38# library is compiled without --enable-jit. We will auto-detect 39# whether the version of the PCRE v1 library in use has JIT support at 40# all, but we unfortunately can't auto-detect whether JIT support 41# hasn't been compiled in in an otherwise JIT-supporting version. If 42# you have link-time errors about a missing `pcre_jit_exec` define 43# this, or recompile PCRE v1 with --enable-jit. 44# 45# Define LIBPCREDIR=/foo/bar if your PCRE header and library files are 46# in /foo/bar/include and /foo/bar/lib directories. Which version of 47# PCRE this points to determined by the USE_LIBPCRE1 and USE_LIBPCRE2 48# variables. 49# 50# Define HAVE_ALLOCA_H if you have working alloca(3) defined in that header. 51# 52# Define NO_CURL if you do not have libcurl installed. git-http-fetch and 53# git-http-push are not built, and you cannot use http:// and https:// 54# transports (neither smart nor dumb). 55# 56# Define CURLDIR=/foo/bar if your curl header and library files are in 57# /foo/bar/include and /foo/bar/lib directories. 58# 59# Define CURL_CONFIG to curl's configuration program that prints information 60# about the library (e.g., its version number). The default is 'curl-config'. 61# 62# Define CURL_LDFLAGS to specify flags that you need to link when using libcurl, 63# if you do not want to rely on the libraries provided by CURL_CONFIG. The 64# default value is a result of `curl-config --libs`. An example value for 65# CURL_LDFLAGS is as follows: 66# 67# CURL_LDFLAGS=-lcurl 68# 69# Define NO_EXPAT if you do not have expat installed. git-http-push is 70# not built, and you cannot push using http:// and https:// transports (dumb). 71# 72# Define EXPATDIR=/foo/bar if your expat header and library files are in 73# /foo/bar/include and /foo/bar/lib directories. 74# 75# Define EXPAT_NEEDS_XMLPARSE_H if you have an old version of expat (e.g., 76# 1.1 or 1.2) that provides xmlparse.h instead of expat.h. 77# 78# Define NO_GETTEXT if you don't want Git output to be translated. 79# A translated Git requires GNU libintl or another gettext implementation, 80# plus libintl-perl at runtime. 81# 82# Define USE_GETTEXT_SCHEME and set it to 'fallthrough', if you don't trust 83# the installed gettext translation of the shell scripts output. 84# 85# Define HAVE_LIBCHARSET_H if you haven't set NO_GETTEXT and you can't 86# trust the langinfo.h's nl_langinfo(CODESET) function to return the 87# current character set. GNU and Solaris have a nl_langinfo(CODESET), 88# FreeBSD can use either, but MinGW and some others need to use 89# libcharset.h's locale_charset() instead. 90# 91# Define CHARSET_LIB to the library you need to link with in order to 92# use locale_charset() function. On some platforms this needs to set to 93# -lcharset, on others to -liconv . 94# 95# Define LIBC_CONTAINS_LIBINTL if your gettext implementation doesn't 96# need -lintl when linking. 97# 98# Define NO_MSGFMT_EXTENDED_OPTIONS if your implementation of msgfmt 99# doesn't support GNU extensions like --check and --statistics 100# 101# Define HAVE_PATHS_H if you have paths.h and want to use the default PATH 102# it specifies. 103# 104# Define NO_D_TYPE_IN_DIRENT if your platform defines DT_UNKNOWN but lacks 105# d_type in struct dirent (Cygwin 1.5, fixed in Cygwin 1.7). 106# 107# Define HAVE_STRINGS_H if you have strings.h and need it for strcasecmp. 108# 109# Define NO_STRCASESTR if you don't have strcasestr. 110# 111# Define NO_MEMMEM if you don't have memmem. 112# 113# Define NO_GETPAGESIZE if you don't have getpagesize. 114# 115# Define NO_STRLCPY if you don't have strlcpy. 116# 117# Define NO_STRTOUMAX if you don't have both strtoimax and strtoumax in the 118# C library. If your compiler also does not support long long or does not have 119# strtoull, define NO_STRTOULL. 120# 121# Define NO_SETENV if you don't have setenv in the C library. 122# 123# Define NO_UNSETENV if you don't have unsetenv in the C library. 124# 125# Define NO_MKDTEMP if you don't have mkdtemp in the C library. 126# 127# Define MKDIR_WO_TRAILING_SLASH if your mkdir() can't deal with trailing slash. 128# 129# Define NO_GECOS_IN_PWENT if you don't have pw_gecos in struct passwd 130# in the C library. 131# 132# Define NO_LIBGEN_H if you don't have libgen.h. 133# 134# Define NEEDS_LIBGEN if your libgen needs -lgen when linking 135# 136# Define NO_SYS_SELECT_H if you don't have sys/select.h. 137# 138# Define NO_SYMLINK_HEAD if you never want .git/HEAD to be a symbolic link. 139# Enable it on Windows. By default, symrefs are still used. 140# 141# Define NO_SVN_TESTS if you want to skip time-consuming SVN interoperability 142# tests. These tests take up a significant amount of the total test time 143# but are not needed unless you plan to talk to SVN repos. 144# 145# Define NO_FINK if you are building on Darwin/Mac OS X, have Fink 146# installed in /sw, but don't want GIT to link against any libraries 147# installed there. If defined you may specify your own (or Fink's) 148# include directories and library directories by defining CFLAGS 149# and LDFLAGS appropriately. 150# 151# Define NO_DARWIN_PORTS if you are building on Darwin/Mac OS X, 152# have DarwinPorts installed in /opt/local, but don't want GIT to 153# link against any libraries installed there. If defined you may 154# specify your own (or DarwinPort's) include directories and 155# library directories by defining CFLAGS and LDFLAGS appropriately. 156# 157# Define NO_APPLE_COMMON_CRYPTO if you are building on Darwin/Mac OS X 158# and do not want to use Apple's CommonCrypto library. This allows you 159# to provide your own OpenSSL library, for example from MacPorts. 160# 161# Define BLK_SHA1 environment variable to make use of the bundled 162# optimized C SHA1 routine. 163# 164# Define PPC_SHA1 environment variable when running make to make use of 165# a bundled SHA1 routine optimized for PowerPC. 166# 167# Define DC_SHA1 to unconditionally enable the collision-detecting sha1 168# algorithm. This is slower, but may detect attempted collision attacks. 169# Takes priority over other *_SHA1 knobs. 170# 171# Define DC_SHA1_EXTERNAL in addition to DC_SHA1 if you want to build / link 172# git with the external SHA1 collision-detect library. 173# Without this option, i.e. the default behavior is to build git with its 174# own built-in code (or submodule). 175# 176# Define DC_SHA1_SUBMODULE in addition to DC_SHA1 to use the 177# sha1collisiondetection shipped as a submodule instead of the 178# non-submodule copy in sha1dc/. This is an experimental option used 179# by the git project to migrate to using sha1collisiondetection as a 180# submodule. 181# 182# Define OPENSSL_SHA1 environment variable when running make to link 183# with the SHA1 routine from openssl library. 184# 185# Define SHA1_MAX_BLOCK_SIZE to limit the amount of data that will be hashed 186# in one call to the platform's SHA1_Update(). e.g. APPLE_COMMON_CRYPTO 187# wants 'SHA1_MAX_BLOCK_SIZE=1024L*1024L*1024L' defined. 188# 189# Define NEEDS_CRYPTO_WITH_SSL if you need -lcrypto when using -lssl (Darwin). 190# 191# Define NEEDS_SSL_WITH_CRYPTO if you need -lssl when using -lcrypto (Darwin). 192# 193# Define NEEDS_LIBICONV if linking with libc is not enough (Darwin). 194# 195# Define NEEDS_LIBINTL_BEFORE_LIBICONV if you need libintl before libiconv. 196# 197# Define NO_INTPTR_T if you don't have intptr_t or uintptr_t. 198# 199# Define NO_UINTMAX_T if you don't have uintmax_t. 200# 201# Define NEEDS_SOCKET if linking with libc is not enough (SunOS, 202# Patrick Mauritz). 203# 204# Define NEEDS_RESOLV if linking with -lnsl and/or -lsocket is not enough. 205# Notably on Solaris hstrerror resides in libresolv and on Solaris 7 206# inet_ntop and inet_pton additionally reside there. 207# 208# Define NO_MMAP if you want to avoid mmap. 209# 210# Define MMAP_PREVENTS_DELETE if a file that is currently mmapped cannot be 211# deleted or cannot be replaced using rename(). 212# 213# Define NO_POLL_H if you don't have poll.h. 214# 215# Define NO_SYS_POLL_H if you don't have sys/poll.h. 216# 217# Define NO_POLL if you do not have or don't want to use poll(). 218# This also implies NO_POLL_H and NO_SYS_POLL_H. 219# 220# Define NEEDS_SYS_PARAM_H if you need to include sys/param.h to compile, 221# *PLEASE* REPORT to git@vger.kernel.org if your platform needs this; 222# we want to know more about the issue. 223# 224# Define NO_PTHREADS if you do not have or do not want to use Pthreads. 225# 226# Define NO_PREAD if you have a problem with pread() system call (e.g. 227# cygwin1.dll before v1.5.22). 228# 229# Define NO_SETITIMER if you don't have setitimer() 230# 231# Define NO_STRUCT_ITIMERVAL if you don't have struct itimerval 232# This also implies NO_SETITIMER 233# 234# Define NO_FAST_WORKING_DIRECTORY if accessing objects in pack files is 235# generally faster on your platform than accessing the working directory. 236# 237# Define NO_TRUSTABLE_FILEMODE if your filesystem may claim to support 238# the executable mode bit, but doesn't really do so. 239# 240# Define NEEDS_MODE_TRANSLATION if your OS strays from the typical file type 241# bits in mode values (e.g. z/OS defines I_SFMT to 0xFF000000 as opposed to the 242# usual 0xF000). 243# 244# Define NO_IPV6 if you lack IPv6 support and getaddrinfo(). 245# 246# Define NO_UNIX_SOCKETS if your system does not offer unix sockets. 247# 248# Define NO_SOCKADDR_STORAGE if your platform does not have struct 249# sockaddr_storage. 250# 251# Define NO_ICONV if your libc does not properly support iconv. 252# 253# Define OLD_ICONV if your library has an old iconv(), where the second 254# (input buffer pointer) parameter is declared with type (const char **). 255# 256# Define NO_DEFLATE_BOUND if your zlib does not have deflateBound. 257# 258# Define NO_R_TO_GCC_LINKER if your gcc does not like "-R/path/lib" 259# that tells runtime paths to dynamic libraries; 260# "-Wl,-rpath=/path/lib" is used instead. 261# 262# Define NO_NORETURN if using buggy versions of gcc 4.6+ and profile feedback, 263# as the compiler can crash (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49299) 264# 265# Define USE_NSEC below if you want git to care about sub-second file mtimes 266# and ctimes. Note that you need recent glibc (at least 2.2.4) for this. On 267# Linux, kernel 2.6.11 or newer is required for reliable sub-second file times 268# on file systems with exactly 1 ns or 1 s resolution. If you intend to use Git 269# on other file systems (e.g. CEPH, CIFS, NTFS, UDF), don't enable USE_NSEC. See 270# Documentation/technical/racy-git.txt for details. 271# 272# Define USE_ST_TIMESPEC if your "struct stat" uses "st_ctimespec" instead of 273# "st_ctim" 274# 275# Define NO_NSEC if your "struct stat" does not have "st_ctim.tv_nsec" 276# available. This automatically turns USE_NSEC off. 277# 278# Define USE_STDEV below if you want git to care about the underlying device 279# change being considered an inode change from the update-index perspective. 280# 281# Define NO_ST_BLOCKS_IN_STRUCT_STAT if your platform does not have st_blocks 282# field that counts the on-disk footprint in 512-byte blocks. 283# 284# Define DOCBOOK_XSL_172 if you want to format man pages with DocBook XSL v1.72 285# (not v1.73 or v1.71). 286# 287# Define ASCIIDOC_ROFF if your DocBook XSL does not escape raw roff directives 288# (versions 1.68.1 through v1.72). 289# 290# Define GNU_ROFF if your target system uses GNU groff. This forces 291# apostrophes to be ASCII so that cut&pasting examples to the shell 292# will work. 293# 294# Define USE_ASCIIDOCTOR to use Asciidoctor instead of AsciiDoc to build the 295# documentation. 296# 297# Define ASCIIDOCTOR_EXTENSIONS_LAB to point to the location of the Asciidoctor 298# Extensions Lab if you have it available. 299# 300# Define PERL_PATH to the path of your Perl binary (usually /usr/bin/perl). 301# 302# Define NO_PERL if you do not want Perl scripts or libraries at all. 303# 304# Define NO_PERL_CPAN_FALLBACKS if you do not want to install bundled 305# copies of CPAN modules that serve as a fallback in case the modules 306# are not available on the system. This option is intended for 307# distributions that want to use their packaged versions of Perl 308# modules, instead of the fallbacks shipped with Git. 309# 310# Define PYTHON_PATH to the path of your Python binary (often /usr/bin/python 311# but /usr/bin/python2.7 on some platforms). 312# 313# Define NO_PYTHON if you do not want Python scripts or libraries at all. 314# 315# Define NO_TCLTK if you do not want Tcl/Tk GUI. 316# 317# Define SANE_TEXT_GREP to "-a" if you use recent versions of GNU grep 318# and egrep that are pickier when their input contains non-ASCII data. 319# 320# The TCL_PATH variable governs the location of the Tcl interpreter 321# used to optimize git-gui for your system. Only used if NO_TCLTK 322# is not set. Defaults to the bare 'tclsh'. 323# 324# The TCLTK_PATH variable governs the location of the Tcl/Tk interpreter. 325# If not set it defaults to the bare 'wish'. If it is set to the empty 326# string then NO_TCLTK will be forced (this is used by configure script). 327# 328# Define INTERNAL_QSORT to use Git's implementation of qsort(), which 329# is a simplified version of the merge sort used in glibc. This is 330# recommended if Git triggers O(n^2) behavior in your platform's qsort(). 331# 332# Define HAVE_ISO_QSORT_S if your platform provides a qsort_s() that's 333# compatible with the one described in C11 Annex K. 334# 335# Define UNRELIABLE_FSTAT if your system's fstat does not return the same 336# information on a not yet closed file that lstat would return for the same 337# file after it was closed. 338# 339# Define OBJECT_CREATION_USES_RENAMES if your operating systems has problems 340# when hardlinking a file to another name and unlinking the original file right 341# away (some NTFS drivers seem to zero the contents in that scenario). 342# 343# Define INSTALL_SYMLINKS if you prefer to have everything that can be 344# symlinked between bin/ and libexec/ to use relative symlinks between 345# the two. This option overrides NO_CROSS_DIRECTORY_HARDLINKS and 346# NO_INSTALL_HARDLINKS which will also use symlinking by indirection 347# within the same directory in some cases, INSTALL_SYMLINKS will 348# always symlink to the final target directly. 349# 350# Define NO_CROSS_DIRECTORY_HARDLINKS if you plan to distribute the installed 351# programs as a tar, where bin/ and libexec/ might be on different file systems. 352# 353# Define NO_INSTALL_HARDLINKS if you prefer to use either symbolic links or 354# copies to install built-in git commands e.g. git-cat-file. 355# 356# Define USE_NED_ALLOCATOR if you want to replace the platforms default 357# memory allocators with the nedmalloc allocator written by Niall Douglas. 358# 359# Define OVERRIDE_STRDUP to override the libc version of strdup(3). 360# This is necessary when using a custom allocator in order to avoid 361# crashes due to allocation and free working on different 'heaps'. 362# It's defined automatically if USE_NED_ALLOCATOR is set. 363# 364# Define NO_REGEX if your C library lacks regex support with REG_STARTEND 365# feature. 366# 367# Define HAVE_DEV_TTY if your system can open /dev/tty to interact with the 368# user. 369# 370# Define JSMIN to point to JavaScript minifier that functions as 371# a filter to have gitweb.js minified. 372# 373# Define CSSMIN to point to a CSS minifier in order to generate a minified 374# version of gitweb.css 375# 376# Define DEFAULT_PAGER to a sensible pager command (defaults to "less") if 377# you want to use something different. The value will be interpreted by the 378# shell at runtime when it is used. 379# 380# Define DEFAULT_EDITOR to a sensible editor command (defaults to "vi") if you 381# want to use something different. The value will be interpreted by the shell 382# if necessary when it is used. Examples: 383# 384# DEFAULT_EDITOR='~/bin/vi', 385# DEFAULT_EDITOR='$GIT_FALLBACK_EDITOR', 386# DEFAULT_EDITOR='"C:\Program Files\Vim\gvim.exe" --nofork' 387# 388# Define COMPUTE_HEADER_DEPENDENCIES to "yes" if you want dependencies on 389# header files to be automatically computed, to avoid rebuilding objects when 390# an unrelated header file changes. Define it to "no" to use the hard-coded 391# dependency rules. The default is "auto", which means to use computed header 392# dependencies if your compiler is detected to support it. 393# 394# Define NATIVE_CRLF if your platform uses CRLF for line endings. 395# 396# Define GIT_USER_AGENT if you want to change how git identifies itself during 397# network interactions. The default is "git/$(GIT_VERSION)". 398# 399# Define DEFAULT_HELP_FORMAT to "man", "info" or "html" 400# (defaults to "man") if you want to have a different default when 401# "git help" is called without a parameter specifying the format. 402# 403# Define GIT_TEST_INDEX_VERSION to 2, 3 or 4 to run the test suite 404# with a different indexfile format version. If it isn't set the index 405# file format used is index-v[23]. 406# 407# Define GMTIME_UNRELIABLE_ERRORS if your gmtime() function does not 408# return NULL when it receives a bogus time_t. 409# 410# Define HAVE_CLOCK_GETTIME if your platform has clock_gettime. 411# 412# Define HAVE_CLOCK_MONOTONIC if your platform has CLOCK_MONOTONIC. 413# 414# Define NEEDS_LIBRT if your platform requires linking with librt (glibc version 415# before 2.17) for clock_gettime and CLOCK_MONOTONIC. 416# 417# Define USE_PARENS_AROUND_GETTEXT_N to "yes" if your compiler happily 418# compiles the following initialization: 419# 420# static const char s[] = ("FOO"); 421# 422# and define it to "no" if you need to remove the parentheses () around the 423# constant. The default is "auto", which means to use parentheses if your 424# compiler is detected to support it. 425# 426# Define HAVE_BSD_SYSCTL if your platform has a BSD-compatible sysctl function. 427# 428# Define HAVE_GETDELIM if your system has the getdelim() function. 429# 430# Define FILENO_IS_A_MACRO if fileno() is a macro, not a real function. 431# 432# Define PAGER_ENV to a SP separated VAR=VAL pairs to define 433# default environment variables to be passed when a pager is spawned, e.g. 434# 435# PAGER_ENV = LESS=FRX LV=-c 436# 437# to say "export LESS=FRX (and LV=-c) if the environment variable 438# LESS (and LV) is not set, respectively". 439# 440# Define TEST_SHELL_PATH if you want to use a shell besides SHELL_PATH for 441# running the test scripts (e.g., bash has better support for "set -x" 442# tracing). 443# 444# When cross-compiling, define HOST_CPU as the canonical name of the CPU on 445# which the built Git will run (for instance "x86_64"). 446# 447# Define RUNTIME_PREFIX to configure Git to resolve its ancillary tooling and 448# support files relative to the location of the runtime binary, rather than 449# hard-coding them into the binary. Git installations built with RUNTIME_PREFIX 450# can be moved to arbitrary filesystem locations. RUNTIME_PREFIX also causes 451# Perl scripts to use a modified entry point header allowing them to resolve 452# support files at runtime. 453# 454# When using RUNTIME_PREFIX, define HAVE_BSD_KERN_PROC_SYSCTL if your platform 455# supports the KERN_PROC BSD sysctl function. 456# 457# When using RUNTIME_PREFIX, define PROCFS_EXECUTABLE_PATH if your platform 458# mounts a "procfs" filesystem capable of resolving the path of the current 459# executable. If defined, this must be the canonical path for the "procfs" 460# current executable path. 461# 462# When using RUNTIME_PREFIX, define HAVE_NS_GET_EXECUTABLE_PATH if your platform 463# supports calling _NSGetExecutablePath to retrieve the path of the running 464# executable. 465# 466# When using RUNTIME_PREFIX, define HAVE_WPGMPTR if your platform offers 467# the global variable _wpgmptr containing the absolute path of the current 468# executable (this is the case on Windows). 469# 470# Define DEVELOPER to enable more compiler warnings. Compiler version 471# and family are auto detected, but could be overridden by defining 472# COMPILER_FEATURES (see config.mak.dev) 473# 474# When DEVELOPER is set, DEVOPTS can be used to control compiler 475# options. This variable contains keywords separated by 476# whitespace. The following keywords are are recognized: 477# 478# no-error: 479# 480# suppresses the -Werror that implicitly comes with 481# DEVELOPER=1. Useful for getting the full set of errors 482# without immediately dying, or for logging them. 483# 484# extra-all: 485# 486# The DEVELOPER mode enables -Wextra with a few exceptions. By 487# setting this flag the exceptions are removed, and all of 488# -Wextra is used. 489# 490# pedantic: 491# 492# Enable -pedantic compilation. This also disables 493# USE_PARENS_AROUND_GETTEXT_N to produce only relevant warnings. 494 495GIT-VERSION-FILE: FORCE 496 @$(SHELL_PATH) ./GIT-VERSION-GEN 497-include GIT-VERSION-FILE 498 499# CFLAGS and LDFLAGS are for the users to override from the command line. 500 501CFLAGS = -g -O2 -Wall 502LDFLAGS = 503ALL_CFLAGS = $(CPPFLAGS) $(CFLAGS) 504ALL_LDFLAGS = $(LDFLAGS) 505STRIP ?= strip 506 507# Create as necessary, replace existing, make ranlib unneeded. 508ARFLAGS = rcs 509 510# Among the variables below, these: 511# gitexecdir 512# template_dir 513# sysconfdir 514# can be specified as a relative path some/where/else; 515# this is interpreted as relative to $(prefix) and "git" at 516# runtime figures out where they are based on the path to the executable. 517# Additionally, the following will be treated as relative by "git" if they 518# begin with "$(prefix)/": 519# mandir 520# infodir 521# htmldir 522# localedir 523# perllibdir 524# This can help installing the suite in a relocatable way. 525 526prefix = $(HOME) 527bindir = $(prefix)/bin 528mandir = $(prefix)/share/man 529infodir = $(prefix)/share/info 530gitexecdir = libexec/git-core 531mergetoolsdir = $(gitexecdir)/mergetools 532sharedir = $(prefix)/share 533gitwebdir = $(sharedir)/gitweb 534perllibdir = $(sharedir)/perl5 535localedir = $(sharedir)/locale 536template_dir = share/git-core/templates 537htmldir = $(prefix)/share/doc/git-doc 538ETC_GITCONFIG = $(sysconfdir)/gitconfig 539ETC_GITATTRIBUTES = $(sysconfdir)/gitattributes 540lib = lib 541# DESTDIR = 542pathsep = : 543 544bindir_relative = $(patsubst $(prefix)/%,%,$(bindir)) 545mandir_relative = $(patsubst $(prefix)/%,%,$(mandir)) 546infodir_relative = $(patsubst $(prefix)/%,%,$(infodir)) 547gitexecdir_relative = $(patsubst $(prefix)/%,%,$(gitexecdir)) 548localedir_relative = $(patsubst $(prefix)/%,%,$(localedir)) 549htmldir_relative = $(patsubst $(prefix)/%,%,$(htmldir)) 550perllibdir_relative = $(patsubst $(prefix)/%,%,$(perllibdir)) 551 552export prefix bindir sharedir sysconfdir gitwebdir perllibdir localedir 553 554CC = cc 555AR = ar 556RM = rm -f 557DIFF = diff 558TAR = tar 559FIND = find 560INSTALL = install 561TCL_PATH = tclsh 562TCLTK_PATH = wish 563XGETTEXT = xgettext 564MSGFMT = msgfmt 565CURL_CONFIG = curl-config 566PTHREAD_LIBS = -lpthread 567PTHREAD_CFLAGS = 568GCOV = gcov 569SPATCH = spatch 570 571export TCL_PATH TCLTK_PATH 572 573SPARSE_FLAGS = 574SPATCH_FLAGS = --all-includes --patch . 575 576 577 578### --- END CONFIGURATION SECTION --- 579 580# Those must not be GNU-specific; they are shared with perl/ which may 581# be built by a different compiler. (Note that this is an artifact now 582# but it still might be nice to keep that distinction.) 583BASIC_CFLAGS = -I. 584BASIC_LDFLAGS = 585 586# Guard against environment variables 587BUILTIN_OBJS = 588BUILT_INS = 589COMPAT_CFLAGS = 590COMPAT_OBJS = 591XDIFF_OBJS = 592VCSSVN_OBJS = 593GENERATED_H = 594EXTRA_CPPFLAGS = 595FUZZ_OBJS = 596FUZZ_PROGRAMS = 597LIB_OBJS = 598PROGRAM_OBJS = 599PROGRAMS = 600SCRIPT_PERL = 601SCRIPT_PYTHON = 602SCRIPT_SH = 603SCRIPT_LIB = 604TEST_BUILTINS_OBJS = 605TEST_PROGRAMS_NEED_X = 606 607# Having this variable in your environment would break pipelines because 608# you cause "cd" to echo its destination to stdout. It can also take 609# scripts to unexpected places. If you like CDPATH, define it for your 610# interactive shell sessions without exporting it. 611unexport CDPATH 612 613SCRIPT_SH += git-bisect.sh 614SCRIPT_SH += git-difftool--helper.sh 615SCRIPT_SH += git-filter-branch.sh 616SCRIPT_SH += git-merge-octopus.sh 617SCRIPT_SH += git-merge-one-file.sh 618SCRIPT_SH += git-merge-resolve.sh 619SCRIPT_SH += git-mergetool.sh 620SCRIPT_SH += git-quiltimport.sh 621SCRIPT_SH += git-legacy-rebase.sh 622SCRIPT_SH += git-remote-testgit.sh 623SCRIPT_SH += git-request-pull.sh 624SCRIPT_SH += git-stash.sh 625SCRIPT_SH += git-submodule.sh 626SCRIPT_SH += git-web--browse.sh 627 628SCRIPT_LIB += git-mergetool--lib 629SCRIPT_LIB += git-parse-remote 630SCRIPT_LIB += git-rebase--am 631SCRIPT_LIB += git-rebase--common 632SCRIPT_LIB += git-rebase--preserve-merges 633SCRIPT_LIB += git-rebase--merge 634SCRIPT_LIB += git-sh-setup 635SCRIPT_LIB += git-sh-i18n 636 637SCRIPT_PERL += git-add--interactive.perl 638SCRIPT_PERL += git-archimport.perl 639SCRIPT_PERL += git-cvsexportcommit.perl 640SCRIPT_PERL += git-cvsimport.perl 641SCRIPT_PERL += git-cvsserver.perl 642SCRIPT_PERL += git-send-email.perl 643SCRIPT_PERL += git-svn.perl 644 645SCRIPT_PYTHON += git-p4.py 646 647NO_INSTALL += git-remote-testgit 648 649# Generated files for scripts 650SCRIPT_SH_GEN = $(patsubst %.sh,%,$(SCRIPT_SH)) 651SCRIPT_PERL_GEN = $(patsubst %.perl,%,$(SCRIPT_PERL)) 652SCRIPT_PYTHON_GEN = $(patsubst %.py,%,$(SCRIPT_PYTHON)) 653 654SCRIPT_SH_INS = $(filter-out $(NO_INSTALL),$(SCRIPT_SH_GEN)) 655SCRIPT_PERL_INS = $(filter-out $(NO_INSTALL),$(SCRIPT_PERL_GEN)) 656SCRIPT_PYTHON_INS = $(filter-out $(NO_INSTALL),$(SCRIPT_PYTHON_GEN)) 657 658# Individual rules to allow e.g. 659# "make -C ../.. SCRIPT_PERL=contrib/foo/bar.perl build-perl-script" 660# from subdirectories like contrib/*/ 661.PHONY: build-perl-script build-sh-script build-python-script 662build-perl-script: $(SCRIPT_PERL_GEN) 663build-sh-script: $(SCRIPT_SH_GEN) 664build-python-script: $(SCRIPT_PYTHON_GEN) 665 666.PHONY: install-perl-script install-sh-script install-python-script 667install-sh-script: $(SCRIPT_SH_INS) 668 $(INSTALL) $^ '$(DESTDIR_SQ)$(gitexec_instdir_SQ)' 669install-perl-script: $(SCRIPT_PERL_INS) 670 $(INSTALL) $^ '$(DESTDIR_SQ)$(gitexec_instdir_SQ)' 671install-python-script: $(SCRIPT_PYTHON_INS) 672 $(INSTALL) $^ '$(DESTDIR_SQ)$(gitexec_instdir_SQ)' 673 674.PHONY: clean-perl-script clean-sh-script clean-python-script 675clean-sh-script: 676 $(RM) $(SCRIPT_SH_GEN) 677clean-perl-script: 678 $(RM) $(SCRIPT_PERL_GEN) 679clean-python-script: 680 $(RM) $(SCRIPT_PYTHON_GEN) 681 682SCRIPTS = $(SCRIPT_SH_INS) \ 683 $(SCRIPT_PERL_INS) \ 684 $(SCRIPT_PYTHON_INS) \ 685 git-instaweb 686 687ETAGS_TARGET = TAGS 688 689FUZZ_OBJS += fuzz-pack-headers.o 690FUZZ_OBJS += fuzz-pack-idx.o 691 692# Always build fuzz objects even if not testing, to prevent bit-rot. 693all:: $(FUZZ_OBJS) 694 695FUZZ_PROGRAMS += $(patsubst %.o,%,$(FUZZ_OBJS)) 696 697# Empty... 698EXTRA_PROGRAMS = 699 700# ... and all the rest that could be moved out of bindir to gitexecdir 701PROGRAMS += $(EXTRA_PROGRAMS) 702 703PROGRAM_OBJS += credential-store.o 704PROGRAM_OBJS += daemon.o 705PROGRAM_OBJS += fast-import.o 706PROGRAM_OBJS += http-backend.o 707PROGRAM_OBJS += imap-send.o 708PROGRAM_OBJS += sh-i18n--envsubst.o 709PROGRAM_OBJS += shell.o 710PROGRAM_OBJS += remote-testsvn.o 711 712# Binary suffix, set to .exe for Windows builds 713X = 714 715PROGRAMS += $(patsubst %.o,git-%$X,$(PROGRAM_OBJS)) 716 717TEST_BUILTINS_OBJS += test-chmtime.o 718TEST_BUILTINS_OBJS += test-config.o 719TEST_BUILTINS_OBJS += test-ctype.o 720TEST_BUILTINS_OBJS += test-date.o 721TEST_BUILTINS_OBJS += test-delta.o 722TEST_BUILTINS_OBJS += test-drop-caches.o 723TEST_BUILTINS_OBJS += test-dump-cache-tree.o 724TEST_BUILTINS_OBJS += test-dump-fsmonitor.o 725TEST_BUILTINS_OBJS += test-dump-split-index.o 726TEST_BUILTINS_OBJS += test-dump-untracked-cache.o 727TEST_BUILTINS_OBJS += test-example-decorate.o 728TEST_BUILTINS_OBJS += test-genrandom.o 729TEST_BUILTINS_OBJS += test-hashmap.o 730TEST_BUILTINS_OBJS += test-index-version.o 731TEST_BUILTINS_OBJS += test-json-writer.o 732TEST_BUILTINS_OBJS += test-lazy-init-name-hash.o 733TEST_BUILTINS_OBJS += test-match-trees.o 734TEST_BUILTINS_OBJS += test-mergesort.o 735TEST_BUILTINS_OBJS += test-mktemp.o 736TEST_BUILTINS_OBJS += test-online-cpus.o 737TEST_BUILTINS_OBJS += test-parse-options.o 738TEST_BUILTINS_OBJS += test-path-utils.o 739TEST_BUILTINS_OBJS += test-pkt-line.o 740TEST_BUILTINS_OBJS += test-prio-queue.o 741TEST_BUILTINS_OBJS += test-reach.o 742TEST_BUILTINS_OBJS += test-read-cache.o 743TEST_BUILTINS_OBJS += test-read-midx.o 744TEST_BUILTINS_OBJS += test-ref-store.o 745TEST_BUILTINS_OBJS += test-regex.o 746TEST_BUILTINS_OBJS += test-repository.o 747TEST_BUILTINS_OBJS += test-revision-walking.o 748TEST_BUILTINS_OBJS += test-run-command.o 749TEST_BUILTINS_OBJS += test-scrap-cache-tree.o 750TEST_BUILTINS_OBJS += test-sha1.o 751TEST_BUILTINS_OBJS += test-sha1-array.o 752TEST_BUILTINS_OBJS += test-sigchain.o 753TEST_BUILTINS_OBJS += test-strcmp-offset.o 754TEST_BUILTINS_OBJS += test-string-list.o 755TEST_BUILTINS_OBJS += test-submodule-config.o 756TEST_BUILTINS_OBJS += test-submodule-nested-repo-config.o 757TEST_BUILTINS_OBJS += test-subprocess.o 758TEST_BUILTINS_OBJS += test-urlmatch-normalization.o 759TEST_BUILTINS_OBJS += test-wildmatch.o 760TEST_BUILTINS_OBJS += test-windows-named-pipe.o 761TEST_BUILTINS_OBJS += test-write-cache.o 762 763# Do not add more tests here unless they have extra dependencies. Add 764# them in TEST_BUILTINS_OBJS above. 765TEST_PROGRAMS_NEED_X += test-fake-ssh 766TEST_PROGRAMS_NEED_X += test-line-buffer 767TEST_PROGRAMS_NEED_X += test-svn-fe 768TEST_PROGRAMS_NEED_X += test-tool 769 770TEST_PROGRAMS = $(patsubst %,t/helper/%$X,$(TEST_PROGRAMS_NEED_X)) 771 772# List built-in command $C whose implementation cmd_$C() is not in 773# builtin/$C.o but is linked in as part of some other command. 774BUILT_INS += $(patsubst builtin/%.o,git-%$X,$(BUILTIN_OBJS)) 775 776BUILT_INS += git-cherry$X 777BUILT_INS += git-cherry-pick$X 778BUILT_INS += git-format-patch$X 779BUILT_INS += git-fsck-objects$X 780BUILT_INS += git-init$X 781BUILT_INS += git-merge-subtree$X 782BUILT_INS += git-show$X 783BUILT_INS += git-stage$X 784BUILT_INS += git-status$X 785BUILT_INS += git-whatchanged$X 786 787# what 'all' will build and 'install' will install in gitexecdir, 788# excluding programs for built-in commands 789ALL_PROGRAMS = $(PROGRAMS) $(SCRIPTS) 790 791# what 'all' will build but not install in gitexecdir 792OTHER_PROGRAMS = git$X 793 794# what test wrappers are needed and 'install' will install, in bindir 795BINDIR_PROGRAMS_NEED_X += git 796BINDIR_PROGRAMS_NEED_X += git-upload-pack 797BINDIR_PROGRAMS_NEED_X += git-receive-pack 798BINDIR_PROGRAMS_NEED_X += git-upload-archive 799BINDIR_PROGRAMS_NEED_X += git-shell 800 801BINDIR_PROGRAMS_NO_X += git-cvsserver 802 803# Set paths to tools early so that they can be used for version tests. 804ifndef SHELL_PATH 805 SHELL_PATH = /bin/sh 806endif 807ifndef PERL_PATH 808 PERL_PATH = /usr/bin/perl 809endif 810ifndef PYTHON_PATH 811 PYTHON_PATH = /usr/bin/python 812endif 813 814export PERL_PATH 815export PYTHON_PATH 816 817TEST_SHELL_PATH = $(SHELL_PATH) 818 819LIB_FILE = libgit.a 820XDIFF_LIB = xdiff/lib.a 821VCSSVN_LIB = vcs-svn/lib.a 822 823GENERATED_H += command-list.h 824 825LIB_H = $(shell $(FIND) . \ 826 -name .git -prune -o \ 827 -name t -prune -o \ 828 -name Documentation -prune -o \ 829 -name '*.h' -print) 830 831LIB_OBJS += abspath.o 832LIB_OBJS += advice.o 833LIB_OBJS += alias.o 834LIB_OBJS += alloc.o 835LIB_OBJS += apply.o 836LIB_OBJS += archive.o 837LIB_OBJS += archive-tar.o 838LIB_OBJS += archive-zip.o 839LIB_OBJS += argv-array.o 840LIB_OBJS += attr.o 841LIB_OBJS += base85.o 842LIB_OBJS += bisect.o 843LIB_OBJS += blame.o 844LIB_OBJS += blob.o 845LIB_OBJS += branch.o 846LIB_OBJS += bulk-checkin.o 847LIB_OBJS += bundle.o 848LIB_OBJS += cache-tree.o 849LIB_OBJS += chdir-notify.o 850LIB_OBJS += checkout.o 851LIB_OBJS += color.o 852LIB_OBJS += column.o 853LIB_OBJS += combine-diff.o 854LIB_OBJS += commit.o 855LIB_OBJS += commit-graph.o 856LIB_OBJS += commit-reach.o 857LIB_OBJS += compat/obstack.o 858LIB_OBJS += compat/terminal.o 859LIB_OBJS += config.o 860LIB_OBJS += connect.o 861LIB_OBJS += connected.o 862LIB_OBJS += convert.o 863LIB_OBJS += copy.o 864LIB_OBJS += credential.o 865LIB_OBJS += csum-file.o 866LIB_OBJS += ctype.o 867LIB_OBJS += date.o 868LIB_OBJS += decorate.o 869LIB_OBJS += delta-islands.o 870LIB_OBJS += diffcore-break.o 871LIB_OBJS += diffcore-delta.o 872LIB_OBJS += diffcore-order.o 873LIB_OBJS += diffcore-pickaxe.o 874LIB_OBJS += diffcore-rename.o 875LIB_OBJS += diff-delta.o 876LIB_OBJS += diff-lib.o 877LIB_OBJS += diff-no-index.o 878LIB_OBJS += diff.o 879LIB_OBJS += dir.o 880LIB_OBJS += dir-iterator.o 881LIB_OBJS += editor.o 882LIB_OBJS += entry.o 883LIB_OBJS += environment.o 884LIB_OBJS += ewah/bitmap.o 885LIB_OBJS += ewah/ewah_bitmap.o 886LIB_OBJS += ewah/ewah_io.o 887LIB_OBJS += ewah/ewah_rlw.o 888LIB_OBJS += exec-cmd.o 889LIB_OBJS += fetch-negotiator.o 890LIB_OBJS += fetch-object.o 891LIB_OBJS += fetch-pack.o 892LIB_OBJS += fsck.o 893LIB_OBJS += fsmonitor.o 894LIB_OBJS += gettext.o 895LIB_OBJS += gpg-interface.o 896LIB_OBJS += graph.o 897LIB_OBJS += grep.o 898LIB_OBJS += hashmap.o 899LIB_OBJS += linear-assignment.o 900LIB_OBJS += help.o 901LIB_OBJS += hex.o 902LIB_OBJS += ident.o 903LIB_OBJS += interdiff.o 904LIB_OBJS += json-writer.o 905LIB_OBJS += kwset.o 906LIB_OBJS += levenshtein.o 907LIB_OBJS += line-log.o 908LIB_OBJS += line-range.o 909LIB_OBJS += list-objects.o 910LIB_OBJS += list-objects-filter.o 911LIB_OBJS += list-objects-filter-options.o 912LIB_OBJS += ll-merge.o 913LIB_OBJS += lockfile.o 914LIB_OBJS += log-tree.o 915LIB_OBJS += ls-refs.o 916LIB_OBJS += mailinfo.o 917LIB_OBJS += mailmap.o 918LIB_OBJS += match-trees.o 919LIB_OBJS += mem-pool.o 920LIB_OBJS += merge.o 921LIB_OBJS += merge-blobs.o 922LIB_OBJS += merge-recursive.o 923LIB_OBJS += mergesort.o 924LIB_OBJS += midx.o 925LIB_OBJS += name-hash.o 926LIB_OBJS += negotiator/default.o 927LIB_OBJS += negotiator/skipping.o 928LIB_OBJS += notes.o 929LIB_OBJS += notes-cache.o 930LIB_OBJS += notes-merge.o 931LIB_OBJS += notes-utils.o 932LIB_OBJS += object.o 933LIB_OBJS += oidmap.o 934LIB_OBJS += oidset.o 935LIB_OBJS += packfile.o 936LIB_OBJS += pack-bitmap.o 937LIB_OBJS += pack-bitmap-write.o 938LIB_OBJS += pack-check.o 939LIB_OBJS += pack-objects.o 940LIB_OBJS += pack-revindex.o 941LIB_OBJS += pack-write.o 942LIB_OBJS += pager.o 943LIB_OBJS += parse-options.o 944LIB_OBJS += parse-options-cb.o 945LIB_OBJS += patch-delta.o 946LIB_OBJS += patch-ids.o 947LIB_OBJS += path.o 948LIB_OBJS += pathspec.o 949LIB_OBJS += pkt-line.o 950LIB_OBJS += preload-index.o 951LIB_OBJS += pretty.o 952LIB_OBJS += prio-queue.o 953LIB_OBJS += progress.o 954LIB_OBJS += prompt.o 955LIB_OBJS += protocol.o 956LIB_OBJS += quote.o 957LIB_OBJS += range-diff.o 958LIB_OBJS += reachable.o 959LIB_OBJS += read-cache.o 960LIB_OBJS += rebase-interactive.o 961LIB_OBJS += reflog-walk.o 962LIB_OBJS += refs.o 963LIB_OBJS += refs/files-backend.o 964LIB_OBJS += refs/iterator.o 965LIB_OBJS += refs/packed-backend.o 966LIB_OBJS += refs/ref-cache.o 967LIB_OBJS += refspec.o 968LIB_OBJS += ref-filter.o 969LIB_OBJS += remote.o 970LIB_OBJS += replace-object.o 971LIB_OBJS += repository.o 972LIB_OBJS += rerere.o 973LIB_OBJS += resolve-undo.o 974LIB_OBJS += revision.o 975LIB_OBJS += run-command.o 976LIB_OBJS += send-pack.o 977LIB_OBJS += sequencer.o 978LIB_OBJS += serve.o 979LIB_OBJS += server-info.o 980LIB_OBJS += setup.o 981LIB_OBJS += sha1-array.o 982LIB_OBJS += sha1-lookup.o 983LIB_OBJS += sha1-file.o 984LIB_OBJS += sha1-name.o 985LIB_OBJS += shallow.o 986LIB_OBJS += sideband.o 987LIB_OBJS += sigchain.o 988LIB_OBJS += split-index.o 989LIB_OBJS += strbuf.o 990LIB_OBJS += streaming.o 991LIB_OBJS += string-list.o 992LIB_OBJS += submodule.o 993LIB_OBJS += submodule-config.o 994LIB_OBJS += sub-process.o 995LIB_OBJS += symlinks.o 996LIB_OBJS += tag.o 997LIB_OBJS += tempfile.o 998LIB_OBJS += thread-utils.o 999LIB_OBJS += tmp-objdir.o1000LIB_OBJS += trace.o1001LIB_OBJS += trailer.o1002LIB_OBJS += transport.o1003LIB_OBJS += transport-helper.o1004LIB_OBJS += tree-diff.o1005LIB_OBJS += tree.o1006LIB_OBJS += tree-walk.o1007LIB_OBJS += unpack-trees.o1008LIB_OBJS += upload-pack.o1009LIB_OBJS += url.o1010LIB_OBJS += urlmatch.o1011LIB_OBJS += usage.o1012LIB_OBJS += userdiff.o1013LIB_OBJS += utf8.o1014LIB_OBJS += varint.o1015LIB_OBJS += version.o1016LIB_OBJS += versioncmp.o1017LIB_OBJS += walker.o1018LIB_OBJS += wildmatch.o1019LIB_OBJS += worktree.o1020LIB_OBJS += wrapper.o1021LIB_OBJS += write-or-die.o1022LIB_OBJS += ws.o1023LIB_OBJS += wt-status.o1024LIB_OBJS += xdiff-interface.o1025LIB_OBJS += zlib.o10261027BUILTIN_OBJS += builtin/add.o1028BUILTIN_OBJS += builtin/am.o1029BUILTIN_OBJS += builtin/annotate.o1030BUILTIN_OBJS += builtin/apply.o1031BUILTIN_OBJS += builtin/archive.o1032BUILTIN_OBJS += builtin/bisect--helper.o1033BUILTIN_OBJS += builtin/blame.o1034BUILTIN_OBJS += builtin/branch.o1035BUILTIN_OBJS += builtin/bundle.o1036BUILTIN_OBJS += builtin/cat-file.o1037BUILTIN_OBJS += builtin/check-attr.o1038BUILTIN_OBJS += builtin/check-ignore.o1039BUILTIN_OBJS += builtin/check-mailmap.o1040BUILTIN_OBJS += builtin/check-ref-format.o1041BUILTIN_OBJS += builtin/checkout-index.o1042BUILTIN_OBJS += builtin/checkout.o1043BUILTIN_OBJS += builtin/clean.o1044BUILTIN_OBJS += builtin/clone.o1045BUILTIN_OBJS += builtin/column.o1046BUILTIN_OBJS += builtin/commit-tree.o1047BUILTIN_OBJS += builtin/commit.o1048BUILTIN_OBJS += builtin/commit-graph.o1049BUILTIN_OBJS += builtin/config.o1050BUILTIN_OBJS += builtin/count-objects.o1051BUILTIN_OBJS += builtin/credential.o1052BUILTIN_OBJS += builtin/describe.o1053BUILTIN_OBJS += builtin/diff-files.o1054BUILTIN_OBJS += builtin/diff-index.o1055BUILTIN_OBJS += builtin/diff-tree.o1056BUILTIN_OBJS += builtin/diff.o1057BUILTIN_OBJS += builtin/difftool.o1058BUILTIN_OBJS += builtin/fast-export.o1059BUILTIN_OBJS += builtin/fetch-pack.o1060BUILTIN_OBJS += builtin/fetch.o1061BUILTIN_OBJS += builtin/fmt-merge-msg.o1062BUILTIN_OBJS += builtin/for-each-ref.o1063BUILTIN_OBJS += builtin/fsck.o1064BUILTIN_OBJS += builtin/gc.o1065BUILTIN_OBJS += builtin/get-tar-commit-id.o1066BUILTIN_OBJS += builtin/grep.o1067BUILTIN_OBJS += builtin/hash-object.o1068BUILTIN_OBJS += builtin/help.o1069BUILTIN_OBJS += builtin/index-pack.o1070BUILTIN_OBJS += builtin/init-db.o1071BUILTIN_OBJS += builtin/interpret-trailers.o1072BUILTIN_OBJS += builtin/log.o1073BUILTIN_OBJS += builtin/ls-files.o1074BUILTIN_OBJS += builtin/ls-remote.o1075BUILTIN_OBJS += builtin/ls-tree.o1076BUILTIN_OBJS += builtin/mailinfo.o1077BUILTIN_OBJS += builtin/mailsplit.o1078BUILTIN_OBJS += builtin/merge.o1079BUILTIN_OBJS += builtin/merge-base.o1080BUILTIN_OBJS += builtin/merge-file.o1081BUILTIN_OBJS += builtin/merge-index.o1082BUILTIN_OBJS += builtin/merge-ours.o1083BUILTIN_OBJS += builtin/merge-recursive.o1084BUILTIN_OBJS += builtin/merge-tree.o1085BUILTIN_OBJS += builtin/mktag.o1086BUILTIN_OBJS += builtin/mktree.o1087BUILTIN_OBJS += builtin/multi-pack-index.o1088BUILTIN_OBJS += builtin/mv.o1089BUILTIN_OBJS += builtin/name-rev.o1090BUILTIN_OBJS += builtin/notes.o1091BUILTIN_OBJS += builtin/pack-objects.o1092BUILTIN_OBJS += builtin/pack-redundant.o1093BUILTIN_OBJS += builtin/pack-refs.o1094BUILTIN_OBJS += builtin/patch-id.o1095BUILTIN_OBJS += builtin/prune-packed.o1096BUILTIN_OBJS += builtin/prune.o1097BUILTIN_OBJS += builtin/pull.o1098BUILTIN_OBJS += builtin/push.o1099BUILTIN_OBJS += builtin/range-diff.o1100BUILTIN_OBJS += builtin/read-tree.o1101BUILTIN_OBJS += builtin/rebase.o1102BUILTIN_OBJS += builtin/rebase--interactive.o1103BUILTIN_OBJS += builtin/receive-pack.o1104BUILTIN_OBJS += builtin/reflog.o1105BUILTIN_OBJS += builtin/remote.o1106BUILTIN_OBJS += builtin/remote-ext.o1107BUILTIN_OBJS += builtin/remote-fd.o1108BUILTIN_OBJS += builtin/repack.o1109BUILTIN_OBJS += builtin/replace.o1110BUILTIN_OBJS += builtin/rerere.o1111BUILTIN_OBJS += builtin/reset.o1112BUILTIN_OBJS += builtin/rev-list.o1113BUILTIN_OBJS += builtin/rev-parse.o1114BUILTIN_OBJS += builtin/revert.o1115BUILTIN_OBJS += builtin/rm.o1116BUILTIN_OBJS += builtin/send-pack.o1117BUILTIN_OBJS += builtin/serve.o1118BUILTIN_OBJS += builtin/shortlog.o1119BUILTIN_OBJS += builtin/show-branch.o1120BUILTIN_OBJS += builtin/show-index.o1121BUILTIN_OBJS += builtin/show-ref.o1122BUILTIN_OBJS += builtin/stripspace.o1123BUILTIN_OBJS += builtin/submodule--helper.o1124BUILTIN_OBJS += builtin/symbolic-ref.o1125BUILTIN_OBJS += builtin/tag.o1126BUILTIN_OBJS += builtin/unpack-file.o1127BUILTIN_OBJS += builtin/unpack-objects.o1128BUILTIN_OBJS += builtin/update-index.o1129BUILTIN_OBJS += builtin/update-ref.o1130BUILTIN_OBJS += builtin/update-server-info.o1131BUILTIN_OBJS += builtin/upload-archive.o1132BUILTIN_OBJS += builtin/upload-pack.o1133BUILTIN_OBJS += builtin/var.o1134BUILTIN_OBJS += builtin/verify-commit.o1135BUILTIN_OBJS += builtin/verify-pack.o1136BUILTIN_OBJS += builtin/verify-tag.o1137BUILTIN_OBJS += builtin/worktree.o1138BUILTIN_OBJS += builtin/write-tree.o11391140GITLIBS = common-main.o $(LIB_FILE) $(XDIFF_LIB)1141EXTLIBS =11421143GIT_USER_AGENT = git/$(GIT_VERSION)11441145ifeq ($(wildcard sha1collisiondetection/lib/sha1.h),sha1collisiondetection/lib/sha1.h)1146DC_SHA1_SUBMODULE = auto1147endif11481149include config.mak.uname1150-include config.mak.autogen1151-include config.mak11521153ifdef DEVELOPER1154include config.mak.dev1155endif11561157comma := ,1158empty :=1159space := $(empty) $(empty)11601161ifdef SANITIZE1162SANITIZERS := $(foreach flag,$(subst $(comma),$(space),$(SANITIZE)),$(flag))1163BASIC_CFLAGS += -fsanitize=$(SANITIZE) -fno-sanitize-recover=$(SANITIZE)1164BASIC_CFLAGS += -fno-omit-frame-pointer1165ifneq ($(filter undefined,$(SANITIZERS)),)1166BASIC_CFLAGS += -DNO_UNALIGNED_LOADS1167endif1168ifneq ($(filter leak,$(SANITIZERS)),)1169BASIC_CFLAGS += -DSUPPRESS_ANNOTATED_LEAKS1170endif1171endif11721173ifndef sysconfdir1174ifeq ($(prefix),/usr)1175sysconfdir = /etc1176else1177sysconfdir = etc1178endif1179endif11801181ifndef COMPUTE_HEADER_DEPENDENCIES1182COMPUTE_HEADER_DEPENDENCIES = auto1183endif11841185ifeq ($(COMPUTE_HEADER_DEPENDENCIES),auto)1186dep_check = $(shell $(CC) $(ALL_CFLAGS) \1187 -c -MF /dev/null -MQ /dev/null -MMD -MP \1188 -x c /dev/null -o /dev/null 2>&1; \1189 echo $$?)1190ifeq ($(dep_check),0)1191override COMPUTE_HEADER_DEPENDENCIES = yes1192else1193override COMPUTE_HEADER_DEPENDENCIES = no1194endif1195endif11961197ifeq ($(COMPUTE_HEADER_DEPENDENCIES),yes)1198USE_COMPUTED_HEADER_DEPENDENCIES = YesPlease1199else1200ifneq ($(COMPUTE_HEADER_DEPENDENCIES),no)1201$(error please set COMPUTE_HEADER_DEPENDENCIES to yes, no, or auto \1202(not "$(COMPUTE_HEADER_DEPENDENCIES)"))1203endif1204endif12051206ifdef SANE_TOOL_PATH1207SANE_TOOL_PATH_SQ = $(subst ','\'',$(SANE_TOOL_PATH))1208BROKEN_PATH_FIX = 's|^\# @@BROKEN_PATH_FIX@@$$|git_broken_path_fix $(SANE_TOOL_PATH_SQ)|'1209PATH := $(SANE_TOOL_PATH):${PATH}1210else1211BROKEN_PATH_FIX = '/^\# @@BROKEN_PATH_FIX@@$$/d'1212endif12131214ifeq (,$(HOST_CPU))1215 BASIC_CFLAGS += -DGIT_HOST_CPU="\"$(firstword $(subst -, ,$(uname_M)))\""1216else1217 BASIC_CFLAGS += -DGIT_HOST_CPU="\"$(HOST_CPU)\""1218endif12191220ifneq (,$(INLINE))1221 BASIC_CFLAGS += -Dinline=$(INLINE)1222endif12231224ifneq (,$(SOCKLEN_T))1225 BASIC_CFLAGS += -Dsocklen_t=$(SOCKLEN_T)1226endif12271228ifeq (yes,$(USE_PARENS_AROUND_GETTEXT_N))1229 BASIC_CFLAGS += -DUSE_PARENS_AROUND_GETTEXT_N=11230else1231ifeq (no,$(USE_PARENS_AROUND_GETTEXT_N))1232 BASIC_CFLAGS += -DUSE_PARENS_AROUND_GETTEXT_N=01233endif1234endif12351236ifeq ($(uname_S),Darwin)1237 ifndef NO_FINK1238 ifeq ($(shell test -d /sw/lib && echo y),y)1239 BASIC_CFLAGS += -I/sw/include1240 BASIC_LDFLAGS += -L/sw/lib1241 endif1242 endif1243 ifndef NO_DARWIN_PORTS1244 ifeq ($(shell test -d /opt/local/lib && echo y),y)1245 BASIC_CFLAGS += -I/opt/local/include1246 BASIC_LDFLAGS += -L/opt/local/lib1247 endif1248 endif1249 ifndef NO_APPLE_COMMON_CRYPTO1250 NO_OPENSSL = YesPlease1251 APPLE_COMMON_CRYPTO = YesPlease1252 COMPAT_CFLAGS += -DAPPLE_COMMON_CRYPTO1253 endif1254 NO_REGEX = YesPlease1255 PTHREAD_LIBS =1256endif12571258ifndef CC_LD_DYNPATH1259 ifdef NO_R_TO_GCC_LINKER1260 # Some gcc does not accept and pass -R to the linker to specify1261 # the runtime dynamic library path.1262 CC_LD_DYNPATH = -Wl,-rpath,1263 else1264 CC_LD_DYNPATH = -R1265 endif1266endif12671268ifdef NO_LIBGEN_H1269 COMPAT_CFLAGS += -DNO_LIBGEN_H1270 COMPAT_OBJS += compat/basename.o1271endif12721273USE_LIBPCRE2 ?= $(USE_LIBPCRE)12741275ifneq (,$(USE_LIBPCRE2))1276 ifdef USE_LIBPCRE11277$(error Only set USE_LIBPCRE2 (or its alias USE_LIBPCRE) or USE_LIBPCRE1, not both!)1278 endif12791280 BASIC_CFLAGS += -DUSE_LIBPCRE21281 EXTLIBS += -lpcre2-81282endif12831284ifdef USE_LIBPCRE11285 BASIC_CFLAGS += -DUSE_LIBPCRE11286 EXTLIBS += -lpcre12871288ifdef NO_LIBPCRE1_JIT1289 BASIC_CFLAGS += -DNO_LIBPCRE1_JIT1290endif1291endif12921293ifdef LIBPCREDIR1294 BASIC_CFLAGS += -I$(LIBPCREDIR)/include1295 EXTLIBS += -L$(LIBPCREDIR)/$(lib) $(CC_LD_DYNPATH)$(LIBPCREDIR)/$(lib)1296endif12971298ifdef HAVE_ALLOCA_H1299 BASIC_CFLAGS += -DHAVE_ALLOCA_H1300endif13011302IMAP_SEND_BUILDDEPS =1303IMAP_SEND_LDFLAGS =13041305ifdef NO_CURL1306 BASIC_CFLAGS += -DNO_CURL1307 REMOTE_CURL_PRIMARY =1308 REMOTE_CURL_ALIASES =1309 REMOTE_CURL_NAMES =1310else1311 ifdef CURLDIR1312 # Try "-Wl,-rpath=$(CURLDIR)/$(lib)" in such a case.1313 BASIC_CFLAGS += -I$(CURLDIR)/include1314 CURL_LIBCURL = -L$(CURLDIR)/$(lib) $(CC_LD_DYNPATH)$(CURLDIR)/$(lib)1315 else1316 CURL_LIBCURL =1317 endif13181319ifdef CURL_LDFLAGS1320 CURL_LIBCURL += $(CURL_LDFLAGS)1321else1322 CURL_LIBCURL += $(shell $(CURL_CONFIG) --libs)1323endif13241325 REMOTE_CURL_PRIMARY = git-remote-http$X1326 REMOTE_CURL_ALIASES = git-remote-https$X git-remote-ftp$X git-remote-ftps$X1327 REMOTE_CURL_NAMES = $(REMOTE_CURL_PRIMARY) $(REMOTE_CURL_ALIASES)1328 PROGRAM_OBJS += http-fetch.o1329 PROGRAMS += $(REMOTE_CURL_NAMES)1330 curl_check := $(shell (echo 070908; $(CURL_CONFIG) --vernum | sed -e '/^70[BC]/s/^/0/') 2>/dev/null | sort -r | sed -ne 2p)1331 ifeq "$(curl_check)" "070908"1332 ifndef NO_EXPAT1333 PROGRAM_OBJS += http-push.o1334 endif1335 endif1336 curl_check := $(shell (echo 072200; $(CURL_CONFIG) --vernum | sed -e '/^70[BC]/s/^/0/') 2>/dev/null | sort -r | sed -ne 2p)1337 ifeq "$(curl_check)" "072200"1338 USE_CURL_FOR_IMAP_SEND = YesPlease1339 endif1340 ifdef USE_CURL_FOR_IMAP_SEND1341 BASIC_CFLAGS += -DUSE_CURL_FOR_IMAP_SEND1342 IMAP_SEND_BUILDDEPS = http.o1343 IMAP_SEND_LDFLAGS += $(CURL_LIBCURL)1344 endif1345 ifndef NO_EXPAT1346 ifdef EXPATDIR1347 BASIC_CFLAGS += -I$(EXPATDIR)/include1348 EXPAT_LIBEXPAT = -L$(EXPATDIR)/$(lib) $(CC_LD_DYNPATH)$(EXPATDIR)/$(lib) -lexpat1349 else1350 EXPAT_LIBEXPAT = -lexpat1351 endif1352 ifdef EXPAT_NEEDS_XMLPARSE_H1353 BASIC_CFLAGS += -DEXPAT_NEEDS_XMLPARSE_H1354 endif1355 endif1356endif1357IMAP_SEND_LDFLAGS += $(OPENSSL_LINK) $(OPENSSL_LIBSSL) $(LIB_4_CRYPTO)13581359ifdef ZLIB_PATH1360 BASIC_CFLAGS += -I$(ZLIB_PATH)/include1361 EXTLIBS += -L$(ZLIB_PATH)/$(lib) $(CC_LD_DYNPATH)$(ZLIB_PATH)/$(lib)1362endif1363EXTLIBS += -lz13641365ifndef NO_OPENSSL1366 OPENSSL_LIBSSL = -lssl1367 ifdef OPENSSLDIR1368 BASIC_CFLAGS += -I$(OPENSSLDIR)/include1369 OPENSSL_LINK = -L$(OPENSSLDIR)/$(lib) $(CC_LD_DYNPATH)$(OPENSSLDIR)/$(lib)1370 else1371 OPENSSL_LINK =1372 endif1373 ifdef NEEDS_CRYPTO_WITH_SSL1374 OPENSSL_LIBSSL += -lcrypto1375 endif1376else1377 BASIC_CFLAGS += -DNO_OPENSSL1378 OPENSSL_LIBSSL =1379endif1380ifdef NO_OPENSSL1381 LIB_4_CRYPTO =1382else1383ifdef NEEDS_SSL_WITH_CRYPTO1384 LIB_4_CRYPTO = $(OPENSSL_LINK) -lcrypto -lssl1385else1386 LIB_4_CRYPTO = $(OPENSSL_LINK) -lcrypto1387endif1388ifdef APPLE_COMMON_CRYPTO1389 LIB_4_CRYPTO += -framework Security -framework CoreFoundation1390endif1391endif1392ifndef NO_ICONV1393 ifdef NEEDS_LIBICONV1394 ifdef ICONVDIR1395 BASIC_CFLAGS += -I$(ICONVDIR)/include1396 ICONV_LINK = -L$(ICONVDIR)/$(lib) $(CC_LD_DYNPATH)$(ICONVDIR)/$(lib)1397 else1398 ICONV_LINK =1399 endif1400 ifdef NEEDS_LIBINTL_BEFORE_LIBICONV1401 ICONV_LINK += -lintl1402 endif1403 EXTLIBS += $(ICONV_LINK) -liconv1404 endif1405endif1406ifdef NEEDS_LIBGEN1407 EXTLIBS += -lgen1408endif1409ifndef NO_GETTEXT1410ifndef LIBC_CONTAINS_LIBINTL1411 EXTLIBS += -lintl1412endif1413endif1414ifdef NEEDS_SOCKET1415 EXTLIBS += -lsocket1416endif1417ifdef NEEDS_NSL1418 EXTLIBS += -lnsl1419endif1420ifdef NEEDS_RESOLV1421 EXTLIBS += -lresolv1422endif1423ifdef NO_D_TYPE_IN_DIRENT1424 BASIC_CFLAGS += -DNO_D_TYPE_IN_DIRENT1425endif1426ifdef NO_GECOS_IN_PWENT1427 BASIC_CFLAGS += -DNO_GECOS_IN_PWENT1428endif1429ifdef NO_ST_BLOCKS_IN_STRUCT_STAT1430 BASIC_CFLAGS += -DNO_ST_BLOCKS_IN_STRUCT_STAT1431endif1432ifdef USE_NSEC1433 BASIC_CFLAGS += -DUSE_NSEC1434endif1435ifdef USE_ST_TIMESPEC1436 BASIC_CFLAGS += -DUSE_ST_TIMESPEC1437endif1438ifdef NO_NORETURN1439 BASIC_CFLAGS += -DNO_NORETURN1440endif1441ifdef NO_NSEC1442 BASIC_CFLAGS += -DNO_NSEC1443endif1444ifdef SNPRINTF_RETURNS_BOGUS1445 COMPAT_CFLAGS += -DSNPRINTF_RETURNS_BOGUS1446 COMPAT_OBJS += compat/snprintf.o1447endif1448ifdef FREAD_READS_DIRECTORIES1449 COMPAT_CFLAGS += -DFREAD_READS_DIRECTORIES1450 COMPAT_OBJS += compat/fopen.o1451endif1452ifdef NO_SYMLINK_HEAD1453 BASIC_CFLAGS += -DNO_SYMLINK_HEAD1454endif1455ifdef GETTEXT_POISON1456$(warning The GETTEXT_POISON option has been removed in favor of runtime GIT_TEST_GETTEXT_POISON. See t/README!)1457endif1458ifdef NO_GETTEXT1459 BASIC_CFLAGS += -DNO_GETTEXT1460 USE_GETTEXT_SCHEME ?= fallthrough1461endif1462ifdef NO_POLL1463 NO_POLL_H = YesPlease1464 NO_SYS_POLL_H = YesPlease1465 COMPAT_CFLAGS += -DNO_POLL -Icompat/poll1466 COMPAT_OBJS += compat/poll/poll.o1467endif1468ifdef NO_STRCASESTR1469 COMPAT_CFLAGS += -DNO_STRCASESTR1470 COMPAT_OBJS += compat/strcasestr.o1471endif1472ifdef NO_STRLCPY1473 COMPAT_CFLAGS += -DNO_STRLCPY1474 COMPAT_OBJS += compat/strlcpy.o1475endif1476ifdef NO_STRTOUMAX1477 COMPAT_CFLAGS += -DNO_STRTOUMAX1478 COMPAT_OBJS += compat/strtoumax.o compat/strtoimax.o1479endif1480ifdef NO_STRTOULL1481 COMPAT_CFLAGS += -DNO_STRTOULL1482endif1483ifdef NO_SETENV1484 COMPAT_CFLAGS += -DNO_SETENV1485 COMPAT_OBJS += compat/setenv.o1486endif1487ifdef NO_MKDTEMP1488 COMPAT_CFLAGS += -DNO_MKDTEMP1489 COMPAT_OBJS += compat/mkdtemp.o1490endif1491ifdef MKDIR_WO_TRAILING_SLASH1492 COMPAT_CFLAGS += -DMKDIR_WO_TRAILING_SLASH1493 COMPAT_OBJS += compat/mkdir.o1494endif1495ifdef NO_UNSETENV1496 COMPAT_CFLAGS += -DNO_UNSETENV1497 COMPAT_OBJS += compat/unsetenv.o1498endif1499ifdef NO_SYS_SELECT_H1500 BASIC_CFLAGS += -DNO_SYS_SELECT_H1501endif1502ifdef NO_POLL_H1503 BASIC_CFLAGS += -DNO_POLL_H1504endif1505ifdef NO_SYS_POLL_H1506 BASIC_CFLAGS += -DNO_SYS_POLL_H1507endif1508ifdef NEEDS_SYS_PARAM_H1509 BASIC_CFLAGS += -DNEEDS_SYS_PARAM_H1510endif1511ifdef NO_INTTYPES_H1512 BASIC_CFLAGS += -DNO_INTTYPES_H1513endif1514ifdef NO_INITGROUPS1515 BASIC_CFLAGS += -DNO_INITGROUPS1516endif1517ifdef NO_MMAP1518 COMPAT_CFLAGS += -DNO_MMAP1519 COMPAT_OBJS += compat/mmap.o1520else1521 ifdef USE_WIN32_MMAP1522 COMPAT_CFLAGS += -DUSE_WIN32_MMAP1523 COMPAT_OBJS += compat/win32mmap.o1524 endif1525endif1526ifdef MMAP_PREVENTS_DELETE1527 BASIC_CFLAGS += -DMMAP_PREVENTS_DELETE1528endif1529ifdef OBJECT_CREATION_USES_RENAMES1530 COMPAT_CFLAGS += -DOBJECT_CREATION_MODE=11531endif1532ifdef NO_STRUCT_ITIMERVAL1533 COMPAT_CFLAGS += -DNO_STRUCT_ITIMERVAL1534 NO_SETITIMER = YesPlease1535endif1536ifdef NO_SETITIMER1537 COMPAT_CFLAGS += -DNO_SETITIMER1538endif1539ifdef NO_PREAD1540 COMPAT_CFLAGS += -DNO_PREAD1541 COMPAT_OBJS += compat/pread.o1542endif1543ifdef NO_FAST_WORKING_DIRECTORY1544 BASIC_CFLAGS += -DNO_FAST_WORKING_DIRECTORY1545endif1546ifdef NO_TRUSTABLE_FILEMODE1547 BASIC_CFLAGS += -DNO_TRUSTABLE_FILEMODE1548endif1549ifdef NEEDS_MODE_TRANSLATION1550 COMPAT_CFLAGS += -DNEEDS_MODE_TRANSLATION1551 COMPAT_OBJS += compat/stat.o1552endif1553ifdef NO_IPV61554 BASIC_CFLAGS += -DNO_IPV61555endif1556ifdef NO_INTPTR_T1557 COMPAT_CFLAGS += -DNO_INTPTR_T1558endif1559ifdef NO_UINTMAX_T1560 BASIC_CFLAGS += -Duintmax_t=uint32_t1561endif1562ifdef NO_SOCKADDR_STORAGE1563ifdef NO_IPV61564 BASIC_CFLAGS += -Dsockaddr_storage=sockaddr_in1565else1566 BASIC_CFLAGS += -Dsockaddr_storage=sockaddr_in61567endif1568endif1569ifdef NO_INET_NTOP1570 LIB_OBJS += compat/inet_ntop.o1571 BASIC_CFLAGS += -DNO_INET_NTOP1572endif1573ifdef NO_INET_PTON1574 LIB_OBJS += compat/inet_pton.o1575 BASIC_CFLAGS += -DNO_INET_PTON1576endif1577ifndef NO_UNIX_SOCKETS1578 LIB_OBJS += unix-socket.o1579 PROGRAM_OBJS += credential-cache.o1580 PROGRAM_OBJS += credential-cache--daemon.o1581endif15821583ifdef NO_ICONV1584 BASIC_CFLAGS += -DNO_ICONV1585endif15861587ifdef OLD_ICONV1588 BASIC_CFLAGS += -DOLD_ICONV1589endif15901591ifdef NO_DEFLATE_BOUND1592 BASIC_CFLAGS += -DNO_DEFLATE_BOUND1593endif15941595ifdef NO_POSIX_GOODIES1596 BASIC_CFLAGS += -DNO_POSIX_GOODIES1597endif15981599ifdef APPLE_COMMON_CRYPTO1600 # Apple CommonCrypto requires chunking1601 SHA1_MAX_BLOCK_SIZE = 1024L*1024L*1024L1602endif16031604ifdef OPENSSL_SHA11605 EXTLIBS += $(LIB_4_CRYPTO)1606 BASIC_CFLAGS += -DSHA1_OPENSSL1607else1608ifdef BLK_SHA11609 LIB_OBJS += block-sha1/sha1.o1610 BASIC_CFLAGS += -DSHA1_BLK1611else1612ifdef PPC_SHA11613 LIB_OBJS += ppc/sha1.o ppc/sha1ppc.o1614 BASIC_CFLAGS += -DSHA1_PPC1615else1616ifdef APPLE_COMMON_CRYPTO1617 COMPAT_CFLAGS += -DCOMMON_DIGEST_FOR_OPENSSL1618 BASIC_CFLAGS += -DSHA1_APPLE1619else1620 DC_SHA1 := YesPlease1621 BASIC_CFLAGS += -DSHA1_DC1622 LIB_OBJS += sha1dc_git.o1623ifdef DC_SHA1_EXTERNAL1624 ifdef DC_SHA1_SUBMODULE1625 ifneq ($(DC_SHA1_SUBMODULE),auto)1626$(error Only set DC_SHA1_EXTERNAL or DC_SHA1_SUBMODULE, not both)1627 endif1628 endif1629 BASIC_CFLAGS += -DDC_SHA1_EXTERNAL1630 EXTLIBS += -lsha1detectcoll1631else1632ifdef DC_SHA1_SUBMODULE1633 LIB_OBJS += sha1collisiondetection/lib/sha1.o1634 LIB_OBJS += sha1collisiondetection/lib/ubc_check.o1635 BASIC_CFLAGS += -DDC_SHA1_SUBMODULE1636else1637 LIB_OBJS += sha1dc/sha1.o1638 LIB_OBJS += sha1dc/ubc_check.o1639endif1640 BASIC_CFLAGS += \1641 -DSHA1DC_NO_STANDARD_INCLUDES \1642 -DSHA1DC_INIT_SAFE_HASH_DEFAULT=0 \1643 -DSHA1DC_CUSTOM_INCLUDE_SHA1_C="\"cache.h\"" \1644 -DSHA1DC_CUSTOM_INCLUDE_UBC_CHECK_C="\"git-compat-util.h\""1645endif1646endif1647endif1648endif1649endif16501651ifdef SHA1_MAX_BLOCK_SIZE1652 LIB_OBJS += compat/sha1-chunked.o1653 BASIC_CFLAGS += -DSHA1_MAX_BLOCK_SIZE="$(SHA1_MAX_BLOCK_SIZE)"1654endif1655ifdef NO_HSTRERROR1656 COMPAT_CFLAGS += -DNO_HSTRERROR1657 COMPAT_OBJS += compat/hstrerror.o1658endif1659ifdef NO_MEMMEM1660 COMPAT_CFLAGS += -DNO_MEMMEM1661 COMPAT_OBJS += compat/memmem.o1662endif1663ifdef NO_GETPAGESIZE1664 COMPAT_CFLAGS += -DNO_GETPAGESIZE1665endif1666ifdef INTERNAL_QSORT1667 COMPAT_CFLAGS += -DINTERNAL_QSORT1668 COMPAT_OBJS += compat/qsort.o1669endif1670ifdef HAVE_ISO_QSORT_S1671 COMPAT_CFLAGS += -DHAVE_ISO_QSORT_S1672else1673 COMPAT_OBJS += compat/qsort_s.o1674endif1675ifdef RUNTIME_PREFIX1676 COMPAT_CFLAGS += -DRUNTIME_PREFIX1677endif16781679ifdef NO_PTHREADS1680 BASIC_CFLAGS += -DNO_PTHREADS1681else1682 BASIC_CFLAGS += $(PTHREAD_CFLAGS)1683 EXTLIBS += $(PTHREAD_LIBS)1684endif16851686ifdef HAVE_PATHS_H1687 BASIC_CFLAGS += -DHAVE_PATHS_H1688endif16891690ifdef HAVE_LIBCHARSET_H1691 BASIC_CFLAGS += -DHAVE_LIBCHARSET_H1692 EXTLIBS += $(CHARSET_LIB)1693endif16941695ifdef HAVE_STRINGS_H1696 BASIC_CFLAGS += -DHAVE_STRINGS_H1697endif16981699ifdef HAVE_DEV_TTY1700 BASIC_CFLAGS += -DHAVE_DEV_TTY1701endif17021703ifdef DIR_HAS_BSD_GROUP_SEMANTICS1704 COMPAT_CFLAGS += -DDIR_HAS_BSD_GROUP_SEMANTICS1705endif1706ifdef UNRELIABLE_FSTAT1707 BASIC_CFLAGS += -DUNRELIABLE_FSTAT1708endif1709ifdef NO_REGEX1710 COMPAT_CFLAGS += -Icompat/regex1711 COMPAT_OBJS += compat/regex/regex.o1712endif1713ifdef NATIVE_CRLF1714 BASIC_CFLAGS += -DNATIVE_CRLF1715endif17161717ifdef USE_NED_ALLOCATOR1718 COMPAT_CFLAGS += -Icompat/nedmalloc1719 COMPAT_OBJS += compat/nedmalloc/nedmalloc.o1720 OVERRIDE_STRDUP = YesPlease1721endif17221723ifdef OVERRIDE_STRDUP1724 COMPAT_CFLAGS += -DOVERRIDE_STRDUP1725 COMPAT_OBJS += compat/strdup.o1726endif17271728ifdef GIT_TEST_CMP_USE_COPIED_CONTEXT1729 export GIT_TEST_CMP_USE_COPIED_CONTEXT1730endif17311732ifndef NO_MSGFMT_EXTENDED_OPTIONS1733 MSGFMT += --check --statistics1734endif17351736ifdef GMTIME_UNRELIABLE_ERRORS1737 COMPAT_OBJS += compat/gmtime.o1738 BASIC_CFLAGS += -DGMTIME_UNRELIABLE_ERRORS1739endif17401741ifdef HAVE_CLOCK_GETTIME1742 BASIC_CFLAGS += -DHAVE_CLOCK_GETTIME1743endif17441745ifdef HAVE_CLOCK_MONOTONIC1746 BASIC_CFLAGS += -DHAVE_CLOCK_MONOTONIC1747endif17481749ifdef NEEDS_LIBRT1750 EXTLIBS += -lrt1751endif17521753ifdef HAVE_BSD_SYSCTL1754 BASIC_CFLAGS += -DHAVE_BSD_SYSCTL1755endif17561757ifdef HAVE_BSD_KERN_PROC_SYSCTL1758 BASIC_CFLAGS += -DHAVE_BSD_KERN_PROC_SYSCTL1759endif17601761ifdef HAVE_GETDELIM1762 BASIC_CFLAGS += -DHAVE_GETDELIM1763endif17641765ifneq ($(PROCFS_EXECUTABLE_PATH),)1766 procfs_executable_path_SQ = $(subst ','\'',$(PROCFS_EXECUTABLE_PATH))1767 BASIC_CFLAGS += '-DPROCFS_EXECUTABLE_PATH="$(procfs_executable_path_SQ)"'1768endif17691770ifdef HAVE_NS_GET_EXECUTABLE_PATH1771 BASIC_CFLAGS += -DHAVE_NS_GET_EXECUTABLE_PATH1772endif17731774ifdef HAVE_WPGMPTR1775 BASIC_CFLAGS += -DHAVE_WPGMPTR1776endif17771778ifdef FILENO_IS_A_MACRO1779 COMPAT_CFLAGS += -DFILENO_IS_A_MACRO1780 COMPAT_OBJS += compat/fileno.o1781endif17821783ifeq ($(TCLTK_PATH),)1784NO_TCLTK = NoThanks1785endif17861787ifeq ($(PERL_PATH),)1788NO_PERL = NoThanks1789endif17901791ifeq ($(PYTHON_PATH),)1792NO_PYTHON = NoThanks1793endif17941795ifndef PAGER_ENV1796PAGER_ENV = LESS=FRX LV=-c1797endif17981799QUIET_SUBDIR0 = +$(MAKE) -C # space to separate -C and subdir1800QUIET_SUBDIR1 =18011802ifneq ($(findstring w,$(MAKEFLAGS)),w)1803PRINT_DIR = --no-print-directory1804else # "make -w"1805NO_SUBDIR = :1806endif18071808ifneq ($(findstring s,$(MAKEFLAGS)),s)1809ifndef V1810 QUIET_CC = @echo ' ' CC $@;1811 QUIET_AR = @echo ' ' AR $@;1812 QUIET_LINK = @echo ' ' LINK $@;1813 QUIET_BUILT_IN = @echo ' ' BUILTIN $@;1814 QUIET_GEN = @echo ' ' GEN $@;1815 QUIET_LNCP = @echo ' ' LN/CP $@;1816 QUIET_XGETTEXT = @echo ' ' XGETTEXT $@;1817 QUIET_MSGFMT = @echo ' ' MSGFMT $@;1818 QUIET_GCOV = @echo ' ' GCOV $@;1819 QUIET_SP = @echo ' ' SP $<;1820 QUIET_HDR = @echo ' ' HDR $<;1821 QUIET_RC = @echo ' ' RC $@;1822 QUIET_SUBDIR0 = +@subdir=1823 QUIET_SUBDIR1 = ;$(NO_SUBDIR) echo ' ' SUBDIR $$subdir; \1824 $(MAKE) $(PRINT_DIR) -C $$subdir1825 export V1826 export QUIET_GEN1827 export QUIET_BUILT_IN1828endif1829endif18301831ifdef NO_INSTALL_HARDLINKS1832 export NO_INSTALL_HARDLINKS1833endif18341835### profile feedback build1836#18371838# Can adjust this to be a global directory if you want to do extended1839# data gathering1840PROFILE_DIR := $(CURDIR)18411842ifeq ("$(PROFILE)","GEN")1843 BASIC_CFLAGS += -fprofile-generate=$(PROFILE_DIR) -DNO_NORETURN=11844 EXTLIBS += -lgcov1845 export CCACHE_DISABLE = t1846 V = 11847else1848ifneq ("$(PROFILE)","")1849 BASIC_CFLAGS += -fprofile-use=$(PROFILE_DIR) -fprofile-correction -DNO_NORETURN=11850 export CCACHE_DISABLE = t1851 V = 11852endif1853endif18541855# Shell quote (do not use $(call) to accommodate ancient setups);18561857ETC_GITCONFIG_SQ = $(subst ','\'',$(ETC_GITCONFIG))1858ETC_GITATTRIBUTES_SQ = $(subst ','\'',$(ETC_GITATTRIBUTES))18591860DESTDIR_SQ = $(subst ','\'',$(DESTDIR))1861bindir_SQ = $(subst ','\'',$(bindir))1862bindir_relative_SQ = $(subst ','\'',$(bindir_relative))1863mandir_SQ = $(subst ','\'',$(mandir))1864mandir_relative_SQ = $(subst ','\'',$(mandir_relative))1865infodir_relative_SQ = $(subst ','\'',$(infodir_relative))1866perllibdir_SQ = $(subst ','\'',$(perllibdir))1867localedir_SQ = $(subst ','\'',$(localedir))1868localedir_relative_SQ = $(subst ','\'',$(localedir_relative))1869gitexecdir_SQ = $(subst ','\'',$(gitexecdir))1870gitexecdir_relative_SQ = $(subst ','\'',$(gitexecdir_relative))1871template_dir_SQ = $(subst ','\'',$(template_dir))1872htmldir_relative_SQ = $(subst ','\'',$(htmldir_relative))1873prefix_SQ = $(subst ','\'',$(prefix))1874perllibdir_relative_SQ = $(subst ','\'',$(perllibdir_relative))1875gitwebdir_SQ = $(subst ','\'',$(gitwebdir))18761877SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH))1878TEST_SHELL_PATH_SQ = $(subst ','\'',$(TEST_SHELL_PATH))1879PERL_PATH_SQ = $(subst ','\'',$(PERL_PATH))1880PYTHON_PATH_SQ = $(subst ','\'',$(PYTHON_PATH))1881TCLTK_PATH_SQ = $(subst ','\'',$(TCLTK_PATH))1882DIFF_SQ = $(subst ','\'',$(DIFF))1883PERLLIB_EXTRA_SQ = $(subst ','\'',$(PERLLIB_EXTRA))18841885# RUNTIME_PREFIX's resolution logic requires resource paths to be expressed1886# relative to each other and share an installation path.1887#1888# This is a dependency in:1889# - Git's binary RUNTIME_PREFIX logic in (see "exec_cmd.c").1890# - The runtime prefix Perl header (see1891# "perl/header_templates/runtime_prefix.template.pl").1892ifdef RUNTIME_PREFIX18931894ifneq ($(filter /%,$(firstword $(gitexecdir_relative))),)1895$(error RUNTIME_PREFIX requires a relative gitexecdir, not: $(gitexecdir))1896endif18971898ifneq ($(filter /%,$(firstword $(localedir_relative))),)1899$(error RUNTIME_PREFIX requires a relative localedir, not: $(localedir))1900endif19011902ifndef NO_PERL1903ifneq ($(filter /%,$(firstword $(perllibdir_relative))),)1904$(error RUNTIME_PREFIX requires a relative perllibdir, not: $(perllibdir))1905endif1906endif19071908endif19091910# We must filter out any object files from $(GITLIBS),1911# as it is typically used like:1912#1913# foo: foo.o $(GITLIBS)1914# $(CC) $(filter %.o,$^) $(LIBS)1915#1916# where we use it as a dependency. Since we also pull object files1917# from the dependency list, that would make each entry appear twice.1918LIBS = $(filter-out %.o, $(GITLIBS)) $(EXTLIBS)19191920BASIC_CFLAGS += $(COMPAT_CFLAGS)1921LIB_OBJS += $(COMPAT_OBJS)19221923# Quote for C19241925ifdef DEFAULT_EDITOR1926DEFAULT_EDITOR_CQ = "$(subst ",\",$(subst \,\\,$(DEFAULT_EDITOR)))"1927DEFAULT_EDITOR_CQ_SQ = $(subst ','\'',$(DEFAULT_EDITOR_CQ))19281929BASIC_CFLAGS += -DDEFAULT_EDITOR='$(DEFAULT_EDITOR_CQ_SQ)'1930endif19311932ifdef DEFAULT_PAGER1933DEFAULT_PAGER_CQ = "$(subst ",\",$(subst \,\\,$(DEFAULT_PAGER)))"1934DEFAULT_PAGER_CQ_SQ = $(subst ','\'',$(DEFAULT_PAGER_CQ))19351936BASIC_CFLAGS += -DDEFAULT_PAGER='$(DEFAULT_PAGER_CQ_SQ)'1937endif19381939ifdef SHELL_PATH1940SHELL_PATH_CQ = "$(subst ",\",$(subst \,\\,$(SHELL_PATH)))"1941SHELL_PATH_CQ_SQ = $(subst ','\'',$(SHELL_PATH_CQ))19421943BASIC_CFLAGS += -DSHELL_PATH='$(SHELL_PATH_CQ_SQ)'1944endif19451946GIT_USER_AGENT_SQ = $(subst ','\'',$(GIT_USER_AGENT))1947GIT_USER_AGENT_CQ = "$(subst ",\",$(subst \,\\,$(GIT_USER_AGENT)))"1948GIT_USER_AGENT_CQ_SQ = $(subst ','\'',$(GIT_USER_AGENT_CQ))1949GIT-USER-AGENT: FORCE1950 @if test x'$(GIT_USER_AGENT_SQ)' != x"`cat GIT-USER-AGENT 2>/dev/null`"; then \1951 echo '$(GIT_USER_AGENT_SQ)' >GIT-USER-AGENT; \1952 fi19531954ifdef DEFAULT_HELP_FORMAT1955BASIC_CFLAGS += -DDEFAULT_HELP_FORMAT='"$(DEFAULT_HELP_FORMAT)"'1956endif19571958PAGER_ENV_SQ = $(subst ','\'',$(PAGER_ENV))1959PAGER_ENV_CQ = "$(subst ",\",$(subst \,\\,$(PAGER_ENV)))"1960PAGER_ENV_CQ_SQ = $(subst ','\'',$(PAGER_ENV_CQ))1961BASIC_CFLAGS += -DPAGER_ENV='$(PAGER_ENV_CQ_SQ)'19621963ALL_CFLAGS += $(BASIC_CFLAGS)1964ALL_LDFLAGS += $(BASIC_LDFLAGS)19651966export DIFF TAR INSTALL DESTDIR SHELL_PATH196719681969### Build rules19701971SHELL = $(SHELL_PATH)19721973all:: shell_compatibility_test19741975ifeq "$(PROFILE)" "BUILD"1976all:: profile1977endif19781979profile:: profile-clean1980 $(MAKE) PROFILE=GEN all1981 $(MAKE) PROFILE=GEN -j1 test1982 @if test -n "$$GIT_PERF_REPO" || test -d .git; then \1983 $(MAKE) PROFILE=GEN -j1 perf; \1984 else \1985 echo "Skipping profile of perf tests..."; \1986 fi1987 $(MAKE) PROFILE=USE all19881989profile-fast: profile-clean1990 $(MAKE) PROFILE=GEN all1991 $(MAKE) PROFILE=GEN -j1 perf1992 $(MAKE) PROFILE=USE all199319941995all:: $(ALL_PROGRAMS) $(SCRIPT_LIB) $(BUILT_INS) $(OTHER_PROGRAMS) GIT-BUILD-OPTIONS1996ifneq (,$X)1997 $(QUIET_BUILT_IN)$(foreach p,$(patsubst %$X,%,$(filter %$X,$(ALL_PROGRAMS) $(BUILT_INS) git$X)), test -d '$p' -o '$p' -ef '$p$X' || $(RM) '$p';)1998endif19992000all::2001ifndef NO_TCLTK2002 $(QUIET_SUBDIR0)git-gui $(QUIET_SUBDIR1) gitexecdir='$(gitexec_instdir_SQ)' all2003 $(QUIET_SUBDIR0)gitk-git $(QUIET_SUBDIR1) all2004endif2005 $(QUIET_SUBDIR0)templates $(QUIET_SUBDIR1) SHELL_PATH='$(SHELL_PATH_SQ)' PERL_PATH='$(PERL_PATH_SQ)'20062007please_set_SHELL_PATH_to_a_more_modern_shell:2008 @$$(:)20092010shell_compatibility_test: please_set_SHELL_PATH_to_a_more_modern_shell20112012strip: $(PROGRAMS) git$X2013 $(STRIP) $(STRIP_OPTS) $^20142015### Target-specific flags and dependencies20162017# The generic compilation pattern rule and automatically2018# computed header dependencies (falling back to a dependency on2019# LIB_H) are enough to describe how most targets should be built,2020# but some targets are special enough to need something a little2021# different.2022#2023# - When a source file "foo.c" #includes a generated header file,2024# we need to list that dependency for the "foo.o" target.2025#2026# We also list it from other targets that are built from foo.c2027# like "foo.sp" and "foo.s", even though that is easy to forget2028# to do because the generated header is already present around2029# after a regular build attempt.2030#2031# - Some code depends on configuration kept in makefile2032# variables. The target-specific variable EXTRA_CPPFLAGS can2033# be used to convey that information to the C preprocessor2034# using -D options.2035#2036# The "foo.o" target should have a corresponding dependency on2037# a file that changes when the value of the makefile variable2038# changes. For example, targets making use of the2039# $(GIT_VERSION) variable depend on GIT-VERSION-FILE.2040#2041# Technically the ".sp" and ".s" targets do not need this2042# dependency because they are force-built, but they get the2043# same dependency for consistency. This way, you do not have to2044# know how each target is implemented. And it means the2045# dependencies here will not need to change if the force-build2046# details change some day.20472048git.sp git.s git.o: GIT-PREFIX2049git.sp git.s git.o: EXTRA_CPPFLAGS = \2050 '-DGIT_HTML_PATH="$(htmldir_relative_SQ)"' \2051 '-DGIT_MAN_PATH="$(mandir_relative_SQ)"' \2052 '-DGIT_INFO_PATH="$(infodir_relative_SQ)"'20532054git$X: git.o GIT-LDFLAGS $(BUILTIN_OBJS) $(GITLIBS)2055 $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) \2056 $(filter %.o,$^) $(LIBS)20572058help.sp help.s help.o: command-list.h20592060builtin/help.sp builtin/help.s builtin/help.o: command-list.h GIT-PREFIX2061builtin/help.sp builtin/help.s builtin/help.o: EXTRA_CPPFLAGS = \2062 '-DGIT_HTML_PATH="$(htmldir_relative_SQ)"' \2063 '-DGIT_MAN_PATH="$(mandir_relative_SQ)"' \2064 '-DGIT_INFO_PATH="$(infodir_relative_SQ)"'20652066version.sp version.s version.o: GIT-VERSION-FILE GIT-USER-AGENT2067version.sp version.s version.o: EXTRA_CPPFLAGS = \2068 '-DGIT_VERSION="$(GIT_VERSION)"' \2069 '-DGIT_USER_AGENT=$(GIT_USER_AGENT_CQ_SQ)' \2070 '-DGIT_BUILT_FROM_COMMIT="$(shell \2071 GIT_CEILING_DIRECTORIES="$(CURDIR)/.." \2072 git rev-parse -q --verify HEAD 2>/dev/null)"'20732074$(BUILT_INS): git$X2075 $(QUIET_BUILT_IN)$(RM) $@ && \2076 ln $< $@ 2>/dev/null || \2077 ln -s $< $@ 2>/dev/null || \2078 cp $< $@20792080command-list.h: generate-cmdlist.sh command-list.txt20812082command-list.h: $(wildcard Documentation/git*.txt) Documentation/*config.txt Documentation/config/*.txt2083 $(QUIET_GEN)$(SHELL_PATH) ./generate-cmdlist.sh command-list.txt >$@+ && mv $@+ $@20842085SCRIPT_DEFINES = $(SHELL_PATH_SQ):$(DIFF_SQ):$(GIT_VERSION):\2086 $(localedir_SQ):$(NO_CURL):$(USE_GETTEXT_SCHEME):$(SANE_TOOL_PATH_SQ):\2087 $(gitwebdir_SQ):$(PERL_PATH_SQ):$(SANE_TEXT_GREP):$(PAGER_ENV):\2088 $(perllibdir_SQ)2089define cmd_munge_script2090$(RM) $@ $@+ && \2091sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \2092 -e 's|@SHELL_PATH@|$(SHELL_PATH_SQ)|' \2093 -e 's|@@DIFF@@|$(DIFF_SQ)|' \2094 -e 's|@@LOCALEDIR@@|$(localedir_SQ)|g' \2095 -e 's/@@NO_CURL@@/$(NO_CURL)/g' \2096 -e 's/@@USE_GETTEXT_SCHEME@@/$(USE_GETTEXT_SCHEME)/g' \2097 -e $(BROKEN_PATH_FIX) \2098 -e 's|@@GITWEBDIR@@|$(gitwebdir_SQ)|g' \2099 -e 's|@@PERL@@|$(PERL_PATH_SQ)|g' \2100 -e 's|@@SANE_TEXT_GREP@@|$(SANE_TEXT_GREP)|g' \2101 -e 's|@@PAGER_ENV@@|$(PAGER_ENV_SQ)|g' \2102 $@.sh >$@+2103endef21042105GIT-SCRIPT-DEFINES: FORCE2106 @FLAGS='$(SCRIPT_DEFINES)'; \2107 if test x"$$FLAGS" != x"`cat $@ 2>/dev/null`" ; then \2108 echo >&2 " * new script parameters"; \2109 echo "$$FLAGS" >$@; \2110 fi211121122113$(SCRIPT_SH_GEN) : % : %.sh GIT-SCRIPT-DEFINES2114 $(QUIET_GEN)$(cmd_munge_script) && \2115 chmod +x $@+ && \2116 mv $@+ $@21172118$(SCRIPT_LIB) : % : %.sh GIT-SCRIPT-DEFINES2119 $(QUIET_GEN)$(cmd_munge_script) && \2120 mv $@+ $@21212122git.res: git.rc GIT-VERSION-FILE GIT-PREFIX2123 $(QUIET_RC)$(RC) \2124 $(join -DMAJOR= -DMINOR= -DMICRO= -DPATCHLEVEL=, $(wordlist 1, 4, \2125 $(shell echo $(GIT_VERSION) 0 0 0 0 | tr '.a-zA-Z-' ' '))) \2126 -DGIT_VERSION="\\\"$(GIT_VERSION)\\\"" -i $< -o $@21272128# This makes sure we depend on the NO_PERL setting itself.2129$(SCRIPT_PERL_GEN): GIT-BUILD-OPTIONS21302131# Used for substitution in Perl modules. Disabled when using RUNTIME_PREFIX2132# since the locale directory is injected.2133perl_localedir_SQ = $(localedir_SQ)21342135ifndef NO_PERL2136PERL_HEADER_TEMPLATE = perl/header_templates/fixed_prefix.template.pl2137PERL_DEFINES = $(PERL_PATH_SQ):$(PERLLIB_EXTRA_SQ):$(perllibdir_SQ)21382139PERL_DEFINES := $(PERL_PATH_SQ) $(PERLLIB_EXTRA_SQ) $(perllibdir_SQ)2140PERL_DEFINES += $(RUNTIME_PREFIX)21412142# Support Perl runtime prefix. In this mode, a different header is installed2143# into Perl scripts.2144ifdef RUNTIME_PREFIX21452146PERL_HEADER_TEMPLATE = perl/header_templates/runtime_prefix.template.pl21472148# Don't export a fixed $(localedir) path; it will be resolved by the Perl header2149# at runtime.2150perl_localedir_SQ =21512152endif21532154PERL_DEFINES += $(gitexecdir) $(perllibdir) $(localedir)21552156$(SCRIPT_PERL_GEN): % : %.perl GIT-PERL-DEFINES GIT-PERL-HEADER GIT-VERSION-FILE2157 $(QUIET_GEN)$(RM) $@ $@+ && \2158 sed -e '1{' \2159 -e ' s|#!.*perl|#!$(PERL_PATH_SQ)|' \2160 -e ' r GIT-PERL-HEADER' \2161 -e ' G' \2162 -e '}' \2163 -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \2164 $< >$@+ && \2165 chmod +x $@+ && \2166 mv $@+ $@21672168PERL_DEFINES := $(subst $(space),:,$(PERL_DEFINES))2169GIT-PERL-DEFINES: FORCE2170 @FLAGS='$(PERL_DEFINES)'; \2171 if test x"$$FLAGS" != x"`cat $@ 2>/dev/null`" ; then \2172 echo >&2 " * new perl-specific parameters"; \2173 echo "$$FLAGS" >$@; \2174 fi21752176GIT-PERL-HEADER: $(PERL_HEADER_TEMPLATE) GIT-PERL-DEFINES Makefile2177 $(QUIET_GEN)$(RM) $@ && \2178 INSTLIBDIR='$(perllibdir_SQ)' && \2179 INSTLIBDIR_EXTRA='$(PERLLIB_EXTRA_SQ)' && \2180 INSTLIBDIR="$$INSTLIBDIR$${INSTLIBDIR_EXTRA:+:$$INSTLIBDIR_EXTRA}" && \2181 sed -e 's=@@PATHSEP@@=$(pathsep)=g' \2182 -e "s=@@INSTLIBDIR@@=$$INSTLIBDIR=g" \2183 -e 's=@@PERLLIBDIR_REL@@=$(perllibdir_relative_SQ)=g' \2184 -e 's=@@GITEXECDIR_REL@@=$(gitexecdir_relative_SQ)=g' \2185 -e 's=@@LOCALEDIR_REL@@=$(localedir_relative_SQ)=g' \2186 $< >$@+ && \2187 mv $@+ $@21882189.PHONY: perllibdir2190perllibdir:2191 @echo '$(perllibdir_SQ)'21922193.PHONY: gitweb2194gitweb:2195 $(QUIET_SUBDIR0)gitweb $(QUIET_SUBDIR1) all21962197git-instaweb: git-instaweb.sh GIT-SCRIPT-DEFINES2198 $(QUIET_GEN)$(cmd_munge_script) && \2199 chmod +x $@+ && \2200 mv $@+ $@2201else # NO_PERL2202$(SCRIPT_PERL_GEN) git-instaweb: % : unimplemented.sh2203 $(QUIET_GEN)$(RM) $@ $@+ && \2204 sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \2205 -e 's|@@REASON@@|NO_PERL=$(NO_PERL)|g' \2206 unimplemented.sh >$@+ && \2207 chmod +x $@+ && \2208 mv $@+ $@2209endif # NO_PERL22102211# This makes sure we depend on the NO_PYTHON setting itself.2212$(SCRIPT_PYTHON_GEN): GIT-BUILD-OPTIONS22132214ifndef NO_PYTHON2215$(SCRIPT_PYTHON_GEN): GIT-CFLAGS GIT-PREFIX GIT-PYTHON-VARS2216$(SCRIPT_PYTHON_GEN): % : %.py2217 $(QUIET_GEN)$(RM) $@ $@+ && \2218 sed -e '1s|#!.*python|#!$(PYTHON_PATH_SQ)|' \2219 $< >$@+ && \2220 chmod +x $@+ && \2221 mv $@+ $@2222else # NO_PYTHON2223$(SCRIPT_PYTHON_GEN): % : unimplemented.sh2224 $(QUIET_GEN)$(RM) $@ $@+ && \2225 sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \2226 -e 's|@@REASON@@|NO_PYTHON=$(NO_PYTHON)|g' \2227 unimplemented.sh >$@+ && \2228 chmod +x $@+ && \2229 mv $@+ $@2230endif # NO_PYTHON22312232CONFIGURE_RECIPE = $(RM) configure configure.ac+ && \2233 sed -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \2234 configure.ac >configure.ac+ && \2235 autoconf -o configure configure.ac+ && \2236 $(RM) configure.ac+22372238configure: configure.ac GIT-VERSION-FILE2239 $(QUIET_GEN)$(CONFIGURE_RECIPE)22402241ifdef AUTOCONFIGURED2242# We avoid depending on 'configure' here, because it gets rebuilt2243# every time GIT-VERSION-FILE is modified, only to update the embedded2244# version number string, which config.status does not care about. We2245# do want to recheck when the platform/environment detection logic2246# changes, hence this depends on configure.ac.2247config.status: configure.ac2248 $(QUIET_GEN)$(CONFIGURE_RECIPE) && \2249 if test -f config.status; then \2250 ./config.status --recheck; \2251 else \2252 ./configure; \2253 fi2254reconfigure config.mak.autogen: config.status2255 $(QUIET_GEN)./config.status2256.PHONY: reconfigure # This is a convenience target.2257endif22582259XDIFF_OBJS += xdiff/xdiffi.o2260XDIFF_OBJS += xdiff/xprepare.o2261XDIFF_OBJS += xdiff/xutils.o2262XDIFF_OBJS += xdiff/xemit.o2263XDIFF_OBJS += xdiff/xmerge.o2264XDIFF_OBJS += xdiff/xpatience.o2265XDIFF_OBJS += xdiff/xhistogram.o22662267VCSSVN_OBJS += vcs-svn/line_buffer.o2268VCSSVN_OBJS += vcs-svn/sliding_window.o2269VCSSVN_OBJS += vcs-svn/fast_export.o2270VCSSVN_OBJS += vcs-svn/svndiff.o2271VCSSVN_OBJS += vcs-svn/svndump.o22722273TEST_OBJS := $(patsubst %$X,%.o,$(TEST_PROGRAMS)) $(patsubst %,t/helper/%,$(TEST_BUILTINS_OBJS))2274OBJECTS := $(LIB_OBJS) $(BUILTIN_OBJS) $(PROGRAM_OBJS) $(TEST_OBJS) \2275 $(XDIFF_OBJS) \2276 $(VCSSVN_OBJS) \2277 $(FUZZ_OBJS) \2278 common-main.o \2279 git.o2280ifndef NO_CURL2281 OBJECTS += http.o http-walker.o remote-curl.o2282endif22832284dep_files := $(foreach f,$(OBJECTS),$(dir $f).depend/$(notdir $f).d)2285dep_dirs := $(addsuffix .depend,$(sort $(dir $(OBJECTS))))22862287ifeq ($(COMPUTE_HEADER_DEPENDENCIES),yes)2288$(dep_dirs):2289 @mkdir -p $@22902291missing_dep_dirs := $(filter-out $(wildcard $(dep_dirs)),$(dep_dirs))2292dep_file = $(dir $@).depend/$(notdir $@).d2293dep_args = -MF $(dep_file) -MQ $@ -MMD -MP2294endif22952296ifneq ($(COMPUTE_HEADER_DEPENDENCIES),yes)2297dep_dirs =2298missing_dep_dirs =2299dep_args =2300endif23012302ASM_SRC := $(wildcard $(OBJECTS:o=S))2303ASM_OBJ := $(ASM_SRC:S=o)2304C_OBJ := $(filter-out $(ASM_OBJ),$(OBJECTS))23052306.SUFFIXES:23072308$(C_OBJ): %.o: %.c GIT-CFLAGS $(missing_dep_dirs)2309 $(QUIET_CC)$(CC) -o $*.o -c $(dep_args) $(ALL_CFLAGS) $(EXTRA_CPPFLAGS) $<2310$(ASM_OBJ): %.o: %.S GIT-CFLAGS $(missing_dep_dirs)2311 $(QUIET_CC)$(CC) -o $*.o -c $(dep_args) $(ALL_CFLAGS) $(EXTRA_CPPFLAGS) $<23122313%.s: %.c GIT-CFLAGS FORCE2314 $(QUIET_CC)$(CC) -o $@ -S $(ALL_CFLAGS) $(EXTRA_CPPFLAGS) $<23152316ifdef USE_COMPUTED_HEADER_DEPENDENCIES2317# Take advantage of gcc's on-the-fly dependency generation2318# See <http://gcc.gnu.org/gcc-3.0/features.html>.2319dep_files_present := $(wildcard $(dep_files))2320ifneq ($(dep_files_present),)2321include $(dep_files_present)2322endif2323else2324# Dependencies on header files, for platforms that do not support2325# the gcc -MMD option.2326#2327# Dependencies on automatically generated headers such as command-list.h2328# should _not_ be included here, since they are necessary even when2329# building an object for the first time.23302331$(OBJECTS): $(LIB_H)2332endif23332334exec-cmd.sp exec-cmd.s exec-cmd.o: GIT-PREFIX2335exec-cmd.sp exec-cmd.s exec-cmd.o: EXTRA_CPPFLAGS = \2336 '-DGIT_EXEC_PATH="$(gitexecdir_SQ)"' \2337 '-DGIT_LOCALE_PATH="$(localedir_relative_SQ)"' \2338 '-DBINDIR="$(bindir_relative_SQ)"' \2339 '-DFALLBACK_RUNTIME_PREFIX="$(prefix_SQ)"'23402341builtin/init-db.sp builtin/init-db.s builtin/init-db.o: GIT-PREFIX2342builtin/init-db.sp builtin/init-db.s builtin/init-db.o: EXTRA_CPPFLAGS = \2343 -DDEFAULT_GIT_TEMPLATE_DIR='"$(template_dir_SQ)"'23442345config.sp config.s config.o: GIT-PREFIX2346config.sp config.s config.o: EXTRA_CPPFLAGS = \2347 -DETC_GITCONFIG='"$(ETC_GITCONFIG_SQ)"'23482349attr.sp attr.s attr.o: GIT-PREFIX2350attr.sp attr.s attr.o: EXTRA_CPPFLAGS = \2351 -DETC_GITATTRIBUTES='"$(ETC_GITATTRIBUTES_SQ)"'23522353gettext.sp gettext.s gettext.o: GIT-PREFIX2354gettext.sp gettext.s gettext.o: EXTRA_CPPFLAGS = \2355 -DGIT_LOCALE_PATH='"$(localedir_relative_SQ)"'23562357http-push.sp http.sp http-walker.sp remote-curl.sp imap-send.sp: SPARSE_FLAGS += \2358 -DCURL_DISABLE_TYPECHECK23592360pack-revindex.sp: SPARSE_FLAGS += -Wno-memcpy-max-count23612362ifdef NO_EXPAT2363http-walker.sp http-walker.s http-walker.o: EXTRA_CPPFLAGS = -DNO_EXPAT2364endif23652366ifdef NO_REGEX2367compat/regex/regex.sp compat/regex/regex.o: EXTRA_CPPFLAGS = \2368 -DGAWK -DNO_MBSUPPORT2369endif23702371ifdef USE_NED_ALLOCATOR2372compat/nedmalloc/nedmalloc.sp compat/nedmalloc/nedmalloc.o: EXTRA_CPPFLAGS = \2373 -DNDEBUG -DREPLACE_SYSTEM_ALLOCATOR2374compat/nedmalloc/nedmalloc.sp: SPARSE_FLAGS += -Wno-non-pointer-null2375endif23762377git-%$X: %.o GIT-LDFLAGS $(GITLIBS)2378 $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS)23792380git-imap-send$X: imap-send.o $(IMAP_SEND_BUILDDEPS) GIT-LDFLAGS $(GITLIBS)2381 $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \2382 $(IMAP_SEND_LDFLAGS) $(LIBS)23832384git-http-fetch$X: http.o http-walker.o http-fetch.o GIT-LDFLAGS $(GITLIBS)2385 $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \2386 $(CURL_LIBCURL) $(LIBS)2387git-http-push$X: http.o http-push.o GIT-LDFLAGS $(GITLIBS)2388 $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \2389 $(CURL_LIBCURL) $(EXPAT_LIBEXPAT) $(LIBS)23902391git-remote-testsvn$X: remote-testsvn.o GIT-LDFLAGS $(GITLIBS) $(VCSSVN_LIB)2392 $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS) \2393 $(VCSSVN_LIB)23942395$(REMOTE_CURL_ALIASES): $(REMOTE_CURL_PRIMARY)2396 $(QUIET_LNCP)$(RM) $@ && \2397 ln $< $@ 2>/dev/null || \2398 ln -s $< $@ 2>/dev/null || \2399 cp $< $@24002401$(REMOTE_CURL_PRIMARY): remote-curl.o http.o http-walker.o GIT-LDFLAGS $(GITLIBS)2402 $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \2403 $(CURL_LIBCURL) $(EXPAT_LIBEXPAT) $(LIBS)24042405$(LIB_FILE): $(LIB_OBJS)2406 $(QUIET_AR)$(RM) $@ && $(AR) $(ARFLAGS) $@ $^24072408$(XDIFF_LIB): $(XDIFF_OBJS)2409 $(QUIET_AR)$(RM) $@ && $(AR) $(ARFLAGS) $@ $^24102411$(VCSSVN_LIB): $(VCSSVN_OBJS)2412 $(QUIET_AR)$(RM) $@ && $(AR) $(ARFLAGS) $@ $^24132414export DEFAULT_EDITOR DEFAULT_PAGER24152416.PHONY: doc man man-perl html info pdf2417doc: man-perl2418 $(MAKE) -C Documentation all24192420man: man-perl2421 $(MAKE) -C Documentation man24222423man-perl: perl/build/man/man3/Git.3pm24242425html:2426 $(MAKE) -C Documentation html24272428info:2429 $(MAKE) -C Documentation info24302431pdf:2432 $(MAKE) -C Documentation pdf24332434XGETTEXT_FLAGS = \2435 --force-po \2436 --add-comments=TRANSLATORS: \2437 --msgid-bugs-address="Git Mailing List <git@vger.kernel.org>" \2438 --from-code=UTF-82439XGETTEXT_FLAGS_C = $(XGETTEXT_FLAGS) --language=C \2440 --keyword=_ --keyword=N_ --keyword="Q_:1,2"2441XGETTEXT_FLAGS_SH = $(XGETTEXT_FLAGS) --language=Shell \2442 --keyword=gettextln --keyword=eval_gettextln2443XGETTEXT_FLAGS_PERL = $(XGETTEXT_FLAGS) --language=Perl \2444 --keyword=__ --keyword=N__ --keyword="__n:1,2"2445LOCALIZED_C = $(C_OBJ:o=c) $(LIB_H) $(GENERATED_H)2446LOCALIZED_SH = $(SCRIPT_SH)2447LOCALIZED_SH += git-parse-remote.sh2448LOCALIZED_SH += git-rebase--preserve-merges.sh2449LOCALIZED_SH += git-sh-setup.sh2450LOCALIZED_PERL = $(SCRIPT_PERL)24512452ifdef XGETTEXT_INCLUDE_TESTS2453LOCALIZED_C += t/t0200/test.c2454LOCALIZED_SH += t/t0200/test.sh2455LOCALIZED_PERL += t/t0200/test.perl2456endif24572458## Note that this is meant to be run only by the localization coordinator2459## under a very controlled condition, i.e. (1) it is to be run in a2460## Git repository (not a tarball extract), (2) any local modifications2461## will be lost.2462## Gettext tools cannot work with our own custom PRItime type, so2463## we replace PRItime with PRIuMAX. We need to update this to2464## PRIdMAX if we switch to a signed type later.24652466po/git.pot: $(GENERATED_H) FORCE2467 # All modifications will be reverted at the end, so we do not2468 # want to have any local change.2469 git diff --quiet HEAD && git diff --quiet --cached24702471 @for s in $(LOCALIZED_C) $(LOCALIZED_SH) $(LOCALIZED_PERL); \2472 do \2473 sed -e 's|PRItime|PRIuMAX|g' <"$$s" >"$$s+" && \2474 cat "$$s+" >"$$s" && rm "$$s+"; \2475 done24762477 $(QUIET_XGETTEXT)$(XGETTEXT) -o$@+ $(XGETTEXT_FLAGS_C) $(LOCALIZED_C)2478 $(QUIET_XGETTEXT)$(XGETTEXT) -o$@+ --join-existing $(XGETTEXT_FLAGS_SH) \2479 $(LOCALIZED_SH)2480 $(QUIET_XGETTEXT)$(XGETTEXT) -o$@+ --join-existing $(XGETTEXT_FLAGS_PERL) \2481 $(LOCALIZED_PERL)24822483 # Reverting the munged source, leaving only the updated $@2484 git reset --hard2485 mv $@+ $@24862487.PHONY: pot2488pot: po/git.pot24892490POFILES := $(wildcard po/*.po)2491MOFILES := $(patsubst po/%.po,po/build/locale/%/LC_MESSAGES/git.mo,$(POFILES))24922493ifndef NO_GETTEXT2494all:: $(MOFILES)2495endif24962497po/build/locale/%/LC_MESSAGES/git.mo: po/%.po2498 $(QUIET_MSGFMT)mkdir -p $(dir $@) && $(MSGFMT) -o $@ $<24992500LIB_PERL := $(wildcard perl/Git.pm perl/Git/*.pm perl/Git/*/*.pm perl/Git/*/*/*.pm)2501LIB_PERL_GEN := $(patsubst perl/%.pm,perl/build/lib/%.pm,$(LIB_PERL))2502LIB_CPAN := $(wildcard perl/FromCPAN/*.pm perl/FromCPAN/*/*.pm)2503LIB_CPAN_GEN := $(patsubst perl/%.pm,perl/build/lib/%.pm,$(LIB_CPAN))25042505ifndef NO_PERL2506all:: $(LIB_PERL_GEN)2507ifndef NO_PERL_CPAN_FALLBACKS2508all:: $(LIB_CPAN_GEN)2509endif2510NO_PERL_CPAN_FALLBACKS_SQ = $(subst ','\'',$(NO_PERL_CPAN_FALLBACKS))2511endif25122513perl/build/lib/%.pm: perl/%.pm2514 $(QUIET_GEN)mkdir -p $(dir $@) && \2515 sed -e 's|@@LOCALEDIR@@|$(perl_localedir_SQ)|g' \2516 -e 's|@@NO_PERL_CPAN_FALLBACKS@@|$(NO_PERL_CPAN_FALLBACKS_SQ)|g' \2517 < $< > $@25182519perl/build/man/man3/Git.3pm: perl/Git.pm2520 $(QUIET_GEN)mkdir -p $(dir $@) && \2521 pod2man $< $@25222523FIND_SOURCE_FILES = ( \2524 git ls-files \2525 '*.[hcS]' \2526 '*.sh' \2527 ':!*[tp][0-9][0-9][0-9][0-9]*' \2528 ':!contrib' \2529 2>/dev/null || \2530 $(FIND) . \2531 \( -name .git -type d -prune \) \2532 -o \( -name '[tp][0-9][0-9][0-9][0-9]*' -prune \) \2533 -o \( -name contrib -type d -prune \) \2534 -o \( -name build -type d -prune \) \2535 -o \( -name 'trash*' -type d -prune \) \2536 -o \( -name '*.[hcS]' -type f -print \) \2537 -o \( -name '*.sh' -type f -print \) \2538 )25392540$(ETAGS_TARGET): FORCE2541 $(RM) $(ETAGS_TARGET)2542 $(FIND_SOURCE_FILES) | xargs etags -a -o $(ETAGS_TARGET)25432544tags: FORCE2545 $(RM) tags2546 $(FIND_SOURCE_FILES) | xargs ctags -a25472548cscope:2549 $(RM) cscope*2550 $(FIND_SOURCE_FILES) | xargs cscope -b25512552### Detect prefix changes2553TRACK_PREFIX = $(bindir_SQ):$(gitexecdir_SQ):$(template_dir_SQ):$(prefix_SQ):\2554 $(localedir_SQ)25552556GIT-PREFIX: FORCE2557 @FLAGS='$(TRACK_PREFIX)'; \2558 if test x"$$FLAGS" != x"`cat GIT-PREFIX 2>/dev/null`" ; then \2559 echo >&2 " * new prefix flags"; \2560 echo "$$FLAGS" >GIT-PREFIX; \2561 fi25622563TRACK_CFLAGS = $(CC):$(subst ','\'',$(ALL_CFLAGS)):$(USE_GETTEXT_SCHEME)25642565GIT-CFLAGS: FORCE2566 @FLAGS='$(TRACK_CFLAGS)'; \2567 if test x"$$FLAGS" != x"`cat GIT-CFLAGS 2>/dev/null`" ; then \2568 echo >&2 " * new build flags"; \2569 echo "$$FLAGS" >GIT-CFLAGS; \2570 fi25712572TRACK_LDFLAGS = $(subst ','\'',$(ALL_LDFLAGS))25732574GIT-LDFLAGS: FORCE2575 @FLAGS='$(TRACK_LDFLAGS)'; \2576 if test x"$$FLAGS" != x"`cat GIT-LDFLAGS 2>/dev/null`" ; then \2577 echo >&2 " * new link flags"; \2578 echo "$$FLAGS" >GIT-LDFLAGS; \2579 fi25802581# We need to apply sq twice, once to protect from the shell2582# that runs GIT-BUILD-OPTIONS, and then again to protect it2583# and the first level quoting from the shell that runs "echo".2584GIT-BUILD-OPTIONS: FORCE2585 @echo SHELL_PATH=\''$(subst ','\'',$(SHELL_PATH_SQ))'\' >$@+2586 @echo TEST_SHELL_PATH=\''$(subst ','\'',$(TEST_SHELL_PATH_SQ))'\' >>$@+2587 @echo PERL_PATH=\''$(subst ','\'',$(PERL_PATH_SQ))'\' >>$@+2588 @echo DIFF=\''$(subst ','\'',$(subst ','\'',$(DIFF)))'\' >>$@+2589 @echo PYTHON_PATH=\''$(subst ','\'',$(PYTHON_PATH_SQ))'\' >>$@+2590 @echo TAR=\''$(subst ','\'',$(subst ','\'',$(TAR)))'\' >>$@+2591 @echo NO_CURL=\''$(subst ','\'',$(subst ','\'',$(NO_CURL)))'\' >>$@+2592 @echo NO_EXPAT=\''$(subst ','\'',$(subst ','\'',$(NO_EXPAT)))'\' >>$@+2593 @echo USE_LIBPCRE1=\''$(subst ','\'',$(subst ','\'',$(USE_LIBPCRE1)))'\' >>$@+2594 @echo USE_LIBPCRE2=\''$(subst ','\'',$(subst ','\'',$(USE_LIBPCRE2)))'\' >>$@+2595 @echo NO_LIBPCRE1_JIT=\''$(subst ','\'',$(subst ','\'',$(NO_LIBPCRE1_JIT)))'\' >>$@+2596 @echo NO_PERL=\''$(subst ','\'',$(subst ','\'',$(NO_PERL)))'\' >>$@+2597 @echo NO_PTHREADS=\''$(subst ','\'',$(subst ','\'',$(NO_PTHREADS)))'\' >>$@+2598 @echo NO_PYTHON=\''$(subst ','\'',$(subst ','\'',$(NO_PYTHON)))'\' >>$@+2599 @echo NO_UNIX_SOCKETS=\''$(subst ','\'',$(subst ','\'',$(NO_UNIX_SOCKETS)))'\' >>$@+2600 @echo PAGER_ENV=\''$(subst ','\'',$(subst ','\'',$(PAGER_ENV)))'\' >>$@+2601 @echo DC_SHA1=\''$(subst ','\'',$(subst ','\'',$(DC_SHA1)))'\' >>$@+2602 @echo X=\'$(X)\' >>$@+2603ifdef TEST_OUTPUT_DIRECTORY2604 @echo TEST_OUTPUT_DIRECTORY=\''$(subst ','\'',$(subst ','\'',$(TEST_OUTPUT_DIRECTORY)))'\' >>$@+2605endif2606ifdef GIT_TEST_OPTS2607 @echo GIT_TEST_OPTS=\''$(subst ','\'',$(subst ','\'',$(GIT_TEST_OPTS)))'\' >>$@+2608endif2609ifdef GIT_TEST_CMP2610 @echo GIT_TEST_CMP=\''$(subst ','\'',$(subst ','\'',$(GIT_TEST_CMP)))'\' >>$@+2611endif2612ifdef GIT_TEST_CMP_USE_COPIED_CONTEXT2613 @echo GIT_TEST_CMP_USE_COPIED_CONTEXT=YesPlease >>$@+2614endif2615 @echo NO_GETTEXT=\''$(subst ','\'',$(subst ','\'',$(NO_GETTEXT)))'\' >>$@+2616ifdef GIT_PERF_REPEAT_COUNT2617 @echo GIT_PERF_REPEAT_COUNT=\''$(subst ','\'',$(subst ','\'',$(GIT_PERF_REPEAT_COUNT)))'\' >>$@+2618endif2619ifdef GIT_PERF_REPO2620 @echo GIT_PERF_REPO=\''$(subst ','\'',$(subst ','\'',$(GIT_PERF_REPO)))'\' >>$@+2621endif2622ifdef GIT_PERF_LARGE_REPO2623 @echo GIT_PERF_LARGE_REPO=\''$(subst ','\'',$(subst ','\'',$(GIT_PERF_LARGE_REPO)))'\' >>$@+2624endif2625ifdef GIT_PERF_MAKE_OPTS2626 @echo GIT_PERF_MAKE_OPTS=\''$(subst ','\'',$(subst ','\'',$(GIT_PERF_MAKE_OPTS)))'\' >>$@+2627endif2628ifdef GIT_PERF_MAKE_COMMAND2629 @echo GIT_PERF_MAKE_COMMAND=\''$(subst ','\'',$(subst ','\'',$(GIT_PERF_MAKE_COMMAND)))'\' >>$@+2630endif2631ifdef GIT_INTEROP_MAKE_OPTS2632 @echo GIT_INTEROP_MAKE_OPTS=\''$(subst ','\'',$(subst ','\'',$(GIT_INTEROP_MAKE_OPTS)))'\' >>$@+2633endif2634ifdef GIT_TEST_INDEX_VERSION2635 @echo GIT_TEST_INDEX_VERSION=\''$(subst ','\'',$(subst ','\'',$(GIT_TEST_INDEX_VERSION)))'\' >>$@+2636endif2637 @if cmp $@+ $@ >/dev/null 2>&1; then $(RM) $@+; else mv $@+ $@; fi26382639### Detect Python interpreter path changes2640ifndef NO_PYTHON2641TRACK_PYTHON = $(subst ','\'',-DPYTHON_PATH='$(PYTHON_PATH_SQ)')26422643GIT-PYTHON-VARS: FORCE2644 @VARS='$(TRACK_PYTHON)'; \2645 if test x"$$VARS" != x"`cat $@ 2>/dev/null`" ; then \2646 echo >&2 " * new Python interpreter location"; \2647 echo "$$VARS" >$@; \2648 fi2649endif26502651test_bindir_programs := $(patsubst %,bin-wrappers/%,$(BINDIR_PROGRAMS_NEED_X) $(BINDIR_PROGRAMS_NO_X) $(TEST_PROGRAMS_NEED_X))26522653all:: $(TEST_PROGRAMS) $(test_bindir_programs)2654all:: $(NO_INSTALL)26552656bin-wrappers/%: wrap-for-bin.sh2657 @mkdir -p bin-wrappers2658 $(QUIET_GEN)sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \2659 -e 's|@@BUILD_DIR@@|$(shell pwd)|' \2660 -e 's|@@PROG@@|$(patsubst test-%,t/helper/test-%,$(@F))|' < $< > $@ && \2661 chmod +x $@26622663# GNU make supports exporting all variables by "export" without parameters.2664# However, the environment gets quite big, and some programs have problems2665# with that.26662667export NO_SVN_TESTS2668export TEST_NO_MALLOC_CHECK26692670### Testing rules26712672test: all2673 $(MAKE) -C t/ all26742675perf: all2676 $(MAKE) -C t/perf/ all26772678.PHONY: test perf26792680t/helper/test-line-buffer$X: $(VCSSVN_LIB)26812682t/helper/test-svn-fe$X: $(VCSSVN_LIB)26832684.PRECIOUS: $(TEST_OBJS)26852686t/helper/test-tool$X: $(patsubst %,t/helper/%,$(TEST_BUILTINS_OBJS))26872688t/helper/test-%$X: t/helper/test-%.o GIT-LDFLAGS $(GITLIBS)2689 $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(filter %.a,$^) $(LIBS)26902691check-sha1:: t/helper/test-tool$X2692 t/helper/test-sha1.sh26932694SP_OBJ = $(patsubst %.o,%.sp,$(C_OBJ))26952696$(SP_OBJ): %.sp: %.c GIT-CFLAGS FORCE2697 $(QUIET_SP)cgcc -no-compile $(ALL_CFLAGS) $(EXTRA_CPPFLAGS) \2698 $(SPARSE_FLAGS) $<26992700.PHONY: sparse $(SP_OBJ)2701sparse: $(SP_OBJ)27022703GEN_HDRS := command-list.h unicode-width.h2704EXCEPT_HDRS := $(GEN_HDRS) compat% xdiff%2705CHK_HDRS = $(filter-out $(EXCEPT_HDRS),$(patsubst ./%,%,$(LIB_H)))2706HCO = $(patsubst %.h,%.hco,$(CHK_HDRS))27072708$(HCO): %.hco: %.h FORCE2709 $(QUIET_HDR)$(CC) -include git-compat-util.h -I. -o /dev/null -c -xc $<27102711.PHONY: hdr-check $(HCO)2712hdr-check: $(HCO)27132714.PHONY: style2715style:2716 git clang-format --style file --diff --extensions c,h27172718check: command-list.h2719 @if sparse; \2720 then \2721 echo >&2 "Use 'make sparse' instead"; \2722 $(MAKE) --no-print-directory sparse; \2723 else \2724 echo >&2 "Did you mean 'make test'?"; \2725 exit 1; \2726 fi27272728C_SOURCES = $(patsubst %.o,%.c,$(C_OBJ))2729ifdef DC_SHA1_SUBMODULE2730COCCI_SOURCES = $(filter-out sha1collisiondetection/%,$(C_SOURCES))2731else2732COCCI_SOURCES = $(filter-out sha1dc/%,$(C_SOURCES))2733endif27342735%.cocci.patch: %.cocci $(COCCI_SOURCES)2736 @echo ' ' SPATCH $<; \2737 ret=0; \2738 for f in $(COCCI_SOURCES); do \2739 $(SPATCH) --sp-file $< $$f $(SPATCH_FLAGS) || \2740 { ret=$$?; break; }; \2741 done >$@+ 2>$@.log; \2742 if test $$ret != 0; \2743 then \2744 cat $@.log; \2745 exit 1; \2746 fi; \2747 mv $@+ $@; \2748 if test -s $@; \2749 then \2750 echo ' ' SPATCH result: $@; \2751 fi2752coccicheck: $(addsuffix .patch,$(filter-out %.pending.cocci,$(wildcard contrib/coccinelle/*.cocci)))27532754# See contrib/coccinelle/README2755coccicheck-pending: $(addsuffix .patch,$(wildcard contrib/coccinelle/*.pending.cocci))27562757.PHONY: coccicheck coccicheck-pending27582759### Installation rules27602761ifneq ($(filter /%,$(firstword $(template_dir))),)2762template_instdir = $(template_dir)2763else2764template_instdir = $(prefix)/$(template_dir)2765endif2766export template_instdir27672768ifneq ($(filter /%,$(firstword $(gitexecdir))),)2769gitexec_instdir = $(gitexecdir)2770else2771gitexec_instdir = $(prefix)/$(gitexecdir)2772endif2773gitexec_instdir_SQ = $(subst ','\'',$(gitexec_instdir))2774export gitexec_instdir27752776ifneq ($(filter /%,$(firstword $(mergetoolsdir))),)2777mergetools_instdir = $(mergetoolsdir)2778else2779mergetools_instdir = $(prefix)/$(mergetoolsdir)2780endif2781mergetools_instdir_SQ = $(subst ','\'',$(mergetools_instdir))27822783install_bindir_programs := $(patsubst %,%$X,$(BINDIR_PROGRAMS_NEED_X)) $(BINDIR_PROGRAMS_NO_X)27842785.PHONY: profile-install profile-fast-install2786profile-install: profile2787 $(MAKE) install27882789profile-fast-install: profile-fast2790 $(MAKE) install27912792install: all2793 $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(bindir_SQ)'2794 $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(gitexec_instdir_SQ)'2795 $(INSTALL) $(ALL_PROGRAMS) '$(DESTDIR_SQ)$(gitexec_instdir_SQ)'2796 $(INSTALL) -m 644 $(SCRIPT_LIB) '$(DESTDIR_SQ)$(gitexec_instdir_SQ)'2797 $(INSTALL) $(install_bindir_programs) '$(DESTDIR_SQ)$(bindir_SQ)'2798 $(MAKE) -C templates DESTDIR='$(DESTDIR_SQ)' install2799 $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(mergetools_instdir_SQ)'2800 $(INSTALL) -m 644 mergetools/* '$(DESTDIR_SQ)$(mergetools_instdir_SQ)'2801ifndef NO_GETTEXT2802 $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(localedir_SQ)'2803 (cd po/build/locale && $(TAR) cf - .) | \2804 (cd '$(DESTDIR_SQ)$(localedir_SQ)' && umask 022 && $(TAR) xof -)2805endif2806ifndef NO_PERL2807 $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perllibdir_SQ)'2808 (cd perl/build/lib && $(TAR) cf - .) | \2809 (cd '$(DESTDIR_SQ)$(perllibdir_SQ)' && umask 022 && $(TAR) xof -)2810 $(MAKE) -C gitweb install2811endif2812ifndef NO_TCLTK2813 $(MAKE) -C gitk-git install2814 $(MAKE) -C git-gui gitexecdir='$(gitexec_instdir_SQ)' install2815endif2816ifneq (,$X)2817 $(foreach p,$(patsubst %$X,%,$(filter %$X,$(ALL_PROGRAMS) $(BUILT_INS) git$X)), test '$(DESTDIR_SQ)$(gitexec_instdir_SQ)/$p' -ef '$(DESTDIR_SQ)$(gitexec_instdir_SQ)/$p$X' || $(RM) '$(DESTDIR_SQ)$(gitexec_instdir_SQ)/$p';)2818endif28192820 bindir=$$(cd '$(DESTDIR_SQ)$(bindir_SQ)' && pwd) && \2821 execdir=$$(cd '$(DESTDIR_SQ)$(gitexec_instdir_SQ)' && pwd) && \2822 destdir_from_execdir_SQ=$$(echo '$(gitexecdir_relative_SQ)' | sed -e 's|[^/][^/]*|..|g') && \2823 { test "$$bindir/" = "$$execdir/" || \2824 for p in git$X $(filter $(install_bindir_programs),$(ALL_PROGRAMS)); do \2825 $(RM) "$$execdir/$$p" && \2826 test -n "$(INSTALL_SYMLINKS)" && \2827 ln -s "$$destdir_from_execdir_SQ/$(bindir_relative_SQ)/$$p" "$$execdir/$$p" || \2828 { test -z "$(NO_INSTALL_HARDLINKS)$(NO_CROSS_DIRECTORY_HARDLINKS)" && \2829 ln "$$bindir/$$p" "$$execdir/$$p" 2>/dev/null || \2830 cp "$$bindir/$$p" "$$execdir/$$p" || exit; } \2831 done; \2832 } && \2833 for p in $(filter $(install_bindir_programs),$(BUILT_INS)); do \2834 $(RM) "$$bindir/$$p" && \2835 test -n "$(INSTALL_SYMLINKS)" && \2836 ln -s "git$X" "$$bindir/$$p" || \2837 { test -z "$(NO_INSTALL_HARDLINKS)" && \2838 ln "$$bindir/git$X" "$$bindir/$$p" 2>/dev/null || \2839 ln -s "git$X" "$$bindir/$$p" 2>/dev/null || \2840 cp "$$bindir/git$X" "$$bindir/$$p" || exit; } \2841 done && \2842 for p in $(BUILT_INS); do \2843 $(RM) "$$execdir/$$p" && \2844 test -n "$(INSTALL_SYMLINKS)" && \2845 ln -s "$$destdir_from_execdir_SQ/$(bindir_relative_SQ)/git$X" "$$execdir/$$p" || \2846 { test -z "$(NO_INSTALL_HARDLINKS)" && \2847 ln "$$execdir/git$X" "$$execdir/$$p" 2>/dev/null || \2848 ln -s "git$X" "$$execdir/$$p" 2>/dev/null || \2849 cp "$$execdir/git$X" "$$execdir/$$p" || exit; } \2850 done && \2851 remote_curl_aliases="$(REMOTE_CURL_ALIASES)" && \2852 for p in $$remote_curl_aliases; do \2853 $(RM) "$$execdir/$$p" && \2854 test -n "$(INSTALL_SYMLINKS)" && \2855 ln -s "git-remote-http$X" "$$execdir/$$p" || \2856 { test -z "$(NO_INSTALL_HARDLINKS)" && \2857 ln "$$execdir/git-remote-http$X" "$$execdir/$$p" 2>/dev/null || \2858 ln -s "git-remote-http$X" "$$execdir/$$p" 2>/dev/null || \2859 cp "$$execdir/git-remote-http$X" "$$execdir/$$p" || exit; } \2860 done && \2861 ./check_bindir "z$$bindir" "z$$execdir" "$$bindir/git-add$X"28622863.PHONY: install-gitweb install-doc install-man install-man-perl install-html install-info install-pdf2864.PHONY: quick-install-doc quick-install-man quick-install-html2865install-gitweb:2866 $(MAKE) -C gitweb install28672868install-doc: install-man-perl2869 $(MAKE) -C Documentation install28702871install-man: install-man-perl2872 $(MAKE) -C Documentation install-man28732874install-man-perl: man-perl2875 $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(mandir_SQ)/man3'2876 (cd perl/build/man/man3 && $(TAR) cf - .) | \2877 (cd '$(DESTDIR_SQ)$(mandir_SQ)/man3' && umask 022 && $(TAR) xof -)28782879install-html:2880 $(MAKE) -C Documentation install-html28812882install-info:2883 $(MAKE) -C Documentation install-info28842885install-pdf:2886 $(MAKE) -C Documentation install-pdf28872888quick-install-doc:2889 $(MAKE) -C Documentation quick-install28902891quick-install-man:2892 $(MAKE) -C Documentation quick-install-man28932894quick-install-html:2895 $(MAKE) -C Documentation quick-install-html2896289728982899### Maintainer's dist rules29002901GIT_TARNAME = git-$(GIT_VERSION)2902dist: git-archive$(X) configure2903 ./git-archive --format=tar \2904 --prefix=$(GIT_TARNAME)/ HEAD^{tree} > $(GIT_TARNAME).tar2905 @mkdir -p $(GIT_TARNAME)2906 @cp configure $(GIT_TARNAME)2907 @echo $(GIT_VERSION) > $(GIT_TARNAME)/version2908 @$(MAKE) -C git-gui TARDIR=../$(GIT_TARNAME)/git-gui dist-version2909 $(TAR) rf $(GIT_TARNAME).tar \2910 $(GIT_TARNAME)/configure \2911 $(GIT_TARNAME)/version \2912 $(GIT_TARNAME)/git-gui/version2913ifdef DC_SHA1_SUBMODULE2914 @mkdir -p $(GIT_TARNAME)/sha1collisiondetection/lib2915 @cp sha1collisiondetection/LICENSE.txt \2916 $(GIT_TARNAME)/sha1collisiondetection/2917 @cp sha1collisiondetection/LICENSE.txt \2918 $(GIT_TARNAME)/sha1collisiondetection/2919 @cp sha1collisiondetection/lib/sha1.[ch] \2920 $(GIT_TARNAME)/sha1collisiondetection/lib/2921 @cp sha1collisiondetection/lib/ubc_check.[ch] \2922 $(GIT_TARNAME)/sha1collisiondetection/lib/2923 $(TAR) rf $(GIT_TARNAME).tar \2924 $(GIT_TARNAME)/sha1collisiondetection/LICENSE.txt \2925 $(GIT_TARNAME)/sha1collisiondetection/lib/sha1.[ch] \2926 $(GIT_TARNAME)/sha1collisiondetection/lib/ubc_check.[ch]2927endif2928 @$(RM) -r $(GIT_TARNAME)2929 gzip -f -9 $(GIT_TARNAME).tar29302931rpm::2932 @echo >&2 "Use distro packaged sources to run rpmbuild"2933 @false2934.PHONY: rpm29352936htmldocs = git-htmldocs-$(GIT_VERSION)2937manpages = git-manpages-$(GIT_VERSION)2938.PHONY: dist-doc distclean2939dist-doc:2940 $(RM) -r .doc-tmp-dir2941 mkdir .doc-tmp-dir2942 $(MAKE) -C Documentation WEBDOC_DEST=../.doc-tmp-dir install-webdoc2943 cd .doc-tmp-dir && $(TAR) cf ../$(htmldocs).tar .2944 gzip -n -9 -f $(htmldocs).tar2945 :2946 $(RM) -r .doc-tmp-dir2947 mkdir -p .doc-tmp-dir/man1 .doc-tmp-dir/man5 .doc-tmp-dir/man72948 $(MAKE) -C Documentation DESTDIR=./ \2949 man1dir=../.doc-tmp-dir/man1 \2950 man5dir=../.doc-tmp-dir/man5 \2951 man7dir=../.doc-tmp-dir/man7 \2952 install2953 cd .doc-tmp-dir && $(TAR) cf ../$(manpages).tar .2954 gzip -n -9 -f $(manpages).tar2955 $(RM) -r .doc-tmp-dir29562957### Cleaning rules29582959distclean: clean2960 $(RM) configure2961 $(RM) config.log config.status config.cache2962 $(RM) config.mak.autogen config.mak.append2963 $(RM) -r autom4te.cache29642965profile-clean:2966 $(RM) $(addsuffix *.gcda,$(addprefix $(PROFILE_DIR)/, $(object_dirs)))2967 $(RM) $(addsuffix *.gcno,$(addprefix $(PROFILE_DIR)/, $(object_dirs)))29682969cocciclean:2970 $(RM) contrib/coccinelle/*.cocci.patch*29712972clean: profile-clean coverage-clean cocciclean2973 $(RM) *.res2974 $(RM) $(OBJECTS)2975 $(RM) $(LIB_FILE) $(XDIFF_LIB) $(VCSSVN_LIB)2976 $(RM) $(ALL_PROGRAMS) $(SCRIPT_LIB) $(BUILT_INS) git$X2977 $(RM) $(TEST_PROGRAMS) $(NO_INSTALL)2978 $(RM) $(FUZZ_PROGRAMS)2979 $(RM) -r bin-wrappers $(dep_dirs)2980 $(RM) -r po/build/2981 $(RM) *.pyc *.pyo */*.pyc */*.pyo command-list.h $(ETAGS_TARGET) tags cscope*2982 $(RM) -r $(GIT_TARNAME) .doc-tmp-dir2983 $(RM) $(GIT_TARNAME).tar.gz git-core_$(GIT_VERSION)-*.tar.gz2984 $(RM) $(htmldocs).tar.gz $(manpages).tar.gz2985 $(MAKE) -C Documentation/ clean2986ifndef NO_PERL2987 $(MAKE) -C gitweb clean2988 $(RM) -r perl/build/2989endif2990 $(MAKE) -C templates/ clean2991 $(MAKE) -C t/ clean2992ifndef NO_TCLTK2993 $(MAKE) -C gitk-git clean2994 $(MAKE) -C git-gui clean2995endif2996 $(RM) GIT-VERSION-FILE GIT-CFLAGS GIT-LDFLAGS GIT-BUILD-OPTIONS2997 $(RM) GIT-USER-AGENT GIT-PREFIX2998 $(RM) GIT-SCRIPT-DEFINES GIT-PERL-DEFINES GIT-PERL-HEADER GIT-PYTHON-VARS29993000.PHONY: all install profile-clean cocciclean clean strip3001.PHONY: shell_compatibility_test please_set_SHELL_PATH_to_a_more_modern_shell3002.PHONY: FORCE cscope30033004### Check documentation3005#3006ALL_COMMANDS = $(ALL_PROGRAMS) $(SCRIPT_LIB) $(BUILT_INS)3007ALL_COMMANDS += git3008ALL_COMMANDS += gitk3009ALL_COMMANDS += gitweb3010ALL_COMMANDS += git-gui git-citool30113012.PHONY: check-docs3013check-docs::3014 $(MAKE) -C Documentation lint-docs3015 @(for v in $(ALL_COMMANDS); \3016 do \3017 case "$$v" in \3018 git-merge-octopus | git-merge-ours | git-merge-recursive | \3019 git-merge-resolve | git-merge-subtree | \3020 git-fsck-objects | git-init-db | \3021 git-remote-* | git-stage | \3022 git-?*--?* ) continue ;; \3023 esac ; \3024 test -f "Documentation/$$v.txt" || \3025 echo "no doc: $$v"; \3026 sed -e '1,/^### command list/d' -e '/^#/d' command-list.txt | \3027 grep -q "^$$v[ ]" || \3028 case "$$v" in \3029 git) ;; \3030 *) echo "no link: $$v";; \3031 esac ; \3032 done; \3033 ( \3034 sed -e '1,/^### command list/d' \3035 -e '/^#/d' \3036 -e 's/[ ].*//' \3037 -e 's/^/listed /' command-list.txt; \3038 $(MAKE) -C Documentation print-man1 | \3039 grep '\.txt$$' | \3040 sed -e 's|Documentation/|documented |' \3041 -e 's/\.txt//'; \3042 ) | while read how cmd; \3043 do \3044 case " $(ALL_COMMANDS) " in \3045 *" $$cmd "*) ;; \3046 *) echo "removed but $$how: $$cmd" ;; \3047 esac; \3048 done ) | sort30493050### Make sure built-ins do not have dups and listed in git.c3051#3052check-builtins::3053 ./check-builtins.sh30543055### Test suite coverage testing3056#3057.PHONY: coverage coverage-clean coverage-compile coverage-test coverage-report3058.PHONY: coverage-untested-functions cover_db cover_db_html3059.PHONY: coverage-clean-results30603061coverage:3062 $(MAKE) coverage-test3063 $(MAKE) coverage-untested-functions30643065object_dirs := $(sort $(dir $(OBJECTS)))3066coverage-clean-results:3067 $(RM) $(addsuffix *.gcov,$(object_dirs))3068 $(RM) $(addsuffix *.gcda,$(object_dirs))3069 $(RM) coverage-untested-functions3070 $(RM) -r cover_db/3071 $(RM) -r cover_db_html/30723073coverage-clean: coverage-clean-results3074 $(RM) $(addsuffix *.gcno,$(object_dirs))30753076COVERAGE_CFLAGS = $(CFLAGS) -O0 -ftest-coverage -fprofile-arcs3077COVERAGE_LDFLAGS = $(CFLAGS) -O0 -lgcov3078GCOVFLAGS = --preserve-paths --branch-probabilities --all-blocks30793080coverage-compile:3081 $(MAKE) CFLAGS="$(COVERAGE_CFLAGS)" LDFLAGS="$(COVERAGE_LDFLAGS)" all30823083coverage-test: coverage-clean-results coverage-compile3084 $(MAKE) CFLAGS="$(COVERAGE_CFLAGS)" LDFLAGS="$(COVERAGE_LDFLAGS)" \3085 DEFAULT_TEST_TARGET=test -j1 test30863087coverage-report:3088 $(QUIET_GCOV)for dir in $(object_dirs); do \3089 $(GCOV) $(GCOVFLAGS) --object-directory=$$dir $$dir*.c || exit; \3090 done30913092coverage-untested-functions: coverage-report3093 grep '^function.*called 0 ' *.c.gcov \3094 | sed -e 's/\([^:]*\)\.gcov: *function \([^ ]*\) called.*/\1: \2/' \3095 > coverage-untested-functions30963097cover_db: coverage-report3098 gcov2perl -db cover_db *.gcov30993100cover_db_html: cover_db3101 cover -report html -outputdir cover_db_html cover_db310231033104### Fuzz testing3105#3106# Building fuzz targets generally requires a special set of compiler flags that3107# are not necessarily appropriate for general builds, and that vary greatly3108# depending on the compiler version used.3109#3110# An example command to build against libFuzzer from LLVM 4.0.0:3111#3112# make CC=clang CXX=clang++ \3113# FUZZ_CXXFLAGS="-fsanitize-coverage=trace-pc-guard -fsanitize=address" \3114# LIB_FUZZING_ENGINE=/usr/lib/llvm-4.0/lib/libFuzzer.a \3115# fuzz-all3116#3117FUZZ_CXXFLAGS ?= $(CFLAGS)31183119.PHONY: fuzz-all31203121$(FUZZ_PROGRAMS): all3122 $(QUIET_LINK)$(CXX) $(FUZZ_CXXFLAGS) $(LIB_OBJS) $(BUILTIN_OBJS) \3123 $(XDIFF_OBJS) $(EXTLIBS) git.o $@.o $(LIB_FUZZING_ENGINE) -o $@31243125fuzz-all: $(FUZZ_PROGRAMS)