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 | # |
Linus Torvalds | 765ac8e | 2006-02-28 15:07:20 -0800 | [diff] [blame] | 6 | # Define NO_OPENSSL environment variable if you do not have OpenSSL. |
| 7 | # This also implies MOZILLA_SHA1. |
Petr Baudis | 5bdac8b | 2005-07-29 17:48:26 +0200 | [diff] [blame] | 8 | # |
Nick Hengeveld | 58e60dd | 2005-11-02 11:19:24 -0800 | [diff] [blame] | 9 | # Define NO_CURL if you do not have curl installed. git-http-pull and |
| 10 | # git-http-push are not built, and you cannot use http:// and https:// |
| 11 | # transports. |
Johannes Schindelin | b2c0bd6 | 2005-07-31 02:14:23 +0200 | [diff] [blame] | 12 | # |
Patrick Mauritz | 6d9bbc5 | 2005-09-19 16:11:19 +0200 | [diff] [blame] | 13 | # Define CURLDIR=/foo/bar if your curl header and library files are in |
| 14 | # /foo/bar/include and /foo/bar/lib directories. |
| 15 | # |
Nick Hengeveld | 58e60dd | 2005-11-02 11:19:24 -0800 | [diff] [blame] | 16 | # Define NO_EXPAT if you do not have expat installed. git-http-push is |
| 17 | # not built, and you cannot push using http:// and https:// transports. |
| 18 | # |
Junio C Hamano | 35a730f | 2006-01-19 17:13:51 -0800 | [diff] [blame] | 19 | # Define NO_D_INO_IN_DIRENT if you don't have d_ino in your struct dirent. |
| 20 | # |
Junio C Hamano | 63be37b | 2006-01-19 17:13:57 -0800 | [diff] [blame] | 21 | # Define NO_D_TYPE_IN_DIRENT if your platform defines DT_UNKNOWN but lacks |
| 22 | # d_type in struct dirent (latest Cygwin -- will be fixed soonish). |
| 23 | # |
Ramsay Allan Jones | 579d1fb | 2006-07-30 16:38:28 +0100 | [diff] [blame] | 24 | # Define NO_C99_FORMAT if your formatted IO functions (printf/scanf et.al.) |
| 25 | # do not support the 'size specifiers' introduced by C99, namely ll, hh, |
| 26 | # 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] | 27 | # 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] | 28 | # |
Linus Torvalds | ef34af2 | 2005-09-18 18:30:50 -0700 | [diff] [blame] | 29 | # Define NO_STRCASESTR if you don't have strcasestr. |
| 30 | # |
René Scharfe | b21b9f1 | 2007-09-07 00:32:54 +0200 | [diff] [blame] | 31 | # Define NO_MEMMEM if you don't have memmem. |
| 32 | # |
Peter Eriksen | 817151e | 2006-06-24 16:01:25 +0200 | [diff] [blame] | 33 | # Define NO_STRLCPY if you don't have strlcpy. |
| 34 | # |
Jason Riedy | bc6b4f5 | 2007-02-19 16:22:56 -0800 | [diff] [blame] | 35 | # Define NO_STRTOUMAX if you don't have strtoumax in the C library. |
| 36 | # If your compiler also does not support long long or does not have |
| 37 | # strtoull, define NO_STRTOULL. |
| 38 | # |
Jason Riedy | e40b61f | 2005-12-02 15:08:28 -0800 | [diff] [blame] | 39 | # Define NO_SETENV if you don't have setenv in the C library. |
| 40 | # |
Junio C Hamano | 9f0bb90 | 2006-05-02 00:40:24 -0700 | [diff] [blame] | 41 | # Define NO_SYMLINK_HEAD if you never want .git/HEAD to be a symbolic link. |
| 42 | # Enable it on Windows. By default, symrefs are still used. |
Pavel Roskin | 2fabd21 | 2005-11-15 00:59:50 -0500 | [diff] [blame] | 43 | # |
Pavel Roskin | 0285358 | 2006-07-09 02:44:58 -0700 | [diff] [blame] | 44 | # 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] | 45 | # tests. These tests take up a significant amount of the total test time |
| 46 | # but are not needed unless you plan to talk to SVN repos. |
| 47 | # |
Shawn Pearce | 8eb38ca | 2006-07-24 00:28:28 -0400 | [diff] [blame] | 48 | # Define NO_FINK if you are building on Darwin/Mac OS X, have Fink |
| 49 | # installed in /sw, but don't want GIT to link against any libraries |
| 50 | # installed there. If defined you may specify your own (or Fink's) |
| 51 | # include directories and library directories by defining CFLAGS |
| 52 | # and LDFLAGS appropriately. |
| 53 | # |
| 54 | # Define NO_DARWIN_PORTS if you are building on Darwin/Mac OS X, |
| 55 | # have DarwinPorts installed in /opt/local, but don't want GIT to |
| 56 | # link against any libraries installed there. If defined you may |
| 57 | # specify your own (or DarwinPort's) include directories and |
| 58 | # library directories by defining CFLAGS and LDFLAGS appropriately. |
| 59 | # |
Petr Baudis | 5bdac8b | 2005-07-29 17:48:26 +0200 | [diff] [blame] | 60 | # Define PPC_SHA1 environment variable when running make to make use of |
| 61 | # a bundled SHA1 routine optimized for PowerPC. |
Junio C Hamano | 597c9cc | 2005-09-07 12:22:56 -0700 | [diff] [blame] | 62 | # |
Nicolas Pitre | 7c6ef2f | 2005-09-20 12:27:13 -0400 | [diff] [blame] | 63 | # Define ARM_SHA1 environment variable when running make to make use of |
| 64 | # a bundled SHA1 routine optimized for ARM. |
| 65 | # |
Junio C Hamano | f6af75d | 2006-06-23 17:57:48 -0700 | [diff] [blame] | 66 | # Define MOZILLA_SHA1 environment variable when running make to make use of |
| 67 | # a bundled SHA1 routine coming from Mozilla. It is GPL'd and should be fast |
| 68 | # on non-x86 architectures (e.g. PowerPC), while the OpenSSL version (default |
| 69 | # choice) has very fast version optimized for i586. |
| 70 | # |
Junio C Hamano | 597c9cc | 2005-09-07 12:22:56 -0700 | [diff] [blame] | 71 | # Define NEEDS_SSL_WITH_CRYPTO if you need -lcrypto with -lssl (Darwin). |
Patrick Mauritz | f0ebff0 | 2005-09-06 01:24:03 +0200 | [diff] [blame] | 72 | # |
Junio C Hamano | 597c9cc | 2005-09-07 12:22:56 -0700 | [diff] [blame] | 73 | # Define NEEDS_LIBICONV if linking with libc is not enough (Darwin). |
Patrick Mauritz | f0ebff0 | 2005-09-06 01:24:03 +0200 | [diff] [blame] | 74 | # |
| 75 | # Define NEEDS_SOCKET if linking with libc is not enough (SunOS, |
| 76 | # Patrick Mauritz). |
| 77 | # |
Johannes Schindelin | 730d48a | 2005-10-08 15:54:36 -0700 | [diff] [blame] | 78 | # Define NO_MMAP if you want to avoid mmap. |
| 79 | # |
Stefan-W. Hahn | 6900679 | 2007-01-09 22:04:12 +0100 | [diff] [blame] | 80 | # Define NO_PREAD if you have a problem with pread() system call (e.g. |
| 81 | # cygwin.dll before v1.5.22). |
| 82 | # |
Shawn O. Pearce | 1510fea | 2006-12-14 06:15:57 -0500 | [diff] [blame] | 83 | # Define NO_FAST_WORKING_DIRECTORY if accessing objects in pack files is |
| 84 | # generally faster on your platform than accessing the working directory. |
| 85 | # |
Shawn O. Pearce | c869753 | 2006-12-30 23:53:55 -0500 | [diff] [blame] | 86 | # Define NO_TRUSTABLE_FILEMODE if your filesystem may claim to support |
| 87 | # the executable mode bit, but doesn't really do so. |
| 88 | # |
hpa | 49744d6 | 2005-09-28 16:52:21 -0700 | [diff] [blame] | 89 | # Define NO_IPV6 if you lack IPv6 support and getaddrinfo(). |
| 90 | # |
Junio C Hamano | bdc37f5 | 2006-01-19 17:13:32 -0800 | [diff] [blame] | 91 | # Define NO_SOCKADDR_STORAGE if your platform does not have struct |
| 92 | # sockaddr_storage. |
| 93 | # |
Fernando J. Pereda | b6e56ec | 2006-02-16 09:38:01 +0100 | [diff] [blame] | 94 | # Define NO_ICONV if your libc does not properly support iconv. |
| 95 | # |
Ramsay Jones | fd547a9 | 2007-03-03 18:29:03 +0000 | [diff] [blame] | 96 | # Define OLD_ICONV if your library has an old iconv(), where the second |
| 97 | # (input buffer pointer) parameter is declared with type (const char **). |
| 98 | # |
Matt Kraai | 2064887 | 2007-06-30 10:05:03 -0700 | [diff] [blame] | 99 | # Define NO_R_TO_GCC_LINKER if your gcc does not like "-R/path/lib" |
| 100 | # that tells runtime paths to dynamic libraries; |
| 101 | # "-Wl,-rpath=/path/lib" is used instead. |
Junio C Hamano | bbfc63d | 2006-12-27 14:17:35 -0800 | [diff] [blame] | 102 | # |
Petr Baudis | 5bdac8b | 2005-07-29 17:48:26 +0200 | [diff] [blame] | 103 | # Define USE_NSEC below if you want git to care about sub-second file mtimes |
| 104 | # and ctimes. Note that you need recent glibc (at least 2.2.4) for this, and |
| 105 | # it will BREAK YOUR LOCAL DIFFS! show-diff and anything using it will likely |
| 106 | # randomly break unless your underlying filesystem supports those sub-second |
| 107 | # times (my ext3 doesn't). |
Junio C Hamano | f6af75d | 2006-06-23 17:57:48 -0700 | [diff] [blame] | 108 | # |
Petr Baudis | 5bdac8b | 2005-07-29 17:48:26 +0200 | [diff] [blame] | 109 | # Define USE_STDEV below if you want git to care about the underlying device |
| 110 | # change being considered an inode change from the update-cache perspective. |
Alex Riesen | f848718 | 2006-12-04 10:50:04 +0100 | [diff] [blame] | 111 | # |
Junio C Hamano | 4c7100a | 2007-06-14 22:20:16 -0700 | [diff] [blame] | 112 | # Define ASCIIDOC8 if you want to format documentation with AsciiDoc 8 |
| 113 | # |
Alex Riesen | f848718 | 2006-12-04 10:50:04 +0100 | [diff] [blame] | 114 | # Define NO_PERL_MAKEMAKER if you cannot use Makefiles generated by perl's |
| 115 | # MakeMaker (e.g. using ActiveState under Cygwin). |
| 116 | # |
Eygene Ryabinkin | 3cfaf11 | 2007-03-28 04:00:23 -0700 | [diff] [blame] | 117 | # Define NO_TCLTK if you do not want Tcl/Tk GUI. |
| 118 | # |
Shawn O. Pearce | 5f5dbd7 | 2007-05-07 23:36:31 -0400 | [diff] [blame] | 119 | # The TCL_PATH variable governs the location of the Tcl interpreter |
| 120 | # used to optimize git-gui for your system. Only used if NO_TCLTK |
| 121 | # is not set. Defaults to the bare 'tclsh'. |
| 122 | # |
| 123 | # The TCLTK_PATH variable governs the location of the Tcl/Tk interpreter. |
Eygene Ryabinkin | 81b63c7 | 2007-03-28 04:12:07 -0700 | [diff] [blame] | 124 | # If not set it defaults to the bare 'wish'. If it is set to the empty |
| 125 | # string then NO_TCLTK will be forced (this is used by configure script). |
| 126 | # |
Nicolas Pitre | 8ecce68 | 2007-09-06 02:13:11 -0400 | [diff] [blame] | 127 | # Define THREADED_DELTA_SEARCH if you have pthreads and wish to exploit |
| 128 | # parallel delta searching when packing objects. |
| 129 | # |
Petr Baudis | 5bdac8b | 2005-07-29 17:48:26 +0200 | [diff] [blame] | 130 | |
Junio C Hamano | 9b88fce | 2005-12-27 14:40:17 -0800 | [diff] [blame] | 131 | GIT-VERSION-FILE: .FORCE-GIT-VERSION-FILE |
Fredrik Kuivinen | 3654638 | 2006-02-14 00:15:14 +0100 | [diff] [blame] | 132 | @$(SHELL_PATH) ./GIT-VERSION-GEN |
Junio C Hamano | 9b88fce | 2005-12-27 14:40:17 -0800 | [diff] [blame] | 133 | -include GIT-VERSION-FILE |
Petr Baudis | 5bdac8b | 2005-07-29 17:48:26 +0200 | [diff] [blame] | 134 | |
Paul Jakma | e15f545 | 2006-02-20 23:36:28 +0000 | [diff] [blame] | 135 | uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not') |
| 136 | uname_M := $(shell sh -c 'uname -m 2>/dev/null || echo not') |
| 137 | uname_O := $(shell sh -c 'uname -o 2>/dev/null || echo not') |
| 138 | uname_R := $(shell sh -c 'uname -r 2>/dev/null || echo not') |
| 139 | uname_P := $(shell sh -c 'uname -p 2>/dev/null || echo not') |
| 140 | |
Junio C Hamano | 94d2331 | 2005-11-13 01:46:13 -0800 | [diff] [blame] | 141 | # 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] | 142 | |
Pavel Roskin | b05701c | 2005-08-06 01:36:15 -0400 | [diff] [blame] | 143 | CFLAGS = -g -O2 -Wall |
Junio C Hamano | 94d2331 | 2005-11-13 01:46:13 -0800 | [diff] [blame] | 144 | LDFLAGS = |
Junio C Hamano | 12aa745 | 2005-11-04 23:50:09 -0800 | [diff] [blame] | 145 | ALL_CFLAGS = $(CFLAGS) |
Junio C Hamano | 94d2331 | 2005-11-13 01:46:13 -0800 | [diff] [blame] | 146 | ALL_LDFLAGS = $(LDFLAGS) |
Junio C Hamano | 4dc0002 | 2006-01-12 21:42:25 -0800 | [diff] [blame] | 147 | STRIP ?= strip |
Thomas Glanzmann | 29c2cce | 2005-05-07 10:41:54 +0200 | [diff] [blame] | 148 | |
Pavel Roskin | b05701c | 2005-08-06 01:36:15 -0400 | [diff] [blame] | 149 | prefix = $(HOME) |
| 150 | bindir = $(prefix)/bin |
Paul Jakma | e15f545 | 2006-02-20 23:36:28 +0000 | [diff] [blame] | 151 | gitexecdir = $(bindir) |
Johannes Sixt | 9354768 | 2007-06-11 10:02:17 +0200 | [diff] [blame] | 152 | sharedir = $(prefix)/share |
Johannes Sixt | d52fd42 | 2007-06-11 11:10:47 +0200 | [diff] [blame] | 153 | template_dir = $(sharedir)/git-core/templates |
Josh Triplett | b51b8bb | 2007-04-24 00:51:35 -0700 | [diff] [blame] | 154 | ifeq ($(prefix),/usr) |
| 155 | sysconfdir = /etc |
| 156 | else |
| 157 | sysconfdir = $(prefix)/etc |
| 158 | endif |
Robert Schiele | 10861be | 2007-08-01 06:30:35 +0200 | [diff] [blame] | 159 | lib = lib |
Josh Triplett | b51b8bb | 2007-04-24 00:51:35 -0700 | [diff] [blame] | 160 | ETC_GITCONFIG = $(sysconfdir)/gitconfig |
Petr Baudis | a682ef9 | 2005-08-05 01:56:38 +0200 | [diff] [blame] | 161 | # DESTDIR= |
Petr Baudis | 5c2a7fb | 2005-04-13 02:14:06 -0700 | [diff] [blame] | 162 | |
Martin Waitz | 5d043a3 | 2006-08-01 21:34:08 +0200 | [diff] [blame] | 163 | # default configuration for gitweb |
Jeff King | c8d138a | 2006-08-02 15:23:34 -0400 | [diff] [blame] | 164 | GITWEB_CONFIG = gitweb_config.perl |
Yasushi SHOJI | 2de21fa | 2006-08-15 07:50:49 +0900 | [diff] [blame] | 165 | GITWEB_HOME_LINK_STR = projects |
Martin Waitz | 5d043a3 | 2006-08-01 21:34:08 +0200 | [diff] [blame] | 166 | GITWEB_SITENAME = |
| 167 | GITWEB_PROJECTROOT = /pub/git |
Matthias Lederhofer | 32f4aac | 2006-09-17 00:31:01 +0200 | [diff] [blame] | 168 | GITWEB_EXPORT_OK = |
| 169 | GITWEB_STRICT_EXPORT = |
Jakub Narebski | 19a8721 | 2006-08-15 23:03:17 +0200 | [diff] [blame] | 170 | GITWEB_BASE_URL = |
Martin Waitz | 5d043a3 | 2006-08-01 21:34:08 +0200 | [diff] [blame] | 171 | GITWEB_LIST = |
| 172 | GITWEB_HOMETEXT = indextext.html |
| 173 | GITWEB_CSS = gitweb.css |
Martin Waitz | 281f2f6 | 2006-07-31 00:38:39 +0200 | [diff] [blame] | 174 | GITWEB_LOGO = git-logo.png |
Jakub Narebski | 0b5deba | 2006-09-04 20:32:13 +0200 | [diff] [blame] | 175 | GITWEB_FAVICON = git-favicon.png |
Alan Chandler | b2d3476 | 2006-10-03 13:49:03 +0100 | [diff] [blame] | 176 | GITWEB_SITE_HEADER = |
| 177 | GITWEB_SITE_FOOTER = |
Martin Waitz | 5d043a3 | 2006-08-01 21:34:08 +0200 | [diff] [blame] | 178 | |
Shawn O. Pearce | 5f5dbd7 | 2007-05-07 23:36:31 -0400 | [diff] [blame] | 179 | export prefix bindir gitexecdir sharedir template_dir sysconfdir |
Jakub Narebski | e14421b | 2006-06-29 22:11:25 +0200 | [diff] [blame] | 180 | |
Pavel Roskin | b05701c | 2005-08-06 01:36:15 -0400 | [diff] [blame] | 181 | CC = gcc |
| 182 | AR = ar |
Emil Medve | 4cb08df | 2007-07-14 12:51:44 -0500 | [diff] [blame] | 183 | RM = rm -f |
Junio C Hamano | 229a7ed | 2005-09-23 10:41:40 -0700 | [diff] [blame] | 184 | TAR = tar |
David Kastrup | 89b2f19 | 2007-07-29 15:23:28 -0700 | [diff] [blame] | 185 | FIND = find |
Pavel Roskin | b05701c | 2005-08-06 01:36:15 -0400 | [diff] [blame] | 186 | INSTALL = install |
| 187 | RPMBUILD = rpmbuild |
Shawn O. Pearce | 5f5dbd7 | 2007-05-07 23:36:31 -0400 | [diff] [blame] | 188 | TCL_PATH = tclsh |
Eygene Ryabinkin | 81b63c7 | 2007-03-28 04:12:07 -0700 | [diff] [blame] | 189 | TCLTK_PATH = wish |
Linus Torvalds | e83c516 | 2005-04-07 15:13:13 -0700 | [diff] [blame] | 190 | |
Shawn O. Pearce | 5f5dbd7 | 2007-05-07 23:36:31 -0400 | [diff] [blame] | 191 | export TCL_PATH TCLTK_PATH |
| 192 | |
Linus Torvalds | 44c9e85 | 2005-07-03 10:02:35 -0700 | [diff] [blame] | 193 | # sparse is architecture-neutral, which means that we need to tell it |
| 194 | # explicitly what architecture to check for. Fix this up for yours.. |
Pavel Roskin | b05701c | 2005-08-06 01:36:15 -0400 | [diff] [blame] | 195 | SPARSE_FLAGS = -D__BIG_ENDIAN__ -D__powerpc__ |
Linus Torvalds | 44c9e85 | 2005-07-03 10:02:35 -0700 | [diff] [blame] | 196 | |
Petr Baudis | 28818ff | 2005-07-29 17:50:24 +0200 | [diff] [blame] | 197 | |
| 198 | |
| 199 | ### --- END CONFIGURATION SECTION --- |
| 200 | |
Petr Baudis | 8d7f586 | 2006-06-25 03:47:03 +0200 | [diff] [blame] | 201 | # 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] | 202 | # be built by a different compiler. (Note that this is an artifact now |
| 203 | # but it still might be nice to keep that distinction.) |
| 204 | BASIC_CFLAGS = |
| 205 | BASIC_LDFLAGS = |
Petr Baudis | 8d7f586 | 2006-06-25 03:47:03 +0200 | [diff] [blame] | 206 | |
Junio C Hamano | 215a7ad | 2005-09-07 17:26:23 -0700 | [diff] [blame] | 207 | SCRIPT_SH = \ |
Lars Hjemli | c31820c | 2006-10-23 23:27:45 +0200 | [diff] [blame] | 208 | git-bisect.sh git-checkout.sh \ |
Rene Scharfe | e827633 | 2006-10-24 01:01:57 +0200 | [diff] [blame] | 209 | git-clean.sh git-clone.sh git-commit.sh \ |
James Bowes | 6757ada | 2007-03-13 21:58:22 -0400 | [diff] [blame] | 210 | git-fetch.sh \ |
Junio C Hamano | 6856373 | 2006-05-21 02:48:21 -0700 | [diff] [blame] | 211 | git-ls-remote.sh \ |
Theodore Ts'o | c4b4a5a | 2007-03-06 00:05:16 -0500 | [diff] [blame] | 212 | git-merge-one-file.sh git-mergetool.sh git-parse-remote.sh \ |
Johannes Schindelin | 1b1dce4 | 2007-06-25 01:11:14 +0100 | [diff] [blame] | 213 | git-pull.sh git-rebase.sh git-rebase--interactive.sh \ |
Carlos Rica | 0e5a7fa | 2007-09-11 05:19:34 +0200 | [diff] [blame] | 214 | git-repack.sh git-request-pull.sh \ |
Johannes Schindelin | 9509af6 | 2007-03-01 05:26:30 +0100 | [diff] [blame] | 215 | git-sh-setup.sh \ |
Junio C Hamano | 59c8e2c | 2007-05-24 19:25:25 -0700 | [diff] [blame] | 216 | git-am.sh \ |
Junio C Hamano | 2276aa6 | 2005-09-10 17:56:19 -0700 | [diff] [blame] | 217 | git-merge.sh git-merge-stupid.sh git-merge-octopus.sh \ |
Linus Torvalds | 63dffdf | 2006-05-16 16:46:31 -0700 | [diff] [blame] | 218 | git-merge-resolve.sh git-merge-ours.sh \ |
Johannes Schindelin | 6f6826c | 2007-06-03 01:31:28 +0100 | [diff] [blame] | 219 | git-lost-found.sh git-quiltimport.sh git-submodule.sh \ |
しらいしななこ | f2c66ed | 2007-06-30 14:37:09 +0900 | [diff] [blame] | 220 | git-filter-branch.sh \ |
| 221 | git-stash.sh |
Petr Baudis | 28818ff | 2005-07-29 17:50:24 +0200 | [diff] [blame] | 222 | |
Junio C Hamano | 215a7ad | 2005-09-07 17:26:23 -0700 | [diff] [blame] | 223 | SCRIPT_PERL = \ |
Junio C Hamano | 5cde71d | 2006-12-10 20:55:50 -0800 | [diff] [blame] | 224 | git-add--interactive.perl \ |
Junio C Hamano | 215a7ad | 2005-09-07 17:26:23 -0700 | [diff] [blame] | 225 | git-archimport.perl git-cvsimport.perl git-relink.perl \ |
Junio C Hamano | e194cd1 | 2007-01-03 12:13:04 -0800 | [diff] [blame] | 226 | git-cvsserver.perl git-remote.perl \ |
Johannes Schindelin | 11be42a | 2006-07-26 03:52:35 +0200 | [diff] [blame] | 227 | git-svnimport.perl git-cvsexportcommit.perl \ |
Eric Wong | 60d02cc | 2006-07-06 00:14:16 -0700 | [diff] [blame] | 228 | git-send-email.perl git-svn.perl |
Junio C Hamano | 60036a4 | 2005-07-30 17:31:47 -0700 | [diff] [blame] | 229 | |
Andreas Ericsson | d6ebd25 | 2005-11-22 00:44:15 +0100 | [diff] [blame] | 230 | SCRIPTS = $(patsubst %.sh,%,$(SCRIPT_SH)) \ |
| 231 | $(patsubst %.perl,%,$(SCRIPT_PERL)) \ |
Johannes Schindelin | 9509af6 | 2007-03-01 05:26:30 +0100 | [diff] [blame] | 232 | git-status git-instaweb |
Andreas Ericsson | d6ebd25 | 2005-11-22 00:44:15 +0100 | [diff] [blame] | 233 | |
Junio C Hamano | b42934d | 2006-01-12 21:37:17 -0800 | [diff] [blame] | 234 | # ... and all the rest that could be moved out of bindir to gitexecdir |
Junio C Hamano | 215a7ad | 2005-09-07 17:26:23 -0700 | [diff] [blame] | 235 | PROGRAMS = \ |
Nguyen Thai Ngoc Duy | 59d1024 | 2007-05-28 22:05:43 -0400 | [diff] [blame] | 236 | git-convert-objects$X git-fetch-pack$X \ |
Daniel Barkalow | fbdeef9 | 2007-09-10 23:02:40 -0400 | [diff] [blame] | 237 | git-hash-object$X git-index-pack$X \ |
Shawn O. Pearce | db5e523 | 2006-08-05 02:04:21 -0400 | [diff] [blame] | 238 | git-fast-import$X \ |
Shawn O. Pearce | af8ffbe | 2006-11-05 02:28:25 -0500 | [diff] [blame] | 239 | git-daemon$X \ |
Matthias Kestenholz | 5d4a600 | 2006-08-03 17:24:36 +0200 | [diff] [blame] | 240 | git-merge-index$X git-mktag$X git-mktree$X git-patch-id$X \ |
Matthias Kestenholz | 53bb2c0 | 2006-08-02 18:32:32 +0200 | [diff] [blame] | 241 | git-peek-remote$X git-receive-pack$X \ |
Peter Eriksen | 51ce34b | 2006-05-23 14:15:35 +0200 | [diff] [blame] | 242 | git-send-pack$X git-shell$X \ |
Daniel Barkalow | fbdeef9 | 2007-09-10 23:02:40 -0400 | [diff] [blame] | 243 | git-show-index$X \ |
| 244 | git-unpack-file$X \ |
Matthias Kestenholz | 6441363 | 2006-08-03 17:24:37 +0200 | [diff] [blame] | 245 | git-update-server-info$X \ |
Nguyen Thai Ngoc Duy | 59d1024 | 2007-05-28 22:05:43 -0400 | [diff] [blame] | 246 | git-upload-pack$X \ |
Matthias Kestenholz | d6b64ed | 2006-08-03 17:24:35 +0200 | [diff] [blame] | 247 | git-pack-redundant$X git-var$X \ |
Shawn O. Pearce | 9a0eaf8 | 2007-01-10 06:36:36 -0500 | [diff] [blame] | 248 | git-merge-tree$X git-imap-send$X \ |
Junio C Hamano | a06f678 | 2006-09-24 19:49:47 -0700 | [diff] [blame] | 249 | git-merge-recursive$X \ |
Junio C Hamano | 42f7740 | 2006-08-15 21:38:07 -0700 | [diff] [blame] | 250 | $(EXTRA_PROGRAMS) |
| 251 | |
| 252 | # Empty... |
| 253 | EXTRA_PROGRAMS = |
Andreas Ericsson | d6ebd25 | 2005-11-22 00:44:15 +0100 | [diff] [blame] | 254 | |
Junio C Hamano | e414156 | 2006-08-04 01:23:19 -0700 | [diff] [blame] | 255 | BUILT_INS = \ |
Rene Scharfe | e827633 | 2006-10-24 01:01:57 +0200 | [diff] [blame] | 256 | git-format-patch$X git-show$X git-whatchanged$X git-cherry$X \ |
Tom Prince | e0d10e1 | 2007-01-28 16:16:53 -0800 | [diff] [blame] | 257 | git-get-tar-commit-id$X git-init$X git-repo-config$X \ |
Johannes Schindelin | 9509af6 | 2007-03-01 05:26:30 +0100 | [diff] [blame] | 258 | git-fsck-objects$X git-cherry-pick$X \ |
Junio C Hamano | f754fa9 | 2006-08-04 01:51:04 -0700 | [diff] [blame] | 259 | $(patsubst builtin-%.o,git-%$X,$(BUILTIN_OBJS)) |
Junio C Hamano | 9173080 | 2006-04-10 17:37:58 -0700 | [diff] [blame] | 260 | |
Junio C Hamano | b42934d | 2006-01-12 21:37:17 -0800 | [diff] [blame] | 261 | # what 'all' will build and 'install' will install, in gitexecdir |
Junio C Hamano | 6506e15 | 2007-02-06 21:27:09 -0800 | [diff] [blame] | 262 | ALL_PROGRAMS = $(PROGRAMS) $(SCRIPTS) |
Linus Torvalds | e83c516 | 2005-04-07 15:13:13 -0700 | [diff] [blame] | 263 | |
Junio C Hamano | 68faf68 | 2007-02-15 16:32:45 -0800 | [diff] [blame] | 264 | ALL_PROGRAMS += git-merge-subtree$X |
| 265 | |
Eygene Ryabinkin | 3cfaf11 | 2007-03-28 04:00:23 -0700 | [diff] [blame] | 266 | # what 'all' will build but not install in gitexecdir |
| 267 | OTHER_PROGRAMS = git$X gitweb/gitweb.cgi |
| 268 | ifndef NO_TCLTK |
Eygene Ryabinkin | 6bdb18a | 2007-03-28 04:22:02 -0700 | [diff] [blame] | 269 | OTHER_PROGRAMS += gitk-wish |
Eygene Ryabinkin | 3cfaf11 | 2007-03-28 04:00:23 -0700 | [diff] [blame] | 270 | endif |
| 271 | |
Ryan Anderson | 3d32051 | 2005-11-21 00:11:22 -0500 | [diff] [blame] | 272 | # Set paths to tools early so that they can be used for version tests. |
| 273 | ifndef SHELL_PATH |
| 274 | SHELL_PATH = /bin/sh |
| 275 | endif |
| 276 | ifndef PERL_PATH |
| 277 | PERL_PATH = /usr/bin/perl |
| 278 | endif |
Junio C Hamano | 720d150 | 2005-09-10 17:46:27 -0700 | [diff] [blame] | 279 | |
Luben Tuikov | 3a79347 | 2006-12-14 23:03:03 -0800 | [diff] [blame] | 280 | export PERL_PATH |
| 281 | |
Linus Torvalds | 0a02ce7 | 2005-04-18 12:49:39 -0700 | [diff] [blame] | 282 | LIB_FILE=libgit.a |
Linus Torvalds | 3443546 | 2006-03-24 20:13:22 -0800 | [diff] [blame] | 283 | XDIFF_LIB=xdiff/lib.a |
Linus Torvalds | 0a02ce7 | 2005-04-18 12:49:39 -0700 | [diff] [blame] | 284 | |
Junio C Hamano | 215a7ad | 2005-09-07 17:26:23 -0700 | [diff] [blame] | 285 | LIB_H = \ |
Dmitry V. Levin | 6b1b40d | 2007-09-06 03:22:51 +0400 | [diff] [blame] | 286 | archive.h blob.h cache.h cache-tree.h commit.h csum-file.h delta.h grep.h \ |
Junio C Hamano | 4405fb7 | 2006-09-17 18:32:03 -0700 | [diff] [blame] | 287 | diff.h object.h pack.h pkt-line.h quote.h refs.h list-objects.h sideband.h \ |
Junio C Hamano | 1b0c717 | 2006-03-29 22:55:43 -0800 | [diff] [blame] | 288 | run-command.h strbuf.h tag.h tree.h git-compat-util.h revision.h \ |
Johannes Schindelin | 9e83266 | 2006-12-22 22:06:08 +0100 | [diff] [blame] | 289 | tree-walk.h log-tree.h dir.h path-list.h unpack-trees.h builtin.h \ |
Daniel Barkalow | 5751f49 | 2007-05-12 11:45:53 -0400 | [diff] [blame] | 290 | utf8.h reflog-walk.h patch-ids.h attr.h decorate.h progress.h \ |
| 291 | mailmap.h remote.h |
Junio C Hamano | 8f3f9b0 | 2005-07-23 17:54:41 -0700 | [diff] [blame] | 292 | |
Junio C Hamano | 215a7ad | 2005-09-07 17:26:23 -0700 | [diff] [blame] | 293 | DIFF_OBJS = \ |
Junio C Hamano | 6973dca | 2006-04-21 23:57:45 -0700 | [diff] [blame] | 294 | diff.o diff-lib.o diffcore-break.o diffcore-order.o \ |
Junio C Hamano | 6541675 | 2006-02-28 16:01:36 -0800 | [diff] [blame] | 295 | diffcore-pickaxe.o diffcore-rename.o tree-diff.o combine-diff.o \ |
Junio C Hamano | 5f1c3f0 | 2006-04-09 01:11:11 -0700 | [diff] [blame] | 296 | diffcore-delta.o log-tree.o |
Josef Weidendorfer | b1bf95b | 2005-07-31 21:17:43 +0200 | [diff] [blame] | 297 | |
Junio C Hamano | 215a7ad | 2005-09-07 17:26:23 -0700 | [diff] [blame] | 298 | LIB_OBJS = \ |
Junio C Hamano | 283c8ee | 2006-05-20 00:56:11 -0700 | [diff] [blame] | 299 | blob.o commit.o connect.o csum-file.o cache-tree.o base85.o \ |
Jon Loeliger | 49ba83f | 2006-09-19 20:31:51 -0500 | [diff] [blame] | 300 | date.o diff-delta.o entry.o exec_cmd.o ident.o \ |
| 301 | interpolate.o \ |
| 302 | lockfile.o \ |
Junio C Hamano | 5d23e13 | 2007-04-09 17:01:27 -0700 | [diff] [blame] | 303 | patch-ids.o \ |
Dana L. How | 8b0eca7 | 2007-05-02 12:13:14 -0400 | [diff] [blame] | 304 | object.o pack-check.o pack-write.o patch-delta.o path.o pkt-line.o \ |
| 305 | sideband.o reachable.o reflog-walk.o \ |
Linus Torvalds | 3e4339e | 2006-06-18 11:45:02 -0700 | [diff] [blame] | 306 | quote.o read-cache.o refs.o run-command.o dir.o object-refs.o \ |
Junio C Hamano | 215a7ad | 2005-09-07 17:26:23 -0700 | [diff] [blame] | 307 | server-info.o setup.o sha1_file.o sha1_name.o strbuf.o \ |
Junio C Hamano | f3123c4 | 2005-10-22 01:28:13 -0700 | [diff] [blame] | 308 | tag.o tree.o usage.o config.o environment.o ctype.o copy.o \ |
Nicolas Pitre | da093d3 | 2006-11-01 17:06:23 -0500 | [diff] [blame] | 309 | revision.o pager.o tree-walk.o xdiff-interface.o \ |
Junio C Hamano | 68faf68 | 2007-02-15 16:32:45 -0800 | [diff] [blame] | 310 | write_or_die.o trace.o list-objects.o grep.o match-trees.o \ |
Jeff King | 7c92fe0 | 2006-09-08 04:03:18 -0400 | [diff] [blame] | 311 | alloc.o merge-file.o path-list.o help.o unpack-trees.o $(DIFF_OBJS) \ |
Linus Torvalds | 6c510be | 2007-02-13 11:07:23 -0800 | [diff] [blame] | 312 | color.o wt-status.o archive-zip.o archive-tar.o shallow.o utf8.o \ |
Daniel Barkalow | 5751f49 | 2007-05-12 11:45:53 -0400 | [diff] [blame] | 313 | convert.o attr.o decorate.o progress.o mailmap.o symlinks.o remote.o |
Junio C Hamano | d19938a | 2005-05-09 17:57:56 -0700 | [diff] [blame] | 314 | |
Linus Torvalds | 70827b1 | 2006-04-21 10:27:34 -0700 | [diff] [blame] | 315 | BUILTIN_OBJS = \ |
Junio C Hamano | f754fa9 | 2006-08-04 01:51:04 -0700 | [diff] [blame] | 316 | builtin-add.o \ |
Ryan Anderson | f789e34 | 2006-10-09 03:32:05 -0700 | [diff] [blame] | 317 | builtin-annotate.o \ |
Junio C Hamano | f754fa9 | 2006-08-04 01:51:04 -0700 | [diff] [blame] | 318 | builtin-apply.o \ |
Franck Bui-Huu | 4df096a | 2006-09-07 15:12:02 +0200 | [diff] [blame] | 319 | builtin-archive.o \ |
Junio C Hamano | acca687 | 2006-11-08 18:47:54 -0800 | [diff] [blame] | 320 | builtin-blame.o \ |
Lars Hjemli | c31820c | 2006-10-23 23:27:45 +0200 | [diff] [blame] | 321 | builtin-branch.o \ |
Johannes Schindelin | 2e0afaf | 2007-02-22 01:59:14 +0100 | [diff] [blame] | 322 | builtin-bundle.o \ |
Junio C Hamano | f754fa9 | 2006-08-04 01:51:04 -0700 | [diff] [blame] | 323 | builtin-cat-file.o \ |
Junio C Hamano | d0bfd02 | 2007-04-12 01:07:32 -0700 | [diff] [blame] | 324 | builtin-check-attr.o \ |
Junio C Hamano | e414156 | 2006-08-04 01:23:19 -0700 | [diff] [blame] | 325 | builtin-checkout-index.o \ |
Junio C Hamano | f754fa9 | 2006-08-04 01:51:04 -0700 | [diff] [blame] | 326 | builtin-check-ref-format.o \ |
| 327 | builtin-commit-tree.o \ |
| 328 | builtin-count-objects.o \ |
Shawn O. Pearce | 9a0eaf8 | 2007-01-10 06:36:36 -0500 | [diff] [blame] | 329 | builtin-describe.o \ |
Junio C Hamano | f754fa9 | 2006-08-04 01:51:04 -0700 | [diff] [blame] | 330 | builtin-diff.o \ |
| 331 | builtin-diff-files.o \ |
| 332 | builtin-diff-index.o \ |
Junio C Hamano | f754fa9 | 2006-08-04 01:51:04 -0700 | [diff] [blame] | 333 | builtin-diff-tree.o \ |
Junio C Hamano | d4289ff | 2007-01-16 00:23:24 -0800 | [diff] [blame] | 334 | builtin-fetch--tool.o \ |
Junio C Hamano | f754fa9 | 2006-08-04 01:51:04 -0700 | [diff] [blame] | 335 | builtin-fmt-merge-msg.o \ |
Junio C Hamano | 9f613dd | 2006-09-15 13:30:02 -0700 | [diff] [blame] | 336 | builtin-for-each-ref.o \ |
Mark Wooding | b4dfefe | 2007-01-29 15:48:06 +0000 | [diff] [blame] | 337 | builtin-fsck.o \ |
James Bowes | 6757ada | 2007-03-13 21:58:22 -0400 | [diff] [blame] | 338 | builtin-gc.o \ |
Junio C Hamano | f754fa9 | 2006-08-04 01:51:04 -0700 | [diff] [blame] | 339 | builtin-grep.o \ |
| 340 | builtin-init-db.o \ |
| 341 | builtin-log.o \ |
| 342 | builtin-ls-files.o \ |
| 343 | builtin-ls-tree.o \ |
| 344 | builtin-mailinfo.o \ |
| 345 | builtin-mailsplit.o \ |
Junio C Hamano | 71dfbf2 | 2007-01-09 00:50:02 -0800 | [diff] [blame] | 346 | builtin-merge-base.o \ |
Johannes Schindelin | ba1f5f3 | 2006-12-06 16:26:06 +0100 | [diff] [blame] | 347 | builtin-merge-file.o \ |
Junio C Hamano | f754fa9 | 2006-08-04 01:51:04 -0700 | [diff] [blame] | 348 | builtin-mv.o \ |
| 349 | builtin-name-rev.o \ |
| 350 | builtin-pack-objects.o \ |
| 351 | builtin-prune.o \ |
| 352 | builtin-prune-packed.o \ |
| 353 | builtin-push.o \ |
| 354 | builtin-read-tree.o \ |
Junio C Hamano | 4264dc1 | 2006-12-19 00:23:12 -0800 | [diff] [blame] | 355 | builtin-reflog.o \ |
Tom Prince | e0d10e1 | 2007-01-28 16:16:53 -0800 | [diff] [blame] | 356 | builtin-config.o \ |
Johannes Schindelin | 658f365 | 2006-12-20 17:39:41 +0100 | [diff] [blame] | 357 | builtin-rerere.o \ |
Carlos Rica | 0e5a7fa | 2007-09-11 05:19:34 +0200 | [diff] [blame] | 358 | builtin-reset.o \ |
Junio C Hamano | f754fa9 | 2006-08-04 01:51:04 -0700 | [diff] [blame] | 359 | builtin-rev-list.o \ |
| 360 | builtin-rev-parse.o \ |
Johannes Schindelin | 9509af6 | 2007-03-01 05:26:30 +0100 | [diff] [blame] | 361 | builtin-revert.o \ |
Junio C Hamano | f754fa9 | 2006-08-04 01:51:04 -0700 | [diff] [blame] | 362 | builtin-rm.o \ |
Jeff King | c91f0d9 | 2006-09-08 04:05:34 -0400 | [diff] [blame] | 363 | builtin-runstatus.o \ |
Johannes Schindelin | b8ec592 | 2006-10-22 13:23:31 +0200 | [diff] [blame] | 364 | builtin-shortlog.o \ |
Junio C Hamano | f754fa9 | 2006-08-04 01:51:04 -0700 | [diff] [blame] | 365 | builtin-show-branch.o \ |
| 366 | builtin-stripspace.o \ |
| 367 | builtin-symbolic-ref.o \ |
Carlos Rica | 62e09ce | 2007-07-20 01:42:28 +0200 | [diff] [blame] | 368 | builtin-tag.o \ |
Junio C Hamano | f754fa9 | 2006-08-04 01:51:04 -0700 | [diff] [blame] | 369 | builtin-tar-tree.o \ |
| 370 | builtin-unpack-objects.o \ |
| 371 | builtin-update-index.o \ |
| 372 | builtin-update-ref.o \ |
Franck Bui-Huu | 39345a2 | 2006-09-07 15:12:05 +0200 | [diff] [blame] | 373 | builtin-upload-archive.o \ |
Rene Scharfe | 2e3ed67 | 2006-08-10 17:02:38 +0200 | [diff] [blame] | 374 | builtin-verify-pack.o \ |
Carlos Rica | 2ae68fc | 2007-07-27 06:07:34 +0200 | [diff] [blame] | 375 | builtin-verify-tag.o \ |
Rene Scharfe | e4fbbfe | 2006-08-26 23:19:21 +0200 | [diff] [blame] | 376 | builtin-write-tree.o \ |
Junio C Hamano | eaf12a8 | 2006-09-21 00:40:28 -0700 | [diff] [blame] | 377 | builtin-show-ref.o \ |
Linus Torvalds | e1e22e3 | 2006-09-11 16:37:32 -0700 | [diff] [blame] | 378 | builtin-pack-refs.o |
Linus Torvalds | 70827b1 | 2006-04-21 10:27:34 -0700 | [diff] [blame] | 379 | |
Johannes Schindelin | 54c261f | 2006-03-27 01:14:52 +0200 | [diff] [blame] | 380 | GITLIBS = $(LIB_FILE) $(XDIFF_LIB) |
Robert Schiele | bef19da | 2007-07-29 20:35:45 +0200 | [diff] [blame] | 381 | EXTLIBS = |
Linus Torvalds | cef661f | 2005-04-21 12:33:22 -0700 | [diff] [blame] | 382 | |
Junio C Hamano | 229a7ed | 2005-09-23 10:41:40 -0700 | [diff] [blame] | 383 | # |
| 384 | # Platform specific tweaks |
| 385 | # |
Junio C Hamano | f7c1534 | 2005-10-09 12:52:35 -0700 | [diff] [blame] | 386 | |
| 387 | # We choose to avoid "if .. else if .. else .. endif endif" |
| 388 | # because maintaining the nesting to match is a pain. If |
| 389 | # we had "elif" things would have been much nicer... |
Junio C Hamano | f7c1534 | 2005-10-09 12:52:35 -0700 | [diff] [blame] | 390 | |
Peter Eriksen | 817151e | 2006-06-24 16:01:25 +0200 | [diff] [blame] | 391 | ifeq ($(uname_S),Linux) |
| 392 | NO_STRLCPY = YesPlease |
| 393 | endif |
Gerrit Pape | ca7a741 | 2006-07-29 16:26:18 +0000 | [diff] [blame] | 394 | ifeq ($(uname_S),GNU/kFreeBSD) |
| 395 | NO_STRLCPY = YesPlease |
| 396 | endif |
Junio C Hamano | f7c1534 | 2005-10-09 12:52:35 -0700 | [diff] [blame] | 397 | ifeq ($(uname_S),Darwin) |
Junio C Hamano | 597c9cc | 2005-09-07 12:22:56 -0700 | [diff] [blame] | 398 | NEEDS_SSL_WITH_CRYPTO = YesPlease |
| 399 | NEEDS_LIBICONV = YesPlease |
Arjen Laarhoven | 63b4b7a | 2007-04-07 01:49:17 +0200 | [diff] [blame] | 400 | OLD_ICONV = UnfortunatelyYes |
Peter Eriksen | 817151e | 2006-06-24 16:01:25 +0200 | [diff] [blame] | 401 | NO_STRLCPY = YesPlease |
Shawn O. Pearce | 3d59405 | 2007-09-09 01:09:17 -0400 | [diff] [blame] | 402 | NO_MEMMEM = YesPlease |
Junio C Hamano | 597c9cc | 2005-09-07 12:22:56 -0700 | [diff] [blame] | 403 | endif |
Junio C Hamano | f7c1534 | 2005-10-09 12:52:35 -0700 | [diff] [blame] | 404 | ifeq ($(uname_S),SunOS) |
Patrick Mauritz | f0ebff0 | 2005-09-06 01:24:03 +0200 | [diff] [blame] | 405 | NEEDS_SOCKET = YesPlease |
Junio C Hamano | 5a90d4a | 2005-09-11 22:25:49 -0700 | [diff] [blame] | 406 | NEEDS_NSL = YesPlease |
Junio C Hamano | 229a7ed | 2005-09-23 10:41:40 -0700 | [diff] [blame] | 407 | SHELL_PATH = /bin/bash |
| 408 | NO_STRCASESTR = YesPlease |
René Scharfe | b21b9f1 | 2007-09-07 00:32:54 +0200 | [diff] [blame] | 409 | NO_MEMMEM = YesPlease |
Alex Riesen | fa0c87c | 2007-06-13 20:54:32 +0200 | [diff] [blame] | 410 | NO_HSTRERROR = YesPlease |
Jason Riedy | e40b61f | 2005-12-02 15:08:28 -0800 | [diff] [blame] | 411 | ifeq ($(uname_R),5.8) |
Paul Jakma | e15f545 | 2006-02-20 23:36:28 +0000 | [diff] [blame] | 412 | NEEDS_LIBICONV = YesPlease |
Jason Riedy | 731043f | 2006-01-25 12:38:36 -0800 | [diff] [blame] | 413 | NO_UNSETENV = YesPlease |
Jason Riedy | e40b61f | 2005-12-02 15:08:28 -0800 | [diff] [blame] | 414 | NO_SETENV = YesPlease |
Dennis Stosberg | 66c4509 | 2006-08-15 11:01:22 +0200 | [diff] [blame] | 415 | NO_C99_FORMAT = YesPlease |
Jason Riedy | bc6b4f5 | 2007-02-19 16:22:56 -0800 | [diff] [blame] | 416 | NO_STRTOUMAX = YesPlease |
Jason Riedy | e40b61f | 2005-12-02 15:08:28 -0800 | [diff] [blame] | 417 | endif |
Dennis Stosberg | 40d88d4 | 2006-04-11 11:42:26 -0700 | [diff] [blame] | 418 | ifeq ($(uname_R),5.9) |
| 419 | NO_UNSETENV = YesPlease |
| 420 | NO_SETENV = YesPlease |
Dennis Stosberg | 66c4509 | 2006-08-15 11:01:22 +0200 | [diff] [blame] | 421 | NO_C99_FORMAT = YesPlease |
Jason Riedy | bc6b4f5 | 2007-02-19 16:22:56 -0800 | [diff] [blame] | 422 | NO_STRTOUMAX = YesPlease |
Dennis Stosberg | 40d88d4 | 2006-04-11 11:42:26 -0700 | [diff] [blame] | 423 | endif |
Junio C Hamano | 229a7ed | 2005-09-23 10:41:40 -0700 | [diff] [blame] | 424 | INSTALL = ginstall |
| 425 | TAR = gtar |
Petr Baudis | 8d7f586 | 2006-06-25 03:47:03 +0200 | [diff] [blame] | 426 | BASIC_CFLAGS += -D__EXTENSIONS__ |
Patrick Mauritz | f0ebff0 | 2005-09-06 01:24:03 +0200 | [diff] [blame] | 427 | endif |
Junio C Hamano | f7c1534 | 2005-10-09 12:52:35 -0700 | [diff] [blame] | 428 | ifeq ($(uname_O),Cygwin) |
Junio C Hamano | 63be37b | 2006-01-19 17:13:57 -0800 | [diff] [blame] | 429 | NO_D_TYPE_IN_DIRENT = YesPlease |
Junio C Hamano | 35a730f | 2006-01-19 17:13:51 -0800 | [diff] [blame] | 430 | NO_D_INO_IN_DIRENT = YesPlease |
hpa | 1775451 | 2005-09-28 16:37:37 -0700 | [diff] [blame] | 431 | NO_STRCASESTR = YesPlease |
René Scharfe | b21b9f1 | 2007-09-07 00:32:54 +0200 | [diff] [blame] | 432 | NO_MEMMEM = YesPlease |
Junio C Hamano | 9f0bb90 | 2006-05-02 00:40:24 -0700 | [diff] [blame] | 433 | NO_SYMLINK_HEAD = YesPlease |
hpa | 1775451 | 2005-09-28 16:37:37 -0700 | [diff] [blame] | 434 | NEEDS_LIBICONV = YesPlease |
Shawn O. Pearce | 1510fea | 2006-12-14 06:15:57 -0500 | [diff] [blame] | 435 | NO_FAST_WORKING_DIRECTORY = UnfortunatelyYes |
Shawn O. Pearce | c869753 | 2006-12-30 23:53:55 -0500 | [diff] [blame] | 436 | NO_TRUSTABLE_FILEMODE = UnfortunatelyYes |
Junio C Hamano | 2e67a5f | 2005-11-17 11:29:47 -0800 | [diff] [blame] | 437 | # There are conflicting reports about this. |
| 438 | # On some boxes NO_MMAP is needed, and not so elsewhere. |
Junio C Hamano | 87ac139 | 2006-12-27 15:12:31 -0800 | [diff] [blame] | 439 | # Try commenting this out if you suspect MMAP is more efficient |
| 440 | NO_MMAP = YesPlease |
hpa | 49744d6 | 2005-09-28 16:52:21 -0700 | [diff] [blame] | 441 | NO_IPV6 = YesPlease |
Peter Anvin | a23cd8e | 2005-09-28 19:08:37 -0700 | [diff] [blame] | 442 | X = .exe |
Nicolas Pitre | 7c6ef2f | 2005-09-20 12:27:13 -0400 | [diff] [blame] | 443 | endif |
Alecs King | b3bf974 | 2006-01-27 02:04:30 +0800 | [diff] [blame] | 444 | ifeq ($(uname_S),FreeBSD) |
| 445 | NEEDS_LIBICONV = YesPlease |
Robert Boone | a2f22db | 2007-09-10 11:43:35 -0500 | [diff] [blame] | 446 | NO_MEMMEM = YesPlease |
Petr Baudis | 8d7f586 | 2006-06-25 03:47:03 +0200 | [diff] [blame] | 447 | BASIC_CFLAGS += -I/usr/local/include |
| 448 | BASIC_LDFLAGS += -L/usr/local/lib |
Alecs King | b3bf974 | 2006-01-27 02:04:30 +0800 | [diff] [blame] | 449 | endif |
Junio C Hamano | f7c1534 | 2005-10-09 12:52:35 -0700 | [diff] [blame] | 450 | ifeq ($(uname_S),OpenBSD) |
Junio C Hamano | 5fb41e8 | 2005-10-10 11:51:11 -0700 | [diff] [blame] | 451 | NO_STRCASESTR = YesPlease |
René Scharfe | b21b9f1 | 2007-09-07 00:32:54 +0200 | [diff] [blame] | 452 | NO_MEMMEM = YesPlease |
Han Boetes | 18c5a52 | 2005-10-01 08:23:26 +0200 | [diff] [blame] | 453 | NEEDS_LIBICONV = YesPlease |
Petr Baudis | 8d7f586 | 2006-06-25 03:47:03 +0200 | [diff] [blame] | 454 | BASIC_CFLAGS += -I/usr/local/include |
| 455 | BASIC_LDFLAGS += -L/usr/local/lib |
Junio C Hamano | 94d2331 | 2005-11-13 01:46:13 -0800 | [diff] [blame] | 456 | endif |
| 457 | ifeq ($(uname_S),NetBSD) |
Dennis Stosberg | e88856b | 2006-05-11 19:35:31 +0200 | [diff] [blame] | 458 | ifeq ($(shell expr "$(uname_R)" : '[01]\.'),2) |
| 459 | NEEDS_LIBICONV = YesPlease |
| 460 | endif |
Petr Baudis | 8d7f586 | 2006-06-25 03:47:03 +0200 | [diff] [blame] | 461 | BASIC_CFLAGS += -I/usr/pkg/include |
| 462 | BASIC_LDFLAGS += -L/usr/pkg/lib |
| 463 | ALL_LDFLAGS += -Wl,-rpath,/usr/pkg/lib |
Han Boetes | 18c5a52 | 2005-10-01 08:23:26 +0200 | [diff] [blame] | 464 | endif |
Jason Riedy | a6da939 | 2005-12-06 14:20:16 -0800 | [diff] [blame] | 465 | ifeq ($(uname_S),AIX) |
| 466 | NO_STRCASESTR=YesPlease |
René Scharfe | b21b9f1 | 2007-09-07 00:32:54 +0200 | [diff] [blame] | 467 | NO_MEMMEM = YesPlease |
Peter Eriksen | 817151e | 2006-06-24 16:01:25 +0200 | [diff] [blame] | 468 | NO_STRLCPY = YesPlease |
Jason Riedy | a6da939 | 2005-12-06 14:20:16 -0800 | [diff] [blame] | 469 | NEEDS_LIBICONV=YesPlease |
| 470 | endif |
Thomas Schwinge | c29ba0c | 2007-08-02 10:56:42 +0200 | [diff] [blame] | 471 | ifeq ($(uname_S),GNU) |
| 472 | # GNU/Hurd |
| 473 | NO_STRLCPY=YesPlease |
| 474 | endif |
Johannes Schindelin | 289c4b3 | 2006-02-17 15:23:41 +0100 | [diff] [blame] | 475 | ifeq ($(uname_S),IRIX64) |
| 476 | NO_IPV6=YesPlease |
| 477 | NO_SETENV=YesPlease |
| 478 | NO_STRCASESTR=YesPlease |
René Scharfe | b21b9f1 | 2007-09-07 00:32:54 +0200 | [diff] [blame] | 479 | NO_MEMMEM = YesPlease |
Peter Eriksen | 817151e | 2006-06-24 16:01:25 +0200 | [diff] [blame] | 480 | NO_STRLCPY = YesPlease |
Johannes Schindelin | 289c4b3 | 2006-02-17 15:23:41 +0100 | [diff] [blame] | 481 | NO_SOCKADDR_STORAGE=YesPlease |
| 482 | SHELL_PATH=/usr/gnu/bin/bash |
Petr Baudis | 8d7f586 | 2006-06-25 03:47:03 +0200 | [diff] [blame] | 483 | BASIC_CFLAGS += -DPATH_MAX=1024 |
Johannes Schindelin | 289c4b3 | 2006-02-17 15:23:41 +0100 | [diff] [blame] | 484 | # for now, build 32-bit version |
Petr Baudis | 8d7f586 | 2006-06-25 03:47:03 +0200 | [diff] [blame] | 485 | BASIC_LDFLAGS += -L/usr/lib32 |
Johannes Schindelin | 289c4b3 | 2006-02-17 15:23:41 +0100 | [diff] [blame] | 486 | endif |
Junio C Hamano | f7c1534 | 2005-10-09 12:52:35 -0700 | [diff] [blame] | 487 | ifneq (,$(findstring arm,$(uname_M))) |
| 488 | ARM_SHA1 = YesPlease |
| 489 | endif |
Junio C Hamano | 597c9cc | 2005-09-07 12:22:56 -0700 | [diff] [blame] | 490 | |
Jakub Narebski | 5566771 | 2006-07-03 01:56:48 +0200 | [diff] [blame] | 491 | -include config.mak.autogen |
Johannes Schindelin | f2d6a25 | 2005-10-11 15:22:47 -0700 | [diff] [blame] | 492 | -include config.mak |
Linus Torvalds | cef661f | 2005-04-21 12:33:22 -0700 | [diff] [blame] | 493 | |
Brian Gernhardt | 59f8674 | 2006-12-12 12:01:47 -0500 | [diff] [blame] | 494 | ifeq ($(uname_S),Darwin) |
| 495 | ifndef NO_FINK |
| 496 | ifeq ($(shell test -d /sw/lib && echo y),y) |
| 497 | BASIC_CFLAGS += -I/sw/include |
| 498 | BASIC_LDFLAGS += -L/sw/lib |
| 499 | endif |
| 500 | endif |
| 501 | ifndef NO_DARWIN_PORTS |
| 502 | ifeq ($(shell test -d /opt/local/lib && echo y),y) |
| 503 | BASIC_CFLAGS += -I/opt/local/include |
| 504 | BASIC_LDFLAGS += -L/opt/local/lib |
| 505 | endif |
| 506 | endif |
| 507 | endif |
| 508 | |
Junio C Hamano | bbfc63d | 2006-12-27 14:17:35 -0800 | [diff] [blame] | 509 | ifdef NO_R_TO_GCC_LINKER |
| 510 | # Some gcc does not accept and pass -R to the linker to specify |
| 511 | # the runtime dynamic library path. |
| 512 | CC_LD_DYNPATH = -Wl,-rpath= |
| 513 | else |
| 514 | CC_LD_DYNPATH = -R |
| 515 | endif |
| 516 | |
Daniel Barkalow | 30ae764 | 2007-09-10 23:02:45 -0400 | [diff] [blame^] | 517 | ifdef NO_CURL |
| 518 | BASIC_CFLAGS += -DNO_CURL |
| 519 | else |
Junio C Hamano | 229a7ed | 2005-09-23 10:41:40 -0700 | [diff] [blame] | 520 | ifdef CURLDIR |
Robert Schiele | 10861be | 2007-08-01 06:30:35 +0200 | [diff] [blame] | 521 | # Try "-Wl,-rpath=$(CURLDIR)/$(lib)" in such a case. |
Petr Baudis | 8d7f586 | 2006-06-25 03:47:03 +0200 | [diff] [blame] | 522 | BASIC_CFLAGS += -I$(CURLDIR)/include |
Robert Schiele | 10861be | 2007-08-01 06:30:35 +0200 | [diff] [blame] | 523 | CURL_LIBCURL = -L$(CURLDIR)/$(lib) $(CC_LD_DYNPATH)$(CURLDIR)/$(lib) -lcurl |
Junio C Hamano | 229a7ed | 2005-09-23 10:41:40 -0700 | [diff] [blame] | 524 | else |
| 525 | CURL_LIBCURL = -lcurl |
| 526 | endif |
Daniel Barkalow | 30ae764 | 2007-09-10 23:02:45 -0400 | [diff] [blame^] | 527 | BUILTIN_OBJS += builtin-http-fetch.o |
| 528 | EXTLIBS += $(CURL_LIBCURL) |
| 529 | LIB_OBJS += http.o walker.o http-walker.o |
Nick Hengeveld | 0890098 | 2005-11-18 17:08:36 -0800 | [diff] [blame] | 530 | curl_check := $(shell (echo 070908; curl-config --vernum) | sort -r | sed -ne 2p) |
| 531 | ifeq "$(curl_check)" "070908" |
| 532 | ifndef NO_EXPAT |
Nick Hengeveld | 0890098 | 2005-11-18 17:08:36 -0800 | [diff] [blame] | 533 | PROGRAMS += git-http-push$X |
| 534 | endif |
Nick Hengeveld | 58e60dd | 2005-11-02 11:19:24 -0800 | [diff] [blame] | 535 | endif |
Johannes Schindelin | 459a21b | 2006-04-05 16:22:40 +0200 | [diff] [blame] | 536 | ifndef NO_EXPAT |
| 537 | EXPAT_LIBEXPAT = -lexpat |
| 538 | endif |
Junio C Hamano | 229a7ed | 2005-09-23 10:41:40 -0700 | [diff] [blame] | 539 | endif |
| 540 | |
Robert Schiele | bef19da | 2007-07-29 20:35:45 +0200 | [diff] [blame] | 541 | ifdef ZLIB_PATH |
| 542 | BASIC_CFLAGS += -I$(ZLIB_PATH)/include |
Robert Schiele | 10861be | 2007-08-01 06:30:35 +0200 | [diff] [blame] | 543 | EXTLIBS += -L$(ZLIB_PATH)/$(lib) $(CC_LD_DYNPATH)$(ZLIB_PATH)/$(lib) |
Robert Schiele | bef19da | 2007-07-29 20:35:45 +0200 | [diff] [blame] | 544 | endif |
| 545 | EXTLIBS += -lz |
| 546 | |
Petr Baudis | dd53c7a | 2005-07-29 17:50:51 +0200 | [diff] [blame] | 547 | ifndef NO_OPENSSL |
Junio C Hamano | 215a7ad | 2005-09-07 17:26:23 -0700 | [diff] [blame] | 548 | OPENSSL_LIBSSL = -lssl |
Junio C Hamano | 455a7f3 | 2005-09-30 13:31:16 -0700 | [diff] [blame] | 549 | ifdef OPENSSLDIR |
Petr Baudis | 8d7f586 | 2006-06-25 03:47:03 +0200 | [diff] [blame] | 550 | BASIC_CFLAGS += -I$(OPENSSLDIR)/include |
Robert Schiele | 10861be | 2007-08-01 06:30:35 +0200 | [diff] [blame] | 551 | OPENSSL_LINK = -L$(OPENSSLDIR)/$(lib) $(CC_LD_DYNPATH)$(OPENSSLDIR)/$(lib) |
Junio C Hamano | 455a7f3 | 2005-09-30 13:31:16 -0700 | [diff] [blame] | 552 | else |
| 553 | OPENSSL_LINK = |
| 554 | endif |
Petr Baudis | dd53c7a | 2005-07-29 17:50:51 +0200 | [diff] [blame] | 555 | else |
Petr Baudis | 8d7f586 | 2006-06-25 03:47:03 +0200 | [diff] [blame] | 556 | BASIC_CFLAGS += -DNO_OPENSSL |
Junio C Hamano | 215a7ad | 2005-09-07 17:26:23 -0700 | [diff] [blame] | 557 | MOZILLA_SHA1 = 1 |
| 558 | OPENSSL_LIBSSL = |
Petr Baudis | dd53c7a | 2005-07-29 17:50:51 +0200 | [diff] [blame] | 559 | endif |
Junio C Hamano | 597c9cc | 2005-09-07 12:22:56 -0700 | [diff] [blame] | 560 | ifdef NEEDS_SSL_WITH_CRYPTO |
Junio C Hamano | 455a7f3 | 2005-09-30 13:31:16 -0700 | [diff] [blame] | 561 | LIB_4_CRYPTO = $(OPENSSL_LINK) -lcrypto -lssl |
Junio C Hamano | 597c9cc | 2005-09-07 12:22:56 -0700 | [diff] [blame] | 562 | else |
Junio C Hamano | 455a7f3 | 2005-09-30 13:31:16 -0700 | [diff] [blame] | 563 | LIB_4_CRYPTO = $(OPENSSL_LINK) -lcrypto |
Junio C Hamano | 597c9cc | 2005-09-07 12:22:56 -0700 | [diff] [blame] | 564 | endif |
| 565 | ifdef NEEDS_LIBICONV |
Junio C Hamano | 455a7f3 | 2005-09-30 13:31:16 -0700 | [diff] [blame] | 566 | ifdef ICONVDIR |
Petr Baudis | 8d7f586 | 2006-06-25 03:47:03 +0200 | [diff] [blame] | 567 | BASIC_CFLAGS += -I$(ICONVDIR)/include |
Robert Schiele | 10861be | 2007-08-01 06:30:35 +0200 | [diff] [blame] | 568 | ICONV_LINK = -L$(ICONVDIR)/$(lib) $(CC_LD_DYNPATH)$(ICONVDIR)/$(lib) |
Junio C Hamano | 455a7f3 | 2005-09-30 13:31:16 -0700 | [diff] [blame] | 569 | else |
| 570 | ICONV_LINK = |
| 571 | endif |
Petr Baudis | d595a47 | 2006-06-24 18:35:12 -0700 | [diff] [blame] | 572 | EXTLIBS += $(ICONV_LINK) -liconv |
Junio C Hamano | 597c9cc | 2005-09-07 12:22:56 -0700 | [diff] [blame] | 573 | endif |
Patrick Mauritz | f0ebff0 | 2005-09-06 01:24:03 +0200 | [diff] [blame] | 574 | ifdef NEEDS_SOCKET |
Petr Baudis | d595a47 | 2006-06-24 18:35:12 -0700 | [diff] [blame] | 575 | EXTLIBS += -lsocket |
Patrick Mauritz | f0ebff0 | 2005-09-06 01:24:03 +0200 | [diff] [blame] | 576 | endif |
Junio C Hamano | 5a90d4a | 2005-09-11 22:25:49 -0700 | [diff] [blame] | 577 | ifdef NEEDS_NSL |
Petr Baudis | d595a47 | 2006-06-24 18:35:12 -0700 | [diff] [blame] | 578 | EXTLIBS += -lnsl |
Junio C Hamano | 5a90d4a | 2005-09-11 22:25:49 -0700 | [diff] [blame] | 579 | endif |
Junio C Hamano | 63be37b | 2006-01-19 17:13:57 -0800 | [diff] [blame] | 580 | ifdef NO_D_TYPE_IN_DIRENT |
Petr Baudis | 8d7f586 | 2006-06-25 03:47:03 +0200 | [diff] [blame] | 581 | BASIC_CFLAGS += -DNO_D_TYPE_IN_DIRENT |
Junio C Hamano | 63be37b | 2006-01-19 17:13:57 -0800 | [diff] [blame] | 582 | endif |
Junio C Hamano | 35a730f | 2006-01-19 17:13:51 -0800 | [diff] [blame] | 583 | ifdef NO_D_INO_IN_DIRENT |
Petr Baudis | 8d7f586 | 2006-06-25 03:47:03 +0200 | [diff] [blame] | 584 | BASIC_CFLAGS += -DNO_D_INO_IN_DIRENT |
Junio C Hamano | 35a730f | 2006-01-19 17:13:51 -0800 | [diff] [blame] | 585 | endif |
Ramsay Allan Jones | 579d1fb | 2006-07-30 16:38:28 +0100 | [diff] [blame] | 586 | ifdef NO_C99_FORMAT |
Junio C Hamano | 8188e73 | 2007-02-05 16:53:12 -0800 | [diff] [blame] | 587 | BASIC_CFLAGS += -DNO_C99_FORMAT |
Ramsay Allan Jones | 579d1fb | 2006-07-30 16:38:28 +0100 | [diff] [blame] | 588 | endif |
Junio C Hamano | 9f0bb90 | 2006-05-02 00:40:24 -0700 | [diff] [blame] | 589 | ifdef NO_SYMLINK_HEAD |
Petr Baudis | 8d7f586 | 2006-06-25 03:47:03 +0200 | [diff] [blame] | 590 | BASIC_CFLAGS += -DNO_SYMLINK_HEAD |
Junio C Hamano | 9f0bb90 | 2006-05-02 00:40:24 -0700 | [diff] [blame] | 591 | endif |
Linus Torvalds | ef34af2 | 2005-09-18 18:30:50 -0700 | [diff] [blame] | 592 | ifdef NO_STRCASESTR |
Junio C Hamano | 4050c0d | 2005-12-05 11:54:29 -0800 | [diff] [blame] | 593 | COMPAT_CFLAGS += -DNO_STRCASESTR |
Jason Riedy | e40b61f | 2005-12-02 15:08:28 -0800 | [diff] [blame] | 594 | COMPAT_OBJS += compat/strcasestr.o |
| 595 | endif |
Peter Eriksen | 817151e | 2006-06-24 16:01:25 +0200 | [diff] [blame] | 596 | ifdef NO_STRLCPY |
| 597 | COMPAT_CFLAGS += -DNO_STRLCPY |
| 598 | COMPAT_OBJS += compat/strlcpy.o |
| 599 | endif |
Jason Riedy | bc6b4f5 | 2007-02-19 16:22:56 -0800 | [diff] [blame] | 600 | ifdef NO_STRTOUMAX |
| 601 | COMPAT_CFLAGS += -DNO_STRTOUMAX |
| 602 | COMPAT_OBJS += compat/strtoumax.o |
| 603 | endif |
| 604 | ifdef NO_STRTOULL |
| 605 | COMPAT_CFLAGS += -DNO_STRTOULL |
| 606 | endif |
Jason Riedy | e40b61f | 2005-12-02 15:08:28 -0800 | [diff] [blame] | 607 | ifdef NO_SETENV |
Junio C Hamano | 4050c0d | 2005-12-05 11:54:29 -0800 | [diff] [blame] | 608 | COMPAT_CFLAGS += -DNO_SETENV |
Jason Riedy | e40b61f | 2005-12-02 15:08:28 -0800 | [diff] [blame] | 609 | COMPAT_OBJS += compat/setenv.o |
Linus Torvalds | ef34af2 | 2005-09-18 18:30:50 -0700 | [diff] [blame] | 610 | endif |
Johannes Schindelin | 104ff34 | 2006-08-29 12:51:14 +0200 | [diff] [blame] | 611 | ifdef NO_UNSETENV |
Jason Riedy | 731043f | 2006-01-25 12:38:36 -0800 | [diff] [blame] | 612 | COMPAT_CFLAGS += -DNO_UNSETENV |
| 613 | COMPAT_OBJS += compat/unsetenv.o |
| 614 | endif |
Johannes Schindelin | 730d48a | 2005-10-08 15:54:36 -0700 | [diff] [blame] | 615 | ifdef NO_MMAP |
Junio C Hamano | 4050c0d | 2005-12-05 11:54:29 -0800 | [diff] [blame] | 616 | COMPAT_CFLAGS += -DNO_MMAP |
Jason Riedy | e40b61f | 2005-12-02 15:08:28 -0800 | [diff] [blame] | 617 | COMPAT_OBJS += compat/mmap.o |
Johannes Schindelin | 730d48a | 2005-10-08 15:54:36 -0700 | [diff] [blame] | 618 | endif |
Stefan-W. Hahn | 6900679 | 2007-01-09 22:04:12 +0100 | [diff] [blame] | 619 | ifdef NO_PREAD |
| 620 | COMPAT_CFLAGS += -DNO_PREAD |
| 621 | COMPAT_OBJS += compat/pread.o |
| 622 | endif |
Shawn O. Pearce | 1510fea | 2006-12-14 06:15:57 -0500 | [diff] [blame] | 623 | ifdef NO_FAST_WORKING_DIRECTORY |
| 624 | BASIC_CFLAGS += -DNO_FAST_WORKING_DIRECTORY |
| 625 | endif |
Shawn O. Pearce | c869753 | 2006-12-30 23:53:55 -0500 | [diff] [blame] | 626 | ifdef NO_TRUSTABLE_FILEMODE |
| 627 | BASIC_CFLAGS += -DNO_TRUSTABLE_FILEMODE |
| 628 | endif |
hpa | 49744d6 | 2005-09-28 16:52:21 -0700 | [diff] [blame] | 629 | ifdef NO_IPV6 |
Petr Baudis | 8d7f586 | 2006-06-25 03:47:03 +0200 | [diff] [blame] | 630 | BASIC_CFLAGS += -DNO_IPV6 |
Junio C Hamano | bdc37f5 | 2006-01-19 17:13:32 -0800 | [diff] [blame] | 631 | endif |
| 632 | ifdef NO_SOCKADDR_STORAGE |
| 633 | ifdef NO_IPV6 |
Petr Baudis | 8d7f586 | 2006-06-25 03:47:03 +0200 | [diff] [blame] | 634 | BASIC_CFLAGS += -Dsockaddr_storage=sockaddr_in |
Junio C Hamano | bdc37f5 | 2006-01-19 17:13:32 -0800 | [diff] [blame] | 635 | else |
Petr Baudis | 8d7f586 | 2006-06-25 03:47:03 +0200 | [diff] [blame] | 636 | BASIC_CFLAGS += -Dsockaddr_storage=sockaddr_in6 |
Junio C Hamano | bdc37f5 | 2006-01-19 17:13:32 -0800 | [diff] [blame] | 637 | endif |
hpa | 49744d6 | 2005-09-28 16:52:21 -0700 | [diff] [blame] | 638 | endif |
Yakov Lerner | 6ba68ab | 2006-05-22 00:37:00 +0300 | [diff] [blame] | 639 | ifdef NO_INET_NTOP |
| 640 | LIB_OBJS += compat/inet_ntop.o |
| 641 | endif |
Jon Loeliger | dd46762 | 2006-09-26 09:47:43 -0500 | [diff] [blame] | 642 | ifdef NO_INET_PTON |
| 643 | LIB_OBJS += compat/inet_pton.o |
| 644 | endif |
Linus Torvalds | cef661f | 2005-04-21 12:33:22 -0700 | [diff] [blame] | 645 | |
Fernando J. Pereda | b6e56ec | 2006-02-16 09:38:01 +0100 | [diff] [blame] | 646 | ifdef NO_ICONV |
Petr Baudis | 8d7f586 | 2006-06-25 03:47:03 +0200 | [diff] [blame] | 647 | BASIC_CFLAGS += -DNO_ICONV |
Fernando J. Pereda | b6e56ec | 2006-02-16 09:38:01 +0100 | [diff] [blame] | 648 | endif |
| 649 | |
Ramsay Jones | fd547a9 | 2007-03-03 18:29:03 +0000 | [diff] [blame] | 650 | ifdef OLD_ICONV |
| 651 | BASIC_CFLAGS += -DOLD_ICONV |
| 652 | endif |
| 653 | |
Nicolas Pitre | 7c6ef2f | 2005-09-20 12:27:13 -0400 | [diff] [blame] | 654 | ifdef PPC_SHA1 |
| 655 | SHA1_HEADER = "ppc/sha1.h" |
| 656 | LIB_OBJS += ppc/sha1.o ppc/sha1ppc.o |
| 657 | else |
| 658 | ifdef ARM_SHA1 |
| 659 | SHA1_HEADER = "arm/sha1.h" |
| 660 | LIB_OBJS += arm/sha1.o arm/sha1_arm.o |
| 661 | else |
| 662 | ifdef MOZILLA_SHA1 |
| 663 | SHA1_HEADER = "mozilla-sha1/sha1.h" |
| 664 | LIB_OBJS += mozilla-sha1/sha1.o |
| 665 | else |
| 666 | SHA1_HEADER = <openssl/sha.h> |
Petr Baudis | d595a47 | 2006-06-24 18:35:12 -0700 | [diff] [blame] | 667 | EXTLIBS += $(LIB_4_CRYPTO) |
Nicolas Pitre | 7c6ef2f | 2005-09-20 12:27:13 -0400 | [diff] [blame] | 668 | endif |
| 669 | endif |
| 670 | endif |
Alex Riesen | f848718 | 2006-12-04 10:50:04 +0100 | [diff] [blame] | 671 | ifdef NO_PERL_MAKEMAKER |
| 672 | export NO_PERL_MAKEMAKER |
| 673 | endif |
Alex Riesen | fa0c87c | 2007-06-13 20:54:32 +0200 | [diff] [blame] | 674 | ifdef NO_HSTRERROR |
| 675 | COMPAT_CFLAGS += -DNO_HSTRERROR |
| 676 | COMPAT_OBJS += compat/hstrerror.o |
| 677 | endif |
René Scharfe | b21b9f1 | 2007-09-07 00:32:54 +0200 | [diff] [blame] | 678 | ifdef NO_MEMMEM |
| 679 | COMPAT_CFLAGS += -DNO_MEMMEM |
| 680 | COMPAT_OBJS += compat/memmem.o |
| 681 | endif |
Alex Riesen | b777434 | 2007-03-07 00:44:49 +0100 | [diff] [blame] | 682 | |
Nicolas Pitre | 8ecce68 | 2007-09-06 02:13:11 -0400 | [diff] [blame] | 683 | ifdef THREADED_DELTA_SEARCH |
| 684 | BASIC_CFLAGS += -DTHREADED_DELTA_SEARCH |
| 685 | EXTLIBS += -lpthread |
| 686 | endif |
| 687 | |
Eygene Ryabinkin | 81b63c7 | 2007-03-28 04:12:07 -0700 | [diff] [blame] | 688 | ifeq ($(TCLTK_PATH),) |
| 689 | NO_TCLTK=NoThanks |
| 690 | endif |
| 691 | |
Fernando J. Pereda | 3b486cd | 2007-04-04 22:42:33 +0200 | [diff] [blame] | 692 | QUIET_SUBDIR0 = +$(MAKE) -C # space to separate -C and subdir |
Alex Riesen | b777434 | 2007-03-07 00:44:49 +0100 | [diff] [blame] | 693 | QUIET_SUBDIR1 = |
| 694 | |
Alex Riesen | a6f3709 | 2007-03-07 00:05:34 +0100 | [diff] [blame] | 695 | ifneq ($(findstring $(MAKEFLAGS),w),w) |
| 696 | PRINT_DIR = --no-print-directory |
| 697 | else # "make -w" |
| 698 | NO_SUBDIR = : |
| 699 | endif |
| 700 | |
Alex Riesen | b777434 | 2007-03-07 00:44:49 +0100 | [diff] [blame] | 701 | ifneq ($(findstring $(MAKEFLAGS),s),s) |
Shawn O. Pearce | 2314c94 | 2007-03-06 02:09:14 -0500 | [diff] [blame] | 702 | ifndef V |
Alex Riesen | 31d0399 | 2007-03-06 23:37:18 +0100 | [diff] [blame] | 703 | QUIET_CC = @echo ' ' CC $@; |
Shawn O. Pearce | 74f2b2a | 2007-03-06 01:35:01 -0500 | [diff] [blame] | 704 | QUIET_AR = @echo ' ' AR $@; |
| 705 | QUIET_LINK = @echo ' ' LINK $@; |
| 706 | QUIET_BUILT_IN = @echo ' ' BUILTIN $@; |
| 707 | QUIET_GEN = @echo ' ' GEN $@; |
Fernando J. Pereda | 3b486cd | 2007-04-04 22:42:33 +0200 | [diff] [blame] | 708 | QUIET_SUBDIR0 = +@subdir= |
Alex Riesen | a6f3709 | 2007-03-07 00:05:34 +0100 | [diff] [blame] | 709 | QUIET_SUBDIR1 = ;$(NO_SUBDIR) echo ' ' SUBDIR $$subdir; \ |
| 710 | $(MAKE) $(PRINT_DIR) -C $$subdir |
Shawn O. Pearce | 2314c94 | 2007-03-06 02:09:14 -0500 | [diff] [blame] | 711 | export V |
Alex Riesen | 31d0399 | 2007-03-06 23:37:18 +0100 | [diff] [blame] | 712 | export QUIET_GEN |
Alex Riesen | b777434 | 2007-03-07 00:44:49 +0100 | [diff] [blame] | 713 | export QUIET_BUILT_IN |
| 714 | endif |
Shawn O. Pearce | 74f2b2a | 2007-03-06 01:35:01 -0500 | [diff] [blame] | 715 | endif |
Nicolas Pitre | 7c6ef2f | 2005-09-20 12:27:13 -0400 | [diff] [blame] | 716 | |
Junio C Hamano | 4c7100a | 2007-06-14 22:20:16 -0700 | [diff] [blame] | 717 | ifdef ASCIIDOC8 |
| 718 | export ASCIIDOC8 |
| 719 | endif |
| 720 | |
Pavel Roskin | addf88e | 2006-07-09 03:44:30 -0400 | [diff] [blame] | 721 | # Shell quote (do not use $(call) to accommodate ancient setups); |
Johannes Schindelin | 39c015c | 2006-02-18 12:40:22 +0100 | [diff] [blame] | 722 | |
| 723 | SHA1_HEADER_SQ = $(subst ','\'',$(SHA1_HEADER)) |
Johannes Schindelin | 32043c9 | 2007-02-14 12:48:14 +0100 | [diff] [blame] | 724 | ETC_GITCONFIG_SQ = $(subst ','\'',$(ETC_GITCONFIG)) |
Johannes Schindelin | 39c015c | 2006-02-18 12:40:22 +0100 | [diff] [blame] | 725 | |
| 726 | DESTDIR_SQ = $(subst ','\'',$(DESTDIR)) |
| 727 | bindir_SQ = $(subst ','\'',$(bindir)) |
| 728 | gitexecdir_SQ = $(subst ','\'',$(gitexecdir)) |
| 729 | template_dir_SQ = $(subst ','\'',$(template_dir)) |
Yakov Lerner | ca3bcab | 2006-06-15 01:36:00 +0300 | [diff] [blame] | 730 | prefix_SQ = $(subst ','\'',$(prefix)) |
Johannes Schindelin | 39c015c | 2006-02-18 12:40:22 +0100 | [diff] [blame] | 731 | |
| 732 | SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH)) |
| 733 | PERL_PATH_SQ = $(subst ','\'',$(PERL_PATH)) |
Eygene Ryabinkin | 81b63c7 | 2007-03-28 04:12:07 -0700 | [diff] [blame] | 734 | TCLTK_PATH_SQ = $(subst ','\'',$(TCLTK_PATH)) |
Johannes Schindelin | 39c015c | 2006-02-18 12:40:22 +0100 | [diff] [blame] | 735 | |
Petr Baudis | d595a47 | 2006-06-24 18:35:12 -0700 | [diff] [blame] | 736 | LIBS = $(GITLIBS) $(EXTLIBS) |
| 737 | |
Johannes Schindelin | 32043c9 | 2007-02-14 12:48:14 +0100 | [diff] [blame] | 738 | BASIC_CFLAGS += -DSHA1_HEADER='$(SHA1_HEADER_SQ)' \ |
| 739 | -DETC_GITCONFIG='"$(ETC_GITCONFIG_SQ)"' $(COMPAT_CFLAGS) |
Jason Riedy | e40b61f | 2005-12-02 15:08:28 -0800 | [diff] [blame] | 740 | LIB_OBJS += $(COMPAT_OBJS) |
Petr Baudis | 8d7f586 | 2006-06-25 03:47:03 +0200 | [diff] [blame] | 741 | |
| 742 | ALL_CFLAGS += $(BASIC_CFLAGS) |
| 743 | ALL_LDFLAGS += $(BASIC_LDFLAGS) |
| 744 | |
Shawn O. Pearce | a42cbac | 2007-05-07 23:53:06 -0400 | [diff] [blame] | 745 | export TAR INSTALL DESTDIR SHELL_PATH |
Petr Baudis | d595a47 | 2006-06-24 18:35:12 -0700 | [diff] [blame] | 746 | |
| 747 | |
Petr Baudis | 28818ff | 2005-07-29 17:50:24 +0200 | [diff] [blame] | 748 | ### Build rules |
Linus Torvalds | 8996702 | 2005-04-30 13:19:56 -0700 | [diff] [blame] | 749 | |
Eygene Ryabinkin | 3cfaf11 | 2007-03-28 04:00:23 -0700 | [diff] [blame] | 750 | all:: $(ALL_PROGRAMS) $(BUILT_INS) $(OTHER_PROGRAMS) |
Junio C Hamano | 6fc301b | 2007-01-10 12:24:54 -0800 | [diff] [blame] | 751 | ifneq (,$X) |
Emil Medve | 4cb08df | 2007-07-14 12:51:44 -0500 | [diff] [blame] | 752 | $(foreach p,$(patsubst %$X,%,$(filter %$X,$(ALL_PROGRAMS) $(BUILT_INS) git$X)), $(RM) '$p';) |
Junio C Hamano | 6fc301b | 2007-01-10 12:24:54 -0800 | [diff] [blame] | 753 | endif |
Petr Baudis | 28818ff | 2005-07-29 17:50:24 +0200 | [diff] [blame] | 754 | |
Junio C Hamano | 6fc301b | 2007-01-10 12:24:54 -0800 | [diff] [blame] | 755 | all:: |
Eygene Ryabinkin | 3cfaf11 | 2007-03-28 04:00:23 -0700 | [diff] [blame] | 756 | ifndef NO_TCLTK |
Shawn O. Pearce | 5f5dbd7 | 2007-05-07 23:36:31 -0400 | [diff] [blame] | 757 | $(QUIET_SUBDIR0)git-gui $(QUIET_SUBDIR1) all |
Eygene Ryabinkin | 3cfaf11 | 2007-03-28 04:00:23 -0700 | [diff] [blame] | 758 | endif |
Shawn O. Pearce | 74f2b2a | 2007-03-06 01:35:01 -0500 | [diff] [blame] | 759 | $(QUIET_SUBDIR0)perl $(QUIET_SUBDIR1) PERL_PATH='$(PERL_PATH_SQ)' prefix='$(prefix_SQ)' all |
| 760 | $(QUIET_SUBDIR0)templates $(QUIET_SUBDIR1) |
Nicolas Pitre | a310d43 | 2005-05-19 10:27:14 -0400 | [diff] [blame] | 761 | |
Junio C Hamano | 4dc0002 | 2006-01-12 21:42:25 -0800 | [diff] [blame] | 762 | strip: $(PROGRAMS) git$X |
| 763 | $(STRIP) $(STRIP_OPTS) $(PROGRAMS) git$X |
| 764 | |
Eygene Ryabinkin | 6bdb18a | 2007-03-28 04:22:02 -0700 | [diff] [blame] | 765 | gitk-wish: gitk GIT-GUI-VARS |
Emil Medve | 4cb08df | 2007-07-14 12:51:44 -0500 | [diff] [blame] | 766 | $(QUIET_GEN)$(RM) $@ $@+ && \ |
Eygene Ryabinkin | 6bdb18a | 2007-03-28 04:22:02 -0700 | [diff] [blame] | 767 | sed -e '1,3s|^exec .* "$$0"|exec $(subst |,'\|',$(TCLTK_PATH_SQ)) "$$0"|' <gitk >$@+ && \ |
| 768 | chmod +x $@+ && \ |
| 769 | mv -f $@+ $@ |
| 770 | |
Junio C Hamano | 334d28a | 2007-06-13 01:28:21 -0700 | [diff] [blame] | 771 | git.o: git.c common-cmds.h GIT-CFLAGS |
| 772 | $(QUIET_CC)$(CC) -DGIT_VERSION='"$(GIT_VERSION)"' \ |
| 773 | $(ALL_CFLAGS) -c $(filter %.c,$^) |
| 774 | |
| 775 | git$X: git.o $(BUILTIN_OBJS) $(GITLIBS) |
Matt McCutchen | 54dadbd | 2007-07-09 21:30:39 -0400 | [diff] [blame] | 776 | $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ git.o \ |
Linus Torvalds | 70827b1 | 2006-04-21 10:27:34 -0700 | [diff] [blame] | 777 | $(BUILTIN_OBJS) $(ALL_LDFLAGS) $(LIBS) |
Junio C Hamano | 6a2e50f | 2005-09-07 21:26:52 -0700 | [diff] [blame] | 778 | |
Junio C Hamano | f754fa9 | 2006-08-04 01:51:04 -0700 | [diff] [blame] | 779 | help.o: common-cmds.h |
Junio C Hamano | 08df617 | 2006-04-21 21:56:13 -0700 | [diff] [blame] | 780 | |
Junio C Hamano | 68faf68 | 2007-02-15 16:32:45 -0800 | [diff] [blame] | 781 | git-merge-subtree$X: git-merge-recursive$X |
Emil Medve | 4cb08df | 2007-07-14 12:51:44 -0500 | [diff] [blame] | 782 | $(QUIET_BUILT_IN)$(RM) $@ && ln git-merge-recursive$X $@ |
Junio C Hamano | 68faf68 | 2007-02-15 16:32:45 -0800 | [diff] [blame] | 783 | |
Junio C Hamano | 9173080 | 2006-04-10 17:37:58 -0700 | [diff] [blame] | 784 | $(BUILT_INS): git$X |
Emil Medve | 4cb08df | 2007-07-14 12:51:44 -0500 | [diff] [blame] | 785 | $(QUIET_BUILT_IN)$(RM) $@ && ln git$X $@ |
Junio C Hamano | 9173080 | 2006-04-10 17:37:58 -0700 | [diff] [blame] | 786 | |
Junio C Hamano | 48dd1da | 2007-06-13 02:00:01 -0700 | [diff] [blame] | 787 | common-cmds.h: ./generate-cmdlist.sh |
| 788 | |
Junio C Hamano | 766b084 | 2007-04-05 15:03:48 -0700 | [diff] [blame] | 789 | common-cmds.h: $(wildcard Documentation/git-*.txt) |
Shawn O. Pearce | 74f2b2a | 2007-03-06 01:35:01 -0500 | [diff] [blame] | 790 | $(QUIET_GEN)./generate-cmdlist.sh > $@+ && mv $@+ $@ |
Fredrik Kuivinen | a87cd02 | 2006-03-09 17:24:19 +0100 | [diff] [blame] | 791 | |
Andreas Ericsson | d6ebd25 | 2005-11-22 00:44:15 +0100 | [diff] [blame] | 792 | $(patsubst %.sh,%,$(SCRIPT_SH)) : % : %.sh |
Emil Medve | 4cb08df | 2007-07-14 12:51:44 -0500 | [diff] [blame] | 793 | $(QUIET_GEN)$(RM) $@ $@+ && \ |
Johannes Schindelin | 39c015c | 2006-02-18 12:40:22 +0100 | [diff] [blame] | 794 | sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \ |
Michal Rokos | d9bffc0 | 2006-07-08 17:32:04 +0200 | [diff] [blame] | 795 | -e 's|@@PERL@@|$(PERL_PATH_SQ)|g' \ |
Junio C Hamano | 3ff8cbe | 2005-10-04 12:41:35 -0700 | [diff] [blame] | 796 | -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \ |
Fernando J. Pereda | 6c5c62f | 2006-02-15 12:37:30 +0100 | [diff] [blame] | 797 | -e 's/@@NO_CURL@@/$(NO_CURL)/g' \ |
Shawn O. Pearce | 74f2b2a | 2007-03-06 01:35:01 -0500 | [diff] [blame] | 798 | $@.sh >$@+ && \ |
| 799 | chmod +x $@+ && \ |
Jim Meyering | fc36f6a | 2006-05-25 18:52:01 +0200 | [diff] [blame] | 800 | mv $@+ $@ |
Junio C Hamano | bc6146d | 2005-09-08 18:50:33 -0700 | [diff] [blame] | 801 | |
Alex Riesen | f848718 | 2006-12-04 10:50:04 +0100 | [diff] [blame] | 802 | $(patsubst %.perl,%,$(SCRIPT_PERL)): perl/perl.mak |
| 803 | |
| 804 | perl/perl.mak: GIT-CFLAGS |
Alex Riesen | 31d0399 | 2007-03-06 23:37:18 +0100 | [diff] [blame] | 805 | $(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] | 806 | |
Junio C Hamano | f6276fe | 2006-06-24 19:41:03 -0700 | [diff] [blame] | 807 | $(patsubst %.perl,%,$(SCRIPT_PERL)): % : %.perl |
Emil Medve | 4cb08df | 2007-07-14 12:51:44 -0500 | [diff] [blame] | 808 | $(QUIET_GEN)$(RM) $@ $@+ && \ |
Junio C Hamano | 893973a | 2006-06-29 17:02:21 -0700 | [diff] [blame] | 809 | INSTLIBDIR=`$(MAKE) -C perl -s --no-print-directory instlibdir` && \ |
Junio C Hamano | 998c4da | 2006-07-07 13:04:35 -0700 | [diff] [blame] | 810 | sed -e '1{' \ |
| 811 | -e ' s|#!.*perl|#!$(PERL_PATH_SQ)|' \ |
| 812 | -e ' h' \ |
| 813 | -e ' s=.*=use lib (split(/:/, $$ENV{GITPERLLIB} || "@@INSTLIBDIR@@"));=' \ |
| 814 | -e ' H' \ |
| 815 | -e ' x' \ |
| 816 | -e '}' \ |
Junio C Hamano | f6276fe | 2006-06-24 19:41:03 -0700 | [diff] [blame] | 817 | -e 's|@@INSTLIBDIR@@|'"$$INSTLIBDIR"'|g' \ |
Junio C Hamano | 3ff8cbe | 2005-10-04 12:41:35 -0700 | [diff] [blame] | 818 | -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \ |
Shawn O. Pearce | 74f2b2a | 2007-03-06 01:35:01 -0500 | [diff] [blame] | 819 | $@.perl >$@+ && \ |
| 820 | chmod +x $@+ && \ |
Jim Meyering | fc36f6a | 2006-05-25 18:52:01 +0200 | [diff] [blame] | 821 | mv $@+ $@ |
Junio C Hamano | bc6146d | 2005-09-08 18:50:33 -0700 | [diff] [blame] | 822 | |
Junio C Hamano | cf7bb58 | 2006-02-10 00:45:59 -0800 | [diff] [blame] | 823 | git-status: git-commit |
Shawn O. Pearce | 74f2b2a | 2007-03-06 01:35:01 -0500 | [diff] [blame] | 824 | $(QUIET_GEN)cp $< $@+ && mv $@+ $@ |
Junio C Hamano | cf7bb58 | 2006-02-10 00:45:59 -0800 | [diff] [blame] | 825 | |
Martin Waitz | 5d043a3 | 2006-08-01 21:34:08 +0200 | [diff] [blame] | 826 | gitweb/gitweb.cgi: gitweb/gitweb.perl |
Emil Medve | 4cb08df | 2007-07-14 12:51:44 -0500 | [diff] [blame] | 827 | $(QUIET_GEN)$(RM) $@ $@+ && \ |
Martin Waitz | 5d043a3 | 2006-08-01 21:34:08 +0200 | [diff] [blame] | 828 | sed -e '1s|#!.*perl|#!$(PERL_PATH_SQ)|' \ |
Junio C Hamano | 06c084d | 2006-08-02 13:50:20 -0700 | [diff] [blame] | 829 | -e 's|++GIT_VERSION++|$(GIT_VERSION)|g' \ |
| 830 | -e 's|++GIT_BINDIR++|$(bindir)|g' \ |
| 831 | -e 's|++GITWEB_CONFIG++|$(GITWEB_CONFIG)|g' \ |
Yasushi SHOJI | 2de21fa | 2006-08-15 07:50:49 +0900 | [diff] [blame] | 832 | -e 's|++GITWEB_HOME_LINK_STR++|$(GITWEB_HOME_LINK_STR)|g' \ |
Junio C Hamano | 06c084d | 2006-08-02 13:50:20 -0700 | [diff] [blame] | 833 | -e 's|++GITWEB_SITENAME++|$(GITWEB_SITENAME)|g' \ |
| 834 | -e 's|++GITWEB_PROJECTROOT++|$(GITWEB_PROJECTROOT)|g' \ |
Matthias Lederhofer | 32f4aac | 2006-09-17 00:31:01 +0200 | [diff] [blame] | 835 | -e 's|++GITWEB_EXPORT_OK++|$(GITWEB_EXPORT_OK)|g' \ |
| 836 | -e 's|++GITWEB_STRICT_EXPORT++|$(GITWEB_STRICT_EXPORT)|g' \ |
Jakub Narebski | 19a8721 | 2006-08-15 23:03:17 +0200 | [diff] [blame] | 837 | -e 's|++GITWEB_BASE_URL++|$(GITWEB_BASE_URL)|g' \ |
Junio C Hamano | 06c084d | 2006-08-02 13:50:20 -0700 | [diff] [blame] | 838 | -e 's|++GITWEB_LIST++|$(GITWEB_LIST)|g' \ |
| 839 | -e 's|++GITWEB_HOMETEXT++|$(GITWEB_HOMETEXT)|g' \ |
| 840 | -e 's|++GITWEB_CSS++|$(GITWEB_CSS)|g' \ |
| 841 | -e 's|++GITWEB_LOGO++|$(GITWEB_LOGO)|g' \ |
Jakub Narebski | 0b5deba | 2006-09-04 20:32:13 +0200 | [diff] [blame] | 842 | -e 's|++GITWEB_FAVICON++|$(GITWEB_FAVICON)|g' \ |
Alan Chandler | b2d3476 | 2006-10-03 13:49:03 +0100 | [diff] [blame] | 843 | -e 's|++GITWEB_SITE_HEADER++|$(GITWEB_SITE_HEADER)|g' \ |
| 844 | -e 's|++GITWEB_SITE_FOOTER++|$(GITWEB_SITE_FOOTER)|g' \ |
Shawn O. Pearce | 74f2b2a | 2007-03-06 01:35:01 -0500 | [diff] [blame] | 845 | $< >$@+ && \ |
| 846 | chmod +x $@+ && \ |
Martin Waitz | 5d043a3 | 2006-08-01 21:34:08 +0200 | [diff] [blame] | 847 | mv $@+ $@ |
| 848 | |
Eric Wong | a51d37c | 2006-07-01 15:14:14 -0700 | [diff] [blame] | 849 | git-instaweb: git-instaweb.sh gitweb/gitweb.cgi gitweb/gitweb.css |
Emil Medve | 4cb08df | 2007-07-14 12:51:44 -0500 | [diff] [blame] | 850 | $(QUIET_GEN)$(RM) $@ $@+ && \ |
Eric Wong | a51d37c | 2006-07-01 15:14:14 -0700 | [diff] [blame] | 851 | sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \ |
| 852 | -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \ |
| 853 | -e 's/@@NO_CURL@@/$(NO_CURL)/g' \ |
Michal Rokos | 6e959ab | 2006-07-08 17:27:10 +0200 | [diff] [blame] | 854 | -e '/@@GITWEB_CGI@@/r gitweb/gitweb.cgi' \ |
Johannes Schindelin | 0700228 | 2006-07-02 11:31:30 +0200 | [diff] [blame] | 855 | -e '/@@GITWEB_CGI@@/d' \ |
Michal Rokos | 6e959ab | 2006-07-08 17:27:10 +0200 | [diff] [blame] | 856 | -e '/@@GITWEB_CSS@@/r gitweb/gitweb.css' \ |
Johannes Schindelin | 0700228 | 2006-07-02 11:31:30 +0200 | [diff] [blame] | 857 | -e '/@@GITWEB_CSS@@/d' \ |
Shawn O. Pearce | 74f2b2a | 2007-03-06 01:35:01 -0500 | [diff] [blame] | 858 | $@.sh > $@+ && \ |
| 859 | chmod +x $@+ && \ |
Eric Wong | a51d37c | 2006-07-01 15:14:14 -0700 | [diff] [blame] | 860 | mv $@+ $@ |
| 861 | |
Jakub Narebski | 3900145 | 2006-08-08 18:35:23 +0200 | [diff] [blame] | 862 | configure: configure.ac |
Emil Medve | 4cb08df | 2007-07-14 12:51:44 -0500 | [diff] [blame] | 863 | $(QUIET_GEN)$(RM) $@ $<+ && \ |
Jakub Narebski | 3900145 | 2006-08-08 18:35:23 +0200 | [diff] [blame] | 864 | sed -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \ |
Shawn O. Pearce | 74f2b2a | 2007-03-06 01:35:01 -0500 | [diff] [blame] | 865 | $< > $<+ && \ |
| 866 | autoconf -o $@ $<+ && \ |
Emil Medve | 4cb08df | 2007-07-14 12:51:44 -0500 | [diff] [blame] | 867 | $(RM) $<+ |
Jakub Narebski | 3900145 | 2006-08-08 18:35:23 +0200 | [diff] [blame] | 868 | |
Junio C Hamano | 9b88fce | 2005-12-27 14:40:17 -0800 | [diff] [blame] | 869 | # These can record GIT_VERSION |
Matt McCutchen | 54dadbd | 2007-07-09 21:30:39 -0400 | [diff] [blame] | 870 | git.o git.spec \ |
Junio C Hamano | 9b88fce | 2005-12-27 14:40:17 -0800 | [diff] [blame] | 871 | $(patsubst %.sh,%,$(SCRIPT_SH)) \ |
| 872 | $(patsubst %.perl,%,$(SCRIPT_PERL)) \ |
Junio C Hamano | 9b88fce | 2005-12-27 14:40:17 -0800 | [diff] [blame] | 873 | : GIT-VERSION-FILE |
Johannes Schindelin | e99fcf9 | 2005-12-22 20:38:23 +0100 | [diff] [blame] | 874 | |
Yakov Lerner | ca3bcab | 2006-06-15 01:36:00 +0300 | [diff] [blame] | 875 | %.o: %.c GIT-CFLAGS |
Shawn O. Pearce | 74f2b2a | 2007-03-06 01:35:01 -0500 | [diff] [blame] | 876 | $(QUIET_CC)$(CC) -o $*.o -c $(ALL_CFLAGS) $< |
Linus Torvalds | e36cb1c | 2007-05-30 10:42:41 -0700 | [diff] [blame] | 877 | %.s: %.c GIT-CFLAGS |
| 878 | $(QUIET_CC)$(CC) -S $(ALL_CFLAGS) $< |
Pavel Roskin | b05701c | 2005-08-06 01:36:15 -0400 | [diff] [blame] | 879 | %.o: %.S |
Shawn O. Pearce | 74f2b2a | 2007-03-06 01:35:01 -0500 | [diff] [blame] | 880 | $(QUIET_CC)$(CC) -o $*.o -c $(ALL_CFLAGS) $< |
Pavel Roskin | b05701c | 2005-08-06 01:36:15 -0400 | [diff] [blame] | 881 | |
Yakov Lerner | ca3bcab | 2006-06-15 01:36:00 +0300 | [diff] [blame] | 882 | exec_cmd.o: exec_cmd.c GIT-CFLAGS |
Shawn O. Pearce | 74f2b2a | 2007-03-06 01:35:01 -0500 | [diff] [blame] | 883 | $(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] | 884 | builtin-init-db.o: builtin-init-db.c GIT-CFLAGS |
Shawn O. Pearce | 74f2b2a | 2007-03-06 01:35:01 -0500 | [diff] [blame] | 885 | $(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] | 886 | |
Yakov Lerner | ca3bcab | 2006-06-15 01:36:00 +0300 | [diff] [blame] | 887 | http.o: http.c GIT-CFLAGS |
Shawn O. Pearce | 74f2b2a | 2007-03-06 01:35:01 -0500 | [diff] [blame] | 888 | $(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] | 889 | |
Nick Hengeveld | 8d9fbe5 | 2006-04-04 05:33:18 -0700 | [diff] [blame] | 890 | ifdef NO_EXPAT |
Daniel Barkalow | 30ae764 | 2007-09-10 23:02:45 -0400 | [diff] [blame^] | 891 | http-walker.o: http-walker.c http.h GIT-CFLAGS |
Shawn O. Pearce | 74f2b2a | 2007-03-06 01:35:01 -0500 | [diff] [blame] | 892 | $(QUIET_CC)$(CC) -o $*.o -c $(ALL_CFLAGS) -DNO_EXPAT $< |
Nick Hengeveld | 8d9fbe5 | 2006-04-04 05:33:18 -0700 | [diff] [blame] | 893 | endif |
| 894 | |
Junio C Hamano | 8eef8e0 | 2006-03-31 16:23:46 -0800 | [diff] [blame] | 895 | git-%$X: %.o $(GITLIBS) |
Shawn O. Pearce | 74f2b2a | 2007-03-06 01:35:01 -0500 | [diff] [blame] | 896 | $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS) |
Daniel Barkalow | 6eb7ed5 | 2005-04-23 18:47:23 -0700 | [diff] [blame] | 897 | |
Mike McCormack | f2561fd | 2006-03-10 14:32:50 +0900 | [diff] [blame] | 898 | git-imap-send$X: imap-send.o $(LIB_FILE) |
| 899 | |
Daniel Barkalow | 30ae764 | 2007-09-10 23:02:45 -0400 | [diff] [blame^] | 900 | http.o http-walker.o http-push.o: http.h |
Johannes Schindelin | 39c015c | 2006-02-18 12:40:22 +0100 | [diff] [blame] | 901 | |
Junio C Hamano | 8fced61 | 2006-07-03 00:53:13 -0700 | [diff] [blame] | 902 | 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] | 903 | $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \ |
Johannes Schindelin | 39c015c | 2006-02-18 12:40:22 +0100 | [diff] [blame] | 904 | $(LIBS) $(CURL_LIBCURL) $(EXPAT_LIBEXPAT) |
| 905 | |
Daniel Barkalow | 30ae764 | 2007-09-10 23:02:45 -0400 | [diff] [blame^] | 906 | $(LIB_OBJS) $(BUILTIN_OBJS) walker.o: $(LIB_H) |
Junio C Hamano | 1f33026 | 2006-06-22 15:43:47 -0700 | [diff] [blame] | 907 | $(patsubst git-%$X,%.o,$(PROGRAMS)): $(LIB_H) $(wildcard */*.h) |
Petr Baudis | e468305 | 2005-07-29 17:48:50 +0200 | [diff] [blame] | 908 | $(DIFF_OBJS): diffcore.h |
Linus Torvalds | e83c516 | 2005-04-07 15:13:13 -0700 | [diff] [blame] | 909 | |
Petr Baudis | 28818ff | 2005-07-29 17:50:24 +0200 | [diff] [blame] | 910 | $(LIB_FILE): $(LIB_OBJS) |
Emil Medve | 4cb08df | 2007-07-14 12:51:44 -0500 | [diff] [blame] | 911 | $(QUIET_AR)$(RM) $@ && $(AR) rcs $@ $(LIB_OBJS) |
Petr Baudis | 28818ff | 2005-07-29 17:50:24 +0200 | [diff] [blame] | 912 | |
Johannes Schindelin | 857b933 | 2006-11-21 23:24:34 +0100 | [diff] [blame] | 913 | XDIFF_OBJS=xdiff/xdiffi.o xdiff/xprepare.o xdiff/xutils.o xdiff/xemit.o \ |
| 914 | xdiff/xmerge.o |
Andy Whitcroft | 17b96be | 2006-10-17 19:08:08 +0100 | [diff] [blame] | 915 | $(XDIFF_OBJS): xdiff/xinclude.h xdiff/xmacros.h xdiff/xdiff.h xdiff/xtypes.h \ |
| 916 | xdiff/xutils.h xdiff/xprepare.h xdiff/xdiffi.h xdiff/xemit.h |
Linus Torvalds | 3443546 | 2006-03-24 20:13:22 -0800 | [diff] [blame] | 917 | |
| 918 | $(XDIFF_LIB): $(XDIFF_OBJS) |
Emil Medve | 4cb08df | 2007-07-14 12:51:44 -0500 | [diff] [blame] | 919 | $(QUIET_AR)$(RM) $@ && $(AR) rcs $@ $(XDIFF_OBJS) |
Linus Torvalds | 3443546 | 2006-03-24 20:13:22 -0800 | [diff] [blame] | 920 | |
| 921 | |
Petr Baudis | d595a47 | 2006-06-24 18:35:12 -0700 | [diff] [blame] | 922 | perl/Makefile: perl/Git.pm perl/Makefile.PL GIT-CFLAGS |
Petr Baudis | 63df97a | 2006-06-24 04:34:36 +0200 | [diff] [blame] | 923 | (cd perl && $(PERL_PATH) Makefile.PL \ |
Petr Baudis | 18b0fc1 | 2006-09-23 20:20:47 +0200 | [diff] [blame] | 924 | PREFIX='$(prefix_SQ)') |
Petr Baudis | b1edc53 | 2006-06-24 04:34:29 +0200 | [diff] [blame] | 925 | |
Petr Baudis | 28818ff | 2005-07-29 17:50:24 +0200 | [diff] [blame] | 926 | doc: |
| 927 | $(MAKE) -C Documentation all |
| 928 | |
David Kastrup | 4739809 | 2007-08-06 12:22:57 +0200 | [diff] [blame] | 929 | info: |
| 930 | $(MAKE) -C Documentation info |
| 931 | |
Fredrik Kuivinen | f81e7c6 | 2006-03-18 11:07:12 +0100 | [diff] [blame] | 932 | TAGS: |
Emil Medve | 4cb08df | 2007-07-14 12:51:44 -0500 | [diff] [blame] | 933 | $(RM) TAGS |
David Kastrup | 89b2f19 | 2007-07-29 15:23:28 -0700 | [diff] [blame] | 934 | $(FIND) . -name '*.[hcS]' -print | xargs etags -a |
Fredrik Kuivinen | f81e7c6 | 2006-03-18 11:07:12 +0100 | [diff] [blame] | 935 | |
| 936 | tags: |
Emil Medve | 4cb08df | 2007-07-14 12:51:44 -0500 | [diff] [blame] | 937 | $(RM) tags |
David Kastrup | 89b2f19 | 2007-07-29 15:23:28 -0700 | [diff] [blame] | 938 | $(FIND) . -name '*.[hcS]' -print | xargs ctags -a |
Petr Baudis | 28818ff | 2005-07-29 17:50:24 +0200 | [diff] [blame] | 939 | |
Yakov Lerner | ca3bcab | 2006-06-15 01:36:00 +0300 | [diff] [blame] | 940 | ### Detect prefix changes |
Junio C Hamano | 7cdbff1 | 2006-11-20 00:49:31 -0800 | [diff] [blame] | 941 | TRACK_CFLAGS = $(subst ','\'',$(ALL_CFLAGS)):\ |
Yakov Lerner | ca3bcab | 2006-06-15 01:36:00 +0300 | [diff] [blame] | 942 | $(bindir_SQ):$(gitexecdir_SQ):$(template_dir_SQ):$(prefix_SQ) |
| 943 | |
| 944 | GIT-CFLAGS: .FORCE-GIT-CFLAGS |
| 945 | @FLAGS='$(TRACK_CFLAGS)'; \ |
| 946 | if test x"$$FLAGS" != x"`cat GIT-CFLAGS 2>/dev/null`" ; then \ |
| 947 | echo 1>&2 " * new build flags or prefix"; \ |
| 948 | echo "$$FLAGS" >GIT-CFLAGS; \ |
| 949 | fi |
| 950 | |
Eygene Ryabinkin | 6bdb18a | 2007-03-28 04:22:02 -0700 | [diff] [blame] | 951 | ### Detect Tck/Tk interpreter path changes |
| 952 | ifndef NO_TCLTK |
| 953 | TRACK_VARS = $(subst ','\'',-DTCLTK_PATH='$(TCLTK_PATH_SQ)') |
| 954 | |
| 955 | GIT-GUI-VARS: .FORCE-GIT-GUI-VARS |
| 956 | @VARS='$(TRACK_VARS)'; \ |
| 957 | if test x"$$VARS" != x"`cat $@ 2>/dev/null`" ; then \ |
| 958 | echo 1>&2 " * new Tcl/Tk interpreter location"; \ |
| 959 | echo "$$VARS" >$@; \ |
| 960 | fi |
| 961 | |
| 962 | .PHONY: .FORCE-GIT-GUI-VARS |
| 963 | endif |
| 964 | |
Petr Baudis | 28818ff | 2005-07-29 17:50:24 +0200 | [diff] [blame] | 965 | ### Testing rules |
| 966 | |
Johannes Schindelin | e5392c5 | 2007-08-01 01:28:59 +0100 | [diff] [blame] | 967 | TEST_PROGRAMS = test-chmtime$X test-genrandom$X test-date$X test-delta$X test-sha1$X test-match-trees$X test-absolute-path$X |
Junio C Hamano | 96651ef | 2007-04-28 15:32:49 -0700 | [diff] [blame] | 968 | |
| 969 | all:: $(TEST_PROGRAMS) |
| 970 | |
Johannes Schindelin | abb7c7b | 2006-02-18 13:01:18 +0100 | [diff] [blame] | 971 | # GNU make supports exporting all variables by "export" without parameters. |
| 972 | # However, the environment gets quite big, and some programs have problems |
| 973 | # with that. |
| 974 | |
Johannes Schindelin | 140245b | 2006-07-07 13:26:31 +0200 | [diff] [blame] | 975 | export NO_SVN_TESTS |
Johannes Schindelin | abb7c7b | 2006-02-18 13:01:18 +0100 | [diff] [blame] | 976 | |
Junio C Hamano | 96651ef | 2007-04-28 15:32:49 -0700 | [diff] [blame] | 977 | test: all |
Petr Baudis | 28818ff | 2005-07-29 17:50:24 +0200 | [diff] [blame] | 978 | $(MAKE) -C t/ all |
| 979 | |
Julian Phillips | 5c5ba73 | 2007-05-31 00:18:24 +0100 | [diff] [blame] | 980 | test-date$X: date.o ctype.o |
Petr Baudis | 28818ff | 2005-07-29 17:50:24 +0200 | [diff] [blame] | 981 | |
Julian Phillips | 5c5ba73 | 2007-05-31 00:18:24 +0100 | [diff] [blame] | 982 | test-delta$X: diff-delta.o patch-delta.o |
Petr Baudis | 28818ff | 2005-07-29 17:50:24 +0200 | [diff] [blame] | 983 | |
Junio C Hamano | fa8fe28 | 2007-08-30 19:14:31 -0700 | [diff] [blame] | 984 | .PRECIOUS: $(patsubst test-%$X,test-%.o,$(TEST_PROGRAMS)) |
| 985 | |
Julian Phillips | 5c5ba73 | 2007-05-31 00:18:24 +0100 | [diff] [blame] | 986 | test-%$X: test-%.o $(GITLIBS) |
| 987 | $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS) |
Nicolas Pitre | 2dca1af | 2007-04-11 13:59:51 -0400 | [diff] [blame] | 988 | |
Junio C Hamano | b65bc21 | 2006-06-24 00:59:49 -0700 | [diff] [blame] | 989 | check-sha1:: test-sha1$X |
| 990 | ./test-sha1.sh |
| 991 | |
René Scharfe | 7c4c9f4 | 2007-01-04 19:33:48 +0100 | [diff] [blame] | 992 | check: common-cmds.h |
Junio C Hamano | 773b633 | 2005-12-14 13:32:52 -0800 | [diff] [blame] | 993 | 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] | 994 | |
Linus Torvalds | 36e5e70 | 2007-06-30 11:49:17 -0700 | [diff] [blame] | 995 | remove-dashes: |
| 996 | ./fixup-builtins $(BUILT_INS) |
Petr Baudis | 28818ff | 2005-07-29 17:50:24 +0200 | [diff] [blame] | 997 | |
| 998 | ### Installation rules |
| 999 | |
Andreas Ericsson | d6ebd25 | 2005-11-22 00:44:15 +0100 | [diff] [blame] | 1000 | install: all |
Johannes Schindelin | 39c015c | 2006-02-18 12:40:22 +0100 | [diff] [blame] | 1001 | $(INSTALL) -d -m755 '$(DESTDIR_SQ)$(bindir_SQ)' |
| 1002 | $(INSTALL) -d -m755 '$(DESTDIR_SQ)$(gitexecdir_SQ)' |
| 1003 | $(INSTALL) $(ALL_PROGRAMS) '$(DESTDIR_SQ)$(gitexecdir_SQ)' |
Eygene Ryabinkin | 3cfaf11 | 2007-03-28 04:00:23 -0700 | [diff] [blame] | 1004 | $(INSTALL) git$X '$(DESTDIR_SQ)$(bindir_SQ)' |
Ramsay Allan Jones | 7ffe709 | 2006-07-29 17:25:03 +0100 | [diff] [blame] | 1005 | $(MAKE) -C templates DESTDIR='$(DESTDIR_SQ)' install |
Alex Riesen | f848718 | 2006-12-04 10:50:04 +0100 | [diff] [blame] | 1006 | $(MAKE) -C perl prefix='$(prefix_SQ)' install |
Eygene Ryabinkin | 3cfaf11 | 2007-03-28 04:00:23 -0700 | [diff] [blame] | 1007 | ifndef NO_TCLTK |
Eygene Ryabinkin | 6bdb18a | 2007-03-28 04:22:02 -0700 | [diff] [blame] | 1008 | $(INSTALL) gitk-wish '$(DESTDIR_SQ)$(bindir_SQ)'/gitk |
Shawn O. Pearce | d647c2e | 2007-02-12 18:20:34 -0500 | [diff] [blame] | 1009 | $(MAKE) -C git-gui install |
Eygene Ryabinkin | 3cfaf11 | 2007-03-28 04:00:23 -0700 | [diff] [blame] | 1010 | endif |
Sean | 7f7e6ea | 2006-05-22 00:42:59 -0400 | [diff] [blame] | 1011 | if test 'z$(bindir_SQ)' != 'z$(gitexecdir_SQ)'; \ |
| 1012 | then \ |
| 1013 | ln -f '$(DESTDIR_SQ)$(bindir_SQ)/git$X' \ |
| 1014 | '$(DESTDIR_SQ)$(gitexecdir_SQ)/git$X' || \ |
| 1015 | cp '$(DESTDIR_SQ)$(bindir_SQ)/git$X' \ |
| 1016 | '$(DESTDIR_SQ)$(gitexecdir_SQ)/git$X'; \ |
| 1017 | fi |
Emil Medve | 4cb08df | 2007-07-14 12:51:44 -0500 | [diff] [blame] | 1018 | $(foreach p,$(BUILT_INS), $(RM) '$(DESTDIR_SQ)$(gitexecdir_SQ)/$p' && ln '$(DESTDIR_SQ)$(gitexecdir_SQ)/git$X' '$(DESTDIR_SQ)$(gitexecdir_SQ)/$p' ;) |
Junio C Hamano | 6fc301b | 2007-01-10 12:24:54 -0800 | [diff] [blame] | 1019 | ifneq (,$X) |
Emil Medve | 4cb08df | 2007-07-14 12:51:44 -0500 | [diff] [blame] | 1020 | $(foreach p,$(patsubst %$X,%,$(filter %$X,$(ALL_PROGRAMS) $(BUILT_INS) git$X)), $(RM) '$(DESTDIR_SQ)$(gitexecdir_SQ)/$p';) |
Junio C Hamano | 6fc301b | 2007-01-10 12:24:54 -0800 | [diff] [blame] | 1021 | endif |
Petr Baudis | 28818ff | 2005-07-29 17:50:24 +0200 | [diff] [blame] | 1022 | |
| 1023 | install-doc: |
| 1024 | $(MAKE) -C Documentation install |
| 1025 | |
David Kastrup | 4739809 | 2007-08-06 12:22:57 +0200 | [diff] [blame] | 1026 | install-info: |
| 1027 | $(MAKE) -C Documentation install-info |
| 1028 | |
Eric Wong | 6538d1e | 2006-12-23 08:26:09 -0800 | [diff] [blame] | 1029 | quick-install-doc: |
| 1030 | $(MAKE) -C Documentation quick-install |
Petr Baudis | 28818ff | 2005-07-29 17:50:24 +0200 | [diff] [blame] | 1031 | |
| 1032 | |
| 1033 | |
| 1034 | ### Maintainer's dist rules |
| 1035 | |
Junio C Hamano | 9b88fce | 2005-12-27 14:40:17 -0800 | [diff] [blame] | 1036 | git.spec: git.spec.in |
Jim Meyering | fc36f6a | 2006-05-25 18:52:01 +0200 | [diff] [blame] | 1037 | sed -e 's/@@VERSION@@/$(GIT_VERSION)/g' < $< > $@+ |
| 1038 | mv $@+ $@ |
Chris Wright | a9db297 | 2005-07-07 13:09:50 -0700 | [diff] [blame] | 1039 | |
Junio C Hamano | 27dedf0 | 2005-11-16 21:32:44 -0800 | [diff] [blame] | 1040 | GIT_TARNAME=git-$(GIT_VERSION) |
Matthias Lederhofer | f58494b | 2007-06-18 23:30:36 +0200 | [diff] [blame] | 1041 | dist: git.spec git-archive configure |
Junio C Hamano | 9ccb64c | 2006-10-05 02:26:12 -0700 | [diff] [blame] | 1042 | ./git-archive --format=tar \ |
| 1043 | --prefix=$(GIT_TARNAME)/ HEAD^{tree} > $(GIT_TARNAME).tar |
Chris Wright | a9db297 | 2005-07-07 13:09:50 -0700 | [diff] [blame] | 1044 | @mkdir -p $(GIT_TARNAME) |
Matthias Lederhofer | f58494b | 2007-06-18 23:30:36 +0200 | [diff] [blame] | 1045 | @cp git.spec configure $(GIT_TARNAME) |
H. Peter Anvin | 181129d | 2006-01-09 18:07:01 -0800 | [diff] [blame] | 1046 | @echo $(GIT_VERSION) > $(GIT_TARNAME)/version |
Shawn O. Pearce | d647c2e | 2007-02-12 18:20:34 -0500 | [diff] [blame] | 1047 | @$(MAKE) -C git-gui TARDIR=../$(GIT_TARNAME)/git-gui dist-version |
H. Peter Anvin | 181129d | 2006-01-09 18:07:01 -0800 | [diff] [blame] | 1048 | $(TAR) rf $(GIT_TARNAME).tar \ |
Shawn O. Pearce | d647c2e | 2007-02-12 18:20:34 -0500 | [diff] [blame] | 1049 | $(GIT_TARNAME)/git.spec \ |
Matthias Lederhofer | f58494b | 2007-06-18 23:30:36 +0200 | [diff] [blame] | 1050 | $(GIT_TARNAME)/configure \ |
Shawn O. Pearce | d647c2e | 2007-02-12 18:20:34 -0500 | [diff] [blame] | 1051 | $(GIT_TARNAME)/version \ |
Shawn O. Pearce | 115f0fe | 2007-03-12 13:40:31 -0400 | [diff] [blame] | 1052 | $(GIT_TARNAME)/git-gui/version |
Emil Medve | 4cb08df | 2007-07-14 12:51:44 -0500 | [diff] [blame] | 1053 | @$(RM) -r $(GIT_TARNAME) |
Eric W. Biederman | 9dce3c0 | 2005-07-14 19:20:50 -0600 | [diff] [blame] | 1054 | gzip -f -9 $(GIT_TARNAME).tar |
Chris Wright | a9db297 | 2005-07-07 13:09:50 -0700 | [diff] [blame] | 1055 | |
| 1056 | rpm: dist |
Junio C Hamano | 27dedf0 | 2005-11-16 21:32:44 -0800 | [diff] [blame] | 1057 | $(RPMBUILD) -ta $(GIT_TARNAME).tar.gz |
Chris Wright | a9db297 | 2005-07-07 13:09:50 -0700 | [diff] [blame] | 1058 | |
Tilman Sauerbeck | 52db049 | 2006-05-18 12:57:04 +0200 | [diff] [blame] | 1059 | htmldocs = git-htmldocs-$(GIT_VERSION) |
| 1060 | manpages = git-manpages-$(GIT_VERSION) |
| 1061 | dist-doc: |
Emil Medve | 4cb08df | 2007-07-14 12:51:44 -0500 | [diff] [blame] | 1062 | $(RM) -r .doc-tmp-dir |
Tilman Sauerbeck | 52db049 | 2006-05-18 12:57:04 +0200 | [diff] [blame] | 1063 | mkdir .doc-tmp-dir |
| 1064 | $(MAKE) -C Documentation WEBDOC_DEST=../.doc-tmp-dir install-webdoc |
| 1065 | cd .doc-tmp-dir && $(TAR) cf ../$(htmldocs).tar . |
| 1066 | gzip -n -9 -f $(htmldocs).tar |
| 1067 | : |
Emil Medve | 4cb08df | 2007-07-14 12:51:44 -0500 | [diff] [blame] | 1068 | $(RM) -r .doc-tmp-dir |
Junio C Hamano | 4392da4 | 2007-04-19 20:47:04 -0700 | [diff] [blame] | 1069 | 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] | 1070 | $(MAKE) -C Documentation DESTDIR=./ \ |
Jakub Narebski | 7b8cf0c | 2006-06-29 23:26:54 +0200 | [diff] [blame] | 1071 | man1dir=../.doc-tmp-dir/man1 \ |
Junio C Hamano | 4392da4 | 2007-04-19 20:47:04 -0700 | [diff] [blame] | 1072 | man5dir=../.doc-tmp-dir/man5 \ |
Jakub Narebski | 7b8cf0c | 2006-06-29 23:26:54 +0200 | [diff] [blame] | 1073 | man7dir=../.doc-tmp-dir/man7 \ |
Tilman Sauerbeck | 52db049 | 2006-05-18 12:57:04 +0200 | [diff] [blame] | 1074 | install |
| 1075 | cd .doc-tmp-dir && $(TAR) cf ../$(manpages).tar . |
| 1076 | gzip -n -9 -f $(manpages).tar |
Emil Medve | 4cb08df | 2007-07-14 12:51:44 -0500 | [diff] [blame] | 1077 | $(RM) -r .doc-tmp-dir |
Tilman Sauerbeck | 52db049 | 2006-05-18 12:57:04 +0200 | [diff] [blame] | 1078 | |
Petr Baudis | 28818ff | 2005-07-29 17:50:24 +0200 | [diff] [blame] | 1079 | ### Cleaning rules |
Eric W. Biederman | 87a81c8 | 2005-07-14 19:21:57 -0600 | [diff] [blame] | 1080 | |
Linus Torvalds | e83c516 | 2005-04-07 15:13:13 -0700 | [diff] [blame] | 1081 | clean: |
Emil Medve | 4cb08df | 2007-07-14 12:51:44 -0500 | [diff] [blame] | 1082 | $(RM) *.o mozilla-sha1/*.o arm/*.o ppc/*.o compat/*.o xdiff/*.o \ |
Matthias Lederhofer | d0f51a8 | 2007-06-05 15:43:17 +0200 | [diff] [blame] | 1083 | $(LIB_FILE) $(XDIFF_LIB) |
Emil Medve | 4cb08df | 2007-07-14 12:51:44 -0500 | [diff] [blame] | 1084 | $(RM) $(ALL_PROGRAMS) $(BUILT_INS) git$X |
| 1085 | $(RM) $(TEST_PROGRAMS) |
| 1086 | $(RM) *.spec *.pyc *.pyo */*.pyc */*.pyo common-cmds.h TAGS tags |
| 1087 | $(RM) -r autom4te.cache |
| 1088 | $(RM) configure config.log config.mak.autogen config.mak.append config.status config.cache |
| 1089 | $(RM) -r $(GIT_TARNAME) .doc-tmp-dir |
| 1090 | $(RM) $(GIT_TARNAME).tar.gz git-core_$(GIT_VERSION)-*.tar.gz |
| 1091 | $(RM) $(htmldocs).tar.gz $(manpages).tar.gz |
| 1092 | $(RM) gitweb/gitweb.cgi |
Thomas Glanzmann | ca67f00 | 2005-05-22 20:27:28 +0200 | [diff] [blame] | 1093 | $(MAKE) -C Documentation/ clean |
Alex Riesen | f848718 | 2006-12-04 10:50:04 +0100 | [diff] [blame] | 1094 | $(MAKE) -C perl clean |
Petr Baudis | b1edc53 | 2006-06-24 04:34:29 +0200 | [diff] [blame] | 1095 | $(MAKE) -C templates/ clean |
Junio C Hamano | 4b7581f | 2005-08-02 17:24:11 -0700 | [diff] [blame] | 1096 | $(MAKE) -C t/ clean |
Eygene Ryabinkin | 3cfaf11 | 2007-03-28 04:00:23 -0700 | [diff] [blame] | 1097 | ifndef NO_TCLTK |
Emil Medve | 4cb08df | 2007-07-14 12:51:44 -0500 | [diff] [blame] | 1098 | $(RM) gitk-wish |
Eygene Ryabinkin | 3cfaf11 | 2007-03-28 04:00:23 -0700 | [diff] [blame] | 1099 | $(MAKE) -C git-gui clean |
| 1100 | endif |
Emil Medve | 4cb08df | 2007-07-14 12:51:44 -0500 | [diff] [blame] | 1101 | $(RM) GIT-VERSION-FILE GIT-CFLAGS GIT-GUI-VARS |
Junio C Hamano | 9b88fce | 2005-12-27 14:40:17 -0800 | [diff] [blame] | 1102 | |
Junio C Hamano | 4dc0002 | 2006-01-12 21:42:25 -0800 | [diff] [blame] | 1103 | .PHONY: all install clean strip |
Yakov Lerner | ca3bcab | 2006-06-15 01:36:00 +0300 | [diff] [blame] | 1104 | .PHONY: .FORCE-GIT-VERSION-FILE TAGS tags .FORCE-GIT-CFLAGS |
Junio C Hamano | d89056c | 2005-12-19 17:59:58 -0800 | [diff] [blame] | 1105 | |
Junio C Hamano | 8c989ec | 2006-04-13 00:17:19 -0700 | [diff] [blame] | 1106 | ### Check documentation |
| 1107 | # |
| 1108 | check-docs:: |
| 1109 | @for v in $(ALL_PROGRAMS) $(BUILT_INS) git$X gitk; \ |
| 1110 | do \ |
| 1111 | case "$$v" in \ |
Junio C Hamano | 8c989ec | 2006-04-13 00:17:19 -0700 | [diff] [blame] | 1112 | git-merge-octopus | git-merge-ours | git-merge-recursive | \ |
Junio C Hamano | 6506e15 | 2007-02-06 21:27:09 -0800 | [diff] [blame] | 1113 | git-merge-resolve | git-merge-stupid | \ |
Junio C Hamano | 4b02c52 | 2007-02-13 22:45:22 -0800 | [diff] [blame] | 1114 | git-add--interactive | git-fsck-objects | git-init-db | \ |
Daniel Barkalow | fbdeef9 | 2007-09-10 23:02:40 -0400 | [diff] [blame] | 1115 | git-repo-config | git-fetch--tool ) continue ;; \ |
Junio C Hamano | 8c989ec | 2006-04-13 00:17:19 -0700 | [diff] [blame] | 1116 | esac ; \ |
| 1117 | test -f "Documentation/$$v.txt" || \ |
| 1118 | echo "no doc: $$v"; \ |
Junio C Hamano | 4b02c52 | 2007-02-13 22:45:22 -0800 | [diff] [blame] | 1119 | sed -e '1,/^__DATA__/d' Documentation/cmd-list.perl | \ |
| 1120 | grep -q "^$$v[ ]" || \ |
Junio C Hamano | 8c989ec | 2006-04-13 00:17:19 -0700 | [diff] [blame] | 1121 | case "$$v" in \ |
| 1122 | git) ;; \ |
| 1123 | *) echo "no link: $$v";; \ |
| 1124 | esac ; \ |
| 1125 | done | sort |
Junio C Hamano | c74390e | 2006-11-05 11:26:21 -0800 | [diff] [blame] | 1126 | |
| 1127 | ### Make sure built-ins do not have dups and listed in git.c |
| 1128 | # |
| 1129 | check-builtins:: |
| 1130 | ./check-builtins.sh |