Junio C Hamano | 2731d04 | 2005-12-01 12:26:41 -0800 | [diff] [blame] | 1 | # The default target of this Makefile is... |
Junio C Hamano | 6fc301b | 2007-01-10 12:24:54 -0800 | [diff] [blame] | 2 | all:: |
Junio C Hamano | 2731d04 | 2005-12-01 12:26:41 -0800 | [diff] [blame] | 3 | |
Shawn O. Pearce | 2314c94 | 2007-03-06 02:09:14 -0500 | [diff] [blame] | 4 | # Define V=1 to have a more verbose compile. |
Shawn O. Pearce | 74f2b2a | 2007-03-06 01:35:01 -0500 | [diff] [blame] | 5 | # |
Michal Rokos | c4582f9 | 2008-03-05 16:46:13 +0100 | [diff] [blame] | 6 | # Define SNPRINTF_RETURNS_BOGUS if your are on a system which snprintf() |
| 7 | # or vsnprintf() return -1 instead of number of characters which would |
| 8 | # have been written to the final string if enough space had been available. |
| 9 | # |
Brandon Casey | cba2252 | 2008-02-08 20:32:47 -0600 | [diff] [blame] | 10 | # Define FREAD_READS_DIRECTORIES if your are on a system which succeeds |
| 11 | # when attempting to read from an fopen'ed directory. |
| 12 | # |
Linus Torvalds | 765ac8e | 2006-02-28 15:07:20 -0800 | [diff] [blame] | 13 | # Define NO_OPENSSL environment variable if you do not have OpenSSL. |
| 14 | # This also implies MOZILLA_SHA1. |
Petr Baudis | 5bdac8b | 2005-07-29 17:48:26 +0200 | [diff] [blame] | 15 | # |
Johan Herland | 8da1e21 | 2008-06-15 12:14:12 +0200 | [diff] [blame] | 16 | # Define NO_CURL if you do not have libcurl installed. git-http-pull and |
Nick Hengeveld | 58e60dd | 2005-11-02 11:19:24 -0800 | [diff] [blame] | 17 | # git-http-push are not built, and you cannot use http:// and https:// |
| 18 | # transports. |
Johannes Schindelin | b2c0bd6 | 2005-07-31 02:14:23 +0200 | [diff] [blame] | 19 | # |
Patrick Mauritz | 6d9bbc5 | 2005-09-19 16:11:19 +0200 | [diff] [blame] | 20 | # Define CURLDIR=/foo/bar if your curl header and library files are in |
| 21 | # /foo/bar/include and /foo/bar/lib directories. |
| 22 | # |
Nick Hengeveld | 58e60dd | 2005-11-02 11:19:24 -0800 | [diff] [blame] | 23 | # Define NO_EXPAT if you do not have expat installed. git-http-push is |
| 24 | # not built, and you cannot push using http:// and https:// transports. |
| 25 | # |
Junio C Hamano | 35a730f | 2006-01-19 17:13:51 -0800 | [diff] [blame] | 26 | # Define NO_D_INO_IN_DIRENT if you don't have d_ino in your struct dirent. |
| 27 | # |
Junio C Hamano | 63be37b | 2006-01-19 17:13:57 -0800 | [diff] [blame] | 28 | # Define NO_D_TYPE_IN_DIRENT if your platform defines DT_UNKNOWN but lacks |
| 29 | # d_type in struct dirent (latest Cygwin -- will be fixed soonish). |
| 30 | # |
Ramsay Allan Jones | 579d1fb | 2006-07-30 16:38:28 +0100 | [diff] [blame] | 31 | # Define NO_C99_FORMAT if your formatted IO functions (printf/scanf et.al.) |
| 32 | # do not support the 'size specifiers' introduced by C99, namely ll, hh, |
| 33 | # j, z, t. (representing long long int, char, intmax_t, size_t, ptrdiff_t). |
Jakub Narebski | 465e649 | 2006-08-04 17:55:58 +0200 | [diff] [blame] | 34 | # some C compilers supported these specifiers prior to C99 as an extension. |
Ramsay Allan Jones | 579d1fb | 2006-07-30 16:38:28 +0100 | [diff] [blame] | 35 | # |
Linus Torvalds | ef34af2 | 2005-09-18 18:30:50 -0700 | [diff] [blame] | 36 | # Define NO_STRCASESTR if you don't have strcasestr. |
| 37 | # |
René Scharfe | b21b9f1 | 2007-09-07 00:32:54 +0200 | [diff] [blame] | 38 | # Define NO_MEMMEM if you don't have memmem. |
| 39 | # |
Peter Eriksen | 817151e | 2006-06-24 16:01:25 +0200 | [diff] [blame] | 40 | # Define NO_STRLCPY if you don't have strlcpy. |
| 41 | # |
Jason Riedy | bc6b4f5 | 2007-02-19 16:22:56 -0800 | [diff] [blame] | 42 | # Define NO_STRTOUMAX if you don't have strtoumax in the C library. |
| 43 | # If your compiler also does not support long long or does not have |
| 44 | # strtoull, define NO_STRTOULL. |
| 45 | # |
Jason Riedy | e40b61f | 2005-12-02 15:08:28 -0800 | [diff] [blame] | 46 | # Define NO_SETENV if you don't have setenv in the C library. |
| 47 | # |
Jakub Narebski | bfa8fcc | 2008-01-18 02:03:51 +0100 | [diff] [blame] | 48 | # Define NO_UNSETENV if you don't have unsetenv in the C library. |
| 49 | # |
Shawn O. Pearce | ca5bb5d | 2007-10-20 16:03:49 -0400 | [diff] [blame] | 50 | # Define NO_MKDTEMP if you don't have mkdtemp in the C library. |
| 51 | # |
Robert Schiele | 2600973 | 2008-01-24 19:34:46 +0100 | [diff] [blame] | 52 | # Define NO_SYS_SELECT_H if you don't have sys/select.h. |
| 53 | # |
Junio C Hamano | 9f0bb90 | 2006-05-02 00:40:24 -0700 | [diff] [blame] | 54 | # Define NO_SYMLINK_HEAD if you never want .git/HEAD to be a symbolic link. |
| 55 | # Enable it on Windows. By default, symrefs are still used. |
Pavel Roskin | 2fabd21 | 2005-11-15 00:59:50 -0500 | [diff] [blame] | 56 | # |
Pavel Roskin | 0285358 | 2006-07-09 02:44:58 -0700 | [diff] [blame] | 57 | # Define NO_SVN_TESTS if you want to skip time-consuming SVN interoperability |
Eric Wong | 60d02cc | 2006-07-06 00:14:16 -0700 | [diff] [blame] | 58 | # tests. These tests take up a significant amount of the total test time |
| 59 | # but are not needed unless you plan to talk to SVN repos. |
| 60 | # |
Shawn Pearce | 8eb38ca | 2006-07-24 00:28:28 -0400 | [diff] [blame] | 61 | # Define NO_FINK if you are building on Darwin/Mac OS X, have Fink |
| 62 | # installed in /sw, but don't want GIT to link against any libraries |
| 63 | # installed there. If defined you may specify your own (or Fink's) |
| 64 | # include directories and library directories by defining CFLAGS |
| 65 | # and LDFLAGS appropriately. |
| 66 | # |
| 67 | # Define NO_DARWIN_PORTS if you are building on Darwin/Mac OS X, |
| 68 | # have DarwinPorts installed in /opt/local, but don't want GIT to |
| 69 | # link against any libraries installed there. If defined you may |
| 70 | # specify your own (or DarwinPort's) include directories and |
| 71 | # library directories by defining CFLAGS and LDFLAGS appropriately. |
| 72 | # |
Petr Baudis | 5bdac8b | 2005-07-29 17:48:26 +0200 | [diff] [blame] | 73 | # Define PPC_SHA1 environment variable when running make to make use of |
| 74 | # a bundled SHA1 routine optimized for PowerPC. |
Junio C Hamano | 597c9cc | 2005-09-07 12:22:56 -0700 | [diff] [blame] | 75 | # |
Nicolas Pitre | 7c6ef2f | 2005-09-20 12:27:13 -0400 | [diff] [blame] | 76 | # Define ARM_SHA1 environment variable when running make to make use of |
| 77 | # a bundled SHA1 routine optimized for ARM. |
| 78 | # |
Junio C Hamano | f6af75d | 2006-06-23 17:57:48 -0700 | [diff] [blame] | 79 | # Define MOZILLA_SHA1 environment variable when running make to make use of |
| 80 | # a bundled SHA1 routine coming from Mozilla. It is GPL'd and should be fast |
| 81 | # on non-x86 architectures (e.g. PowerPC), while the OpenSSL version (default |
| 82 | # choice) has very fast version optimized for i586. |
| 83 | # |
Junio C Hamano | 597c9cc | 2005-09-07 12:22:56 -0700 | [diff] [blame] | 84 | # Define NEEDS_SSL_WITH_CRYPTO if you need -lcrypto with -lssl (Darwin). |
Patrick Mauritz | f0ebff0 | 2005-09-06 01:24:03 +0200 | [diff] [blame] | 85 | # |
Junio C Hamano | 597c9cc | 2005-09-07 12:22:56 -0700 | [diff] [blame] | 86 | # Define NEEDS_LIBICONV if linking with libc is not enough (Darwin). |
Patrick Mauritz | f0ebff0 | 2005-09-06 01:24:03 +0200 | [diff] [blame] | 87 | # |
| 88 | # Define NEEDS_SOCKET if linking with libc is not enough (SunOS, |
| 89 | # Patrick Mauritz). |
| 90 | # |
Johannes Schindelin | 730d48a | 2005-10-08 15:54:36 -0700 | [diff] [blame] | 91 | # Define NO_MMAP if you want to avoid mmap. |
| 92 | # |
Stefan-W. Hahn | 6900679 | 2007-01-09 22:04:12 +0100 | [diff] [blame] | 93 | # Define NO_PREAD if you have a problem with pread() system call (e.g. |
| 94 | # cygwin.dll before v1.5.22). |
| 95 | # |
Shawn O. Pearce | 1510fea | 2006-12-14 06:15:57 -0500 | [diff] [blame] | 96 | # Define NO_FAST_WORKING_DIRECTORY if accessing objects in pack files is |
| 97 | # generally faster on your platform than accessing the working directory. |
| 98 | # |
Shawn O. Pearce | c869753 | 2006-12-30 23:53:55 -0500 | [diff] [blame] | 99 | # Define NO_TRUSTABLE_FILEMODE if your filesystem may claim to support |
| 100 | # the executable mode bit, but doesn't really do so. |
| 101 | # |
hpa | 49744d6 | 2005-09-28 16:52:21 -0700 | [diff] [blame] | 102 | # Define NO_IPV6 if you lack IPv6 support and getaddrinfo(). |
| 103 | # |
Junio C Hamano | bdc37f5 | 2006-01-19 17:13:32 -0800 | [diff] [blame] | 104 | # Define NO_SOCKADDR_STORAGE if your platform does not have struct |
| 105 | # sockaddr_storage. |
| 106 | # |
Fernando J. Pereda | b6e56ec | 2006-02-16 09:38:01 +0100 | [diff] [blame] | 107 | # Define NO_ICONV if your libc does not properly support iconv. |
| 108 | # |
Ramsay Jones | fd547a9 | 2007-03-03 18:29:03 +0000 | [diff] [blame] | 109 | # Define OLD_ICONV if your library has an old iconv(), where the second |
| 110 | # (input buffer pointer) parameter is declared with type (const char **). |
| 111 | # |
David Symonds | 609a228 | 2007-11-07 14:24:28 +1100 | [diff] [blame] | 112 | # Define NO_DEFLATE_BOUND if your zlib does not have deflateBound. |
| 113 | # |
Matt Kraai | 2064887 | 2007-06-30 10:05:03 -0700 | [diff] [blame] | 114 | # Define NO_R_TO_GCC_LINKER if your gcc does not like "-R/path/lib" |
| 115 | # that tells runtime paths to dynamic libraries; |
| 116 | # "-Wl,-rpath=/path/lib" is used instead. |
Junio C Hamano | bbfc63d | 2006-12-27 14:17:35 -0800 | [diff] [blame] | 117 | # |
Petr Baudis | 5bdac8b | 2005-07-29 17:48:26 +0200 | [diff] [blame] | 118 | # Define USE_NSEC below if you want git to care about sub-second file mtimes |
| 119 | # and ctimes. Note that you need recent glibc (at least 2.2.4) for this, and |
| 120 | # it will BREAK YOUR LOCAL DIFFS! show-diff and anything using it will likely |
| 121 | # randomly break unless your underlying filesystem supports those sub-second |
| 122 | # times (my ext3 doesn't). |
Junio C Hamano | f6af75d | 2006-06-23 17:57:48 -0700 | [diff] [blame] | 123 | # |
Petr Baudis | 5bdac8b | 2005-07-29 17:48:26 +0200 | [diff] [blame] | 124 | # Define USE_STDEV below if you want git to care about the underlying device |
Johannes Schindelin | 10455d2 | 2007-11-30 11:35:23 +0000 | [diff] [blame] | 125 | # change being considered an inode change from the update-index perspective. |
Alex Riesen | f848718 | 2006-12-04 10:50:04 +0100 | [diff] [blame] | 126 | # |
Junio C Hamano | fdb2a2a | 2008-08-18 21:57:16 +0200 | [diff] [blame] | 127 | # Define NO_ST_BLOCKS_IN_STRUCT_STAT if your platform does not have st_blocks |
| 128 | # field that counts the on-disk footprint in 512-byte blocks. |
| 129 | # |
Junio C Hamano | 4c7100a | 2007-06-14 22:20:16 -0700 | [diff] [blame] | 130 | # Define ASCIIDOC8 if you want to format documentation with AsciiDoc 8 |
| 131 | # |
Jonas Fonseca | 7f55cf4 | 2007-11-14 10:38:46 +0100 | [diff] [blame] | 132 | # Define DOCBOOK_XSL_172 if you want to format man pages with DocBook XSL v1.72. |
| 133 | # |
Alex Riesen | f848718 | 2006-12-04 10:50:04 +0100 | [diff] [blame] | 134 | # Define NO_PERL_MAKEMAKER if you cannot use Makefiles generated by perl's |
| 135 | # MakeMaker (e.g. using ActiveState under Cygwin). |
| 136 | # |
Eygene Ryabinkin | 3cfaf11 | 2007-03-28 04:00:23 -0700 | [diff] [blame] | 137 | # Define NO_TCLTK if you do not want Tcl/Tk GUI. |
| 138 | # |
Shawn O. Pearce | 5f5dbd7 | 2007-05-07 23:36:31 -0400 | [diff] [blame] | 139 | # The TCL_PATH variable governs the location of the Tcl interpreter |
| 140 | # used to optimize git-gui for your system. Only used if NO_TCLTK |
| 141 | # is not set. Defaults to the bare 'tclsh'. |
| 142 | # |
| 143 | # The TCLTK_PATH variable governs the location of the Tcl/Tk interpreter. |
Eygene Ryabinkin | 81b63c7 | 2007-03-28 04:12:07 -0700 | [diff] [blame] | 144 | # If not set it defaults to the bare 'wish'. If it is set to the empty |
| 145 | # string then NO_TCLTK will be forced (this is used by configure script). |
| 146 | # |
Nicolas Pitre | 8ecce68 | 2007-09-06 02:13:11 -0400 | [diff] [blame] | 147 | # Define THREADED_DELTA_SEARCH if you have pthreads and wish to exploit |
| 148 | # parallel delta searching when packing objects. |
| 149 | # |
Brian Downing | 43fe901 | 2008-02-05 15:10:44 -0600 | [diff] [blame] | 150 | # Define INTERNAL_QSORT to use Git's implementation of qsort(), which |
| 151 | # is a simplified version of the merge sort used in glibc. This is |
| 152 | # recommended if Git triggers O(n^2) behavior in your platform's qsort(). |
| 153 | # |
Jeff King | 5f7c643 | 2008-03-12 17:39:16 -0400 | [diff] [blame] | 154 | # Define NO_EXTERNAL_GREP if you don't want "git grep" to ever call |
| 155 | # your external grep (e.g., if your system lacks grep, if its grep is |
| 156 | # broken, or spawning external process is slower than built-in grep git has). |
Petr Baudis | 5bdac8b | 2005-07-29 17:48:26 +0200 | [diff] [blame] | 157 | |
Junio C Hamano | 9b88fce | 2005-12-27 14:40:17 -0800 | [diff] [blame] | 158 | GIT-VERSION-FILE: .FORCE-GIT-VERSION-FILE |
Fredrik Kuivinen | 3654638 | 2006-02-14 00:15:14 +0100 | [diff] [blame] | 159 | @$(SHELL_PATH) ./GIT-VERSION-GEN |
Junio C Hamano | 9b88fce | 2005-12-27 14:40:17 -0800 | [diff] [blame] | 160 | -include GIT-VERSION-FILE |
Petr Baudis | 5bdac8b | 2005-07-29 17:48:26 +0200 | [diff] [blame] | 161 | |
Paul Jakma | e15f545 | 2006-02-20 23:36:28 +0000 | [diff] [blame] | 162 | uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not') |
| 163 | uname_M := $(shell sh -c 'uname -m 2>/dev/null || echo not') |
| 164 | uname_O := $(shell sh -c 'uname -o 2>/dev/null || echo not') |
| 165 | uname_R := $(shell sh -c 'uname -r 2>/dev/null || echo not') |
| 166 | uname_P := $(shell sh -c 'uname -p 2>/dev/null || echo not') |
| 167 | |
Junio C Hamano | 94d2331 | 2005-11-13 01:46:13 -0800 | [diff] [blame] | 168 | # CFLAGS and LDFLAGS are for the users to override from the command line. |
Junio C Hamano | 12aa745 | 2005-11-04 23:50:09 -0800 | [diff] [blame] | 169 | |
Pavel Roskin | b05701c | 2005-08-06 01:36:15 -0400 | [diff] [blame] | 170 | CFLAGS = -g -O2 -Wall |
Junio C Hamano | 94d2331 | 2005-11-13 01:46:13 -0800 | [diff] [blame] | 171 | LDFLAGS = |
Junio C Hamano | 12aa745 | 2005-11-04 23:50:09 -0800 | [diff] [blame] | 172 | ALL_CFLAGS = $(CFLAGS) |
Junio C Hamano | 94d2331 | 2005-11-13 01:46:13 -0800 | [diff] [blame] | 173 | ALL_LDFLAGS = $(LDFLAGS) |
Junio C Hamano | 4dc0002 | 2006-01-12 21:42:25 -0800 | [diff] [blame] | 174 | STRIP ?= strip |
Thomas Glanzmann | 29c2cce | 2005-05-07 10:41:54 +0200 | [diff] [blame] | 175 | |
Johannes Sixt | 49fa65a | 2008-07-23 21:12:18 +0200 | [diff] [blame] | 176 | # Among the variables below, these: |
| 177 | # gitexecdir |
| 178 | # template_dir |
| 179 | # htmldir |
| 180 | # ETC_GITCONFIG (but not sysconfdir) |
| 181 | # can be specified as a relative path ../some/where/else (which must begin |
| 182 | # with ../); this is interpreted as relative to $(bindir) and "git" at |
| 183 | # runtime figures out where they are based on the path to the executable. |
| 184 | # This can help installing the suite in a relocatable way. |
| 185 | |
Pavel Roskin | b05701c | 2005-08-06 01:36:15 -0400 | [diff] [blame] | 186 | prefix = $(HOME) |
| 187 | bindir = $(prefix)/bin |
Sergei Organov | 8e566f2 | 2007-12-06 21:33:01 +0300 | [diff] [blame] | 188 | mandir = $(prefix)/share/man |
Junio C Hamano | a149a1a | 2007-12-10 01:35:29 -0800 | [diff] [blame] | 189 | infodir = $(prefix)/share/info |
Nguyễn Thái Ngọc Duy | f28ac70 | 2007-11-28 23:21:57 +0700 | [diff] [blame] | 190 | gitexecdir = $(prefix)/libexec/git-core |
Johannes Sixt | 9354768 | 2007-06-11 10:02:17 +0200 | [diff] [blame] | 191 | sharedir = $(prefix)/share |
Johannes Sixt | d52fd42 | 2007-06-11 11:10:47 +0200 | [diff] [blame] | 192 | template_dir = $(sharedir)/git-core/templates |
Christian Couder | 5d6491c | 2007-12-02 06:07:55 +0100 | [diff] [blame] | 193 | htmldir=$(sharedir)/doc/git-doc |
Josh Triplett | b51b8bb | 2007-04-24 00:51:35 -0700 | [diff] [blame] | 194 | ifeq ($(prefix),/usr) |
| 195 | sysconfdir = /etc |
| 196 | else |
| 197 | sysconfdir = $(prefix)/etc |
| 198 | endif |
Robert Schiele | 10861be | 2007-08-01 06:30:35 +0200 | [diff] [blame] | 199 | lib = lib |
Josh Triplett | b51b8bb | 2007-04-24 00:51:35 -0700 | [diff] [blame] | 200 | ETC_GITCONFIG = $(sysconfdir)/gitconfig |
Petr Baudis | a682ef9 | 2005-08-05 01:56:38 +0200 | [diff] [blame] | 201 | # DESTDIR= |
Petr Baudis | 5c2a7fb | 2005-04-13 02:14:06 -0700 | [diff] [blame] | 202 | |
Martin Waitz | 5d043a3 | 2006-08-01 21:34:08 +0200 | [diff] [blame] | 203 | # default configuration for gitweb |
Jeff King | c8d138a | 2006-08-02 15:23:34 -0400 | [diff] [blame] | 204 | GITWEB_CONFIG = gitweb_config.perl |
Gerrit Pape | 17a8b25 | 2008-03-26 18:11:19 +0000 | [diff] [blame] | 205 | GITWEB_CONFIG_SYSTEM = /etc/gitweb.conf |
Yasushi SHOJI | 2de21fa | 2006-08-15 07:50:49 +0900 | [diff] [blame] | 206 | GITWEB_HOME_LINK_STR = projects |
Martin Waitz | 5d043a3 | 2006-08-01 21:34:08 +0200 | [diff] [blame] | 207 | GITWEB_SITENAME = |
| 208 | GITWEB_PROJECTROOT = /pub/git |
Luke Lu | ca5e949 | 2007-10-16 20:45:25 -0700 | [diff] [blame] | 209 | GITWEB_PROJECT_MAXDEPTH = 2007 |
Matthias Lederhofer | 32f4aac | 2006-09-17 00:31:01 +0200 | [diff] [blame] | 210 | GITWEB_EXPORT_OK = |
| 211 | GITWEB_STRICT_EXPORT = |
Jakub Narebski | 19a8721 | 2006-08-15 23:03:17 +0200 | [diff] [blame] | 212 | GITWEB_BASE_URL = |
Martin Waitz | 5d043a3 | 2006-08-01 21:34:08 +0200 | [diff] [blame] | 213 | GITWEB_LIST = |
| 214 | GITWEB_HOMETEXT = indextext.html |
| 215 | GITWEB_CSS = gitweb.css |
Martin Waitz | 281f2f6 | 2006-07-31 00:38:39 +0200 | [diff] [blame] | 216 | GITWEB_LOGO = git-logo.png |
Jakub Narebski | 0b5deba | 2006-09-04 20:32:13 +0200 | [diff] [blame] | 217 | GITWEB_FAVICON = git-favicon.png |
Alan Chandler | b2d3476 | 2006-10-03 13:49:03 +0100 | [diff] [blame] | 218 | GITWEB_SITE_HEADER = |
| 219 | GITWEB_SITE_FOOTER = |
Martin Waitz | 5d043a3 | 2006-08-01 21:34:08 +0200 | [diff] [blame] | 220 | |
Johannes Sixt | 49fa65a | 2008-07-23 21:12:18 +0200 | [diff] [blame] | 221 | export prefix bindir sharedir htmldir sysconfdir |
Jakub Narebski | e14421b | 2006-06-29 22:11:25 +0200 | [diff] [blame] | 222 | |
Pavel Roskin | b05701c | 2005-08-06 01:36:15 -0400 | [diff] [blame] | 223 | CC = gcc |
| 224 | AR = ar |
Emil Medve | 4cb08df | 2007-07-14 12:51:44 -0500 | [diff] [blame] | 225 | RM = rm -f |
Junio C Hamano | 229a7ed | 2005-09-23 10:41:40 -0700 | [diff] [blame] | 226 | TAR = tar |
David Kastrup | 89b2f19 | 2007-07-29 15:23:28 -0700 | [diff] [blame] | 227 | FIND = find |
Pavel Roskin | b05701c | 2005-08-06 01:36:15 -0400 | [diff] [blame] | 228 | INSTALL = install |
| 229 | RPMBUILD = rpmbuild |
Shawn O. Pearce | 5f5dbd7 | 2007-05-07 23:36:31 -0400 | [diff] [blame] | 230 | TCL_PATH = tclsh |
Eygene Ryabinkin | 81b63c7 | 2007-03-28 04:12:07 -0700 | [diff] [blame] | 231 | TCLTK_PATH = wish |
Linus Torvalds | e83c516 | 2005-04-07 15:13:13 -0700 | [diff] [blame] | 232 | |
Shawn O. Pearce | 5f5dbd7 | 2007-05-07 23:36:31 -0400 | [diff] [blame] | 233 | export TCL_PATH TCLTK_PATH |
| 234 | |
Linus Torvalds | 44c9e85 | 2005-07-03 10:02:35 -0700 | [diff] [blame] | 235 | # sparse is architecture-neutral, which means that we need to tell it |
| 236 | # explicitly what architecture to check for. Fix this up for yours.. |
Pavel Roskin | b05701c | 2005-08-06 01:36:15 -0400 | [diff] [blame] | 237 | SPARSE_FLAGS = -D__BIG_ENDIAN__ -D__powerpc__ |
Linus Torvalds | 44c9e85 | 2005-07-03 10:02:35 -0700 | [diff] [blame] | 238 | |
Petr Baudis | 28818ff | 2005-07-29 17:50:24 +0200 | [diff] [blame] | 239 | |
| 240 | |
| 241 | ### --- END CONFIGURATION SECTION --- |
| 242 | |
Petr Baudis | 8d7f586 | 2006-06-25 03:47:03 +0200 | [diff] [blame] | 243 | # Those must not be GNU-specific; they are shared with perl/ which may |
Petr Baudis | 18b0fc1 | 2006-09-23 20:20:47 +0200 | [diff] [blame] | 244 | # be built by a different compiler. (Note that this is an artifact now |
| 245 | # but it still might be nice to keep that distinction.) |
| 246 | BASIC_CFLAGS = |
| 247 | BASIC_LDFLAGS = |
Petr Baudis | 8d7f586 | 2006-06-25 03:47:03 +0200 | [diff] [blame] | 248 | |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 249 | SCRIPT_SH += git-am.sh |
| 250 | SCRIPT_SH += git-bisect.sh |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 251 | SCRIPT_SH += git-filter-branch.sh |
| 252 | SCRIPT_SH += git-lost-found.sh |
| 253 | SCRIPT_SH += git-merge-octopus.sh |
| 254 | SCRIPT_SH += git-merge-one-file.sh |
| 255 | SCRIPT_SH += git-merge-resolve.sh |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 256 | SCRIPT_SH += git-mergetool.sh |
| 257 | SCRIPT_SH += git-parse-remote.sh |
| 258 | SCRIPT_SH += git-pull.sh |
| 259 | SCRIPT_SH += git-quiltimport.sh |
| 260 | SCRIPT_SH += git-rebase--interactive.sh |
| 261 | SCRIPT_SH += git-rebase.sh |
| 262 | SCRIPT_SH += git-repack.sh |
| 263 | SCRIPT_SH += git-request-pull.sh |
| 264 | SCRIPT_SH += git-sh-setup.sh |
| 265 | SCRIPT_SH += git-stash.sh |
| 266 | SCRIPT_SH += git-submodule.sh |
| 267 | SCRIPT_SH += git-web--browse.sh |
Petr Baudis | 28818ff | 2005-07-29 17:50:24 +0200 | [diff] [blame] | 268 | |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 269 | SCRIPT_PERL += git-add--interactive.perl |
| 270 | SCRIPT_PERL += git-archimport.perl |
| 271 | SCRIPT_PERL += git-cvsexportcommit.perl |
| 272 | SCRIPT_PERL += git-cvsimport.perl |
| 273 | SCRIPT_PERL += git-cvsserver.perl |
| 274 | SCRIPT_PERL += git-relink.perl |
| 275 | SCRIPT_PERL += git-send-email.perl |
| 276 | SCRIPT_PERL += git-svn.perl |
Junio C Hamano | 60036a4 | 2005-07-30 17:31:47 -0700 | [diff] [blame] | 277 | |
Andreas Ericsson | d6ebd25 | 2005-11-22 00:44:15 +0100 | [diff] [blame] | 278 | SCRIPTS = $(patsubst %.sh,%,$(SCRIPT_SH)) \ |
| 279 | $(patsubst %.perl,%,$(SCRIPT_PERL)) \ |
Shawn O. Pearce | e475fe1 | 2007-11-23 15:35:08 -0500 | [diff] [blame] | 280 | git-instaweb |
Andreas Ericsson | d6ebd25 | 2005-11-22 00:44:15 +0100 | [diff] [blame] | 281 | |
Junio C Hamano | 42f7740 | 2006-08-15 21:38:07 -0700 | [diff] [blame] | 282 | # Empty... |
| 283 | EXTRA_PROGRAMS = |
Andreas Ericsson | d6ebd25 | 2005-11-22 00:44:15 +0100 | [diff] [blame] | 284 | |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 285 | # ... and all the rest that could be moved out of bindir to gitexecdir |
| 286 | PROGRAMS += $(EXTRA_PROGRAMS) |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 287 | PROGRAMS += git-fast-import$X |
| 288 | PROGRAMS += git-fetch-pack$X |
| 289 | PROGRAMS += git-hash-object$X |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 290 | PROGRAMS += git-index-pack$X |
| 291 | PROGRAMS += git-merge-index$X |
| 292 | PROGRAMS += git-merge-tree$X |
| 293 | PROGRAMS += git-mktag$X |
| 294 | PROGRAMS += git-mktree$X |
| 295 | PROGRAMS += git-pack-redundant$X |
| 296 | PROGRAMS += git-patch-id$X |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 297 | PROGRAMS += git-send-pack$X |
Johannes Sixt | e705d75 | 2008-09-08 12:46:55 +0200 | [diff] [blame] | 298 | PROGRAMS += git-shell$X |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 299 | PROGRAMS += git-show-index$X |
| 300 | PROGRAMS += git-unpack-file$X |
| 301 | PROGRAMS += git-update-server-info$X |
| 302 | PROGRAMS += git-upload-pack$X |
| 303 | PROGRAMS += git-var$X |
| 304 | |
Junio C Hamano | 1736855 | 2008-02-23 11:08:25 -0800 | [diff] [blame] | 305 | # List built-in command $C whose implementation cmd_$C() is not in |
| 306 | # builtin-$C.o but is linked in as part of some other command. |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 307 | BUILT_INS += $(patsubst builtin-%.o,git-%$X,$(BUILTIN_OBJS)) |
| 308 | |
| 309 | BUILT_INS += git-cherry-pick$X |
| 310 | BUILT_INS += git-cherry$X |
| 311 | BUILT_INS += git-format-patch$X |
| 312 | BUILT_INS += git-fsck-objects$X |
| 313 | BUILT_INS += git-get-tar-commit-id$X |
| 314 | BUILT_INS += git-init$X |
| 315 | BUILT_INS += git-merge-subtree$X |
| 316 | BUILT_INS += git-peek-remote$X |
| 317 | BUILT_INS += git-repo-config$X |
| 318 | BUILT_INS += git-show$X |
| 319 | BUILT_INS += git-status$X |
| 320 | BUILT_INS += git-whatchanged$X |
Junio C Hamano | 9173080 | 2006-04-10 17:37:58 -0700 | [diff] [blame] | 321 | |
Junio C Hamano | b42934d | 2006-01-12 21:37:17 -0800 | [diff] [blame] | 322 | # what 'all' will build and 'install' will install, in gitexecdir |
Junio C Hamano | 6506e15 | 2007-02-06 21:27:09 -0800 | [diff] [blame] | 323 | ALL_PROGRAMS = $(PROGRAMS) $(SCRIPTS) |
Linus Torvalds | e83c516 | 2005-04-07 15:13:13 -0700 | [diff] [blame] | 324 | |
Eygene Ryabinkin | 3cfaf11 | 2007-03-28 04:00:23 -0700 | [diff] [blame] | 325 | # what 'all' will build but not install in gitexecdir |
| 326 | OTHER_PROGRAMS = git$X gitweb/gitweb.cgi |
Eygene Ryabinkin | 3cfaf11 | 2007-03-28 04:00:23 -0700 | [diff] [blame] | 327 | |
Ryan Anderson | 3d32051 | 2005-11-21 00:11:22 -0500 | [diff] [blame] | 328 | # Set paths to tools early so that they can be used for version tests. |
| 329 | ifndef SHELL_PATH |
| 330 | SHELL_PATH = /bin/sh |
| 331 | endif |
| 332 | ifndef PERL_PATH |
| 333 | PERL_PATH = /usr/bin/perl |
| 334 | endif |
Junio C Hamano | 720d150 | 2005-09-10 17:46:27 -0700 | [diff] [blame] | 335 | |
Luben Tuikov | 3a79347 | 2006-12-14 23:03:03 -0800 | [diff] [blame] | 336 | export PERL_PATH |
| 337 | |
Linus Torvalds | 0a02ce7 | 2005-04-18 12:49:39 -0700 | [diff] [blame] | 338 | LIB_FILE=libgit.a |
Linus Torvalds | 3443546 | 2006-03-24 20:13:22 -0800 | [diff] [blame] | 339 | XDIFF_LIB=xdiff/lib.a |
Linus Torvalds | 0a02ce7 | 2005-04-18 12:49:39 -0700 | [diff] [blame] | 340 | |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 341 | LIB_H += archive.h |
| 342 | LIB_H += attr.h |
| 343 | LIB_H += blob.h |
| 344 | LIB_H += builtin.h |
| 345 | LIB_H += cache.h |
| 346 | LIB_H += cache-tree.h |
| 347 | LIB_H += commit.h |
Johannes Sixt | f4626df | 2007-12-01 21:24:59 +0100 | [diff] [blame] | 348 | LIB_H += compat/mingw.h |
Dmitry Potapov | adbc0b6 | 2008-09-30 17:53:47 +0400 | [diff] [blame] | 349 | LIB_H += compat/cygwin.h |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 350 | LIB_H += csum-file.h |
| 351 | LIB_H += decorate.h |
| 352 | LIB_H += delta.h |
| 353 | LIB_H += diffcore.h |
| 354 | LIB_H += diff.h |
| 355 | LIB_H += dir.h |
| 356 | LIB_H += fsck.h |
| 357 | LIB_H += git-compat-util.h |
Adam Simpkins | c12172d | 2008-05-04 03:36:53 -0700 | [diff] [blame] | 358 | LIB_H += graph.h |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 359 | LIB_H += grep.h |
| 360 | LIB_H += hash.h |
Miklos Vajna | 940208a | 2008-07-30 01:16:58 +0200 | [diff] [blame] | 361 | LIB_H += help.h |
Johannes Schindelin | 8af84da | 2008-08-31 15:50:23 +0200 | [diff] [blame] | 362 | LIB_H += levenshtein.h |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 363 | LIB_H += list-objects.h |
| 364 | LIB_H += ll-merge.h |
| 365 | LIB_H += log-tree.h |
| 366 | LIB_H += mailmap.h |
Miklos Vajna | db3a954 | 2008-09-03 01:49:05 +0200 | [diff] [blame] | 367 | LIB_H += merge-recursive.h |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 368 | LIB_H += object.h |
| 369 | LIB_H += pack.h |
Johan Herland | 94e724a | 2008-06-15 16:05:06 +0200 | [diff] [blame] | 370 | LIB_H += pack-refs.h |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 371 | LIB_H += pack-revindex.h |
| 372 | LIB_H += parse-options.h |
| 373 | LIB_H += patch-ids.h |
Johannes Schindelin | c455c87 | 2008-07-21 19:03:49 +0100 | [diff] [blame] | 374 | LIB_H += string-list.h |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 375 | LIB_H += pkt-line.h |
| 376 | LIB_H += progress.h |
| 377 | LIB_H += quote.h |
| 378 | LIB_H += reflog-walk.h |
| 379 | LIB_H += refs.h |
| 380 | LIB_H += remote.h |
Stephan Beyer | 5b2fd95 | 2008-07-09 14:58:57 +0200 | [diff] [blame] | 381 | LIB_H += rerere.h |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 382 | LIB_H += revision.h |
| 383 | LIB_H += run-command.h |
Junio C Hamano | 628522e | 2007-12-29 02:05:47 -0800 | [diff] [blame] | 384 | LIB_H += sha1-lookup.h |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 385 | LIB_H += sideband.h |
| 386 | LIB_H += strbuf.h |
| 387 | LIB_H += tag.h |
| 388 | LIB_H += transport.h |
| 389 | LIB_H += tree.h |
| 390 | LIB_H += tree-walk.h |
| 391 | LIB_H += unpack-trees.h |
Jeff King | be58e70 | 2008-10-05 17:43:21 -0400 | [diff] [blame^] | 392 | LIB_H += userdiff.h |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 393 | LIB_H += utf8.h |
Junio C Hamano | d3d20b8 | 2008-05-26 14:56:19 -0700 | [diff] [blame] | 394 | LIB_H += wt-status.h |
Junio C Hamano | 8f3f9b0 | 2005-07-23 17:54:41 -0700 | [diff] [blame] | 395 | |
Dmitry Potapov | 5b8e6f8 | 2008-06-28 00:46:42 +0400 | [diff] [blame] | 396 | LIB_OBJS += abspath.o |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 397 | LIB_OBJS += alias.o |
| 398 | LIB_OBJS += alloc.o |
| 399 | LIB_OBJS += archive.o |
| 400 | LIB_OBJS += archive-tar.o |
| 401 | LIB_OBJS += archive-zip.o |
| 402 | LIB_OBJS += attr.o |
| 403 | LIB_OBJS += base85.o |
| 404 | LIB_OBJS += blob.o |
| 405 | LIB_OBJS += branch.o |
| 406 | LIB_OBJS += bundle.o |
| 407 | LIB_OBJS += cache-tree.o |
| 408 | LIB_OBJS += color.o |
| 409 | LIB_OBJS += combine-diff.o |
| 410 | LIB_OBJS += commit.o |
| 411 | LIB_OBJS += config.o |
| 412 | LIB_OBJS += connect.o |
| 413 | LIB_OBJS += convert.o |
| 414 | LIB_OBJS += copy.o |
| 415 | LIB_OBJS += csum-file.o |
| 416 | LIB_OBJS += ctype.o |
| 417 | LIB_OBJS += date.o |
| 418 | LIB_OBJS += decorate.o |
| 419 | LIB_OBJS += diffcore-break.o |
| 420 | LIB_OBJS += diffcore-delta.o |
| 421 | LIB_OBJS += diffcore-order.o |
| 422 | LIB_OBJS += diffcore-pickaxe.o |
| 423 | LIB_OBJS += diffcore-rename.o |
| 424 | LIB_OBJS += diff-delta.o |
Junio C Hamano | 0569e9b | 2008-05-23 22:28:56 -0700 | [diff] [blame] | 425 | LIB_OBJS += diff-no-index.o |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 426 | LIB_OBJS += diff-lib.o |
| 427 | LIB_OBJS += diff.o |
| 428 | LIB_OBJS += dir.o |
Stephan Beyer | d82f33e | 2008-07-25 18:28:41 +0200 | [diff] [blame] | 429 | LIB_OBJS += editor.o |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 430 | LIB_OBJS += entry.o |
| 431 | LIB_OBJS += environment.o |
| 432 | LIB_OBJS += exec_cmd.o |
| 433 | LIB_OBJS += fsck.o |
Adam Simpkins | c12172d | 2008-05-04 03:36:53 -0700 | [diff] [blame] | 434 | LIB_OBJS += graph.o |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 435 | LIB_OBJS += grep.o |
| 436 | LIB_OBJS += hash.o |
| 437 | LIB_OBJS += help.o |
| 438 | LIB_OBJS += ident.o |
| 439 | LIB_OBJS += interpolate.o |
Johannes Schindelin | 8af84da | 2008-08-31 15:50:23 +0200 | [diff] [blame] | 440 | LIB_OBJS += levenshtein.o |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 441 | LIB_OBJS += list-objects.o |
| 442 | LIB_OBJS += ll-merge.o |
| 443 | LIB_OBJS += lockfile.o |
| 444 | LIB_OBJS += log-tree.o |
| 445 | LIB_OBJS += mailmap.o |
| 446 | LIB_OBJS += match-trees.o |
| 447 | LIB_OBJS += merge-file.o |
Miklos Vajna | 9047ebb | 2008-08-12 18:45:14 +0200 | [diff] [blame] | 448 | LIB_OBJS += merge-recursive.o |
Linus Torvalds | 96872bc | 2008-03-21 13:16:24 -0700 | [diff] [blame] | 449 | LIB_OBJS += name-hash.o |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 450 | LIB_OBJS += object.o |
| 451 | LIB_OBJS += pack-check.o |
Johan Herland | 94e724a | 2008-06-15 16:05:06 +0200 | [diff] [blame] | 452 | LIB_OBJS += pack-refs.o |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 453 | LIB_OBJS += pack-revindex.o |
| 454 | LIB_OBJS += pack-write.o |
| 455 | LIB_OBJS += pager.o |
| 456 | LIB_OBJS += parse-options.o |
| 457 | LIB_OBJS += patch-delta.o |
| 458 | LIB_OBJS += patch-ids.o |
Johannes Schindelin | c455c87 | 2008-07-21 19:03:49 +0100 | [diff] [blame] | 459 | LIB_OBJS += string-list.o |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 460 | LIB_OBJS += path.o |
| 461 | LIB_OBJS += pkt-line.o |
| 462 | LIB_OBJS += pretty.o |
| 463 | LIB_OBJS += progress.o |
| 464 | LIB_OBJS += quote.o |
| 465 | LIB_OBJS += reachable.o |
| 466 | LIB_OBJS += read-cache.o |
| 467 | LIB_OBJS += reflog-walk.o |
| 468 | LIB_OBJS += refs.o |
| 469 | LIB_OBJS += remote.o |
Stephan Beyer | 5b2fd95 | 2008-07-09 14:58:57 +0200 | [diff] [blame] | 470 | LIB_OBJS += rerere.o |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 471 | LIB_OBJS += revision.o |
| 472 | LIB_OBJS += run-command.o |
| 473 | LIB_OBJS += server-info.o |
| 474 | LIB_OBJS += setup.o |
| 475 | LIB_OBJS += sha1_file.o |
Junio C Hamano | 628522e | 2007-12-29 02:05:47 -0800 | [diff] [blame] | 476 | LIB_OBJS += sha1-lookup.o |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 477 | LIB_OBJS += sha1_name.o |
| 478 | LIB_OBJS += shallow.o |
| 479 | LIB_OBJS += sideband.o |
| 480 | LIB_OBJS += strbuf.o |
| 481 | LIB_OBJS += symlinks.o |
| 482 | LIB_OBJS += tag.o |
| 483 | LIB_OBJS += trace.o |
| 484 | LIB_OBJS += transport.o |
| 485 | LIB_OBJS += tree-diff.o |
| 486 | LIB_OBJS += tree.o |
| 487 | LIB_OBJS += tree-walk.o |
| 488 | LIB_OBJS += unpack-trees.o |
Jeff King | be58e70 | 2008-10-05 17:43:21 -0400 | [diff] [blame^] | 489 | LIB_OBJS += userdiff.o |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 490 | LIB_OBJS += usage.o |
| 491 | LIB_OBJS += utf8.o |
| 492 | LIB_OBJS += walker.o |
Linus Torvalds | 112db55 | 2008-06-22 12:19:25 -0700 | [diff] [blame] | 493 | LIB_OBJS += wrapper.o |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 494 | LIB_OBJS += write_or_die.o |
| 495 | LIB_OBJS += ws.o |
| 496 | LIB_OBJS += wt-status.o |
| 497 | LIB_OBJS += xdiff-interface.o |
Josef Weidendorfer | b1bf95b | 2005-07-31 21:17:43 +0200 | [diff] [blame] | 498 | |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 499 | BUILTIN_OBJS += builtin-add.o |
| 500 | BUILTIN_OBJS += builtin-annotate.o |
| 501 | BUILTIN_OBJS += builtin-apply.o |
| 502 | BUILTIN_OBJS += builtin-archive.o |
| 503 | BUILTIN_OBJS += builtin-blame.o |
| 504 | BUILTIN_OBJS += builtin-branch.o |
| 505 | BUILTIN_OBJS += builtin-bundle.o |
| 506 | BUILTIN_OBJS += builtin-cat-file.o |
| 507 | BUILTIN_OBJS += builtin-check-attr.o |
| 508 | BUILTIN_OBJS += builtin-check-ref-format.o |
| 509 | BUILTIN_OBJS += builtin-checkout-index.o |
| 510 | BUILTIN_OBJS += builtin-checkout.o |
| 511 | BUILTIN_OBJS += builtin-clean.o |
Daniel Barkalow | 8434c2f | 2008-04-27 13:39:30 -0400 | [diff] [blame] | 512 | BUILTIN_OBJS += builtin-clone.o |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 513 | BUILTIN_OBJS += builtin-commit-tree.o |
| 514 | BUILTIN_OBJS += builtin-commit.o |
| 515 | BUILTIN_OBJS += builtin-config.o |
| 516 | BUILTIN_OBJS += builtin-count-objects.o |
| 517 | BUILTIN_OBJS += builtin-describe.o |
| 518 | BUILTIN_OBJS += builtin-diff-files.o |
| 519 | BUILTIN_OBJS += builtin-diff-index.o |
| 520 | BUILTIN_OBJS += builtin-diff-tree.o |
| 521 | BUILTIN_OBJS += builtin-diff.o |
| 522 | BUILTIN_OBJS += builtin-fast-export.o |
| 523 | BUILTIN_OBJS += builtin-fetch--tool.o |
| 524 | BUILTIN_OBJS += builtin-fetch-pack.o |
| 525 | BUILTIN_OBJS += builtin-fetch.o |
| 526 | BUILTIN_OBJS += builtin-fmt-merge-msg.o |
| 527 | BUILTIN_OBJS += builtin-for-each-ref.o |
| 528 | BUILTIN_OBJS += builtin-fsck.o |
| 529 | BUILTIN_OBJS += builtin-gc.o |
| 530 | BUILTIN_OBJS += builtin-grep.o |
Miklos Vajna | 3d78d1f | 2008-08-02 10:08:38 +0200 | [diff] [blame] | 531 | BUILTIN_OBJS += builtin-help.o |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 532 | BUILTIN_OBJS += builtin-init-db.o |
| 533 | BUILTIN_OBJS += builtin-log.o |
| 534 | BUILTIN_OBJS += builtin-ls-files.o |
| 535 | BUILTIN_OBJS += builtin-ls-remote.o |
| 536 | BUILTIN_OBJS += builtin-ls-tree.o |
| 537 | BUILTIN_OBJS += builtin-mailinfo.o |
| 538 | BUILTIN_OBJS += builtin-mailsplit.o |
Miklos Vajna | 1c7b76b | 2008-07-07 19:24:20 +0200 | [diff] [blame] | 539 | BUILTIN_OBJS += builtin-merge.o |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 540 | BUILTIN_OBJS += builtin-merge-base.o |
| 541 | BUILTIN_OBJS += builtin-merge-file.o |
| 542 | BUILTIN_OBJS += builtin-merge-ours.o |
| 543 | BUILTIN_OBJS += builtin-merge-recursive.o |
| 544 | BUILTIN_OBJS += builtin-mv.o |
| 545 | BUILTIN_OBJS += builtin-name-rev.o |
| 546 | BUILTIN_OBJS += builtin-pack-objects.o |
| 547 | BUILTIN_OBJS += builtin-pack-refs.o |
| 548 | BUILTIN_OBJS += builtin-prune-packed.o |
| 549 | BUILTIN_OBJS += builtin-prune.o |
| 550 | BUILTIN_OBJS += builtin-push.o |
| 551 | BUILTIN_OBJS += builtin-read-tree.o |
Junio C Hamano | be5908a | 2008-09-09 01:27:08 -0700 | [diff] [blame] | 552 | BUILTIN_OBJS += builtin-receive-pack.o |
Junio C Hamano | 74ca5e6 | 2008-03-12 01:46:26 -0700 | [diff] [blame] | 553 | BUILTIN_OBJS += builtin-reflog.o |
| 554 | BUILTIN_OBJS += builtin-remote.o |
| 555 | BUILTIN_OBJS += builtin-rerere.o |
| 556 | BUILTIN_OBJS += builtin-reset.o |
| 557 | BUILTIN_OBJS += builtin-rev-list.o |
| 558 | BUILTIN_OBJS += builtin-rev-parse.o |
| 559 | BUILTIN_OBJS += builtin-revert.o |
| 560 | BUILTIN_OBJS += builtin-rm.o |
| 561 | BUILTIN_OBJS += builtin-send-pack.o |
| 562 | BUILTIN_OBJS += builtin-shortlog.o |
| 563 | BUILTIN_OBJS += builtin-show-branch.o |
| 564 | BUILTIN_OBJS += builtin-show-ref.o |
| 565 | BUILTIN_OBJS += builtin-stripspace.o |
| 566 | BUILTIN_OBJS += builtin-symbolic-ref.o |
| 567 | BUILTIN_OBJS += builtin-tag.o |
| 568 | BUILTIN_OBJS += builtin-tar-tree.o |
| 569 | BUILTIN_OBJS += builtin-unpack-objects.o |
| 570 | BUILTIN_OBJS += builtin-update-index.o |
| 571 | BUILTIN_OBJS += builtin-update-ref.o |
| 572 | BUILTIN_OBJS += builtin-upload-archive.o |
| 573 | BUILTIN_OBJS += builtin-verify-pack.o |
| 574 | BUILTIN_OBJS += builtin-verify-tag.o |
| 575 | BUILTIN_OBJS += builtin-write-tree.o |
Linus Torvalds | 70827b1 | 2006-04-21 10:27:34 -0700 | [diff] [blame] | 576 | |
Johannes Schindelin | 54c261f | 2006-03-27 01:14:52 +0200 | [diff] [blame] | 577 | GITLIBS = $(LIB_FILE) $(XDIFF_LIB) |
Robert Schiele | bef19da | 2007-07-29 20:35:45 +0200 | [diff] [blame] | 578 | EXTLIBS = |
Linus Torvalds | cef661f | 2005-04-21 12:33:22 -0700 | [diff] [blame] | 579 | |
Junio C Hamano | 229a7ed | 2005-09-23 10:41:40 -0700 | [diff] [blame] | 580 | # |
| 581 | # Platform specific tweaks |
| 582 | # |
Junio C Hamano | f7c1534 | 2005-10-09 12:52:35 -0700 | [diff] [blame] | 583 | |
| 584 | # We choose to avoid "if .. else if .. else .. endif endif" |
| 585 | # because maintaining the nesting to match is a pain. If |
| 586 | # we had "elif" things would have been much nicer... |
Junio C Hamano | f7c1534 | 2005-10-09 12:52:35 -0700 | [diff] [blame] | 587 | |
Peter Eriksen | 817151e | 2006-06-24 16:01:25 +0200 | [diff] [blame] | 588 | ifeq ($(uname_S),Linux) |
| 589 | NO_STRLCPY = YesPlease |
Pierre Habouzit | 38bd6497 | 2008-07-21 11:23:43 +0200 | [diff] [blame] | 590 | THREADED_DELTA_SEARCH = YesPlease |
Peter Eriksen | 817151e | 2006-06-24 16:01:25 +0200 | [diff] [blame] | 591 | endif |
Gerrit Pape | ca7a741 | 2006-07-29 16:26:18 +0000 | [diff] [blame] | 592 | ifeq ($(uname_S),GNU/kFreeBSD) |
| 593 | NO_STRLCPY = YesPlease |
Pierre Habouzit | 38bd6497 | 2008-07-21 11:23:43 +0200 | [diff] [blame] | 594 | THREADED_DELTA_SEARCH = YesPlease |
Gerrit Pape | ca7a741 | 2006-07-29 16:26:18 +0000 | [diff] [blame] | 595 | endif |
Boyd Lynn Gerber | 457bb45 | 2008-06-08 14:47:54 -0600 | [diff] [blame] | 596 | ifeq ($(uname_S),UnixWare) |
| 597 | CC = cc |
| 598 | NEEDS_SOCKET = YesPlease |
| 599 | NEEDS_NSL = YesPlease |
| 600 | NEEDS_SSL_WITH_CRYPTO = YesPlease |
| 601 | NEEDS_LIBICONV = YesPlease |
| 602 | SHELL_PATH = /usr/local/bin/bash |
| 603 | NO_IPV6 = YesPlease |
| 604 | NO_HSTRERROR = YesPlease |
| 605 | BASIC_CFLAGS += -Kthread |
| 606 | BASIC_CFLAGS += -I/usr/local/include |
| 607 | BASIC_LDFLAGS += -L/usr/local/lib |
| 608 | INSTALL = ginstall |
| 609 | TAR = gtar |
| 610 | NO_STRCASESTR = YesPlease |
| 611 | NO_MEMMEM = YesPlease |
| 612 | endif |
| 613 | ifeq ($(uname_S),SCO_SV) |
| 614 | ifeq ($(uname_R),3.2) |
| 615 | CFLAGS = -O2 |
| 616 | endif |
| 617 | ifeq ($(uname_R),5) |
| 618 | CC = cc |
| 619 | BASIC_CFLAGS += -Kthread |
| 620 | endif |
| 621 | NEEDS_SOCKET = YesPlease |
| 622 | NEEDS_NSL = YesPlease |
| 623 | NEEDS_SSL_WITH_CRYPTO = YesPlease |
| 624 | NEEDS_LIBICONV = YesPlease |
| 625 | SHELL_PATH = /usr/bin/bash |
| 626 | NO_IPV6 = YesPlease |
| 627 | NO_HSTRERROR = YesPlease |
| 628 | BASIC_CFLAGS += -I/usr/local/include |
| 629 | BASIC_LDFLAGS += -L/usr/local/lib |
| 630 | NO_STRCASESTR = YesPlease |
| 631 | NO_MEMMEM = YesPlease |
| 632 | INSTALL = ginstall |
| 633 | TAR = gtar |
| 634 | endif |
Junio C Hamano | f7c1534 | 2005-10-09 12:52:35 -0700 | [diff] [blame] | 635 | ifeq ($(uname_S),Darwin) |
Junio C Hamano | 597c9cc | 2005-09-07 12:22:56 -0700 | [diff] [blame] | 636 | NEEDS_SSL_WITH_CRYPTO = YesPlease |
| 637 | NEEDS_LIBICONV = YesPlease |
Wincent Colaiuta | fe4aafb | 2007-12-06 20:07:03 +0100 | [diff] [blame] | 638 | ifneq ($(shell expr "$(uname_R)" : '9\.'),2) |
| 639 | OLD_ICONV = UnfortunatelyYes |
| 640 | endif |
Peter Eriksen | 817151e | 2006-06-24 16:01:25 +0200 | [diff] [blame] | 641 | NO_STRLCPY = YesPlease |
Shawn O. Pearce | 3d59405 | 2007-09-09 01:09:17 -0400 | [diff] [blame] | 642 | NO_MEMMEM = YesPlease |
Arjen Laarhoven | 3632cfc | 2008-09-07 20:45:37 +0200 | [diff] [blame] | 643 | COMPAT_CFLAGS += -Icompat/regex |
| 644 | COMPAT_OBJS += compat/regex/regex.o |
Junio C Hamano | 597c9cc | 2005-09-07 12:22:56 -0700 | [diff] [blame] | 645 | endif |
Junio C Hamano | f7c1534 | 2005-10-09 12:52:35 -0700 | [diff] [blame] | 646 | ifeq ($(uname_S),SunOS) |
Patrick Mauritz | f0ebff0 | 2005-09-06 01:24:03 +0200 | [diff] [blame] | 647 | NEEDS_SOCKET = YesPlease |
Junio C Hamano | 5a90d4a | 2005-09-11 22:25:49 -0700 | [diff] [blame] | 648 | NEEDS_NSL = YesPlease |
Junio C Hamano | 229a7ed | 2005-09-23 10:41:40 -0700 | [diff] [blame] | 649 | SHELL_PATH = /bin/bash |
| 650 | NO_STRCASESTR = YesPlease |
René Scharfe | b21b9f1 | 2007-09-07 00:32:54 +0200 | [diff] [blame] | 651 | NO_MEMMEM = YesPlease |
Alex Riesen | fa0c87c | 2007-06-13 20:54:32 +0200 | [diff] [blame] | 652 | NO_HSTRERROR = YesPlease |
Guido Ostkamp | 4e0da76 | 2007-11-16 19:59:58 +0100 | [diff] [blame] | 653 | NO_MKDTEMP = YesPlease |
David Soria Parra | 6e2dfb1 | 2008-10-02 02:08:47 +0200 | [diff] [blame] | 654 | OLD_ICONV = UnfortunatelyYes |
Jason Riedy | e40b61f | 2005-12-02 15:08:28 -0800 | [diff] [blame] | 655 | ifeq ($(uname_R),5.8) |
Jason Riedy | 731043f | 2006-01-25 12:38:36 -0800 | [diff] [blame] | 656 | NO_UNSETENV = YesPlease |
Jason Riedy | e40b61f | 2005-12-02 15:08:28 -0800 | [diff] [blame] | 657 | NO_SETENV = YesPlease |
Dennis Stosberg | 66c4509 | 2006-08-15 11:01:22 +0200 | [diff] [blame] | 658 | NO_C99_FORMAT = YesPlease |
Jason Riedy | bc6b4f5 | 2007-02-19 16:22:56 -0800 | [diff] [blame] | 659 | NO_STRTOUMAX = YesPlease |
Jason Riedy | e40b61f | 2005-12-02 15:08:28 -0800 | [diff] [blame] | 660 | endif |
Dennis Stosberg | 40d88d4 | 2006-04-11 11:42:26 -0700 | [diff] [blame] | 661 | ifeq ($(uname_R),5.9) |
| 662 | NO_UNSETENV = YesPlease |
| 663 | NO_SETENV = YesPlease |
Dennis Stosberg | 66c4509 | 2006-08-15 11:01:22 +0200 | [diff] [blame] | 664 | NO_C99_FORMAT = YesPlease |
Jason Riedy | bc6b4f5 | 2007-02-19 16:22:56 -0800 | [diff] [blame] | 665 | NO_STRTOUMAX = YesPlease |
Dennis Stosberg | 40d88d4 | 2006-04-11 11:42:26 -0700 | [diff] [blame] | 666 | endif |
Junio C Hamano | 229a7ed | 2005-09-23 10:41:40 -0700 | [diff] [blame] | 667 | INSTALL = ginstall |
| 668 | TAR = gtar |
Petr Baudis | 8d7f586 | 2006-06-25 03:47:03 +0200 | [diff] [blame] | 669 | BASIC_CFLAGS += -D__EXTENSIONS__ |
Patrick Mauritz | f0ebff0 | 2005-09-06 01:24:03 +0200 | [diff] [blame] | 670 | endif |
Junio C Hamano | f7c1534 | 2005-10-09 12:52:35 -0700 | [diff] [blame] | 671 | ifeq ($(uname_O),Cygwin) |
Junio C Hamano | 63be37b | 2006-01-19 17:13:57 -0800 | [diff] [blame] | 672 | NO_D_TYPE_IN_DIRENT = YesPlease |
Junio C Hamano | 35a730f | 2006-01-19 17:13:51 -0800 | [diff] [blame] | 673 | NO_D_INO_IN_DIRENT = YesPlease |
hpa | 1775451 | 2005-09-28 16:37:37 -0700 | [diff] [blame] | 674 | NO_STRCASESTR = YesPlease |
René Scharfe | b21b9f1 | 2007-09-07 00:32:54 +0200 | [diff] [blame] | 675 | NO_MEMMEM = YesPlease |
Junio C Hamano | 9f0bb90 | 2006-05-02 00:40:24 -0700 | [diff] [blame] | 676 | NO_SYMLINK_HEAD = YesPlease |
hpa | 1775451 | 2005-09-28 16:37:37 -0700 | [diff] [blame] | 677 | NEEDS_LIBICONV = YesPlease |
Shawn O. Pearce | 1510fea | 2006-12-14 06:15:57 -0500 | [diff] [blame] | 678 | NO_FAST_WORKING_DIRECTORY = UnfortunatelyYes |
Shawn O. Pearce | c869753 | 2006-12-30 23:53:55 -0500 | [diff] [blame] | 679 | NO_TRUSTABLE_FILEMODE = UnfortunatelyYes |
Pascal Obry | 7a4a2e1 | 2007-12-01 10:49:22 +0100 | [diff] [blame] | 680 | OLD_ICONV = UnfortunatelyYes |
Junio C Hamano | 2e67a5f | 2005-11-17 11:29:47 -0800 | [diff] [blame] | 681 | # There are conflicting reports about this. |
| 682 | # On some boxes NO_MMAP is needed, and not so elsewhere. |
Junio C Hamano | 87ac139 | 2006-12-27 15:12:31 -0800 | [diff] [blame] | 683 | # Try commenting this out if you suspect MMAP is more efficient |
| 684 | NO_MMAP = YesPlease |
hpa | 49744d6 | 2005-09-28 16:52:21 -0700 | [diff] [blame] | 685 | NO_IPV6 = YesPlease |
Peter Anvin | a23cd8e | 2005-09-28 19:08:37 -0700 | [diff] [blame] | 686 | X = .exe |
Nicolas Pitre | 7c6ef2f | 2005-09-20 12:27:13 -0400 | [diff] [blame] | 687 | endif |
Alecs King | b3bf974 | 2006-01-27 02:04:30 +0800 | [diff] [blame] | 688 | ifeq ($(uname_S),FreeBSD) |
| 689 | NEEDS_LIBICONV = YesPlease |
Robert Boone | a2f22db | 2007-09-10 11:43:35 -0500 | [diff] [blame] | 690 | NO_MEMMEM = YesPlease |
Petr Baudis | 8d7f586 | 2006-06-25 03:47:03 +0200 | [diff] [blame] | 691 | BASIC_CFLAGS += -I/usr/local/include |
| 692 | BASIC_LDFLAGS += -L/usr/local/lib |
Alex Riesen | 81a24b5 | 2008-03-05 00:15:39 +0100 | [diff] [blame] | 693 | DIR_HAS_BSD_GROUP_SEMANTICS = YesPlease |
Pierre Habouzit | 38bd6497 | 2008-07-21 11:23:43 +0200 | [diff] [blame] | 694 | THREADED_DELTA_SEARCH = YesPlease |
Jeff King | 06e75d9 | 2008-09-11 08:12:16 -0400 | [diff] [blame] | 695 | COMPAT_CFLAGS += -Icompat/regex |
| 696 | COMPAT_OBJS += compat/regex/regex.o |
Alecs King | b3bf974 | 2006-01-27 02:04:30 +0800 | [diff] [blame] | 697 | endif |
Junio C Hamano | f7c1534 | 2005-10-09 12:52:35 -0700 | [diff] [blame] | 698 | ifeq ($(uname_S),OpenBSD) |
Junio C Hamano | 5fb41e8 | 2005-10-10 11:51:11 -0700 | [diff] [blame] | 699 | NO_STRCASESTR = YesPlease |
René Scharfe | b21b9f1 | 2007-09-07 00:32:54 +0200 | [diff] [blame] | 700 | NO_MEMMEM = YesPlease |
Han Boetes | 18c5a52 | 2005-10-01 08:23:26 +0200 | [diff] [blame] | 701 | NEEDS_LIBICONV = YesPlease |
Petr Baudis | 8d7f586 | 2006-06-25 03:47:03 +0200 | [diff] [blame] | 702 | BASIC_CFLAGS += -I/usr/local/include |
| 703 | BASIC_LDFLAGS += -L/usr/local/lib |
Pierre Habouzit | 38bd6497 | 2008-07-21 11:23:43 +0200 | [diff] [blame] | 704 | THREADED_DELTA_SEARCH = YesPlease |
Junio C Hamano | 94d2331 | 2005-11-13 01:46:13 -0800 | [diff] [blame] | 705 | endif |
| 706 | ifeq ($(uname_S),NetBSD) |
Dennis Stosberg | e88856b | 2006-05-11 19:35:31 +0200 | [diff] [blame] | 707 | ifeq ($(shell expr "$(uname_R)" : '[01]\.'),2) |
| 708 | NEEDS_LIBICONV = YesPlease |
| 709 | endif |
Petr Baudis | 8d7f586 | 2006-06-25 03:47:03 +0200 | [diff] [blame] | 710 | BASIC_CFLAGS += -I/usr/pkg/include |
Junio C Hamano | f5b904d | 2008-08-16 21:56:24 -0700 | [diff] [blame] | 711 | BASIC_LDFLAGS += -L/usr/pkg/lib $(CC_LD_DYNPATH)/usr/pkg/lib |
Pierre Habouzit | 38bd6497 | 2008-07-21 11:23:43 +0200 | [diff] [blame] | 712 | THREADED_DELTA_SEARCH = YesPlease |
Han Boetes | 18c5a52 | 2005-10-01 08:23:26 +0200 | [diff] [blame] | 713 | endif |
Jason Riedy | a6da939 | 2005-12-06 14:20:16 -0800 | [diff] [blame] | 714 | ifeq ($(uname_S),AIX) |
| 715 | NO_STRCASESTR=YesPlease |
René Scharfe | b21b9f1 | 2007-09-07 00:32:54 +0200 | [diff] [blame] | 716 | NO_MEMMEM = YesPlease |
Mike Ralphson | 377d9c4 | 2008-05-07 09:35:55 +0100 | [diff] [blame] | 717 | NO_MKDTEMP = YesPlease |
Peter Eriksen | 817151e | 2006-06-24 16:01:25 +0200 | [diff] [blame] | 718 | NO_STRLCPY = YesPlease |
Mike Ralphson | 377d9c4 | 2008-05-07 09:35:55 +0100 | [diff] [blame] | 719 | FREAD_READS_DIRECTORIES = UnfortunatelyYes |
| 720 | INTERNAL_QSORT = UnfortunatelyYes |
Jason Riedy | a6da939 | 2005-12-06 14:20:16 -0800 | [diff] [blame] | 721 | NEEDS_LIBICONV=YesPlease |
Mike Ralphson | 377d9c4 | 2008-05-07 09:35:55 +0100 | [diff] [blame] | 722 | BASIC_CFLAGS += -D_LARGE_FILES |
Johannes Sixt | 9c101b3 | 2008-09-11 10:14:44 +0200 | [diff] [blame] | 723 | COMPAT_CFLAGS += -Icompat/regex |
| 724 | COMPAT_OBJS += compat/regex/regex.o |
Jason Riedy | a6da939 | 2005-12-06 14:20:16 -0800 | [diff] [blame] | 725 | endif |
Thomas Schwinge | c29ba0c | 2007-08-02 10:56:42 +0200 | [diff] [blame] | 726 | ifeq ($(uname_S),GNU) |
| 727 | # GNU/Hurd |
| 728 | NO_STRLCPY=YesPlease |
| 729 | endif |
Johannes Schindelin | 289c4b3 | 2006-02-17 15:23:41 +0100 | [diff] [blame] | 730 | ifeq ($(uname_S),IRIX64) |
| 731 | NO_IPV6=YesPlease |
| 732 | NO_SETENV=YesPlease |
| 733 | NO_STRCASESTR=YesPlease |
René Scharfe | b21b9f1 | 2007-09-07 00:32:54 +0200 | [diff] [blame] | 734 | NO_MEMMEM = YesPlease |
Peter Eriksen | 817151e | 2006-06-24 16:01:25 +0200 | [diff] [blame] | 735 | NO_STRLCPY = YesPlease |
Johannes Schindelin | 289c4b3 | 2006-02-17 15:23:41 +0100 | [diff] [blame] | 736 | NO_SOCKADDR_STORAGE=YesPlease |
| 737 | SHELL_PATH=/usr/gnu/bin/bash |
Petr Baudis | 8d7f586 | 2006-06-25 03:47:03 +0200 | [diff] [blame] | 738 | BASIC_CFLAGS += -DPATH_MAX=1024 |
Johannes Schindelin | 289c4b3 | 2006-02-17 15:23:41 +0100 | [diff] [blame] | 739 | # for now, build 32-bit version |
Petr Baudis | 8d7f586 | 2006-06-25 03:47:03 +0200 | [diff] [blame] | 740 | BASIC_LDFLAGS += -L/usr/lib32 |
Johannes Schindelin | 289c4b3 | 2006-02-17 15:23:41 +0100 | [diff] [blame] | 741 | endif |
Robert Schiele | 81cc66a | 2008-01-24 19:35:20 +0100 | [diff] [blame] | 742 | ifeq ($(uname_S),HP-UX) |
| 743 | NO_IPV6=YesPlease |
| 744 | NO_SETENV=YesPlease |
| 745 | NO_STRCASESTR=YesPlease |
| 746 | NO_MEMMEM = YesPlease |
| 747 | NO_STRLCPY = YesPlease |
| 748 | NO_MKDTEMP = YesPlease |
| 749 | NO_UNSETENV = YesPlease |
| 750 | NO_HSTRERROR = YesPlease |
| 751 | NO_SYS_SELECT_H = YesPlease |
Miklos Vajna | 7d77016 | 2008-08-24 00:07:55 +0200 | [diff] [blame] | 752 | SNPRINTF_RETURNS_BOGUS = YesPlease |
Robert Schiele | 81cc66a | 2008-01-24 19:35:20 +0100 | [diff] [blame] | 753 | endif |
Dmitry Potapov | adbc0b6 | 2008-09-30 17:53:47 +0400 | [diff] [blame] | 754 | ifneq (,$(findstring CYGWIN,$(uname_S))) |
| 755 | COMPAT_OBJS += compat/cygwin.o |
| 756 | endif |
Johannes Sixt | f4626df | 2007-12-01 21:24:59 +0100 | [diff] [blame] | 757 | ifneq (,$(findstring MINGW,$(uname_S))) |
| 758 | NO_MMAP = YesPlease |
| 759 | NO_PREAD = YesPlease |
| 760 | NO_OPENSSL = YesPlease |
| 761 | NO_CURL = YesPlease |
| 762 | NO_SYMLINK_HEAD = YesPlease |
| 763 | NO_IPV6 = YesPlease |
| 764 | NO_SETENV = YesPlease |
| 765 | NO_UNSETENV = YesPlease |
| 766 | NO_STRCASESTR = YesPlease |
| 767 | NO_STRLCPY = YesPlease |
| 768 | NO_MEMMEM = YesPlease |
| 769 | NEEDS_LIBICONV = YesPlease |
| 770 | OLD_ICONV = YesPlease |
| 771 | NO_C99_FORMAT = YesPlease |
| 772 | NO_STRTOUMAX = YesPlease |
| 773 | NO_MKDTEMP = YesPlease |
| 774 | SNPRINTF_RETURNS_BOGUS = YesPlease |
| 775 | NO_SVN_TESTS = YesPlease |
| 776 | NO_PERL_MAKEMAKER = YesPlease |
| 777 | NO_POSIX_ONLY_PROGRAMS = YesPlease |
Junio C Hamano | fdb2a2a | 2008-08-18 21:57:16 +0200 | [diff] [blame] | 778 | NO_ST_BLOCKS_IN_STRUCT_STAT = YesPlease |
Arjen Laarhoven | 3632cfc | 2008-09-07 20:45:37 +0200 | [diff] [blame] | 779 | COMPAT_CFLAGS += -D__USE_MINGW_ACCESS -DNOGDI -Icompat -Icompat/regex -Icompat/fnmatch |
Johannes Sixt | f4626df | 2007-12-01 21:24:59 +0100 | [diff] [blame] | 780 | COMPAT_CFLAGS += -DSNPRINTF_SIZE_CORR=1 |
Johannes Sixt | 23326d1 | 2007-12-08 20:57:25 +0100 | [diff] [blame] | 781 | COMPAT_CFLAGS += -DSTRIP_EXTENSION=\".exe\" |
Arjen Laarhoven | 3632cfc | 2008-09-07 20:45:37 +0200 | [diff] [blame] | 782 | COMPAT_OBJS += compat/mingw.o compat/fnmatch/fnmatch.o compat/regex/regex.o compat/winansi.o |
Johannes Sixt | f4626df | 2007-12-01 21:24:59 +0100 | [diff] [blame] | 783 | EXTLIBS += -lws2_32 |
| 784 | X = .exe |
Johannes Sixt | bf74a88 | 2008-07-21 21:19:56 +0200 | [diff] [blame] | 785 | gitexecdir = ../libexec/git-core |
Johannes Sixt | 8512439 | 2007-11-30 22:28:38 +0100 | [diff] [blame] | 786 | template_dir = ../share/git-core/templates/ |
| 787 | ETC_GITCONFIG = ../etc/gitconfig |
Johannes Sixt | f4626df | 2007-12-01 21:24:59 +0100 | [diff] [blame] | 788 | endif |
Junio C Hamano | f7c1534 | 2005-10-09 12:52:35 -0700 | [diff] [blame] | 789 | ifneq (,$(findstring arm,$(uname_M))) |
| 790 | ARM_SHA1 = YesPlease |
| 791 | endif |
Junio C Hamano | 597c9cc | 2005-09-07 12:22:56 -0700 | [diff] [blame] | 792 | |
Jakub Narebski | 5566771 | 2006-07-03 01:56:48 +0200 | [diff] [blame] | 793 | -include config.mak.autogen |
Johannes Schindelin | f2d6a25 | 2005-10-11 15:22:47 -0700 | [diff] [blame] | 794 | -include config.mak |
Linus Torvalds | cef661f | 2005-04-21 12:33:22 -0700 | [diff] [blame] | 795 | |
Brian Gernhardt | 59f8674 | 2006-12-12 12:01:47 -0500 | [diff] [blame] | 796 | ifeq ($(uname_S),Darwin) |
| 797 | ifndef NO_FINK |
| 798 | ifeq ($(shell test -d /sw/lib && echo y),y) |
| 799 | BASIC_CFLAGS += -I/sw/include |
| 800 | BASIC_LDFLAGS += -L/sw/lib |
| 801 | endif |
| 802 | endif |
| 803 | ifndef NO_DARWIN_PORTS |
| 804 | ifeq ($(shell test -d /opt/local/lib && echo y),y) |
| 805 | BASIC_CFLAGS += -I/opt/local/include |
| 806 | BASIC_LDFLAGS += -L/opt/local/lib |
| 807 | endif |
| 808 | endif |
| 809 | endif |
| 810 | |
Junio C Hamano | f5b904d | 2008-08-16 21:56:24 -0700 | [diff] [blame] | 811 | ifndef CC_LD_DYNPATH |
| 812 | ifdef NO_R_TO_GCC_LINKER |
| 813 | # Some gcc does not accept and pass -R to the linker to specify |
| 814 | # the runtime dynamic library path. |
| 815 | CC_LD_DYNPATH = -Wl,-rpath, |
| 816 | else |
| 817 | CC_LD_DYNPATH = -R |
| 818 | endif |
Junio C Hamano | bbfc63d | 2006-12-27 14:17:35 -0800 | [diff] [blame] | 819 | endif |
| 820 | |
Daniel Barkalow | 30ae764 | 2007-09-10 23:02:45 -0400 | [diff] [blame] | 821 | ifdef NO_CURL |
| 822 | BASIC_CFLAGS += -DNO_CURL |
| 823 | else |
Junio C Hamano | 229a7ed | 2005-09-23 10:41:40 -0700 | [diff] [blame] | 824 | ifdef CURLDIR |
Robert Schiele | 10861be | 2007-08-01 06:30:35 +0200 | [diff] [blame] | 825 | # Try "-Wl,-rpath=$(CURLDIR)/$(lib)" in such a case. |
Petr Baudis | 8d7f586 | 2006-06-25 03:47:03 +0200 | [diff] [blame] | 826 | BASIC_CFLAGS += -I$(CURLDIR)/include |
Robert Schiele | 10861be | 2007-08-01 06:30:35 +0200 | [diff] [blame] | 827 | CURL_LIBCURL = -L$(CURLDIR)/$(lib) $(CC_LD_DYNPATH)$(CURLDIR)/$(lib) -lcurl |
Junio C Hamano | 229a7ed | 2005-09-23 10:41:40 -0700 | [diff] [blame] | 828 | else |
| 829 | CURL_LIBCURL = -lcurl |
| 830 | endif |
Daniel Barkalow | 30ae764 | 2007-09-10 23:02:45 -0400 | [diff] [blame] | 831 | BUILTIN_OBJS += builtin-http-fetch.o |
| 832 | EXTLIBS += $(CURL_LIBCURL) |
Johannes Schindelin | ccfc02a | 2007-10-15 14:52:25 +0100 | [diff] [blame] | 833 | LIB_OBJS += http.o http-walker.o |
Nick Hengeveld | 0890098 | 2005-11-18 17:08:36 -0800 | [diff] [blame] | 834 | curl_check := $(shell (echo 070908; curl-config --vernum) | sort -r | sed -ne 2p) |
| 835 | ifeq "$(curl_check)" "070908" |
| 836 | ifndef NO_EXPAT |
Nick Hengeveld | 0890098 | 2005-11-18 17:08:36 -0800 | [diff] [blame] | 837 | PROGRAMS += git-http-push$X |
| 838 | endif |
Nick Hengeveld | 58e60dd | 2005-11-02 11:19:24 -0800 | [diff] [blame] | 839 | endif |
Johannes Schindelin | 459a21b | 2006-04-05 16:22:40 +0200 | [diff] [blame] | 840 | ifndef NO_EXPAT |
| 841 | EXPAT_LIBEXPAT = -lexpat |
| 842 | endif |
Junio C Hamano | 229a7ed | 2005-09-23 10:41:40 -0700 | [diff] [blame] | 843 | endif |
| 844 | |
Robert Schiele | bef19da | 2007-07-29 20:35:45 +0200 | [diff] [blame] | 845 | ifdef ZLIB_PATH |
| 846 | BASIC_CFLAGS += -I$(ZLIB_PATH)/include |
Robert Schiele | 10861be | 2007-08-01 06:30:35 +0200 | [diff] [blame] | 847 | EXTLIBS += -L$(ZLIB_PATH)/$(lib) $(CC_LD_DYNPATH)$(ZLIB_PATH)/$(lib) |
Robert Schiele | bef19da | 2007-07-29 20:35:45 +0200 | [diff] [blame] | 848 | endif |
| 849 | EXTLIBS += -lz |
| 850 | |
Johannes Sixt | 58eda02 | 2007-12-01 11:10:54 +0100 | [diff] [blame] | 851 | ifndef NO_POSIX_ONLY_PROGRAMS |
| 852 | PROGRAMS += git-daemon$X |
| 853 | PROGRAMS += git-imap-send$X |
| 854 | endif |
Petr Baudis | dd53c7a | 2005-07-29 17:50:51 +0200 | [diff] [blame] | 855 | ifndef NO_OPENSSL |
Junio C Hamano | 215a7ad | 2005-09-07 17:26:23 -0700 | [diff] [blame] | 856 | OPENSSL_LIBSSL = -lssl |
Junio C Hamano | 455a7f3 | 2005-09-30 13:31:16 -0700 | [diff] [blame] | 857 | ifdef OPENSSLDIR |
Petr Baudis | 8d7f586 | 2006-06-25 03:47:03 +0200 | [diff] [blame] | 858 | BASIC_CFLAGS += -I$(OPENSSLDIR)/include |
Robert Schiele | 10861be | 2007-08-01 06:30:35 +0200 | [diff] [blame] | 859 | OPENSSL_LINK = -L$(OPENSSLDIR)/$(lib) $(CC_LD_DYNPATH)$(OPENSSLDIR)/$(lib) |
Junio C Hamano | 455a7f3 | 2005-09-30 13:31:16 -0700 | [diff] [blame] | 860 | else |
| 861 | OPENSSL_LINK = |
| 862 | endif |
Petr Baudis | dd53c7a | 2005-07-29 17:50:51 +0200 | [diff] [blame] | 863 | else |
Petr Baudis | 8d7f586 | 2006-06-25 03:47:03 +0200 | [diff] [blame] | 864 | BASIC_CFLAGS += -DNO_OPENSSL |
Junio C Hamano | 215a7ad | 2005-09-07 17:26:23 -0700 | [diff] [blame] | 865 | MOZILLA_SHA1 = 1 |
| 866 | OPENSSL_LIBSSL = |
Petr Baudis | dd53c7a | 2005-07-29 17:50:51 +0200 | [diff] [blame] | 867 | endif |
Junio C Hamano | 597c9cc | 2005-09-07 12:22:56 -0700 | [diff] [blame] | 868 | ifdef NEEDS_SSL_WITH_CRYPTO |
Junio C Hamano | 455a7f3 | 2005-09-30 13:31:16 -0700 | [diff] [blame] | 869 | LIB_4_CRYPTO = $(OPENSSL_LINK) -lcrypto -lssl |
Junio C Hamano | 597c9cc | 2005-09-07 12:22:56 -0700 | [diff] [blame] | 870 | else |
Junio C Hamano | 455a7f3 | 2005-09-30 13:31:16 -0700 | [diff] [blame] | 871 | LIB_4_CRYPTO = $(OPENSSL_LINK) -lcrypto |
Junio C Hamano | 597c9cc | 2005-09-07 12:22:56 -0700 | [diff] [blame] | 872 | endif |
| 873 | ifdef NEEDS_LIBICONV |
Junio C Hamano | 455a7f3 | 2005-09-30 13:31:16 -0700 | [diff] [blame] | 874 | ifdef ICONVDIR |
Petr Baudis | 8d7f586 | 2006-06-25 03:47:03 +0200 | [diff] [blame] | 875 | BASIC_CFLAGS += -I$(ICONVDIR)/include |
Robert Schiele | 10861be | 2007-08-01 06:30:35 +0200 | [diff] [blame] | 876 | ICONV_LINK = -L$(ICONVDIR)/$(lib) $(CC_LD_DYNPATH)$(ICONVDIR)/$(lib) |
Junio C Hamano | 455a7f3 | 2005-09-30 13:31:16 -0700 | [diff] [blame] | 877 | else |
| 878 | ICONV_LINK = |
| 879 | endif |
Petr Baudis | d595a47 | 2006-06-24 18:35:12 -0700 | [diff] [blame] | 880 | EXTLIBS += $(ICONV_LINK) -liconv |
Junio C Hamano | 597c9cc | 2005-09-07 12:22:56 -0700 | [diff] [blame] | 881 | endif |
Patrick Mauritz | f0ebff0 | 2005-09-06 01:24:03 +0200 | [diff] [blame] | 882 | ifdef NEEDS_SOCKET |
Petr Baudis | d595a47 | 2006-06-24 18:35:12 -0700 | [diff] [blame] | 883 | EXTLIBS += -lsocket |
Patrick Mauritz | f0ebff0 | 2005-09-06 01:24:03 +0200 | [diff] [blame] | 884 | endif |
Junio C Hamano | 5a90d4a | 2005-09-11 22:25:49 -0700 | [diff] [blame] | 885 | ifdef NEEDS_NSL |
Petr Baudis | d595a47 | 2006-06-24 18:35:12 -0700 | [diff] [blame] | 886 | EXTLIBS += -lnsl |
Junio C Hamano | 5a90d4a | 2005-09-11 22:25:49 -0700 | [diff] [blame] | 887 | endif |
Junio C Hamano | 63be37b | 2006-01-19 17:13:57 -0800 | [diff] [blame] | 888 | ifdef NO_D_TYPE_IN_DIRENT |
Petr Baudis | 8d7f586 | 2006-06-25 03:47:03 +0200 | [diff] [blame] | 889 | BASIC_CFLAGS += -DNO_D_TYPE_IN_DIRENT |
Junio C Hamano | 63be37b | 2006-01-19 17:13:57 -0800 | [diff] [blame] | 890 | endif |
Junio C Hamano | 35a730f | 2006-01-19 17:13:51 -0800 | [diff] [blame] | 891 | ifdef NO_D_INO_IN_DIRENT |
Petr Baudis | 8d7f586 | 2006-06-25 03:47:03 +0200 | [diff] [blame] | 892 | BASIC_CFLAGS += -DNO_D_INO_IN_DIRENT |
Junio C Hamano | 35a730f | 2006-01-19 17:13:51 -0800 | [diff] [blame] | 893 | endif |
Junio C Hamano | fdb2a2a | 2008-08-18 21:57:16 +0200 | [diff] [blame] | 894 | ifdef NO_ST_BLOCKS_IN_STRUCT_STAT |
| 895 | BASIC_CFLAGS += -DNO_ST_BLOCKS_IN_STRUCT_STAT |
| 896 | endif |
Ramsay Allan Jones | 579d1fb | 2006-07-30 16:38:28 +0100 | [diff] [blame] | 897 | ifdef NO_C99_FORMAT |
Junio C Hamano | 8188e73 | 2007-02-05 16:53:12 -0800 | [diff] [blame] | 898 | BASIC_CFLAGS += -DNO_C99_FORMAT |
Ramsay Allan Jones | 579d1fb | 2006-07-30 16:38:28 +0100 | [diff] [blame] | 899 | endif |
Michal Rokos | c4582f9 | 2008-03-05 16:46:13 +0100 | [diff] [blame] | 900 | ifdef SNPRINTF_RETURNS_BOGUS |
| 901 | COMPAT_CFLAGS += -DSNPRINTF_RETURNS_BOGUS |
| 902 | COMPAT_OBJS += compat/snprintf.o |
| 903 | endif |
Brandon Casey | cba2252 | 2008-02-08 20:32:47 -0600 | [diff] [blame] | 904 | ifdef FREAD_READS_DIRECTORIES |
| 905 | COMPAT_CFLAGS += -DFREAD_READS_DIRECTORIES |
| 906 | COMPAT_OBJS += compat/fopen.o |
| 907 | endif |
Junio C Hamano | 9f0bb90 | 2006-05-02 00:40:24 -0700 | [diff] [blame] | 908 | ifdef NO_SYMLINK_HEAD |
Petr Baudis | 8d7f586 | 2006-06-25 03:47:03 +0200 | [diff] [blame] | 909 | BASIC_CFLAGS += -DNO_SYMLINK_HEAD |
Junio C Hamano | 9f0bb90 | 2006-05-02 00:40:24 -0700 | [diff] [blame] | 910 | endif |
Linus Torvalds | ef34af2 | 2005-09-18 18:30:50 -0700 | [diff] [blame] | 911 | ifdef NO_STRCASESTR |
Junio C Hamano | 4050c0d | 2005-12-05 11:54:29 -0800 | [diff] [blame] | 912 | COMPAT_CFLAGS += -DNO_STRCASESTR |
Jason Riedy | e40b61f | 2005-12-02 15:08:28 -0800 | [diff] [blame] | 913 | COMPAT_OBJS += compat/strcasestr.o |
| 914 | endif |
Peter Eriksen | 817151e | 2006-06-24 16:01:25 +0200 | [diff] [blame] | 915 | ifdef NO_STRLCPY |
| 916 | COMPAT_CFLAGS += -DNO_STRLCPY |
| 917 | COMPAT_OBJS += compat/strlcpy.o |
| 918 | endif |
Jason Riedy | bc6b4f5 | 2007-02-19 16:22:56 -0800 | [diff] [blame] | 919 | ifdef NO_STRTOUMAX |
| 920 | COMPAT_CFLAGS += -DNO_STRTOUMAX |
| 921 | COMPAT_OBJS += compat/strtoumax.o |
| 922 | endif |
| 923 | ifdef NO_STRTOULL |
| 924 | COMPAT_CFLAGS += -DNO_STRTOULL |
| 925 | endif |
Jason Riedy | e40b61f | 2005-12-02 15:08:28 -0800 | [diff] [blame] | 926 | ifdef NO_SETENV |
Junio C Hamano | 4050c0d | 2005-12-05 11:54:29 -0800 | [diff] [blame] | 927 | COMPAT_CFLAGS += -DNO_SETENV |
Jason Riedy | e40b61f | 2005-12-02 15:08:28 -0800 | [diff] [blame] | 928 | COMPAT_OBJS += compat/setenv.o |
Linus Torvalds | ef34af2 | 2005-09-18 18:30:50 -0700 | [diff] [blame] | 929 | endif |
Shawn O. Pearce | ca5bb5d | 2007-10-20 16:03:49 -0400 | [diff] [blame] | 930 | ifdef NO_MKDTEMP |
| 931 | COMPAT_CFLAGS += -DNO_MKDTEMP |
| 932 | COMPAT_OBJS += compat/mkdtemp.o |
| 933 | endif |
Johannes Schindelin | 104ff34 | 2006-08-29 12:51:14 +0200 | [diff] [blame] | 934 | ifdef NO_UNSETENV |
Jason Riedy | 731043f | 2006-01-25 12:38:36 -0800 | [diff] [blame] | 935 | COMPAT_CFLAGS += -DNO_UNSETENV |
| 936 | COMPAT_OBJS += compat/unsetenv.o |
| 937 | endif |
Robert Schiele | 2600973 | 2008-01-24 19:34:46 +0100 | [diff] [blame] | 938 | ifdef NO_SYS_SELECT_H |
| 939 | BASIC_CFLAGS += -DNO_SYS_SELECT_H |
| 940 | endif |
Johannes Schindelin | 730d48a | 2005-10-08 15:54:36 -0700 | [diff] [blame] | 941 | ifdef NO_MMAP |
Junio C Hamano | 4050c0d | 2005-12-05 11:54:29 -0800 | [diff] [blame] | 942 | COMPAT_CFLAGS += -DNO_MMAP |
Jason Riedy | e40b61f | 2005-12-02 15:08:28 -0800 | [diff] [blame] | 943 | COMPAT_OBJS += compat/mmap.o |
Johannes Schindelin | 730d48a | 2005-10-08 15:54:36 -0700 | [diff] [blame] | 944 | endif |
Stefan-W. Hahn | 6900679 | 2007-01-09 22:04:12 +0100 | [diff] [blame] | 945 | ifdef NO_PREAD |
| 946 | COMPAT_CFLAGS += -DNO_PREAD |
| 947 | COMPAT_OBJS += compat/pread.o |
| 948 | endif |
Shawn O. Pearce | 1510fea | 2006-12-14 06:15:57 -0500 | [diff] [blame] | 949 | ifdef NO_FAST_WORKING_DIRECTORY |
| 950 | BASIC_CFLAGS += -DNO_FAST_WORKING_DIRECTORY |
| 951 | endif |
Shawn O. Pearce | c869753 | 2006-12-30 23:53:55 -0500 | [diff] [blame] | 952 | ifdef NO_TRUSTABLE_FILEMODE |
| 953 | BASIC_CFLAGS += -DNO_TRUSTABLE_FILEMODE |
| 954 | endif |
hpa | 49744d6 | 2005-09-28 16:52:21 -0700 | [diff] [blame] | 955 | ifdef NO_IPV6 |
Petr Baudis | 8d7f586 | 2006-06-25 03:47:03 +0200 | [diff] [blame] | 956 | BASIC_CFLAGS += -DNO_IPV6 |
Junio C Hamano | bdc37f5 | 2006-01-19 17:13:32 -0800 | [diff] [blame] | 957 | endif |
| 958 | ifdef NO_SOCKADDR_STORAGE |
| 959 | ifdef NO_IPV6 |
Petr Baudis | 8d7f586 | 2006-06-25 03:47:03 +0200 | [diff] [blame] | 960 | BASIC_CFLAGS += -Dsockaddr_storage=sockaddr_in |
Junio C Hamano | bdc37f5 | 2006-01-19 17:13:32 -0800 | [diff] [blame] | 961 | else |
Petr Baudis | 8d7f586 | 2006-06-25 03:47:03 +0200 | [diff] [blame] | 962 | BASIC_CFLAGS += -Dsockaddr_storage=sockaddr_in6 |
Junio C Hamano | bdc37f5 | 2006-01-19 17:13:32 -0800 | [diff] [blame] | 963 | endif |
hpa | 49744d6 | 2005-09-28 16:52:21 -0700 | [diff] [blame] | 964 | endif |
Yakov Lerner | 6ba68ab | 2006-05-22 00:37:00 +0300 | [diff] [blame] | 965 | ifdef NO_INET_NTOP |
| 966 | LIB_OBJS += compat/inet_ntop.o |
| 967 | endif |
Jon Loeliger | dd46762 | 2006-09-26 09:47:43 -0500 | [diff] [blame] | 968 | ifdef NO_INET_PTON |
| 969 | LIB_OBJS += compat/inet_pton.o |
| 970 | endif |
Linus Torvalds | cef661f | 2005-04-21 12:33:22 -0700 | [diff] [blame] | 971 | |
Fernando J. Pereda | b6e56ec | 2006-02-16 09:38:01 +0100 | [diff] [blame] | 972 | ifdef NO_ICONV |
Petr Baudis | 8d7f586 | 2006-06-25 03:47:03 +0200 | [diff] [blame] | 973 | BASIC_CFLAGS += -DNO_ICONV |
Fernando J. Pereda | b6e56ec | 2006-02-16 09:38:01 +0100 | [diff] [blame] | 974 | endif |
| 975 | |
Ramsay Jones | fd547a9 | 2007-03-03 18:29:03 +0000 | [diff] [blame] | 976 | ifdef OLD_ICONV |
| 977 | BASIC_CFLAGS += -DOLD_ICONV |
| 978 | endif |
| 979 | |
David Symonds | 609a228 | 2007-11-07 14:24:28 +1100 | [diff] [blame] | 980 | ifdef NO_DEFLATE_BOUND |
| 981 | BASIC_CFLAGS += -DNO_DEFLATE_BOUND |
| 982 | endif |
| 983 | |
Nicolas Pitre | 7c6ef2f | 2005-09-20 12:27:13 -0400 | [diff] [blame] | 984 | ifdef PPC_SHA1 |
| 985 | SHA1_HEADER = "ppc/sha1.h" |
| 986 | LIB_OBJS += ppc/sha1.o ppc/sha1ppc.o |
| 987 | else |
| 988 | ifdef ARM_SHA1 |
| 989 | SHA1_HEADER = "arm/sha1.h" |
| 990 | LIB_OBJS += arm/sha1.o arm/sha1_arm.o |
| 991 | else |
| 992 | ifdef MOZILLA_SHA1 |
| 993 | SHA1_HEADER = "mozilla-sha1/sha1.h" |
| 994 | LIB_OBJS += mozilla-sha1/sha1.o |
| 995 | else |
| 996 | SHA1_HEADER = <openssl/sha.h> |
Petr Baudis | d595a47 | 2006-06-24 18:35:12 -0700 | [diff] [blame] | 997 | EXTLIBS += $(LIB_4_CRYPTO) |
Nicolas Pitre | 7c6ef2f | 2005-09-20 12:27:13 -0400 | [diff] [blame] | 998 | endif |
| 999 | endif |
| 1000 | endif |
Alex Riesen | f848718 | 2006-12-04 10:50:04 +0100 | [diff] [blame] | 1001 | ifdef NO_PERL_MAKEMAKER |
| 1002 | export NO_PERL_MAKEMAKER |
| 1003 | endif |
Alex Riesen | fa0c87c | 2007-06-13 20:54:32 +0200 | [diff] [blame] | 1004 | ifdef NO_HSTRERROR |
| 1005 | COMPAT_CFLAGS += -DNO_HSTRERROR |
| 1006 | COMPAT_OBJS += compat/hstrerror.o |
| 1007 | endif |
René Scharfe | b21b9f1 | 2007-09-07 00:32:54 +0200 | [diff] [blame] | 1008 | ifdef NO_MEMMEM |
| 1009 | COMPAT_CFLAGS += -DNO_MEMMEM |
| 1010 | COMPAT_OBJS += compat/memmem.o |
| 1011 | endif |
Brian Downing | 43fe901 | 2008-02-05 15:10:44 -0600 | [diff] [blame] | 1012 | ifdef INTERNAL_QSORT |
| 1013 | COMPAT_CFLAGS += -DINTERNAL_QSORT |
| 1014 | COMPAT_OBJS += compat/qsort.o |
| 1015 | endif |
Alex Riesen | b777434 | 2007-03-07 00:44:49 +0100 | [diff] [blame] | 1016 | |
Nicolas Pitre | 8ecce68 | 2007-09-06 02:13:11 -0400 | [diff] [blame] | 1017 | ifdef THREADED_DELTA_SEARCH |
| 1018 | BASIC_CFLAGS += -DTHREADED_DELTA_SEARCH |
| 1019 | EXTLIBS += -lpthread |
Andreas Ericsson | 833e3df | 2008-02-22 20:11:56 -0600 | [diff] [blame] | 1020 | LIB_OBJS += thread-utils.o |
Nicolas Pitre | 8ecce68 | 2007-09-06 02:13:11 -0400 | [diff] [blame] | 1021 | endif |
Alex Riesen | 81a24b5 | 2008-03-05 00:15:39 +0100 | [diff] [blame] | 1022 | ifdef DIR_HAS_BSD_GROUP_SEMANTICS |
| 1023 | COMPAT_CFLAGS += -DDIR_HAS_BSD_GROUP_SEMANTICS |
| 1024 | endif |
Jeff King | 5f7c643 | 2008-03-12 17:39:16 -0400 | [diff] [blame] | 1025 | ifdef NO_EXTERNAL_GREP |
| 1026 | BASIC_CFLAGS += -DNO_EXTERNAL_GREP |
| 1027 | endif |
Nicolas Pitre | 8ecce68 | 2007-09-06 02:13:11 -0400 | [diff] [blame] | 1028 | |
Eygene Ryabinkin | 81b63c7 | 2007-03-28 04:12:07 -0700 | [diff] [blame] | 1029 | ifeq ($(TCLTK_PATH),) |
| 1030 | NO_TCLTK=NoThanks |
| 1031 | endif |
| 1032 | |
Fernando J. Pereda | 3b486cd | 2007-04-04 22:42:33 +0200 | [diff] [blame] | 1033 | QUIET_SUBDIR0 = +$(MAKE) -C # space to separate -C and subdir |
Alex Riesen | b777434 | 2007-03-07 00:44:49 +0100 | [diff] [blame] | 1034 | QUIET_SUBDIR1 = |
| 1035 | |
Alex Riesen | a6f3709 | 2007-03-07 00:05:34 +0100 | [diff] [blame] | 1036 | ifneq ($(findstring $(MAKEFLAGS),w),w) |
| 1037 | PRINT_DIR = --no-print-directory |
| 1038 | else # "make -w" |
| 1039 | NO_SUBDIR = : |
| 1040 | endif |
| 1041 | |
Alex Riesen | b777434 | 2007-03-07 00:44:49 +0100 | [diff] [blame] | 1042 | ifneq ($(findstring $(MAKEFLAGS),s),s) |
Shawn O. Pearce | 2314c94 | 2007-03-06 02:09:14 -0500 | [diff] [blame] | 1043 | ifndef V |
Alex Riesen | 31d0399 | 2007-03-06 23:37:18 +0100 | [diff] [blame] | 1044 | QUIET_CC = @echo ' ' CC $@; |
Shawn O. Pearce | 74f2b2a | 2007-03-06 01:35:01 -0500 | [diff] [blame] | 1045 | QUIET_AR = @echo ' ' AR $@; |
| 1046 | QUIET_LINK = @echo ' ' LINK $@; |
| 1047 | QUIET_BUILT_IN = @echo ' ' BUILTIN $@; |
| 1048 | QUIET_GEN = @echo ' ' GEN $@; |
Fernando J. Pereda | 3b486cd | 2007-04-04 22:42:33 +0200 | [diff] [blame] | 1049 | QUIET_SUBDIR0 = +@subdir= |
Alex Riesen | a6f3709 | 2007-03-07 00:05:34 +0100 | [diff] [blame] | 1050 | QUIET_SUBDIR1 = ;$(NO_SUBDIR) echo ' ' SUBDIR $$subdir; \ |
| 1051 | $(MAKE) $(PRINT_DIR) -C $$subdir |
Shawn O. Pearce | 2314c94 | 2007-03-06 02:09:14 -0500 | [diff] [blame] | 1052 | export V |
Alex Riesen | 31d0399 | 2007-03-06 23:37:18 +0100 | [diff] [blame] | 1053 | export QUIET_GEN |
Alex Riesen | b777434 | 2007-03-07 00:44:49 +0100 | [diff] [blame] | 1054 | export QUIET_BUILT_IN |
| 1055 | endif |
Shawn O. Pearce | 74f2b2a | 2007-03-06 01:35:01 -0500 | [diff] [blame] | 1056 | endif |
Nicolas Pitre | 7c6ef2f | 2005-09-20 12:27:13 -0400 | [diff] [blame] | 1057 | |
Junio C Hamano | 4c7100a | 2007-06-14 22:20:16 -0700 | [diff] [blame] | 1058 | ifdef ASCIIDOC8 |
| 1059 | export ASCIIDOC8 |
| 1060 | endif |
| 1061 | |
Pavel Roskin | addf88e | 2006-07-09 03:44:30 -0400 | [diff] [blame] | 1062 | # Shell quote (do not use $(call) to accommodate ancient setups); |
Johannes Schindelin | 39c015c | 2006-02-18 12:40:22 +0100 | [diff] [blame] | 1063 | |
| 1064 | SHA1_HEADER_SQ = $(subst ','\'',$(SHA1_HEADER)) |
Johannes Schindelin | 32043c9 | 2007-02-14 12:48:14 +0100 | [diff] [blame] | 1065 | ETC_GITCONFIG_SQ = $(subst ','\'',$(ETC_GITCONFIG)) |
Johannes Schindelin | 39c015c | 2006-02-18 12:40:22 +0100 | [diff] [blame] | 1066 | |
| 1067 | DESTDIR_SQ = $(subst ','\'',$(DESTDIR)) |
| 1068 | bindir_SQ = $(subst ','\'',$(bindir)) |
Sergei Organov | 8e566f2 | 2007-12-06 21:33:01 +0300 | [diff] [blame] | 1069 | mandir_SQ = $(subst ','\'',$(mandir)) |
Junio C Hamano | a149a1a | 2007-12-10 01:35:29 -0800 | [diff] [blame] | 1070 | infodir_SQ = $(subst ','\'',$(infodir)) |
Johannes Schindelin | 39c015c | 2006-02-18 12:40:22 +0100 | [diff] [blame] | 1071 | gitexecdir_SQ = $(subst ','\'',$(gitexecdir)) |
| 1072 | template_dir_SQ = $(subst ','\'',$(template_dir)) |
Christian Couder | 5d6491c | 2007-12-02 06:07:55 +0100 | [diff] [blame] | 1073 | htmldir_SQ = $(subst ','\'',$(htmldir)) |
Yakov Lerner | ca3bcab | 2006-06-15 01:36:00 +0300 | [diff] [blame] | 1074 | prefix_SQ = $(subst ','\'',$(prefix)) |
Johannes Schindelin | 39c015c | 2006-02-18 12:40:22 +0100 | [diff] [blame] | 1075 | |
| 1076 | SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH)) |
| 1077 | PERL_PATH_SQ = $(subst ','\'',$(PERL_PATH)) |
Eygene Ryabinkin | 81b63c7 | 2007-03-28 04:12:07 -0700 | [diff] [blame] | 1078 | TCLTK_PATH_SQ = $(subst ','\'',$(TCLTK_PATH)) |
Johannes Schindelin | 39c015c | 2006-02-18 12:40:22 +0100 | [diff] [blame] | 1079 | |
Petr Baudis | d595a47 | 2006-06-24 18:35:12 -0700 | [diff] [blame] | 1080 | LIBS = $(GITLIBS) $(EXTLIBS) |
| 1081 | |
Johannes Schindelin | 32043c9 | 2007-02-14 12:48:14 +0100 | [diff] [blame] | 1082 | BASIC_CFLAGS += -DSHA1_HEADER='$(SHA1_HEADER_SQ)' \ |
Johannes Sixt | 506b17b | 2007-11-13 21:05:05 +0100 | [diff] [blame] | 1083 | $(COMPAT_CFLAGS) |
Jason Riedy | e40b61f | 2005-12-02 15:08:28 -0800 | [diff] [blame] | 1084 | LIB_OBJS += $(COMPAT_OBJS) |
Petr Baudis | 8d7f586 | 2006-06-25 03:47:03 +0200 | [diff] [blame] | 1085 | |
| 1086 | ALL_CFLAGS += $(BASIC_CFLAGS) |
| 1087 | ALL_LDFLAGS += $(BASIC_LDFLAGS) |
| 1088 | |
Shawn O. Pearce | a42cbac | 2007-05-07 23:53:06 -0400 | [diff] [blame] | 1089 | export TAR INSTALL DESTDIR SHELL_PATH |
Petr Baudis | d595a47 | 2006-06-24 18:35:12 -0700 | [diff] [blame] | 1090 | |
| 1091 | |
Petr Baudis | 28818ff | 2005-07-29 17:50:24 +0200 | [diff] [blame] | 1092 | ### Build rules |
Linus Torvalds | 8996702 | 2005-04-30 13:19:56 -0700 | [diff] [blame] | 1093 | |
Brandon Casey | c94c8e5 | 2008-08-07 14:03:42 -0500 | [diff] [blame] | 1094 | SHELL = $(SHELL_PATH) |
| 1095 | |
Brandon Casey | 6dc4627 | 2008-08-07 14:06:26 -0500 | [diff] [blame] | 1096 | all:: shell_compatibility_test $(ALL_PROGRAMS) $(BUILT_INS) $(OTHER_PROGRAMS) GIT-BUILD-OPTIONS |
Junio C Hamano | 6fc301b | 2007-01-10 12:24:54 -0800 | [diff] [blame] | 1097 | ifneq (,$X) |
Eric Blake | 0d768f7 | 2008-08-15 15:01:03 +0000 | [diff] [blame] | 1098 | $(foreach p,$(patsubst %$X,%,$(filter %$X,$(ALL_PROGRAMS) $(BUILT_INS) git$X)), test '$p' -ef '$p$X' || $(RM) '$p';) |
Junio C Hamano | 6fc301b | 2007-01-10 12:24:54 -0800 | [diff] [blame] | 1099 | endif |
Petr Baudis | 28818ff | 2005-07-29 17:50:24 +0200 | [diff] [blame] | 1100 | |
Junio C Hamano | 6fc301b | 2007-01-10 12:24:54 -0800 | [diff] [blame] | 1101 | all:: |
Eygene Ryabinkin | 3cfaf11 | 2007-03-28 04:00:23 -0700 | [diff] [blame] | 1102 | ifndef NO_TCLTK |
Junio C Hamano | e84a063 | 2008-07-28 00:02:48 -0700 | [diff] [blame] | 1103 | $(QUIET_SUBDIR0)git-gui $(QUIET_SUBDIR1) gitexecdir='$(gitexec_instdir_SQ)' all |
Junio C Hamano | 62ba514 | 2007-11-17 10:51:16 -0800 | [diff] [blame] | 1104 | $(QUIET_SUBDIR0)gitk-git $(QUIET_SUBDIR1) all |
Eygene Ryabinkin | 3cfaf11 | 2007-03-28 04:00:23 -0700 | [diff] [blame] | 1105 | endif |
Shawn O. Pearce | 74f2b2a | 2007-03-06 01:35:01 -0500 | [diff] [blame] | 1106 | $(QUIET_SUBDIR0)perl $(QUIET_SUBDIR1) PERL_PATH='$(PERL_PATH_SQ)' prefix='$(prefix_SQ)' all |
| 1107 | $(QUIET_SUBDIR0)templates $(QUIET_SUBDIR1) |
Nicolas Pitre | a310d43 | 2005-05-19 10:27:14 -0400 | [diff] [blame] | 1108 | |
Brandon Casey | 6dc4627 | 2008-08-07 14:06:26 -0500 | [diff] [blame] | 1109 | please_set_SHELL_PATH_to_a_more_modern_shell: |
| 1110 | @$$(:) |
| 1111 | |
| 1112 | shell_compatibility_test: please_set_SHELL_PATH_to_a_more_modern_shell |
| 1113 | |
Junio C Hamano | 4dc0002 | 2006-01-12 21:42:25 -0800 | [diff] [blame] | 1114 | strip: $(PROGRAMS) git$X |
| 1115 | $(STRIP) $(STRIP_OPTS) $(PROGRAMS) git$X |
| 1116 | |
Junio C Hamano | 334d28a | 2007-06-13 01:28:21 -0700 | [diff] [blame] | 1117 | git.o: git.c common-cmds.h GIT-CFLAGS |
| 1118 | $(QUIET_CC)$(CC) -DGIT_VERSION='"$(GIT_VERSION)"' \ |
| 1119 | $(ALL_CFLAGS) -c $(filter %.c,$^) |
| 1120 | |
| 1121 | git$X: git.o $(BUILTIN_OBJS) $(GITLIBS) |
Matt McCutchen | 54dadbd | 2007-07-09 21:30:39 -0400 | [diff] [blame] | 1122 | $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ git.o \ |
Linus Torvalds | 70827b1 | 2006-04-21 10:27:34 -0700 | [diff] [blame] | 1123 | $(BUILTIN_OBJS) $(ALL_LDFLAGS) $(LIBS) |
Junio C Hamano | 6a2e50f | 2005-09-07 21:26:52 -0700 | [diff] [blame] | 1124 | |
Miklos Vajna | 3d78d1f | 2008-08-02 10:08:38 +0200 | [diff] [blame] | 1125 | builtin-help.o: builtin-help.c common-cmds.h GIT-CFLAGS |
Junio C Hamano | a149a1a | 2007-12-10 01:35:29 -0800 | [diff] [blame] | 1126 | $(QUIET_CC)$(CC) -o $*.o -c $(ALL_CFLAGS) \ |
Christian Couder | 482cce8 | 2008-02-02 07:32:33 +0100 | [diff] [blame] | 1127 | '-DGIT_HTML_PATH="$(htmldir_SQ)"' \ |
Junio C Hamano | a149a1a | 2007-12-10 01:35:29 -0800 | [diff] [blame] | 1128 | '-DGIT_MAN_PATH="$(mandir_SQ)"' \ |
| 1129 | '-DGIT_INFO_PATH="$(infodir_SQ)"' $< |
Junio C Hamano | 08df617 | 2006-04-21 21:56:13 -0700 | [diff] [blame] | 1130 | |
Junio C Hamano | 9173080 | 2006-04-10 17:37:58 -0700 | [diff] [blame] | 1131 | $(BUILT_INS): git$X |
Andreas Färber | 3e073dc | 2008-08-25 17:33:03 +0200 | [diff] [blame] | 1132 | $(QUIET_BUILT_IN)$(RM) $@ && \ |
| 1133 | ln git$X $@ 2>/dev/null || \ |
| 1134 | ln -s git$X $@ 2>/dev/null || \ |
| 1135 | cp git$X $@ |
Junio C Hamano | 9173080 | 2006-04-10 17:37:58 -0700 | [diff] [blame] | 1136 | |
Junio C Hamano | 79d3066 | 2007-12-01 23:39:19 -0800 | [diff] [blame] | 1137 | common-cmds.h: ./generate-cmdlist.sh command-list.txt |
Junio C Hamano | 48dd1da | 2007-06-13 02:00:01 -0700 | [diff] [blame] | 1138 | |
Junio C Hamano | 766b084 | 2007-04-05 15:03:48 -0700 | [diff] [blame] | 1139 | common-cmds.h: $(wildcard Documentation/git-*.txt) |
Shawn O. Pearce | 74f2b2a | 2007-03-06 01:35:01 -0500 | [diff] [blame] | 1140 | $(QUIET_GEN)./generate-cmdlist.sh > $@+ && mv $@+ $@ |
Fredrik Kuivinen | a87cd02 | 2006-03-09 17:24:19 +0100 | [diff] [blame] | 1141 | |
Andreas Ericsson | d6ebd25 | 2005-11-22 00:44:15 +0100 | [diff] [blame] | 1142 | $(patsubst %.sh,%,$(SCRIPT_SH)) : % : %.sh |
Emil Medve | 4cb08df | 2007-07-14 12:51:44 -0500 | [diff] [blame] | 1143 | $(QUIET_GEN)$(RM) $@ $@+ && \ |
Johannes Schindelin | 39c015c | 2006-02-18 12:40:22 +0100 | [diff] [blame] | 1144 | sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \ |
Jeff King | 4bf9f27 | 2008-03-12 17:41:39 -0400 | [diff] [blame] | 1145 | -e 's|@SHELL_PATH@|$(SHELL_PATH_SQ)|' \ |
Michal Rokos | d9bffc0 | 2006-07-08 17:32:04 +0200 | [diff] [blame] | 1146 | -e 's|@@PERL@@|$(PERL_PATH_SQ)|g' \ |
Junio C Hamano | 3ff8cbe | 2005-10-04 12:41:35 -0700 | [diff] [blame] | 1147 | -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \ |
Fernando J. Pereda | 6c5c62f | 2006-02-15 12:37:30 +0100 | [diff] [blame] | 1148 | -e 's/@@NO_CURL@@/$(NO_CURL)/g' \ |
Shawn O. Pearce | 74f2b2a | 2007-03-06 01:35:01 -0500 | [diff] [blame] | 1149 | $@.sh >$@+ && \ |
| 1150 | chmod +x $@+ && \ |
Jim Meyering | fc36f6a | 2006-05-25 18:52:01 +0200 | [diff] [blame] | 1151 | mv $@+ $@ |
Junio C Hamano | bc6146d | 2005-09-08 18:50:33 -0700 | [diff] [blame] | 1152 | |
Alex Riesen | f848718 | 2006-12-04 10:50:04 +0100 | [diff] [blame] | 1153 | $(patsubst %.perl,%,$(SCRIPT_PERL)): perl/perl.mak |
| 1154 | |
Alex Riesen | d1a2057 | 2007-10-25 22:17:24 +0200 | [diff] [blame] | 1155 | perl/perl.mak: GIT-CFLAGS perl/Makefile perl/Makefile.PL |
Alex Riesen | 31d0399 | 2007-03-06 23:37:18 +0100 | [diff] [blame] | 1156 | $(QUIET_SUBDIR0)perl $(QUIET_SUBDIR1) PERL_PATH='$(PERL_PATH_SQ)' prefix='$(prefix_SQ)' $(@F) |
Alex Riesen | f848718 | 2006-12-04 10:50:04 +0100 | [diff] [blame] | 1157 | |
Junio C Hamano | f6276fe | 2006-06-24 19:41:03 -0700 | [diff] [blame] | 1158 | $(patsubst %.perl,%,$(SCRIPT_PERL)): % : %.perl |
Emil Medve | 4cb08df | 2007-07-14 12:51:44 -0500 | [diff] [blame] | 1159 | $(QUIET_GEN)$(RM) $@ $@+ && \ |
Jim Meyering | e883932 | 2007-09-25 08:42:16 +0200 | [diff] [blame] | 1160 | INSTLIBDIR=`MAKEFLAGS= $(MAKE) -C perl -s --no-print-directory instlibdir` && \ |
Junio C Hamano | 998c4da | 2006-07-07 13:04:35 -0700 | [diff] [blame] | 1161 | sed -e '1{' \ |
| 1162 | -e ' s|#!.*perl|#!$(PERL_PATH_SQ)|' \ |
| 1163 | -e ' h' \ |
| 1164 | -e ' s=.*=use lib (split(/:/, $$ENV{GITPERLLIB} || "@@INSTLIBDIR@@"));=' \ |
| 1165 | -e ' H' \ |
| 1166 | -e ' x' \ |
| 1167 | -e '}' \ |
Junio C Hamano | f6276fe | 2006-06-24 19:41:03 -0700 | [diff] [blame] | 1168 | -e 's|@@INSTLIBDIR@@|'"$$INSTLIBDIR"'|g' \ |
Junio C Hamano | 3ff8cbe | 2005-10-04 12:41:35 -0700 | [diff] [blame] | 1169 | -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \ |
Shawn O. Pearce | 74f2b2a | 2007-03-06 01:35:01 -0500 | [diff] [blame] | 1170 | $@.perl >$@+ && \ |
| 1171 | chmod +x $@+ && \ |
Jim Meyering | fc36f6a | 2006-05-25 18:52:01 +0200 | [diff] [blame] | 1172 | mv $@+ $@ |
Junio C Hamano | bc6146d | 2005-09-08 18:50:33 -0700 | [diff] [blame] | 1173 | |
Martin Waitz | 5d043a3 | 2006-08-01 21:34:08 +0200 | [diff] [blame] | 1174 | gitweb/gitweb.cgi: gitweb/gitweb.perl |
Emil Medve | 4cb08df | 2007-07-14 12:51:44 -0500 | [diff] [blame] | 1175 | $(QUIET_GEN)$(RM) $@ $@+ && \ |
Martin Waitz | 5d043a3 | 2006-08-01 21:34:08 +0200 | [diff] [blame] | 1176 | sed -e '1s|#!.*perl|#!$(PERL_PATH_SQ)|' \ |
Junio C Hamano | 06c084d | 2006-08-02 13:50:20 -0700 | [diff] [blame] | 1177 | -e 's|++GIT_VERSION++|$(GIT_VERSION)|g' \ |
| 1178 | -e 's|++GIT_BINDIR++|$(bindir)|g' \ |
| 1179 | -e 's|++GITWEB_CONFIG++|$(GITWEB_CONFIG)|g' \ |
Gerrit Pape | 26ffcb7 | 2008-04-05 16:37:18 +0000 | [diff] [blame] | 1180 | -e 's|++GITWEB_CONFIG_SYSTEM++|$(GITWEB_CONFIG_SYSTEM)|g' \ |
Yasushi SHOJI | 2de21fa | 2006-08-15 07:50:49 +0900 | [diff] [blame] | 1181 | -e 's|++GITWEB_HOME_LINK_STR++|$(GITWEB_HOME_LINK_STR)|g' \ |
Junio C Hamano | 06c084d | 2006-08-02 13:50:20 -0700 | [diff] [blame] | 1182 | -e 's|++GITWEB_SITENAME++|$(GITWEB_SITENAME)|g' \ |
| 1183 | -e 's|++GITWEB_PROJECTROOT++|$(GITWEB_PROJECTROOT)|g' \ |
Luke Lu | ca5e949 | 2007-10-16 20:45:25 -0700 | [diff] [blame] | 1184 | -e 's|"++GITWEB_PROJECT_MAXDEPTH++"|$(GITWEB_PROJECT_MAXDEPTH)|g' \ |
Matthias Lederhofer | 32f4aac | 2006-09-17 00:31:01 +0200 | [diff] [blame] | 1185 | -e 's|++GITWEB_EXPORT_OK++|$(GITWEB_EXPORT_OK)|g' \ |
| 1186 | -e 's|++GITWEB_STRICT_EXPORT++|$(GITWEB_STRICT_EXPORT)|g' \ |
Jakub Narebski | 19a8721 | 2006-08-15 23:03:17 +0200 | [diff] [blame] | 1187 | -e 's|++GITWEB_BASE_URL++|$(GITWEB_BASE_URL)|g' \ |
Junio C Hamano | 06c084d | 2006-08-02 13:50:20 -0700 | [diff] [blame] | 1188 | -e 's|++GITWEB_LIST++|$(GITWEB_LIST)|g' \ |
| 1189 | -e 's|++GITWEB_HOMETEXT++|$(GITWEB_HOMETEXT)|g' \ |
| 1190 | -e 's|++GITWEB_CSS++|$(GITWEB_CSS)|g' \ |
| 1191 | -e 's|++GITWEB_LOGO++|$(GITWEB_LOGO)|g' \ |
Jakub Narebski | 0b5deba | 2006-09-04 20:32:13 +0200 | [diff] [blame] | 1192 | -e 's|++GITWEB_FAVICON++|$(GITWEB_FAVICON)|g' \ |
Alan Chandler | b2d3476 | 2006-10-03 13:49:03 +0100 | [diff] [blame] | 1193 | -e 's|++GITWEB_SITE_HEADER++|$(GITWEB_SITE_HEADER)|g' \ |
| 1194 | -e 's|++GITWEB_SITE_FOOTER++|$(GITWEB_SITE_FOOTER)|g' \ |
Shawn O. Pearce | 74f2b2a | 2007-03-06 01:35:01 -0500 | [diff] [blame] | 1195 | $< >$@+ && \ |
| 1196 | chmod +x $@+ && \ |
Martin Waitz | 5d043a3 | 2006-08-01 21:34:08 +0200 | [diff] [blame] | 1197 | mv $@+ $@ |
| 1198 | |
Eric Wong | a51d37c | 2006-07-01 15:14:14 -0700 | [diff] [blame] | 1199 | git-instaweb: git-instaweb.sh gitweb/gitweb.cgi gitweb/gitweb.css |
Emil Medve | 4cb08df | 2007-07-14 12:51:44 -0500 | [diff] [blame] | 1200 | $(QUIET_GEN)$(RM) $@ $@+ && \ |
Eric Wong | a51d37c | 2006-07-01 15:14:14 -0700 | [diff] [blame] | 1201 | sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \ |
| 1202 | -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \ |
| 1203 | -e 's/@@NO_CURL@@/$(NO_CURL)/g' \ |
Michal Rokos | 6e959ab | 2006-07-08 17:27:10 +0200 | [diff] [blame] | 1204 | -e '/@@GITWEB_CGI@@/r gitweb/gitweb.cgi' \ |
Johannes Schindelin | 0700228 | 2006-07-02 11:31:30 +0200 | [diff] [blame] | 1205 | -e '/@@GITWEB_CGI@@/d' \ |
Michal Rokos | 6e959ab | 2006-07-08 17:27:10 +0200 | [diff] [blame] | 1206 | -e '/@@GITWEB_CSS@@/r gitweb/gitweb.css' \ |
Johannes Schindelin | 0700228 | 2006-07-02 11:31:30 +0200 | [diff] [blame] | 1207 | -e '/@@GITWEB_CSS@@/d' \ |
Charles Bailey | c569969 | 2007-12-19 12:25:27 +0000 | [diff] [blame] | 1208 | -e 's|@@PERL@@|$(PERL_PATH_SQ)|g' \ |
Shawn O. Pearce | 74f2b2a | 2007-03-06 01:35:01 -0500 | [diff] [blame] | 1209 | $@.sh > $@+ && \ |
| 1210 | chmod +x $@+ && \ |
Eric Wong | a51d37c | 2006-07-01 15:14:14 -0700 | [diff] [blame] | 1211 | mv $@+ $@ |
| 1212 | |
Jakub Narebski | 3900145 | 2006-08-08 18:35:23 +0200 | [diff] [blame] | 1213 | configure: configure.ac |
Emil Medve | 4cb08df | 2007-07-14 12:51:44 -0500 | [diff] [blame] | 1214 | $(QUIET_GEN)$(RM) $@ $<+ && \ |
Jakub Narebski | 3900145 | 2006-08-08 18:35:23 +0200 | [diff] [blame] | 1215 | sed -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \ |
Shawn O. Pearce | 74f2b2a | 2007-03-06 01:35:01 -0500 | [diff] [blame] | 1216 | $< > $<+ && \ |
| 1217 | autoconf -o $@ $<+ && \ |
Emil Medve | 4cb08df | 2007-07-14 12:51:44 -0500 | [diff] [blame] | 1218 | $(RM) $<+ |
Jakub Narebski | 3900145 | 2006-08-08 18:35:23 +0200 | [diff] [blame] | 1219 | |
Junio C Hamano | 9b88fce | 2005-12-27 14:40:17 -0800 | [diff] [blame] | 1220 | # These can record GIT_VERSION |
Matt McCutchen | 54dadbd | 2007-07-09 21:30:39 -0400 | [diff] [blame] | 1221 | git.o git.spec \ |
Junio C Hamano | 9b88fce | 2005-12-27 14:40:17 -0800 | [diff] [blame] | 1222 | $(patsubst %.sh,%,$(SCRIPT_SH)) \ |
| 1223 | $(patsubst %.perl,%,$(SCRIPT_PERL)) \ |
Junio C Hamano | 9b88fce | 2005-12-27 14:40:17 -0800 | [diff] [blame] | 1224 | : GIT-VERSION-FILE |
Johannes Schindelin | e99fcf9 | 2005-12-22 20:38:23 +0100 | [diff] [blame] | 1225 | |
Yakov Lerner | ca3bcab | 2006-06-15 01:36:00 +0300 | [diff] [blame] | 1226 | %.o: %.c GIT-CFLAGS |
Shawn O. Pearce | 74f2b2a | 2007-03-06 01:35:01 -0500 | [diff] [blame] | 1227 | $(QUIET_CC)$(CC) -o $*.o -c $(ALL_CFLAGS) $< |
Linus Torvalds | e36cb1c | 2007-05-30 10:42:41 -0700 | [diff] [blame] | 1228 | %.s: %.c GIT-CFLAGS |
| 1229 | $(QUIET_CC)$(CC) -S $(ALL_CFLAGS) $< |
Pavel Roskin | b05701c | 2005-08-06 01:36:15 -0400 | [diff] [blame] | 1230 | %.o: %.S |
Shawn O. Pearce | 74f2b2a | 2007-03-06 01:35:01 -0500 | [diff] [blame] | 1231 | $(QUIET_CC)$(CC) -o $*.o -c $(ALL_CFLAGS) $< |
Pavel Roskin | b05701c | 2005-08-06 01:36:15 -0400 | [diff] [blame] | 1232 | |
Yakov Lerner | ca3bcab | 2006-06-15 01:36:00 +0300 | [diff] [blame] | 1233 | exec_cmd.o: exec_cmd.c GIT-CFLAGS |
Shawn O. Pearce | 74f2b2a | 2007-03-06 01:35:01 -0500 | [diff] [blame] | 1234 | $(QUIET_CC)$(CC) -o $*.o -c $(ALL_CFLAGS) '-DGIT_EXEC_PATH="$(gitexecdir_SQ)"' $< |
Yakov Lerner | c1f8064 | 2006-06-22 04:47:00 +0300 | [diff] [blame] | 1235 | builtin-init-db.o: builtin-init-db.c GIT-CFLAGS |
Shawn O. Pearce | 74f2b2a | 2007-03-06 01:35:01 -0500 | [diff] [blame] | 1236 | $(QUIET_CC)$(CC) -o $*.o -c $(ALL_CFLAGS) -DDEFAULT_GIT_TEMPLATE_DIR='"$(template_dir_SQ)"' $< |
Michal Ostrowski | 77cb17e | 2006-01-10 21:12:17 -0500 | [diff] [blame] | 1237 | |
Johannes Sixt | 506b17b | 2007-11-13 21:05:05 +0100 | [diff] [blame] | 1238 | config.o: config.c GIT-CFLAGS |
| 1239 | $(QUIET_CC)$(CC) -o $*.o -c $(ALL_CFLAGS) -DETC_GITCONFIG='"$(ETC_GITCONFIG_SQ)"' $< |
| 1240 | |
Yakov Lerner | ca3bcab | 2006-06-15 01:36:00 +0300 | [diff] [blame] | 1241 | http.o: http.c GIT-CFLAGS |
Shawn O. Pearce | 74f2b2a | 2007-03-06 01:35:01 -0500 | [diff] [blame] | 1242 | $(QUIET_CC)$(CC) -o $*.o -c $(ALL_CFLAGS) -DGIT_USER_AGENT='"git/$(GIT_VERSION)"' $< |
Nick Hengeveld | 20fc9bc | 2006-04-04 10:11:29 -0700 | [diff] [blame] | 1243 | |
Nick Hengeveld | 8d9fbe5 | 2006-04-04 05:33:18 -0700 | [diff] [blame] | 1244 | ifdef NO_EXPAT |
Daniel Barkalow | 30ae764 | 2007-09-10 23:02:45 -0400 | [diff] [blame] | 1245 | http-walker.o: http-walker.c http.h GIT-CFLAGS |
Shawn O. Pearce | 74f2b2a | 2007-03-06 01:35:01 -0500 | [diff] [blame] | 1246 | $(QUIET_CC)$(CC) -o $*.o -c $(ALL_CFLAGS) -DNO_EXPAT $< |
Nick Hengeveld | 8d9fbe5 | 2006-04-04 05:33:18 -0700 | [diff] [blame] | 1247 | endif |
| 1248 | |
Junio C Hamano | 8eef8e0 | 2006-03-31 16:23:46 -0800 | [diff] [blame] | 1249 | git-%$X: %.o $(GITLIBS) |
Shawn O. Pearce | 74f2b2a | 2007-03-06 01:35:01 -0500 | [diff] [blame] | 1250 | $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS) |
Daniel Barkalow | 6eb7ed5 | 2005-04-23 18:47:23 -0700 | [diff] [blame] | 1251 | |
Robert Shearman | 684ec6c | 2008-07-09 22:29:00 +0100 | [diff] [blame] | 1252 | git-imap-send$X: imap-send.o $(GITLIBS) |
| 1253 | $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \ |
| 1254 | $(LIBS) $(OPENSSL_LINK) $(OPENSSL_LIBSSL) |
Mike McCormack | f2561fd | 2006-03-10 14:32:50 +0900 | [diff] [blame] | 1255 | |
Mike Hommey | 923e3ec | 2008-01-26 13:19:02 +0100 | [diff] [blame] | 1256 | http.o http-walker.o http-push.o transport.o: http.h |
Johannes Schindelin | 39c015c | 2006-02-18 12:40:22 +0100 | [diff] [blame] | 1257 | |
Junio C Hamano | 8fced61 | 2006-07-03 00:53:13 -0700 | [diff] [blame] | 1258 | git-http-push$X: revision.o http.o http-push.o $(GITLIBS) |
Shawn O. Pearce | 74f2b2a | 2007-03-06 01:35:01 -0500 | [diff] [blame] | 1259 | $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \ |
Johannes Schindelin | 39c015c | 2006-02-18 12:40:22 +0100 | [diff] [blame] | 1260 | $(LIBS) $(CURL_LIBCURL) $(EXPAT_LIBEXPAT) |
| 1261 | |
Johannes Schindelin | ccfc02a | 2007-10-15 14:52:25 +0100 | [diff] [blame] | 1262 | $(LIB_OBJS) $(BUILTIN_OBJS): $(LIB_H) |
Junio C Hamano | 1f33026 | 2006-06-22 15:43:47 -0700 | [diff] [blame] | 1263 | $(patsubst git-%$X,%.o,$(PROGRAMS)): $(LIB_H) $(wildcard */*.h) |
Junio C Hamano | fa47016 | 2007-12-14 22:08:25 -0800 | [diff] [blame] | 1264 | builtin-revert.o wt-status.o: wt-status.h |
Linus Torvalds | e83c516 | 2005-04-07 15:13:13 -0700 | [diff] [blame] | 1265 | |
Petr Baudis | 28818ff | 2005-07-29 17:50:24 +0200 | [diff] [blame] | 1266 | $(LIB_FILE): $(LIB_OBJS) |
Emil Medve | 4cb08df | 2007-07-14 12:51:44 -0500 | [diff] [blame] | 1267 | $(QUIET_AR)$(RM) $@ && $(AR) rcs $@ $(LIB_OBJS) |
Petr Baudis | 28818ff | 2005-07-29 17:50:24 +0200 | [diff] [blame] | 1268 | |
Johannes Schindelin | 857b933 | 2006-11-21 23:24:34 +0100 | [diff] [blame] | 1269 | XDIFF_OBJS=xdiff/xdiffi.o xdiff/xprepare.o xdiff/xutils.o xdiff/xemit.o \ |
| 1270 | xdiff/xmerge.o |
Andy Whitcroft | 17b96be | 2006-10-17 19:08:08 +0100 | [diff] [blame] | 1271 | $(XDIFF_OBJS): xdiff/xinclude.h xdiff/xmacros.h xdiff/xdiff.h xdiff/xtypes.h \ |
| 1272 | xdiff/xutils.h xdiff/xprepare.h xdiff/xdiffi.h xdiff/xemit.h |
Linus Torvalds | 3443546 | 2006-03-24 20:13:22 -0800 | [diff] [blame] | 1273 | |
| 1274 | $(XDIFF_LIB): $(XDIFF_OBJS) |
Emil Medve | 4cb08df | 2007-07-14 12:51:44 -0500 | [diff] [blame] | 1275 | $(QUIET_AR)$(RM) $@ && $(AR) rcs $@ $(XDIFF_OBJS) |
Linus Torvalds | 3443546 | 2006-03-24 20:13:22 -0800 | [diff] [blame] | 1276 | |
| 1277 | |
Petr Baudis | 28818ff | 2005-07-29 17:50:24 +0200 | [diff] [blame] | 1278 | doc: |
| 1279 | $(MAKE) -C Documentation all |
| 1280 | |
Michael J Gruber | 414851a | 2008-09-10 10:19:34 +0200 | [diff] [blame] | 1281 | man: |
| 1282 | $(MAKE) -C Documentation man |
| 1283 | |
| 1284 | html: |
| 1285 | $(MAKE) -C Documentation html |
| 1286 | |
David Kastrup | 4739809 | 2007-08-06 12:22:57 +0200 | [diff] [blame] | 1287 | info: |
| 1288 | $(MAKE) -C Documentation info |
| 1289 | |
Fredrik Kuivinen | f81e7c6 | 2006-03-18 11:07:12 +0100 | [diff] [blame] | 1290 | TAGS: |
Emil Medve | 4cb08df | 2007-07-14 12:51:44 -0500 | [diff] [blame] | 1291 | $(RM) TAGS |
David Kastrup | 89b2f19 | 2007-07-29 15:23:28 -0700 | [diff] [blame] | 1292 | $(FIND) . -name '*.[hcS]' -print | xargs etags -a |
Fredrik Kuivinen | f81e7c6 | 2006-03-18 11:07:12 +0100 | [diff] [blame] | 1293 | |
| 1294 | tags: |
Emil Medve | 4cb08df | 2007-07-14 12:51:44 -0500 | [diff] [blame] | 1295 | $(RM) tags |
David Kastrup | 89b2f19 | 2007-07-29 15:23:28 -0700 | [diff] [blame] | 1296 | $(FIND) . -name '*.[hcS]' -print | xargs ctags -a |
Petr Baudis | 28818ff | 2005-07-29 17:50:24 +0200 | [diff] [blame] | 1297 | |
Kristof Provost | a2a9150 | 2007-10-06 16:24:42 +0200 | [diff] [blame] | 1298 | cscope: |
| 1299 | $(RM) cscope* |
| 1300 | $(FIND) . -name '*.[hcS]' -print | xargs cscope -b |
| 1301 | |
Yakov Lerner | ca3bcab | 2006-06-15 01:36:00 +0300 | [diff] [blame] | 1302 | ### Detect prefix changes |
Junio C Hamano | 7cdbff1 | 2006-11-20 00:49:31 -0800 | [diff] [blame] | 1303 | TRACK_CFLAGS = $(subst ','\'',$(ALL_CFLAGS)):\ |
Yakov Lerner | ca3bcab | 2006-06-15 01:36:00 +0300 | [diff] [blame] | 1304 | $(bindir_SQ):$(gitexecdir_SQ):$(template_dir_SQ):$(prefix_SQ) |
| 1305 | |
| 1306 | GIT-CFLAGS: .FORCE-GIT-CFLAGS |
| 1307 | @FLAGS='$(TRACK_CFLAGS)'; \ |
| 1308 | if test x"$$FLAGS" != x"`cat GIT-CFLAGS 2>/dev/null`" ; then \ |
| 1309 | echo 1>&2 " * new build flags or prefix"; \ |
| 1310 | echo "$$FLAGS" >GIT-CFLAGS; \ |
| 1311 | fi |
| 1312 | |
Junio C Hamano | bfce508 | 2008-07-25 12:35:10 -0700 | [diff] [blame] | 1313 | # We need to apply sq twice, once to protect from the shell |
| 1314 | # that runs GIT-BUILD-OPTIONS, and then again to protect it |
| 1315 | # and the first level quoting from the shell that runs "echo". |
Jeff King | 7cf7f54 | 2008-02-24 14:40:45 -0500 | [diff] [blame] | 1316 | GIT-BUILD-OPTIONS: .FORCE-GIT-BUILD-OPTIONS |
Junio C Hamano | bfce508 | 2008-07-25 12:35:10 -0700 | [diff] [blame] | 1317 | @echo SHELL_PATH=\''$(subst ','\'',$(SHELL_PATH_SQ))'\' >$@ |
| 1318 | @echo TAR=\''$(subst ','\'',$(subst ','\'',$(TAR)))'\' >>$@ |
Jeff King | 7cf7f54 | 2008-02-24 14:40:45 -0500 | [diff] [blame] | 1319 | |
Eygene Ryabinkin | 6bdb18a | 2007-03-28 04:22:02 -0700 | [diff] [blame] | 1320 | ### Detect Tck/Tk interpreter path changes |
| 1321 | ifndef NO_TCLTK |
| 1322 | TRACK_VARS = $(subst ','\'',-DTCLTK_PATH='$(TCLTK_PATH_SQ)') |
| 1323 | |
| 1324 | GIT-GUI-VARS: .FORCE-GIT-GUI-VARS |
| 1325 | @VARS='$(TRACK_VARS)'; \ |
| 1326 | if test x"$$VARS" != x"`cat $@ 2>/dev/null`" ; then \ |
| 1327 | echo 1>&2 " * new Tcl/Tk interpreter location"; \ |
| 1328 | echo "$$VARS" >$@; \ |
| 1329 | fi |
| 1330 | |
| 1331 | .PHONY: .FORCE-GIT-GUI-VARS |
| 1332 | endif |
| 1333 | |
Petr Baudis | 28818ff | 2005-07-29 17:50:24 +0200 | [diff] [blame] | 1334 | ### Testing rules |
| 1335 | |
David Reiss | d553e73 | 2008-05-19 23:49:00 -0700 | [diff] [blame] | 1336 | TEST_PROGRAMS = test-chmtime$X test-genrandom$X test-date$X test-delta$X test-sha1$X test-match-trees$X test-parse-options$X test-path-utils$X |
Junio C Hamano | 96651ef | 2007-04-28 15:32:49 -0700 | [diff] [blame] | 1337 | |
| 1338 | all:: $(TEST_PROGRAMS) |
| 1339 | |
Johannes Schindelin | abb7c7b | 2006-02-18 13:01:18 +0100 | [diff] [blame] | 1340 | # GNU make supports exporting all variables by "export" without parameters. |
| 1341 | # However, the environment gets quite big, and some programs have problems |
| 1342 | # with that. |
| 1343 | |
Johannes Schindelin | 140245b | 2006-07-07 13:26:31 +0200 | [diff] [blame] | 1344 | export NO_SVN_TESTS |
Johannes Schindelin | abb7c7b | 2006-02-18 13:01:18 +0100 | [diff] [blame] | 1345 | |
Junio C Hamano | 96651ef | 2007-04-28 15:32:49 -0700 | [diff] [blame] | 1346 | test: all |
Petr Baudis | 28818ff | 2005-07-29 17:50:24 +0200 | [diff] [blame] | 1347 | $(MAKE) -C t/ all |
| 1348 | |
Julian Phillips | 5c5ba73 | 2007-05-31 00:18:24 +0100 | [diff] [blame] | 1349 | test-date$X: date.o ctype.o |
Petr Baudis | 28818ff | 2005-07-29 17:50:24 +0200 | [diff] [blame] | 1350 | |
Julian Phillips | 5c5ba73 | 2007-05-31 00:18:24 +0100 | [diff] [blame] | 1351 | test-delta$X: diff-delta.o patch-delta.o |
Petr Baudis | 28818ff | 2005-07-29 17:50:24 +0200 | [diff] [blame] | 1352 | |
Alex Riesen | 481424e | 2007-11-14 00:16:36 +0100 | [diff] [blame] | 1353 | test-parse-options$X: parse-options.o |
| 1354 | |
Junio C Hamano | fa8fe28 | 2007-08-30 19:14:31 -0700 | [diff] [blame] | 1355 | .PRECIOUS: $(patsubst test-%$X,test-%.o,$(TEST_PROGRAMS)) |
| 1356 | |
Julian Phillips | 5c5ba73 | 2007-05-31 00:18:24 +0100 | [diff] [blame] | 1357 | test-%$X: test-%.o $(GITLIBS) |
| 1358 | $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS) |
Nicolas Pitre | 2dca1af | 2007-04-11 13:59:51 -0400 | [diff] [blame] | 1359 | |
Junio C Hamano | b65bc21 | 2006-06-24 00:59:49 -0700 | [diff] [blame] | 1360 | check-sha1:: test-sha1$X |
| 1361 | ./test-sha1.sh |
| 1362 | |
René Scharfe | 7c4c9f4 | 2007-01-04 19:33:48 +0100 | [diff] [blame] | 1363 | check: common-cmds.h |
Junio C Hamano | 773b633 | 2005-12-14 13:32:52 -0800 | [diff] [blame] | 1364 | for i in *.c; do sparse $(ALL_CFLAGS) $(SPARSE_FLAGS) $$i || exit; done |
Petr Baudis | 28818ff | 2005-07-29 17:50:24 +0200 | [diff] [blame] | 1365 | |
Linus Torvalds | 36e5e70 | 2007-06-30 11:49:17 -0700 | [diff] [blame] | 1366 | remove-dashes: |
Miklos Vajna | b4f02d3 | 2008-07-11 02:12:06 +0200 | [diff] [blame] | 1367 | ./fixup-builtins $(BUILT_INS) $(PROGRAMS) $(SCRIPTS) |
Petr Baudis | 28818ff | 2005-07-29 17:50:24 +0200 | [diff] [blame] | 1368 | |
| 1369 | ### Installation rules |
| 1370 | |
Johannes Sixt | 0b50b86 | 2008-01-01 22:15:21 +0100 | [diff] [blame] | 1371 | ifeq ($(firstword $(subst /, ,$(template_dir))),..) |
Johannes Sixt | 966c6ed | 2008-07-21 21:19:53 +0200 | [diff] [blame] | 1372 | template_instdir = $(bindir)/$(template_dir) |
Johannes Sixt | 0b50b86 | 2008-01-01 22:15:21 +0100 | [diff] [blame] | 1373 | else |
| 1374 | template_instdir = $(template_dir) |
| 1375 | endif |
| 1376 | export template_instdir |
| 1377 | |
Johannes Sixt | 49fa65a | 2008-07-23 21:12:18 +0200 | [diff] [blame] | 1378 | ifeq ($(firstword $(subst /, ,$(gitexecdir))),..) |
| 1379 | gitexec_instdir = $(bindir)/$(gitexecdir) |
| 1380 | else |
| 1381 | gitexec_instdir = $(gitexecdir) |
| 1382 | endif |
| 1383 | gitexec_instdir_SQ = $(subst ','\'',$(gitexec_instdir)) |
| 1384 | export gitexec_instdir |
| 1385 | |
Andreas Ericsson | d6ebd25 | 2005-11-22 00:44:15 +0100 | [diff] [blame] | 1386 | install: all |
Robert Schiele | 4165076 | 2007-12-01 18:05:40 +0100 | [diff] [blame] | 1387 | $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(bindir_SQ)' |
Johannes Sixt | 49fa65a | 2008-07-23 21:12:18 +0200 | [diff] [blame] | 1388 | $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(gitexec_instdir_SQ)' |
| 1389 | $(INSTALL) $(ALL_PROGRAMS) '$(DESTDIR_SQ)$(gitexec_instdir_SQ)' |
Nanako Shiraishi | ede4caf | 2008-09-10 20:03:18 +0900 | [diff] [blame] | 1390 | $(INSTALL) git$X git-upload-pack$X git-receive-pack$X git-upload-archive$X git-shell$X git-cvsserver '$(DESTDIR_SQ)$(bindir_SQ)' |
Ramsay Allan Jones | 7ffe709 | 2006-07-29 17:25:03 +0100 | [diff] [blame] | 1391 | $(MAKE) -C templates DESTDIR='$(DESTDIR_SQ)' install |
Gerrit Pape | 28072a5 | 2007-12-10 09:31:02 +0000 | [diff] [blame] | 1392 | $(MAKE) -C perl prefix='$(prefix_SQ)' DESTDIR='$(DESTDIR_SQ)' install |
Eygene Ryabinkin | 3cfaf11 | 2007-03-28 04:00:23 -0700 | [diff] [blame] | 1393 | ifndef NO_TCLTK |
Junio C Hamano | 62ba514 | 2007-11-17 10:51:16 -0800 | [diff] [blame] | 1394 | $(MAKE) -C gitk-git install |
Johannes Sixt | 49fa65a | 2008-07-23 21:12:18 +0200 | [diff] [blame] | 1395 | $(MAKE) -C git-gui gitexecdir='$(gitexec_instdir_SQ)' install |
Eygene Ryabinkin | 3cfaf11 | 2007-03-28 04:00:23 -0700 | [diff] [blame] | 1396 | endif |
Junio C Hamano | 6fc301b | 2007-01-10 12:24:54 -0800 | [diff] [blame] | 1397 | ifneq (,$X) |
Johannes Sixt | 49fa65a | 2008-07-23 21:12:18 +0200 | [diff] [blame] | 1398 | $(foreach p,$(patsubst %$X,%,$(filter %$X,$(ALL_PROGRAMS) $(BUILT_INS) git$X)), $(RM) '$(DESTDIR_SQ)$(gitexec_instdir_SQ)/$p';) |
Junio C Hamano | 6fc301b | 2007-01-10 12:24:54 -0800 | [diff] [blame] | 1399 | endif |
Johannes Sixt | 46beb55 | 2008-07-21 21:19:51 +0200 | [diff] [blame] | 1400 | bindir=$$(cd '$(DESTDIR_SQ)$(bindir_SQ)' && pwd) && \ |
Johannes Sixt | 49fa65a | 2008-07-23 21:12:18 +0200 | [diff] [blame] | 1401 | execdir=$$(cd '$(DESTDIR_SQ)$(gitexec_instdir_SQ)' && pwd) && \ |
Andreas Färber | 3e073dc | 2008-08-25 17:33:03 +0200 | [diff] [blame] | 1402 | { $(RM) "$$execdir/git-add$X" && \ |
| 1403 | ln git-add$X "$$execdir/git-add$X" 2>/dev/null || \ |
| 1404 | cp git-add$X "$$execdir/git-add$X"; } && \ |
Alex Riesen | 4e3ae59 | 2008-08-28 15:57:32 +0200 | [diff] [blame] | 1405 | { $(foreach p,$(filter-out git-add$X,$(BUILT_INS)), $(RM) "$$execdir/$p" && \ |
Andreas Färber | 3e073dc | 2008-08-25 17:33:03 +0200 | [diff] [blame] | 1406 | ln "$$execdir/git-add$X" "$$execdir/$p" 2>/dev/null || \ |
| 1407 | ln -s "git-add$X" "$$execdir/$p" 2>/dev/null || \ |
| 1408 | cp "$$execdir/git-add$X" "$$execdir/$p" || exit;) } && \ |
Johannes Sixt | 7b4b59a | 2008-07-21 21:19:58 +0200 | [diff] [blame] | 1409 | ./check_bindir "z$$bindir" "z$$execdir" "$$bindir/git-add$X" |
Petr Baudis | 28818ff | 2005-07-29 17:50:24 +0200 | [diff] [blame] | 1410 | |
| 1411 | install-doc: |
| 1412 | $(MAKE) -C Documentation install |
| 1413 | |
Teemu Likonen | ae081f3 | 2008-06-10 11:34:25 +0300 | [diff] [blame] | 1414 | install-html: |
| 1415 | $(MAKE) -C Documentation install-html |
| 1416 | |
David Kastrup | 4739809 | 2007-08-06 12:22:57 +0200 | [diff] [blame] | 1417 | install-info: |
| 1418 | $(MAKE) -C Documentation install-info |
| 1419 | |
Eric Wong | 6538d1e | 2006-12-23 08:26:09 -0800 | [diff] [blame] | 1420 | quick-install-doc: |
| 1421 | $(MAKE) -C Documentation quick-install |
Petr Baudis | 28818ff | 2005-07-29 17:50:24 +0200 | [diff] [blame] | 1422 | |
Michael J Gruber | 6fe570d | 2008-09-09 22:44:17 +0200 | [diff] [blame] | 1423 | quick-install-html: |
| 1424 | $(MAKE) -C Documentation quick-install-html |
| 1425 | |
Petr Baudis | 28818ff | 2005-07-29 17:50:24 +0200 | [diff] [blame] | 1426 | |
| 1427 | |
| 1428 | ### Maintainer's dist rules |
| 1429 | |
Junio C Hamano | 9b88fce | 2005-12-27 14:40:17 -0800 | [diff] [blame] | 1430 | git.spec: git.spec.in |
Jim Meyering | fc36f6a | 2006-05-25 18:52:01 +0200 | [diff] [blame] | 1431 | sed -e 's/@@VERSION@@/$(GIT_VERSION)/g' < $< > $@+ |
| 1432 | mv $@+ $@ |
Chris Wright | a9db297 | 2005-07-07 13:09:50 -0700 | [diff] [blame] | 1433 | |
Junio C Hamano | 27dedf0 | 2005-11-16 21:32:44 -0800 | [diff] [blame] | 1434 | GIT_TARNAME=git-$(GIT_VERSION) |
Shawn O. Pearce | 6c0f869 | 2008-02-24 00:38:04 -0500 | [diff] [blame] | 1435 | dist: git.spec git-archive$(X) configure |
Junio C Hamano | 9ccb64c | 2006-10-05 02:26:12 -0700 | [diff] [blame] | 1436 | ./git-archive --format=tar \ |
| 1437 | --prefix=$(GIT_TARNAME)/ HEAD^{tree} > $(GIT_TARNAME).tar |
Chris Wright | a9db297 | 2005-07-07 13:09:50 -0700 | [diff] [blame] | 1438 | @mkdir -p $(GIT_TARNAME) |
Matthias Lederhofer | f58494b | 2007-06-18 23:30:36 +0200 | [diff] [blame] | 1439 | @cp git.spec configure $(GIT_TARNAME) |
H. Peter Anvin | 181129d | 2006-01-09 18:07:01 -0800 | [diff] [blame] | 1440 | @echo $(GIT_VERSION) > $(GIT_TARNAME)/version |
Shawn O. Pearce | d647c2e | 2007-02-12 18:20:34 -0500 | [diff] [blame] | 1441 | @$(MAKE) -C git-gui TARDIR=../$(GIT_TARNAME)/git-gui dist-version |
H. Peter Anvin | 181129d | 2006-01-09 18:07:01 -0800 | [diff] [blame] | 1442 | $(TAR) rf $(GIT_TARNAME).tar \ |
Shawn O. Pearce | d647c2e | 2007-02-12 18:20:34 -0500 | [diff] [blame] | 1443 | $(GIT_TARNAME)/git.spec \ |
Matthias Lederhofer | f58494b | 2007-06-18 23:30:36 +0200 | [diff] [blame] | 1444 | $(GIT_TARNAME)/configure \ |
Shawn O. Pearce | d647c2e | 2007-02-12 18:20:34 -0500 | [diff] [blame] | 1445 | $(GIT_TARNAME)/version \ |
Shawn O. Pearce | 115f0fe | 2007-03-12 13:40:31 -0400 | [diff] [blame] | 1446 | $(GIT_TARNAME)/git-gui/version |
Emil Medve | 4cb08df | 2007-07-14 12:51:44 -0500 | [diff] [blame] | 1447 | @$(RM) -r $(GIT_TARNAME) |
Eric W. Biederman | 9dce3c0 | 2005-07-14 19:20:50 -0600 | [diff] [blame] | 1448 | gzip -f -9 $(GIT_TARNAME).tar |
Chris Wright | a9db297 | 2005-07-07 13:09:50 -0700 | [diff] [blame] | 1449 | |
| 1450 | rpm: dist |
Junio C Hamano | 27dedf0 | 2005-11-16 21:32:44 -0800 | [diff] [blame] | 1451 | $(RPMBUILD) -ta $(GIT_TARNAME).tar.gz |
Chris Wright | a9db297 | 2005-07-07 13:09:50 -0700 | [diff] [blame] | 1452 | |
Tilman Sauerbeck | 52db049 | 2006-05-18 12:57:04 +0200 | [diff] [blame] | 1453 | htmldocs = git-htmldocs-$(GIT_VERSION) |
| 1454 | manpages = git-manpages-$(GIT_VERSION) |
| 1455 | dist-doc: |
Emil Medve | 4cb08df | 2007-07-14 12:51:44 -0500 | [diff] [blame] | 1456 | $(RM) -r .doc-tmp-dir |
Tilman Sauerbeck | 52db049 | 2006-05-18 12:57:04 +0200 | [diff] [blame] | 1457 | mkdir .doc-tmp-dir |
| 1458 | $(MAKE) -C Documentation WEBDOC_DEST=../.doc-tmp-dir install-webdoc |
| 1459 | cd .doc-tmp-dir && $(TAR) cf ../$(htmldocs).tar . |
| 1460 | gzip -n -9 -f $(htmldocs).tar |
| 1461 | : |
Emil Medve | 4cb08df | 2007-07-14 12:51:44 -0500 | [diff] [blame] | 1462 | $(RM) -r .doc-tmp-dir |
Junio C Hamano | 4392da4 | 2007-04-19 20:47:04 -0700 | [diff] [blame] | 1463 | mkdir -p .doc-tmp-dir/man1 .doc-tmp-dir/man5 .doc-tmp-dir/man7 |
Martin Waitz | c536032 | 2006-05-25 14:37:46 +0200 | [diff] [blame] | 1464 | $(MAKE) -C Documentation DESTDIR=./ \ |
Jakub Narebski | 7b8cf0c | 2006-06-29 23:26:54 +0200 | [diff] [blame] | 1465 | man1dir=../.doc-tmp-dir/man1 \ |
Junio C Hamano | 4392da4 | 2007-04-19 20:47:04 -0700 | [diff] [blame] | 1466 | man5dir=../.doc-tmp-dir/man5 \ |
Jakub Narebski | 7b8cf0c | 2006-06-29 23:26:54 +0200 | [diff] [blame] | 1467 | man7dir=../.doc-tmp-dir/man7 \ |
Tilman Sauerbeck | 52db049 | 2006-05-18 12:57:04 +0200 | [diff] [blame] | 1468 | install |
| 1469 | cd .doc-tmp-dir && $(TAR) cf ../$(manpages).tar . |
| 1470 | gzip -n -9 -f $(manpages).tar |
Emil Medve | 4cb08df | 2007-07-14 12:51:44 -0500 | [diff] [blame] | 1471 | $(RM) -r .doc-tmp-dir |
Tilman Sauerbeck | 52db049 | 2006-05-18 12:57:04 +0200 | [diff] [blame] | 1472 | |
Petr Baudis | 28818ff | 2005-07-29 17:50:24 +0200 | [diff] [blame] | 1473 | ### Cleaning rules |
Eric W. Biederman | 87a81c8 | 2005-07-14 19:21:57 -0600 | [diff] [blame] | 1474 | |
Mathias Megyei | 922aa80 | 2007-10-04 23:49:19 +0200 | [diff] [blame] | 1475 | distclean: clean |
| 1476 | $(RM) configure |
| 1477 | |
Linus Torvalds | e83c516 | 2005-04-07 15:13:13 -0700 | [diff] [blame] | 1478 | clean: |
Emil Medve | 4cb08df | 2007-07-14 12:51:44 -0500 | [diff] [blame] | 1479 | $(RM) *.o mozilla-sha1/*.o arm/*.o ppc/*.o compat/*.o xdiff/*.o \ |
Junio C Hamano | 4cfc24a | 2008-08-19 18:05:39 -0700 | [diff] [blame] | 1480 | $(LIB_FILE) $(XDIFF_LIB) |
Emil Medve | 4cb08df | 2007-07-14 12:51:44 -0500 | [diff] [blame] | 1481 | $(RM) $(ALL_PROGRAMS) $(BUILT_INS) git$X |
| 1482 | $(RM) $(TEST_PROGRAMS) |
Kristof Provost | a2a9150 | 2007-10-06 16:24:42 +0200 | [diff] [blame] | 1483 | $(RM) *.spec *.pyc *.pyo */*.pyc */*.pyo common-cmds.h TAGS tags cscope* |
Emil Medve | 4cb08df | 2007-07-14 12:51:44 -0500 | [diff] [blame] | 1484 | $(RM) -r autom4te.cache |
Mathias Megyei | 922aa80 | 2007-10-04 23:49:19 +0200 | [diff] [blame] | 1485 | $(RM) config.log config.mak.autogen config.mak.append config.status config.cache |
Emil Medve | 4cb08df | 2007-07-14 12:51:44 -0500 | [diff] [blame] | 1486 | $(RM) -r $(GIT_TARNAME) .doc-tmp-dir |
| 1487 | $(RM) $(GIT_TARNAME).tar.gz git-core_$(GIT_VERSION)-*.tar.gz |
| 1488 | $(RM) $(htmldocs).tar.gz $(manpages).tar.gz |
| 1489 | $(RM) gitweb/gitweb.cgi |
Thomas Glanzmann | ca67f00 | 2005-05-22 20:27:28 +0200 | [diff] [blame] | 1490 | $(MAKE) -C Documentation/ clean |
Alex Riesen | f848718 | 2006-12-04 10:50:04 +0100 | [diff] [blame] | 1491 | $(MAKE) -C perl clean |
Petr Baudis | b1edc53 | 2006-06-24 04:34:29 +0200 | [diff] [blame] | 1492 | $(MAKE) -C templates/ clean |
Junio C Hamano | 4b7581f | 2005-08-02 17:24:11 -0700 | [diff] [blame] | 1493 | $(MAKE) -C t/ clean |
Eygene Ryabinkin | 3cfaf11 | 2007-03-28 04:00:23 -0700 | [diff] [blame] | 1494 | ifndef NO_TCLTK |
Junio C Hamano | 62ba514 | 2007-11-17 10:51:16 -0800 | [diff] [blame] | 1495 | $(MAKE) -C gitk-git clean |
Eygene Ryabinkin | 3cfaf11 | 2007-03-28 04:00:23 -0700 | [diff] [blame] | 1496 | $(MAKE) -C git-gui clean |
| 1497 | endif |
Jeff King | 7cf7f54 | 2008-02-24 14:40:45 -0500 | [diff] [blame] | 1498 | $(RM) GIT-VERSION-FILE GIT-CFLAGS GIT-GUI-VARS GIT-BUILD-OPTIONS |
Junio C Hamano | 9b88fce | 2005-12-27 14:40:17 -0800 | [diff] [blame] | 1499 | |
Junio C Hamano | 4dc0002 | 2006-01-12 21:42:25 -0800 | [diff] [blame] | 1500 | .PHONY: all install clean strip |
Brandon Casey | 6dc4627 | 2008-08-07 14:06:26 -0500 | [diff] [blame] | 1501 | .PHONY: shell_compatibility_test please_set_SHELL_PATH_to_a_more_modern_shell |
Kristof Provost | a2a9150 | 2007-10-06 16:24:42 +0200 | [diff] [blame] | 1502 | .PHONY: .FORCE-GIT-VERSION-FILE TAGS tags cscope .FORCE-GIT-CFLAGS |
Jeff King | 7cf7f54 | 2008-02-24 14:40:45 -0500 | [diff] [blame] | 1503 | .PHONY: .FORCE-GIT-BUILD-OPTIONS |
Junio C Hamano | d89056c | 2005-12-19 17:59:58 -0800 | [diff] [blame] | 1504 | |
Junio C Hamano | 8c989ec | 2006-04-13 00:17:19 -0700 | [diff] [blame] | 1505 | ### Check documentation |
| 1506 | # |
| 1507 | check-docs:: |
Junio C Hamano | 3f7ce64 | 2007-11-08 18:38:27 -0800 | [diff] [blame] | 1508 | @(for v in $(ALL_PROGRAMS) $(BUILT_INS) git gitk; \ |
Junio C Hamano | 8c989ec | 2006-04-13 00:17:19 -0700 | [diff] [blame] | 1509 | do \ |
| 1510 | case "$$v" in \ |
Junio C Hamano | 8c989ec | 2006-04-13 00:17:19 -0700 | [diff] [blame] | 1511 | git-merge-octopus | git-merge-ours | git-merge-recursive | \ |
Miklos Vajna | 51add76 | 2008-07-05 16:43:51 +0200 | [diff] [blame] | 1512 | git-merge-resolve | git-merge-subtree | \ |
Junio C Hamano | 5c66d0d | 2008-01-17 22:52:40 -0800 | [diff] [blame] | 1513 | git-fsck-objects | git-init-db | \ |
Junio C Hamano | 5b4617c | 2007-12-14 22:02:57 -0800 | [diff] [blame] | 1514 | git-?*--?* ) continue ;; \ |
Junio C Hamano | 8c989ec | 2006-04-13 00:17:19 -0700 | [diff] [blame] | 1515 | esac ; \ |
| 1516 | test -f "Documentation/$$v.txt" || \ |
| 1517 | echo "no doc: $$v"; \ |
Junio C Hamano | 79d3066 | 2007-12-01 23:39:19 -0800 | [diff] [blame] | 1518 | sed -e '/^#/d' command-list.txt | \ |
Junio C Hamano | 4b02c52 | 2007-02-13 22:45:22 -0800 | [diff] [blame] | 1519 | grep -q "^$$v[ ]" || \ |
Junio C Hamano | 8c989ec | 2006-04-13 00:17:19 -0700 | [diff] [blame] | 1520 | case "$$v" in \ |
| 1521 | git) ;; \ |
| 1522 | *) echo "no link: $$v";; \ |
| 1523 | esac ; \ |
Junio C Hamano | 3f7ce64 | 2007-11-08 18:38:27 -0800 | [diff] [blame] | 1524 | done; \ |
| 1525 | ( \ |
Junio C Hamano | 79d3066 | 2007-12-01 23:39:19 -0800 | [diff] [blame] | 1526 | sed -e '/^#/d' \ |
Junio C Hamano | 3f7ce64 | 2007-11-08 18:38:27 -0800 | [diff] [blame] | 1527 | -e 's/[ ].*//' \ |
Junio C Hamano | 79d3066 | 2007-12-01 23:39:19 -0800 | [diff] [blame] | 1528 | -e 's/^/listed /' command-list.txt; \ |
Junio C Hamano | 3f7ce64 | 2007-11-08 18:38:27 -0800 | [diff] [blame] | 1529 | ls -1 Documentation/git*txt | \ |
| 1530 | sed -e 's|Documentation/|documented |' \ |
| 1531 | -e 's/\.txt//'; \ |
| 1532 | ) | while read how cmd; \ |
| 1533 | do \ |
| 1534 | case "$$how,$$cmd" in \ |
| 1535 | *,git-citool | \ |
| 1536 | *,git-gui | \ |
Christian Couder | 0f6f195 | 2007-12-04 06:44:29 +0100 | [diff] [blame] | 1537 | *,git-help | \ |
Junio C Hamano | 3f7ce64 | 2007-11-08 18:38:27 -0800 | [diff] [blame] | 1538 | documented,gitattributes | \ |
| 1539 | documented,gitignore | \ |
| 1540 | documented,gitmodules | \ |
Pierre Habouzit | 2f7ee08 | 2007-12-13 11:20:01 +0100 | [diff] [blame] | 1541 | documented,gitcli | \ |
Junio C Hamano | 3f7ce64 | 2007-11-08 18:38:27 -0800 | [diff] [blame] | 1542 | documented,git-tools | \ |
Junio C Hamano | d0594be | 2008-06-15 13:43:32 -0700 | [diff] [blame] | 1543 | documented,gitcore-tutorial | \ |
| 1544 | documented,gitcvs-migration | \ |
| 1545 | documented,gitdiffcore | \ |
| 1546 | documented,gitglossary | \ |
| 1547 | documented,githooks | \ |
| 1548 | documented,gitrepository-layout | \ |
| 1549 | documented,gittutorial | \ |
| 1550 | documented,gittutorial-2 | \ |
Junio C Hamano | 3f7ce64 | 2007-11-08 18:38:27 -0800 | [diff] [blame] | 1551 | sentinel,not,matching,is,ok ) continue ;; \ |
| 1552 | esac; \ |
| 1553 | case " $(ALL_PROGRAMS) $(BUILT_INS) git gitk " in \ |
| 1554 | *" $$cmd "*) ;; \ |
| 1555 | *) echo "removed but $$how: $$cmd" ;; \ |
| 1556 | esac; \ |
| 1557 | done ) | sort |
Junio C Hamano | c74390e | 2006-11-05 11:26:21 -0800 | [diff] [blame] | 1558 | |
| 1559 | ### Make sure built-ins do not have dups and listed in git.c |
| 1560 | # |
| 1561 | check-builtins:: |
| 1562 | ./check-builtins.sh |
Junio C Hamano | 11c57e6 | 2008-01-14 15:10:38 -0800 | [diff] [blame] | 1563 | |