Junio C Hamano | 2731d04 | 2005-12-01 12:26:41 -0800 | [diff] [blame] | 1 | # The default target of this Makefile is... |
| 2 | all: |
| 3 | |
Linus Torvalds | 765ac8e | 2006-02-28 15:07:20 -0800 | [diff] [blame] | 4 | # Define NO_OPENSSL environment variable if you do not have OpenSSL. |
| 5 | # This also implies MOZILLA_SHA1. |
Petr Baudis | 5bdac8b | 2005-07-29 17:48:26 +0200 | [diff] [blame] | 6 | # |
Nick Hengeveld | 58e60dd | 2005-11-02 11:19:24 -0800 | [diff] [blame] | 7 | # Define NO_CURL if you do not have curl installed. git-http-pull and |
| 8 | # git-http-push are not built, and you cannot use http:// and https:// |
| 9 | # transports. |
Johannes Schindelin | b2c0bd6 | 2005-07-31 02:14:23 +0200 | [diff] [blame] | 10 | # |
Patrick Mauritz | 6d9bbc5 | 2005-09-19 16:11:19 +0200 | [diff] [blame] | 11 | # Define CURLDIR=/foo/bar if your curl header and library files are in |
| 12 | # /foo/bar/include and /foo/bar/lib directories. |
| 13 | # |
Nick Hengeveld | 58e60dd | 2005-11-02 11:19:24 -0800 | [diff] [blame] | 14 | # Define NO_EXPAT if you do not have expat installed. git-http-push is |
| 15 | # not built, and you cannot push using http:// and https:// transports. |
| 16 | # |
Junio C Hamano | 35a730f | 2006-01-19 17:13:51 -0800 | [diff] [blame] | 17 | # Define NO_D_INO_IN_DIRENT if you don't have d_ino in your struct dirent. |
| 18 | # |
Junio C Hamano | 63be37b | 2006-01-19 17:13:57 -0800 | [diff] [blame] | 19 | # Define NO_D_TYPE_IN_DIRENT if your platform defines DT_UNKNOWN but lacks |
| 20 | # d_type in struct dirent (latest Cygwin -- will be fixed soonish). |
| 21 | # |
Ramsay Allan Jones | 579d1fb | 2006-07-30 16:38:28 +0100 | [diff] [blame] | 22 | # Define NO_C99_FORMAT if your formatted IO functions (printf/scanf et.al.) |
| 23 | # do not support the 'size specifiers' introduced by C99, namely ll, hh, |
| 24 | # 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] | 25 | # 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] | 26 | # |
Linus Torvalds | ef34af2 | 2005-09-18 18:30:50 -0700 | [diff] [blame] | 27 | # Define NO_STRCASESTR if you don't have strcasestr. |
| 28 | # |
Peter Eriksen | 817151e | 2006-06-24 16:01:25 +0200 | [diff] [blame] | 29 | # Define NO_STRLCPY if you don't have strlcpy. |
| 30 | # |
Jason Riedy | e40b61f | 2005-12-02 15:08:28 -0800 | [diff] [blame] | 31 | # Define NO_SETENV if you don't have setenv in the C library. |
| 32 | # |
Junio C Hamano | 9f0bb90 | 2006-05-02 00:40:24 -0700 | [diff] [blame] | 33 | # Define NO_SYMLINK_HEAD if you never want .git/HEAD to be a symbolic link. |
| 34 | # Enable it on Windows. By default, symrefs are still used. |
Pavel Roskin | 2fabd21 | 2005-11-15 00:59:50 -0500 | [diff] [blame] | 35 | # |
Pavel Roskin | 0285358 | 2006-07-09 02:44:58 -0700 | [diff] [blame] | 36 | # 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] | 37 | # tests. These tests take up a significant amount of the total test time |
| 38 | # but are not needed unless you plan to talk to SVN repos. |
| 39 | # |
Shawn Pearce | 8eb38ca | 2006-07-24 00:28:28 -0400 | [diff] [blame] | 40 | # Define NO_FINK if you are building on Darwin/Mac OS X, have Fink |
| 41 | # installed in /sw, but don't want GIT to link against any libraries |
| 42 | # installed there. If defined you may specify your own (or Fink's) |
| 43 | # include directories and library directories by defining CFLAGS |
| 44 | # and LDFLAGS appropriately. |
| 45 | # |
| 46 | # Define NO_DARWIN_PORTS if you are building on Darwin/Mac OS X, |
| 47 | # have DarwinPorts installed in /opt/local, but don't want GIT to |
| 48 | # link against any libraries installed there. If defined you may |
| 49 | # specify your own (or DarwinPort's) include directories and |
| 50 | # library directories by defining CFLAGS and LDFLAGS appropriately. |
| 51 | # |
Petr Baudis | 5bdac8b | 2005-07-29 17:48:26 +0200 | [diff] [blame] | 52 | # Define PPC_SHA1 environment variable when running make to make use of |
| 53 | # a bundled SHA1 routine optimized for PowerPC. |
Junio C Hamano | 597c9cc | 2005-09-07 12:22:56 -0700 | [diff] [blame] | 54 | # |
Nicolas Pitre | 7c6ef2f | 2005-09-20 12:27:13 -0400 | [diff] [blame] | 55 | # Define ARM_SHA1 environment variable when running make to make use of |
| 56 | # a bundled SHA1 routine optimized for ARM. |
| 57 | # |
Junio C Hamano | f6af75d | 2006-06-23 17:57:48 -0700 | [diff] [blame] | 58 | # Define MOZILLA_SHA1 environment variable when running make to make use of |
| 59 | # a bundled SHA1 routine coming from Mozilla. It is GPL'd and should be fast |
| 60 | # on non-x86 architectures (e.g. PowerPC), while the OpenSSL version (default |
| 61 | # choice) has very fast version optimized for i586. |
| 62 | # |
Junio C Hamano | 597c9cc | 2005-09-07 12:22:56 -0700 | [diff] [blame] | 63 | # Define NEEDS_SSL_WITH_CRYPTO if you need -lcrypto with -lssl (Darwin). |
Patrick Mauritz | f0ebff0 | 2005-09-06 01:24:03 +0200 | [diff] [blame] | 64 | # |
Junio C Hamano | 597c9cc | 2005-09-07 12:22:56 -0700 | [diff] [blame] | 65 | # Define NEEDS_LIBICONV if linking with libc is not enough (Darwin). |
Patrick Mauritz | f0ebff0 | 2005-09-06 01:24:03 +0200 | [diff] [blame] | 66 | # |
| 67 | # Define NEEDS_SOCKET if linking with libc is not enough (SunOS, |
| 68 | # Patrick Mauritz). |
| 69 | # |
Johannes Schindelin | 730d48a | 2005-10-08 15:54:36 -0700 | [diff] [blame] | 70 | # Define NO_MMAP if you want to avoid mmap. |
| 71 | # |
Shawn O. Pearce | 1510fea | 2006-12-14 06:15:57 -0500 | [diff] [blame] | 72 | # Define NO_FAST_WORKING_DIRECTORY if accessing objects in pack files is |
| 73 | # generally faster on your platform than accessing the working directory. |
| 74 | # |
hpa | 49744d6 | 2005-09-28 16:52:21 -0700 | [diff] [blame] | 75 | # Define NO_IPV6 if you lack IPv6 support and getaddrinfo(). |
| 76 | # |
Junio C Hamano | bdc37f5 | 2006-01-19 17:13:32 -0800 | [diff] [blame] | 77 | # Define NO_SOCKADDR_STORAGE if your platform does not have struct |
| 78 | # sockaddr_storage. |
| 79 | # |
Fernando J. Pereda | b6e56ec | 2006-02-16 09:38:01 +0100 | [diff] [blame] | 80 | # Define NO_ICONV if your libc does not properly support iconv. |
| 81 | # |
Junio C Hamano | bbfc63d | 2006-12-27 14:17:35 -0800 | [diff] [blame^] | 82 | # Define NO_R_TO_GCC if your gcc does not like "-R/path/lib" that |
| 83 | # tells runtime paths to dynamic libraries; "-Wl,-rpath=/path/lib" |
| 84 | # is used instead. |
| 85 | # |
Petr Baudis | 5bdac8b | 2005-07-29 17:48:26 +0200 | [diff] [blame] | 86 | # Define USE_NSEC below if you want git to care about sub-second file mtimes |
| 87 | # and ctimes. Note that you need recent glibc (at least 2.2.4) for this, and |
| 88 | # it will BREAK YOUR LOCAL DIFFS! show-diff and anything using it will likely |
| 89 | # randomly break unless your underlying filesystem supports those sub-second |
| 90 | # times (my ext3 doesn't). |
Junio C Hamano | f6af75d | 2006-06-23 17:57:48 -0700 | [diff] [blame] | 91 | # |
Petr Baudis | 5bdac8b | 2005-07-29 17:48:26 +0200 | [diff] [blame] | 92 | # Define USE_STDEV below if you want git to care about the underlying device |
| 93 | # change being considered an inode change from the update-cache perspective. |
Alex Riesen | f848718 | 2006-12-04 10:50:04 +0100 | [diff] [blame] | 94 | # |
| 95 | # Define NO_PERL_MAKEMAKER if you cannot use Makefiles generated by perl's |
| 96 | # MakeMaker (e.g. using ActiveState under Cygwin). |
| 97 | # |
Petr Baudis | 5bdac8b | 2005-07-29 17:48:26 +0200 | [diff] [blame] | 98 | |
Junio C Hamano | 9b88fce | 2005-12-27 14:40:17 -0800 | [diff] [blame] | 99 | GIT-VERSION-FILE: .FORCE-GIT-VERSION-FILE |
Fredrik Kuivinen | 3654638 | 2006-02-14 00:15:14 +0100 | [diff] [blame] | 100 | @$(SHELL_PATH) ./GIT-VERSION-GEN |
Junio C Hamano | 9b88fce | 2005-12-27 14:40:17 -0800 | [diff] [blame] | 101 | -include GIT-VERSION-FILE |
Petr Baudis | 5bdac8b | 2005-07-29 17:48:26 +0200 | [diff] [blame] | 102 | |
Paul Jakma | e15f545 | 2006-02-20 23:36:28 +0000 | [diff] [blame] | 103 | uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not') |
| 104 | uname_M := $(shell sh -c 'uname -m 2>/dev/null || echo not') |
| 105 | uname_O := $(shell sh -c 'uname -o 2>/dev/null || echo not') |
| 106 | uname_R := $(shell sh -c 'uname -r 2>/dev/null || echo not') |
| 107 | uname_P := $(shell sh -c 'uname -p 2>/dev/null || echo not') |
| 108 | |
Junio C Hamano | 94d2331 | 2005-11-13 01:46:13 -0800 | [diff] [blame] | 109 | # 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] | 110 | |
Pavel Roskin | b05701c | 2005-08-06 01:36:15 -0400 | [diff] [blame] | 111 | CFLAGS = -g -O2 -Wall |
Junio C Hamano | 94d2331 | 2005-11-13 01:46:13 -0800 | [diff] [blame] | 112 | LDFLAGS = |
Junio C Hamano | 12aa745 | 2005-11-04 23:50:09 -0800 | [diff] [blame] | 113 | ALL_CFLAGS = $(CFLAGS) |
Junio C Hamano | 94d2331 | 2005-11-13 01:46:13 -0800 | [diff] [blame] | 114 | ALL_LDFLAGS = $(LDFLAGS) |
Junio C Hamano | 4dc0002 | 2006-01-12 21:42:25 -0800 | [diff] [blame] | 115 | STRIP ?= strip |
Thomas Glanzmann | 29c2cce | 2005-05-07 10:41:54 +0200 | [diff] [blame] | 116 | |
Pavel Roskin | b05701c | 2005-08-06 01:36:15 -0400 | [diff] [blame] | 117 | prefix = $(HOME) |
| 118 | bindir = $(prefix)/bin |
Paul Jakma | e15f545 | 2006-02-20 23:36:28 +0000 | [diff] [blame] | 119 | gitexecdir = $(bindir) |
Pavel Roskin | b05701c | 2005-08-06 01:36:15 -0400 | [diff] [blame] | 120 | template_dir = $(prefix)/share/git-core/templates/ |
Petr Baudis | a682ef9 | 2005-08-05 01:56:38 +0200 | [diff] [blame] | 121 | # DESTDIR= |
Petr Baudis | 5c2a7fb | 2005-04-13 02:14:06 -0700 | [diff] [blame] | 122 | |
Martin Waitz | 5d043a3 | 2006-08-01 21:34:08 +0200 | [diff] [blame] | 123 | # default configuration for gitweb |
Jeff King | c8d138a | 2006-08-02 15:23:34 -0400 | [diff] [blame] | 124 | GITWEB_CONFIG = gitweb_config.perl |
Yasushi SHOJI | 2de21fa | 2006-08-15 07:50:49 +0900 | [diff] [blame] | 125 | GITWEB_HOME_LINK_STR = projects |
Martin Waitz | 5d043a3 | 2006-08-01 21:34:08 +0200 | [diff] [blame] | 126 | GITWEB_SITENAME = |
| 127 | GITWEB_PROJECTROOT = /pub/git |
Matthias Lederhofer | 32f4aac | 2006-09-17 00:31:01 +0200 | [diff] [blame] | 128 | GITWEB_EXPORT_OK = |
| 129 | GITWEB_STRICT_EXPORT = |
Jakub Narebski | 19a8721 | 2006-08-15 23:03:17 +0200 | [diff] [blame] | 130 | GITWEB_BASE_URL = |
Martin Waitz | 5d043a3 | 2006-08-01 21:34:08 +0200 | [diff] [blame] | 131 | GITWEB_LIST = |
| 132 | GITWEB_HOMETEXT = indextext.html |
| 133 | GITWEB_CSS = gitweb.css |
Martin Waitz | 281f2f6 | 2006-07-31 00:38:39 +0200 | [diff] [blame] | 134 | GITWEB_LOGO = git-logo.png |
Jakub Narebski | 0b5deba | 2006-09-04 20:32:13 +0200 | [diff] [blame] | 135 | GITWEB_FAVICON = git-favicon.png |
Alan Chandler | b2d3476 | 2006-10-03 13:49:03 +0100 | [diff] [blame] | 136 | GITWEB_SITE_HEADER = |
| 137 | GITWEB_SITE_FOOTER = |
Martin Waitz | 5d043a3 | 2006-08-01 21:34:08 +0200 | [diff] [blame] | 138 | |
Junio C Hamano | 7cdbff1 | 2006-11-20 00:49:31 -0800 | [diff] [blame] | 139 | export prefix bindir gitexecdir template_dir |
Jakub Narebski | e14421b | 2006-06-29 22:11:25 +0200 | [diff] [blame] | 140 | |
Pavel Roskin | b05701c | 2005-08-06 01:36:15 -0400 | [diff] [blame] | 141 | CC = gcc |
| 142 | AR = ar |
Junio C Hamano | 229a7ed | 2005-09-23 10:41:40 -0700 | [diff] [blame] | 143 | TAR = tar |
Pavel Roskin | b05701c | 2005-08-06 01:36:15 -0400 | [diff] [blame] | 144 | INSTALL = install |
| 145 | RPMBUILD = rpmbuild |
Linus Torvalds | e83c516 | 2005-04-07 15:13:13 -0700 | [diff] [blame] | 146 | |
Linus Torvalds | 44c9e85 | 2005-07-03 10:02:35 -0700 | [diff] [blame] | 147 | # sparse is architecture-neutral, which means that we need to tell it |
| 148 | # explicitly what architecture to check for. Fix this up for yours.. |
Pavel Roskin | b05701c | 2005-08-06 01:36:15 -0400 | [diff] [blame] | 149 | SPARSE_FLAGS = -D__BIG_ENDIAN__ -D__powerpc__ |
Linus Torvalds | 44c9e85 | 2005-07-03 10:02:35 -0700 | [diff] [blame] | 150 | |
Petr Baudis | 28818ff | 2005-07-29 17:50:24 +0200 | [diff] [blame] | 151 | |
| 152 | |
| 153 | ### --- END CONFIGURATION SECTION --- |
| 154 | |
Petr Baudis | 8d7f586 | 2006-06-25 03:47:03 +0200 | [diff] [blame] | 155 | # 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] | 156 | # be built by a different compiler. (Note that this is an artifact now |
| 157 | # but it still might be nice to keep that distinction.) |
| 158 | BASIC_CFLAGS = |
| 159 | BASIC_LDFLAGS = |
Petr Baudis | 8d7f586 | 2006-06-25 03:47:03 +0200 | [diff] [blame] | 160 | |
Junio C Hamano | 215a7ad | 2005-09-07 17:26:23 -0700 | [diff] [blame] | 161 | SCRIPT_SH = \ |
Lars Hjemli | c31820c | 2006-10-23 23:27:45 +0200 | [diff] [blame] | 162 | git-bisect.sh git-checkout.sh \ |
Rene Scharfe | e827633 | 2006-10-24 01:01:57 +0200 | [diff] [blame] | 163 | git-clean.sh git-clone.sh git-commit.sh \ |
Shawn O. Pearce | 30f610b | 2006-12-27 02:17:59 -0500 | [diff] [blame] | 164 | git-fetch.sh git-gc.sh \ |
Junio C Hamano | 6856373 | 2006-05-21 02:48:21 -0700 | [diff] [blame] | 165 | git-ls-remote.sh \ |
Junio C Hamano | e32faa8 | 2005-12-19 18:03:31 -0800 | [diff] [blame] | 166 | git-merge-one-file.sh git-parse-remote.sh \ |
Linus Torvalds | ba84a79 | 2006-07-06 10:16:22 -0700 | [diff] [blame] | 167 | git-pull.sh git-rebase.sh \ |
Junio C Hamano | 215a7ad | 2005-09-07 17:26:23 -0700 | [diff] [blame] | 168 | git-repack.sh git-request-pull.sh git-reset.sh \ |
Linus Torvalds | d9b814c | 2006-05-19 16:19:34 -0700 | [diff] [blame] | 169 | git-resolve.sh git-revert.sh git-sh-setup.sh \ |
Junio C Hamano | 7b763f7 | 2006-05-01 23:14:58 -0700 | [diff] [blame] | 170 | git-tag.sh git-verify-tag.sh \ |
Junio C Hamano | d1c5f2a | 2005-10-07 03:44:18 -0700 | [diff] [blame] | 171 | git-applymbox.sh git-applypatch.sh git-am.sh \ |
Junio C Hamano | 2276aa6 | 2005-09-10 17:56:19 -0700 | [diff] [blame] | 172 | git-merge.sh git-merge-stupid.sh git-merge-octopus.sh \ |
Linus Torvalds | 63dffdf | 2006-05-16 16:46:31 -0700 | [diff] [blame] | 173 | git-merge-resolve.sh git-merge-ours.sh \ |
Eric W. Biederman | d3d8f36 | 2006-05-17 12:44:40 -0600 | [diff] [blame] | 174 | git-lost-found.sh git-quiltimport.sh |
Petr Baudis | 28818ff | 2005-07-29 17:50:24 +0200 | [diff] [blame] | 175 | |
Junio C Hamano | 215a7ad | 2005-09-07 17:26:23 -0700 | [diff] [blame] | 176 | SCRIPT_PERL = \ |
Junio C Hamano | 5cde71d | 2006-12-10 20:55:50 -0800 | [diff] [blame] | 177 | git-add--interactive.perl \ |
Junio C Hamano | 215a7ad | 2005-09-07 17:26:23 -0700 | [diff] [blame] | 178 | git-archimport.perl git-cvsimport.perl git-relink.perl \ |
Ryan Anderson | f789e34 | 2006-10-09 03:32:05 -0700 | [diff] [blame] | 179 | git-cvsserver.perl \ |
Johannes Schindelin | 11be42a | 2006-07-26 03:52:35 +0200 | [diff] [blame] | 180 | git-svnimport.perl git-cvsexportcommit.perl \ |
Eric Wong | 60d02cc | 2006-07-06 00:14:16 -0700 | [diff] [blame] | 181 | git-send-email.perl git-svn.perl |
Junio C Hamano | 60036a4 | 2005-07-30 17:31:47 -0700 | [diff] [blame] | 182 | |
Andreas Ericsson | d6ebd25 | 2005-11-22 00:44:15 +0100 | [diff] [blame] | 183 | SCRIPTS = $(patsubst %.sh,%,$(SCRIPT_SH)) \ |
| 184 | $(patsubst %.perl,%,$(SCRIPT_PERL)) \ |
Eric Wong | a51d37c | 2006-07-01 15:14:14 -0700 | [diff] [blame] | 185 | git-cherry-pick git-status git-instaweb |
Andreas Ericsson | d6ebd25 | 2005-11-22 00:44:15 +0100 | [diff] [blame] | 186 | |
Junio C Hamano | b42934d | 2006-01-12 21:37:17 -0800 | [diff] [blame] | 187 | # ... 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] | 188 | PROGRAMS = \ |
Peter Eriksen | e8cc9cd | 2006-05-23 14:15:36 +0200 | [diff] [blame] | 189 | git-convert-objects$X git-fetch-pack$X git-fsck-objects$X \ |
Timo Hirvonen | c3c8835 | 2006-05-19 13:03:57 +0300 | [diff] [blame] | 190 | git-hash-object$X git-index-pack$X git-local-fetch$X \ |
Lukas Sandström | 34488e3 | 2006-06-13 22:21:50 +0200 | [diff] [blame] | 191 | git-merge-base$X \ |
Shawn O. Pearce | af8ffbe | 2006-11-05 02:28:25 -0500 | [diff] [blame] | 192 | git-daemon$X \ |
Matthias Kestenholz | 5d4a600 | 2006-08-03 17:24:36 +0200 | [diff] [blame] | 193 | 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] | 194 | git-peek-remote$X git-receive-pack$X \ |
Peter Eriksen | 51ce34b | 2006-05-23 14:15:35 +0200 | [diff] [blame] | 195 | git-send-pack$X git-shell$X \ |
Peter Anvin | 79a9d8e | 2005-10-03 12:04:44 -0700 | [diff] [blame] | 196 | git-show-index$X git-ssh-fetch$X \ |
Peter Eriksen | 56d1398 | 2006-05-23 14:15:31 +0200 | [diff] [blame] | 197 | git-ssh-upload$X git-unpack-file$X \ |
Matthias Kestenholz | 6441363 | 2006-08-03 17:24:37 +0200 | [diff] [blame] | 198 | git-update-server-info$X \ |
Lukas Sandström | 8ed05fb | 2006-06-13 22:21:42 +0200 | [diff] [blame] | 199 | git-upload-pack$X git-verify-pack$X \ |
Matthias Kestenholz | d6b64ed | 2006-08-03 17:24:35 +0200 | [diff] [blame] | 200 | git-pack-redundant$X git-var$X \ |
Junio C Hamano | acca687 | 2006-11-08 18:47:54 -0800 | [diff] [blame] | 201 | git-describe$X git-merge-tree$X git-imap-send$X \ |
Junio C Hamano | a06f678 | 2006-09-24 19:49:47 -0700 | [diff] [blame] | 202 | git-merge-recursive$X \ |
Junio C Hamano | 42f7740 | 2006-08-15 21:38:07 -0700 | [diff] [blame] | 203 | $(EXTRA_PROGRAMS) |
| 204 | |
| 205 | # Empty... |
| 206 | EXTRA_PROGRAMS = |
Andreas Ericsson | d6ebd25 | 2005-11-22 00:44:15 +0100 | [diff] [blame] | 207 | |
Junio C Hamano | e414156 | 2006-08-04 01:23:19 -0700 | [diff] [blame] | 208 | BUILT_INS = \ |
Rene Scharfe | e827633 | 2006-10-24 01:01:57 +0200 | [diff] [blame] | 209 | git-format-patch$X git-show$X git-whatchanged$X git-cherry$X \ |
Junio C Hamano | f754fa9 | 2006-08-04 01:51:04 -0700 | [diff] [blame] | 210 | git-get-tar-commit-id$X \ |
| 211 | $(patsubst builtin-%.o,git-%$X,$(BUILTIN_OBJS)) |
Junio C Hamano | 9173080 | 2006-04-10 17:37:58 -0700 | [diff] [blame] | 212 | |
Junio C Hamano | b42934d | 2006-01-12 21:37:17 -0800 | [diff] [blame] | 213 | # what 'all' will build and 'install' will install, in gitexecdir |
Shawn O. Pearce | af8ffbe | 2006-11-05 02:28:25 -0500 | [diff] [blame] | 214 | ALL_PROGRAMS = $(PROGRAMS) $(SCRIPTS) \ |
Junio C Hamano | 7c2738c | 2006-10-01 21:41:46 -0700 | [diff] [blame] | 215 | git-merge-recur$X |
Linus Torvalds | e83c516 | 2005-04-07 15:13:13 -0700 | [diff] [blame] | 216 | |
Junio C Hamano | 894a8a8 | 2005-09-30 00:27:11 -0700 | [diff] [blame] | 217 | # Backward compatibility -- to be removed after 1.0 |
H. Peter Anvin | 2f29dd5 | 2005-09-30 10:46:25 -0700 | [diff] [blame] | 218 | PROGRAMS += git-ssh-pull$X git-ssh-push$X |
Junio C Hamano | f71a69a | 2005-09-15 14:56:37 -0700 | [diff] [blame] | 219 | |
Ryan Anderson | 3d32051 | 2005-11-21 00:11:22 -0500 | [diff] [blame] | 220 | # Set paths to tools early so that they can be used for version tests. |
| 221 | ifndef SHELL_PATH |
| 222 | SHELL_PATH = /bin/sh |
| 223 | endif |
| 224 | ifndef PERL_PATH |
| 225 | PERL_PATH = /usr/bin/perl |
| 226 | endif |
Junio C Hamano | 720d150 | 2005-09-10 17:46:27 -0700 | [diff] [blame] | 227 | |
Luben Tuikov | 3a79347 | 2006-12-14 23:03:03 -0800 | [diff] [blame] | 228 | export PERL_PATH |
| 229 | |
Linus Torvalds | 0a02ce7 | 2005-04-18 12:49:39 -0700 | [diff] [blame] | 230 | LIB_FILE=libgit.a |
Linus Torvalds | 3443546 | 2006-03-24 20:13:22 -0800 | [diff] [blame] | 231 | XDIFF_LIB=xdiff/lib.a |
Linus Torvalds | 0a02ce7 | 2005-04-18 12:49:39 -0700 | [diff] [blame] | 232 | |
Junio C Hamano | 215a7ad | 2005-09-07 17:26:23 -0700 | [diff] [blame] | 233 | LIB_H = \ |
Junio C Hamano | 83b5d2f | 2006-09-17 16:02:52 -0700 | [diff] [blame] | 234 | archive.h blob.h cache.h commit.h csum-file.h delta.h grep.h \ |
Junio C Hamano | 4405fb7 | 2006-09-17 18:32:03 -0700 | [diff] [blame] | 235 | 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] | 236 | 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] | 237 | tree-walk.h log-tree.h dir.h path-list.h unpack-trees.h builtin.h \ |
| 238 | utf8.h |
Junio C Hamano | 8f3f9b0 | 2005-07-23 17:54:41 -0700 | [diff] [blame] | 239 | |
Junio C Hamano | 215a7ad | 2005-09-07 17:26:23 -0700 | [diff] [blame] | 240 | DIFF_OBJS = \ |
Junio C Hamano | 6973dca | 2006-04-21 23:57:45 -0700 | [diff] [blame] | 241 | diff.o diff-lib.o diffcore-break.o diffcore-order.o \ |
Junio C Hamano | 6541675 | 2006-02-28 16:01:36 -0800 | [diff] [blame] | 242 | 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] | 243 | diffcore-delta.o log-tree.o |
Josef Weidendorfer | b1bf95b | 2005-07-31 21:17:43 +0200 | [diff] [blame] | 244 | |
Junio C Hamano | 215a7ad | 2005-09-07 17:26:23 -0700 | [diff] [blame] | 245 | LIB_OBJS = \ |
Junio C Hamano | 283c8ee | 2006-05-20 00:56:11 -0700 | [diff] [blame] | 246 | 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] | 247 | date.o diff-delta.o entry.o exec_cmd.o ident.o \ |
| 248 | interpolate.o \ |
| 249 | lockfile.o \ |
Junio C Hamano | 49a52b1 | 2006-09-10 01:06:33 -0700 | [diff] [blame] | 250 | object.o pack-check.o patch-delta.o path.o pkt-line.o sideband.o \ |
Linus Torvalds | 3e4339e | 2006-06-18 11:45:02 -0700 | [diff] [blame] | 251 | 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] | 252 | 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] | 253 | 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] | 254 | revision.o pager.o tree-walk.o xdiff-interface.o \ |
Junio C Hamano | 83b5d2f | 2006-09-17 16:02:52 -0700 | [diff] [blame] | 255 | write_or_die.o trace.o list-objects.o grep.o \ |
Jeff King | 7c92fe0 | 2006-09-08 04:03:18 -0400 | [diff] [blame] | 256 | alloc.o merge-file.o path-list.o help.o unpack-trees.o $(DIFF_OBJS) \ |
Johannes Schindelin | 9e83266 | 2006-12-22 22:06:08 +0100 | [diff] [blame] | 257 | color.o wt-status.o archive-zip.o archive-tar.o \ |
| 258 | utf8.o |
Junio C Hamano | d19938a | 2005-05-09 17:57:56 -0700 | [diff] [blame] | 259 | |
Linus Torvalds | 70827b1 | 2006-04-21 10:27:34 -0700 | [diff] [blame] | 260 | BUILTIN_OBJS = \ |
Junio C Hamano | f754fa9 | 2006-08-04 01:51:04 -0700 | [diff] [blame] | 261 | builtin-add.o \ |
Ryan Anderson | f789e34 | 2006-10-09 03:32:05 -0700 | [diff] [blame] | 262 | builtin-annotate.o \ |
Junio C Hamano | f754fa9 | 2006-08-04 01:51:04 -0700 | [diff] [blame] | 263 | builtin-apply.o \ |
Franck Bui-Huu | 4df096a | 2006-09-07 15:12:02 +0200 | [diff] [blame] | 264 | builtin-archive.o \ |
Junio C Hamano | acca687 | 2006-11-08 18:47:54 -0800 | [diff] [blame] | 265 | builtin-blame.o \ |
Lars Hjemli | c31820c | 2006-10-23 23:27:45 +0200 | [diff] [blame] | 266 | builtin-branch.o \ |
Junio C Hamano | f754fa9 | 2006-08-04 01:51:04 -0700 | [diff] [blame] | 267 | builtin-cat-file.o \ |
Junio C Hamano | e414156 | 2006-08-04 01:23:19 -0700 | [diff] [blame] | 268 | builtin-checkout-index.o \ |
Junio C Hamano | f754fa9 | 2006-08-04 01:51:04 -0700 | [diff] [blame] | 269 | builtin-check-ref-format.o \ |
| 270 | builtin-commit-tree.o \ |
| 271 | builtin-count-objects.o \ |
| 272 | builtin-diff.o \ |
| 273 | builtin-diff-files.o \ |
| 274 | builtin-diff-index.o \ |
| 275 | builtin-diff-stages.o \ |
| 276 | builtin-diff-tree.o \ |
| 277 | builtin-fmt-merge-msg.o \ |
Junio C Hamano | 9f613dd | 2006-09-15 13:30:02 -0700 | [diff] [blame] | 278 | builtin-for-each-ref.o \ |
Junio C Hamano | f754fa9 | 2006-08-04 01:51:04 -0700 | [diff] [blame] | 279 | builtin-grep.o \ |
| 280 | builtin-init-db.o \ |
| 281 | builtin-log.o \ |
| 282 | builtin-ls-files.o \ |
| 283 | builtin-ls-tree.o \ |
| 284 | builtin-mailinfo.o \ |
| 285 | builtin-mailsplit.o \ |
Johannes Schindelin | ba1f5f3 | 2006-12-06 16:26:06 +0100 | [diff] [blame] | 286 | builtin-merge-file.o \ |
Junio C Hamano | f754fa9 | 2006-08-04 01:51:04 -0700 | [diff] [blame] | 287 | builtin-mv.o \ |
| 288 | builtin-name-rev.o \ |
| 289 | builtin-pack-objects.o \ |
| 290 | builtin-prune.o \ |
| 291 | builtin-prune-packed.o \ |
| 292 | builtin-push.o \ |
| 293 | builtin-read-tree.o \ |
Junio C Hamano | 4264dc1 | 2006-12-19 00:23:12 -0800 | [diff] [blame] | 294 | builtin-reflog.o \ |
Junio C Hamano | f754fa9 | 2006-08-04 01:51:04 -0700 | [diff] [blame] | 295 | builtin-repo-config.o \ |
Johannes Schindelin | 658f365 | 2006-12-20 17:39:41 +0100 | [diff] [blame] | 296 | builtin-rerere.o \ |
Junio C Hamano | f754fa9 | 2006-08-04 01:51:04 -0700 | [diff] [blame] | 297 | builtin-rev-list.o \ |
| 298 | builtin-rev-parse.o \ |
| 299 | builtin-rm.o \ |
Jeff King | c91f0d9 | 2006-09-08 04:05:34 -0400 | [diff] [blame] | 300 | builtin-runstatus.o \ |
Johannes Schindelin | b8ec592 | 2006-10-22 13:23:31 +0200 | [diff] [blame] | 301 | builtin-shortlog.o \ |
Junio C Hamano | f754fa9 | 2006-08-04 01:51:04 -0700 | [diff] [blame] | 302 | builtin-show-branch.o \ |
| 303 | builtin-stripspace.o \ |
| 304 | builtin-symbolic-ref.o \ |
| 305 | builtin-tar-tree.o \ |
| 306 | builtin-unpack-objects.o \ |
| 307 | builtin-update-index.o \ |
| 308 | builtin-update-ref.o \ |
Franck Bui-Huu | 39345a2 | 2006-09-07 15:12:05 +0200 | [diff] [blame] | 309 | builtin-upload-archive.o \ |
Rene Scharfe | 2e3ed67 | 2006-08-10 17:02:38 +0200 | [diff] [blame] | 310 | builtin-verify-pack.o \ |
Rene Scharfe | e4fbbfe | 2006-08-26 23:19:21 +0200 | [diff] [blame] | 311 | builtin-write-tree.o \ |
Junio C Hamano | eaf12a8 | 2006-09-21 00:40:28 -0700 | [diff] [blame] | 312 | builtin-show-ref.o \ |
Linus Torvalds | e1e22e3 | 2006-09-11 16:37:32 -0700 | [diff] [blame] | 313 | builtin-pack-refs.o |
Linus Torvalds | 70827b1 | 2006-04-21 10:27:34 -0700 | [diff] [blame] | 314 | |
Johannes Schindelin | 54c261f | 2006-03-27 01:14:52 +0200 | [diff] [blame] | 315 | GITLIBS = $(LIB_FILE) $(XDIFF_LIB) |
Petr Baudis | d595a47 | 2006-06-24 18:35:12 -0700 | [diff] [blame] | 316 | EXTLIBS = -lz |
Linus Torvalds | cef661f | 2005-04-21 12:33:22 -0700 | [diff] [blame] | 317 | |
Junio C Hamano | 229a7ed | 2005-09-23 10:41:40 -0700 | [diff] [blame] | 318 | # |
| 319 | # Platform specific tweaks |
| 320 | # |
Junio C Hamano | f7c1534 | 2005-10-09 12:52:35 -0700 | [diff] [blame] | 321 | |
| 322 | # We choose to avoid "if .. else if .. else .. endif endif" |
| 323 | # because maintaining the nesting to match is a pain. If |
| 324 | # we had "elif" things would have been much nicer... |
Junio C Hamano | f7c1534 | 2005-10-09 12:52:35 -0700 | [diff] [blame] | 325 | |
Peter Eriksen | 817151e | 2006-06-24 16:01:25 +0200 | [diff] [blame] | 326 | ifeq ($(uname_S),Linux) |
| 327 | NO_STRLCPY = YesPlease |
| 328 | endif |
Gerrit Pape | ca7a741 | 2006-07-29 16:26:18 +0000 | [diff] [blame] | 329 | ifeq ($(uname_S),GNU/kFreeBSD) |
| 330 | NO_STRLCPY = YesPlease |
| 331 | endif |
Junio C Hamano | f7c1534 | 2005-10-09 12:52:35 -0700 | [diff] [blame] | 332 | ifeq ($(uname_S),Darwin) |
Junio C Hamano | 597c9cc | 2005-09-07 12:22:56 -0700 | [diff] [blame] | 333 | NEEDS_SSL_WITH_CRYPTO = YesPlease |
| 334 | NEEDS_LIBICONV = YesPlease |
Peter Eriksen | 817151e | 2006-06-24 16:01:25 +0200 | [diff] [blame] | 335 | NO_STRLCPY = YesPlease |
Junio C Hamano | 597c9cc | 2005-09-07 12:22:56 -0700 | [diff] [blame] | 336 | endif |
Junio C Hamano | f7c1534 | 2005-10-09 12:52:35 -0700 | [diff] [blame] | 337 | ifeq ($(uname_S),SunOS) |
Patrick Mauritz | f0ebff0 | 2005-09-06 01:24:03 +0200 | [diff] [blame] | 338 | NEEDS_SOCKET = YesPlease |
Junio C Hamano | 5a90d4a | 2005-09-11 22:25:49 -0700 | [diff] [blame] | 339 | NEEDS_NSL = YesPlease |
Junio C Hamano | 229a7ed | 2005-09-23 10:41:40 -0700 | [diff] [blame] | 340 | SHELL_PATH = /bin/bash |
| 341 | NO_STRCASESTR = YesPlease |
Jason Riedy | e40b61f | 2005-12-02 15:08:28 -0800 | [diff] [blame] | 342 | ifeq ($(uname_R),5.8) |
Paul Jakma | e15f545 | 2006-02-20 23:36:28 +0000 | [diff] [blame] | 343 | NEEDS_LIBICONV = YesPlease |
Jason Riedy | 731043f | 2006-01-25 12:38:36 -0800 | [diff] [blame] | 344 | NO_UNSETENV = YesPlease |
Jason Riedy | e40b61f | 2005-12-02 15:08:28 -0800 | [diff] [blame] | 345 | NO_SETENV = YesPlease |
Dennis Stosberg | 66c4509 | 2006-08-15 11:01:22 +0200 | [diff] [blame] | 346 | NO_C99_FORMAT = YesPlease |
Jason Riedy | e40b61f | 2005-12-02 15:08:28 -0800 | [diff] [blame] | 347 | endif |
Dennis Stosberg | 40d88d4 | 2006-04-11 11:42:26 -0700 | [diff] [blame] | 348 | ifeq ($(uname_R),5.9) |
| 349 | NO_UNSETENV = YesPlease |
| 350 | NO_SETENV = YesPlease |
Dennis Stosberg | 66c4509 | 2006-08-15 11:01:22 +0200 | [diff] [blame] | 351 | NO_C99_FORMAT = YesPlease |
Dennis Stosberg | 40d88d4 | 2006-04-11 11:42:26 -0700 | [diff] [blame] | 352 | endif |
Junio C Hamano | 229a7ed | 2005-09-23 10:41:40 -0700 | [diff] [blame] | 353 | INSTALL = ginstall |
| 354 | TAR = gtar |
Petr Baudis | 8d7f586 | 2006-06-25 03:47:03 +0200 | [diff] [blame] | 355 | BASIC_CFLAGS += -D__EXTENSIONS__ |
Patrick Mauritz | f0ebff0 | 2005-09-06 01:24:03 +0200 | [diff] [blame] | 356 | endif |
Junio C Hamano | f7c1534 | 2005-10-09 12:52:35 -0700 | [diff] [blame] | 357 | ifeq ($(uname_O),Cygwin) |
Junio C Hamano | 63be37b | 2006-01-19 17:13:57 -0800 | [diff] [blame] | 358 | NO_D_TYPE_IN_DIRENT = YesPlease |
Junio C Hamano | 35a730f | 2006-01-19 17:13:51 -0800 | [diff] [blame] | 359 | NO_D_INO_IN_DIRENT = YesPlease |
hpa | 1775451 | 2005-09-28 16:37:37 -0700 | [diff] [blame] | 360 | NO_STRCASESTR = YesPlease |
Junio C Hamano | 9f0bb90 | 2006-05-02 00:40:24 -0700 | [diff] [blame] | 361 | NO_SYMLINK_HEAD = YesPlease |
hpa | 1775451 | 2005-09-28 16:37:37 -0700 | [diff] [blame] | 362 | NEEDS_LIBICONV = YesPlease |
Junio C Hamano | 70b9c59 | 2006-08-02 15:44:07 -0700 | [diff] [blame] | 363 | NO_C99_FORMAT = YesPlease |
Shawn O. Pearce | 1510fea | 2006-12-14 06:15:57 -0500 | [diff] [blame] | 364 | NO_FAST_WORKING_DIRECTORY = UnfortunatelyYes |
Junio C Hamano | 2e67a5f | 2005-11-17 11:29:47 -0800 | [diff] [blame] | 365 | # There are conflicting reports about this. |
| 366 | # On some boxes NO_MMAP is needed, and not so elsewhere. |
Junio C Hamano | 87ac139 | 2006-12-27 15:12:31 -0800 | [diff] [blame] | 367 | # Try commenting this out if you suspect MMAP is more efficient |
| 368 | NO_MMAP = YesPlease |
hpa | 49744d6 | 2005-09-28 16:52:21 -0700 | [diff] [blame] | 369 | NO_IPV6 = YesPlease |
Peter Anvin | a23cd8e | 2005-09-28 19:08:37 -0700 | [diff] [blame] | 370 | X = .exe |
Nicolas Pitre | 7c6ef2f | 2005-09-20 12:27:13 -0400 | [diff] [blame] | 371 | endif |
Alecs King | b3bf974 | 2006-01-27 02:04:30 +0800 | [diff] [blame] | 372 | ifeq ($(uname_S),FreeBSD) |
| 373 | NEEDS_LIBICONV = YesPlease |
Petr Baudis | 8d7f586 | 2006-06-25 03:47:03 +0200 | [diff] [blame] | 374 | BASIC_CFLAGS += -I/usr/local/include |
| 375 | BASIC_LDFLAGS += -L/usr/local/lib |
Alecs King | b3bf974 | 2006-01-27 02:04:30 +0800 | [diff] [blame] | 376 | endif |
Junio C Hamano | f7c1534 | 2005-10-09 12:52:35 -0700 | [diff] [blame] | 377 | ifeq ($(uname_S),OpenBSD) |
Junio C Hamano | 5fb41e8 | 2005-10-10 11:51:11 -0700 | [diff] [blame] | 378 | NO_STRCASESTR = YesPlease |
Han Boetes | 18c5a52 | 2005-10-01 08:23:26 +0200 | [diff] [blame] | 379 | NEEDS_LIBICONV = YesPlease |
Petr Baudis | 8d7f586 | 2006-06-25 03:47:03 +0200 | [diff] [blame] | 380 | BASIC_CFLAGS += -I/usr/local/include |
| 381 | BASIC_LDFLAGS += -L/usr/local/lib |
Junio C Hamano | 94d2331 | 2005-11-13 01:46:13 -0800 | [diff] [blame] | 382 | endif |
| 383 | ifeq ($(uname_S),NetBSD) |
Dennis Stosberg | e88856b | 2006-05-11 19:35:31 +0200 | [diff] [blame] | 384 | ifeq ($(shell expr "$(uname_R)" : '[01]\.'),2) |
| 385 | NEEDS_LIBICONV = YesPlease |
| 386 | endif |
Petr Baudis | 8d7f586 | 2006-06-25 03:47:03 +0200 | [diff] [blame] | 387 | BASIC_CFLAGS += -I/usr/pkg/include |
| 388 | BASIC_LDFLAGS += -L/usr/pkg/lib |
| 389 | ALL_LDFLAGS += -Wl,-rpath,/usr/pkg/lib |
Han Boetes | 18c5a52 | 2005-10-01 08:23:26 +0200 | [diff] [blame] | 390 | endif |
Jason Riedy | a6da939 | 2005-12-06 14:20:16 -0800 | [diff] [blame] | 391 | ifeq ($(uname_S),AIX) |
| 392 | NO_STRCASESTR=YesPlease |
Peter Eriksen | 817151e | 2006-06-24 16:01:25 +0200 | [diff] [blame] | 393 | NO_STRLCPY = YesPlease |
Jason Riedy | a6da939 | 2005-12-06 14:20:16 -0800 | [diff] [blame] | 394 | NEEDS_LIBICONV=YesPlease |
| 395 | endif |
Johannes Schindelin | 289c4b3 | 2006-02-17 15:23:41 +0100 | [diff] [blame] | 396 | ifeq ($(uname_S),IRIX64) |
| 397 | NO_IPV6=YesPlease |
| 398 | NO_SETENV=YesPlease |
| 399 | NO_STRCASESTR=YesPlease |
Peter Eriksen | 817151e | 2006-06-24 16:01:25 +0200 | [diff] [blame] | 400 | NO_STRLCPY = YesPlease |
Johannes Schindelin | 289c4b3 | 2006-02-17 15:23:41 +0100 | [diff] [blame] | 401 | NO_SOCKADDR_STORAGE=YesPlease |
| 402 | SHELL_PATH=/usr/gnu/bin/bash |
Petr Baudis | 8d7f586 | 2006-06-25 03:47:03 +0200 | [diff] [blame] | 403 | BASIC_CFLAGS += -DPATH_MAX=1024 |
Johannes Schindelin | 289c4b3 | 2006-02-17 15:23:41 +0100 | [diff] [blame] | 404 | # for now, build 32-bit version |
Petr Baudis | 8d7f586 | 2006-06-25 03:47:03 +0200 | [diff] [blame] | 405 | BASIC_LDFLAGS += -L/usr/lib32 |
Johannes Schindelin | 289c4b3 | 2006-02-17 15:23:41 +0100 | [diff] [blame] | 406 | endif |
Junio C Hamano | f7c1534 | 2005-10-09 12:52:35 -0700 | [diff] [blame] | 407 | ifneq (,$(findstring arm,$(uname_M))) |
| 408 | ARM_SHA1 = YesPlease |
| 409 | endif |
Junio C Hamano | 597c9cc | 2005-09-07 12:22:56 -0700 | [diff] [blame] | 410 | |
Jakub Narebski | 5566771 | 2006-07-03 01:56:48 +0200 | [diff] [blame] | 411 | -include config.mak.autogen |
Johannes Schindelin | f2d6a25 | 2005-10-11 15:22:47 -0700 | [diff] [blame] | 412 | -include config.mak |
Linus Torvalds | cef661f | 2005-04-21 12:33:22 -0700 | [diff] [blame] | 413 | |
Brian Gernhardt | 59f8674 | 2006-12-12 12:01:47 -0500 | [diff] [blame] | 414 | ifeq ($(uname_S),Darwin) |
| 415 | ifndef NO_FINK |
| 416 | ifeq ($(shell test -d /sw/lib && echo y),y) |
| 417 | BASIC_CFLAGS += -I/sw/include |
| 418 | BASIC_LDFLAGS += -L/sw/lib |
| 419 | endif |
| 420 | endif |
| 421 | ifndef NO_DARWIN_PORTS |
| 422 | ifeq ($(shell test -d /opt/local/lib && echo y),y) |
| 423 | BASIC_CFLAGS += -I/opt/local/include |
| 424 | BASIC_LDFLAGS += -L/opt/local/lib |
| 425 | endif |
| 426 | endif |
| 427 | endif |
| 428 | |
Junio C Hamano | bbfc63d | 2006-12-27 14:17:35 -0800 | [diff] [blame^] | 429 | ifdef NO_R_TO_GCC_LINKER |
| 430 | # Some gcc does not accept and pass -R to the linker to specify |
| 431 | # the runtime dynamic library path. |
| 432 | CC_LD_DYNPATH = -Wl,-rpath= |
| 433 | else |
| 434 | CC_LD_DYNPATH = -R |
| 435 | endif |
| 436 | |
Junio C Hamano | 229a7ed | 2005-09-23 10:41:40 -0700 | [diff] [blame] | 437 | ifndef NO_CURL |
| 438 | ifdef CURLDIR |
Junio C Hamano | bbfc63d | 2006-12-27 14:17:35 -0800 | [diff] [blame^] | 439 | # Try "-Wl,-rpath=$(CURLDIR)/lib" in such a case. |
Petr Baudis | 8d7f586 | 2006-06-25 03:47:03 +0200 | [diff] [blame] | 440 | BASIC_CFLAGS += -I$(CURLDIR)/include |
Junio C Hamano | bbfc63d | 2006-12-27 14:17:35 -0800 | [diff] [blame^] | 441 | CURL_LIBCURL = -L$(CURLDIR)/lib $(CC_LD_DYNPATH)$(CURLDIR)/lib -lcurl |
Junio C Hamano | 229a7ed | 2005-09-23 10:41:40 -0700 | [diff] [blame] | 442 | else |
| 443 | CURL_LIBCURL = -lcurl |
| 444 | endif |
H. Peter Anvin | 2f29dd5 | 2005-09-30 10:46:25 -0700 | [diff] [blame] | 445 | PROGRAMS += git-http-fetch$X |
Nick Hengeveld | 0890098 | 2005-11-18 17:08:36 -0800 | [diff] [blame] | 446 | curl_check := $(shell (echo 070908; curl-config --vernum) | sort -r | sed -ne 2p) |
| 447 | ifeq "$(curl_check)" "070908" |
| 448 | ifndef NO_EXPAT |
Nick Hengeveld | 0890098 | 2005-11-18 17:08:36 -0800 | [diff] [blame] | 449 | PROGRAMS += git-http-push$X |
| 450 | endif |
Nick Hengeveld | 58e60dd | 2005-11-02 11:19:24 -0800 | [diff] [blame] | 451 | endif |
Johannes Schindelin | 459a21b | 2006-04-05 16:22:40 +0200 | [diff] [blame] | 452 | ifndef NO_EXPAT |
| 453 | EXPAT_LIBEXPAT = -lexpat |
| 454 | endif |
Junio C Hamano | 229a7ed | 2005-09-23 10:41:40 -0700 | [diff] [blame] | 455 | endif |
| 456 | |
Petr Baudis | dd53c7a | 2005-07-29 17:50:51 +0200 | [diff] [blame] | 457 | ifndef NO_OPENSSL |
Junio C Hamano | 215a7ad | 2005-09-07 17:26:23 -0700 | [diff] [blame] | 458 | OPENSSL_LIBSSL = -lssl |
Junio C Hamano | 455a7f3 | 2005-09-30 13:31:16 -0700 | [diff] [blame] | 459 | ifdef OPENSSLDIR |
Petr Baudis | 8d7f586 | 2006-06-25 03:47:03 +0200 | [diff] [blame] | 460 | BASIC_CFLAGS += -I$(OPENSSLDIR)/include |
Junio C Hamano | bbfc63d | 2006-12-27 14:17:35 -0800 | [diff] [blame^] | 461 | OPENSSL_LINK = -L$(OPENSSLDIR)/lib $(CC_LD_DYNPATH)$(OPENSSLDIR)/lib |
Junio C Hamano | 455a7f3 | 2005-09-30 13:31:16 -0700 | [diff] [blame] | 462 | else |
| 463 | OPENSSL_LINK = |
| 464 | endif |
Petr Baudis | dd53c7a | 2005-07-29 17:50:51 +0200 | [diff] [blame] | 465 | else |
Petr Baudis | 8d7f586 | 2006-06-25 03:47:03 +0200 | [diff] [blame] | 466 | BASIC_CFLAGS += -DNO_OPENSSL |
Junio C Hamano | 215a7ad | 2005-09-07 17:26:23 -0700 | [diff] [blame] | 467 | MOZILLA_SHA1 = 1 |
| 468 | OPENSSL_LIBSSL = |
Petr Baudis | dd53c7a | 2005-07-29 17:50:51 +0200 | [diff] [blame] | 469 | endif |
Junio C Hamano | 597c9cc | 2005-09-07 12:22:56 -0700 | [diff] [blame] | 470 | ifdef NEEDS_SSL_WITH_CRYPTO |
Junio C Hamano | 455a7f3 | 2005-09-30 13:31:16 -0700 | [diff] [blame] | 471 | LIB_4_CRYPTO = $(OPENSSL_LINK) -lcrypto -lssl |
Junio C Hamano | 597c9cc | 2005-09-07 12:22:56 -0700 | [diff] [blame] | 472 | else |
Junio C Hamano | 455a7f3 | 2005-09-30 13:31:16 -0700 | [diff] [blame] | 473 | LIB_4_CRYPTO = $(OPENSSL_LINK) -lcrypto |
Junio C Hamano | 597c9cc | 2005-09-07 12:22:56 -0700 | [diff] [blame] | 474 | endif |
| 475 | ifdef NEEDS_LIBICONV |
Junio C Hamano | 455a7f3 | 2005-09-30 13:31:16 -0700 | [diff] [blame] | 476 | ifdef ICONVDIR |
Petr Baudis | 8d7f586 | 2006-06-25 03:47:03 +0200 | [diff] [blame] | 477 | BASIC_CFLAGS += -I$(ICONVDIR)/include |
Junio C Hamano | bbfc63d | 2006-12-27 14:17:35 -0800 | [diff] [blame^] | 478 | ICONV_LINK = -L$(ICONVDIR)/lib $(CC_LD_DYNPATH)$(ICONVDIR)/lib |
Junio C Hamano | 455a7f3 | 2005-09-30 13:31:16 -0700 | [diff] [blame] | 479 | else |
| 480 | ICONV_LINK = |
| 481 | endif |
Petr Baudis | d595a47 | 2006-06-24 18:35:12 -0700 | [diff] [blame] | 482 | EXTLIBS += $(ICONV_LINK) -liconv |
Junio C Hamano | 597c9cc | 2005-09-07 12:22:56 -0700 | [diff] [blame] | 483 | endif |
Patrick Mauritz | f0ebff0 | 2005-09-06 01:24:03 +0200 | [diff] [blame] | 484 | ifdef NEEDS_SOCKET |
Petr Baudis | d595a47 | 2006-06-24 18:35:12 -0700 | [diff] [blame] | 485 | EXTLIBS += -lsocket |
Patrick Mauritz | f0ebff0 | 2005-09-06 01:24:03 +0200 | [diff] [blame] | 486 | endif |
Junio C Hamano | 5a90d4a | 2005-09-11 22:25:49 -0700 | [diff] [blame] | 487 | ifdef NEEDS_NSL |
Petr Baudis | d595a47 | 2006-06-24 18:35:12 -0700 | [diff] [blame] | 488 | EXTLIBS += -lnsl |
Junio C Hamano | 5a90d4a | 2005-09-11 22:25:49 -0700 | [diff] [blame] | 489 | endif |
Junio C Hamano | 63be37b | 2006-01-19 17:13:57 -0800 | [diff] [blame] | 490 | ifdef NO_D_TYPE_IN_DIRENT |
Petr Baudis | 8d7f586 | 2006-06-25 03:47:03 +0200 | [diff] [blame] | 491 | BASIC_CFLAGS += -DNO_D_TYPE_IN_DIRENT |
Junio C Hamano | 63be37b | 2006-01-19 17:13:57 -0800 | [diff] [blame] | 492 | endif |
Junio C Hamano | 35a730f | 2006-01-19 17:13:51 -0800 | [diff] [blame] | 493 | ifdef NO_D_INO_IN_DIRENT |
Petr Baudis | 8d7f586 | 2006-06-25 03:47:03 +0200 | [diff] [blame] | 494 | BASIC_CFLAGS += -DNO_D_INO_IN_DIRENT |
Junio C Hamano | 35a730f | 2006-01-19 17:13:51 -0800 | [diff] [blame] | 495 | endif |
Ramsay Allan Jones | 579d1fb | 2006-07-30 16:38:28 +0100 | [diff] [blame] | 496 | ifdef NO_C99_FORMAT |
| 497 | ALL_CFLAGS += -DNO_C99_FORMAT |
| 498 | endif |
Junio C Hamano | 9f0bb90 | 2006-05-02 00:40:24 -0700 | [diff] [blame] | 499 | ifdef NO_SYMLINK_HEAD |
Petr Baudis | 8d7f586 | 2006-06-25 03:47:03 +0200 | [diff] [blame] | 500 | BASIC_CFLAGS += -DNO_SYMLINK_HEAD |
Junio C Hamano | 9f0bb90 | 2006-05-02 00:40:24 -0700 | [diff] [blame] | 501 | endif |
Linus Torvalds | ef34af2 | 2005-09-18 18:30:50 -0700 | [diff] [blame] | 502 | ifdef NO_STRCASESTR |
Junio C Hamano | 4050c0d | 2005-12-05 11:54:29 -0800 | [diff] [blame] | 503 | COMPAT_CFLAGS += -DNO_STRCASESTR |
Jason Riedy | e40b61f | 2005-12-02 15:08:28 -0800 | [diff] [blame] | 504 | COMPAT_OBJS += compat/strcasestr.o |
| 505 | endif |
Peter Eriksen | 817151e | 2006-06-24 16:01:25 +0200 | [diff] [blame] | 506 | ifdef NO_STRLCPY |
| 507 | COMPAT_CFLAGS += -DNO_STRLCPY |
| 508 | COMPAT_OBJS += compat/strlcpy.o |
| 509 | endif |
Jason Riedy | e40b61f | 2005-12-02 15:08:28 -0800 | [diff] [blame] | 510 | ifdef NO_SETENV |
Junio C Hamano | 4050c0d | 2005-12-05 11:54:29 -0800 | [diff] [blame] | 511 | COMPAT_CFLAGS += -DNO_SETENV |
Jason Riedy | e40b61f | 2005-12-02 15:08:28 -0800 | [diff] [blame] | 512 | COMPAT_OBJS += compat/setenv.o |
Linus Torvalds | ef34af2 | 2005-09-18 18:30:50 -0700 | [diff] [blame] | 513 | endif |
Johannes Schindelin | 104ff34 | 2006-08-29 12:51:14 +0200 | [diff] [blame] | 514 | ifdef NO_UNSETENV |
Jason Riedy | 731043f | 2006-01-25 12:38:36 -0800 | [diff] [blame] | 515 | COMPAT_CFLAGS += -DNO_UNSETENV |
| 516 | COMPAT_OBJS += compat/unsetenv.o |
| 517 | endif |
Johannes Schindelin | 730d48a | 2005-10-08 15:54:36 -0700 | [diff] [blame] | 518 | ifdef NO_MMAP |
Junio C Hamano | 4050c0d | 2005-12-05 11:54:29 -0800 | [diff] [blame] | 519 | COMPAT_CFLAGS += -DNO_MMAP |
Jason Riedy | e40b61f | 2005-12-02 15:08:28 -0800 | [diff] [blame] | 520 | COMPAT_OBJS += compat/mmap.o |
Johannes Schindelin | 730d48a | 2005-10-08 15:54:36 -0700 | [diff] [blame] | 521 | endif |
Shawn O. Pearce | 1510fea | 2006-12-14 06:15:57 -0500 | [diff] [blame] | 522 | ifdef NO_FAST_WORKING_DIRECTORY |
| 523 | BASIC_CFLAGS += -DNO_FAST_WORKING_DIRECTORY |
| 524 | endif |
hpa | 49744d6 | 2005-09-28 16:52:21 -0700 | [diff] [blame] | 525 | ifdef NO_IPV6 |
Petr Baudis | 8d7f586 | 2006-06-25 03:47:03 +0200 | [diff] [blame] | 526 | BASIC_CFLAGS += -DNO_IPV6 |
Junio C Hamano | bdc37f5 | 2006-01-19 17:13:32 -0800 | [diff] [blame] | 527 | endif |
| 528 | ifdef NO_SOCKADDR_STORAGE |
| 529 | ifdef NO_IPV6 |
Petr Baudis | 8d7f586 | 2006-06-25 03:47:03 +0200 | [diff] [blame] | 530 | BASIC_CFLAGS += -Dsockaddr_storage=sockaddr_in |
Junio C Hamano | bdc37f5 | 2006-01-19 17:13:32 -0800 | [diff] [blame] | 531 | else |
Petr Baudis | 8d7f586 | 2006-06-25 03:47:03 +0200 | [diff] [blame] | 532 | BASIC_CFLAGS += -Dsockaddr_storage=sockaddr_in6 |
Junio C Hamano | bdc37f5 | 2006-01-19 17:13:32 -0800 | [diff] [blame] | 533 | endif |
hpa | 49744d6 | 2005-09-28 16:52:21 -0700 | [diff] [blame] | 534 | endif |
Yakov Lerner | 6ba68ab | 2006-05-22 00:37:00 +0300 | [diff] [blame] | 535 | ifdef NO_INET_NTOP |
| 536 | LIB_OBJS += compat/inet_ntop.o |
| 537 | endif |
Jon Loeliger | dd46762 | 2006-09-26 09:47:43 -0500 | [diff] [blame] | 538 | ifdef NO_INET_PTON |
| 539 | LIB_OBJS += compat/inet_pton.o |
| 540 | endif |
Linus Torvalds | cef661f | 2005-04-21 12:33:22 -0700 | [diff] [blame] | 541 | |
Fernando J. Pereda | b6e56ec | 2006-02-16 09:38:01 +0100 | [diff] [blame] | 542 | ifdef NO_ICONV |
Petr Baudis | 8d7f586 | 2006-06-25 03:47:03 +0200 | [diff] [blame] | 543 | BASIC_CFLAGS += -DNO_ICONV |
Fernando J. Pereda | b6e56ec | 2006-02-16 09:38:01 +0100 | [diff] [blame] | 544 | endif |
| 545 | |
Nicolas Pitre | 7c6ef2f | 2005-09-20 12:27:13 -0400 | [diff] [blame] | 546 | ifdef PPC_SHA1 |
| 547 | SHA1_HEADER = "ppc/sha1.h" |
| 548 | LIB_OBJS += ppc/sha1.o ppc/sha1ppc.o |
| 549 | else |
| 550 | ifdef ARM_SHA1 |
| 551 | SHA1_HEADER = "arm/sha1.h" |
| 552 | LIB_OBJS += arm/sha1.o arm/sha1_arm.o |
| 553 | else |
| 554 | ifdef MOZILLA_SHA1 |
| 555 | SHA1_HEADER = "mozilla-sha1/sha1.h" |
| 556 | LIB_OBJS += mozilla-sha1/sha1.o |
| 557 | else |
| 558 | SHA1_HEADER = <openssl/sha.h> |
Petr Baudis | d595a47 | 2006-06-24 18:35:12 -0700 | [diff] [blame] | 559 | EXTLIBS += $(LIB_4_CRYPTO) |
Nicolas Pitre | 7c6ef2f | 2005-09-20 12:27:13 -0400 | [diff] [blame] | 560 | endif |
| 561 | endif |
| 562 | endif |
Alex Riesen | f848718 | 2006-12-04 10:50:04 +0100 | [diff] [blame] | 563 | ifdef NO_PERL_MAKEMAKER |
| 564 | export NO_PERL_MAKEMAKER |
| 565 | endif |
Nicolas Pitre | 7c6ef2f | 2005-09-20 12:27:13 -0400 | [diff] [blame] | 566 | |
Pavel Roskin | addf88e | 2006-07-09 03:44:30 -0400 | [diff] [blame] | 567 | # Shell quote (do not use $(call) to accommodate ancient setups); |
Johannes Schindelin | 39c015c | 2006-02-18 12:40:22 +0100 | [diff] [blame] | 568 | |
| 569 | SHA1_HEADER_SQ = $(subst ','\'',$(SHA1_HEADER)) |
| 570 | |
| 571 | DESTDIR_SQ = $(subst ','\'',$(DESTDIR)) |
| 572 | bindir_SQ = $(subst ','\'',$(bindir)) |
| 573 | gitexecdir_SQ = $(subst ','\'',$(gitexecdir)) |
| 574 | template_dir_SQ = $(subst ','\'',$(template_dir)) |
Yakov Lerner | ca3bcab | 2006-06-15 01:36:00 +0300 | [diff] [blame] | 575 | prefix_SQ = $(subst ','\'',$(prefix)) |
Johannes Schindelin | 39c015c | 2006-02-18 12:40:22 +0100 | [diff] [blame] | 576 | |
| 577 | SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH)) |
| 578 | PERL_PATH_SQ = $(subst ','\'',$(PERL_PATH)) |
Johannes Schindelin | 39c015c | 2006-02-18 12:40:22 +0100 | [diff] [blame] | 579 | |
Petr Baudis | d595a47 | 2006-06-24 18:35:12 -0700 | [diff] [blame] | 580 | LIBS = $(GITLIBS) $(EXTLIBS) |
| 581 | |
Petr Baudis | 8d7f586 | 2006-06-25 03:47:03 +0200 | [diff] [blame] | 582 | BASIC_CFLAGS += -DSHA1_HEADER='$(SHA1_HEADER_SQ)' $(COMPAT_CFLAGS) |
Jason Riedy | e40b61f | 2005-12-02 15:08:28 -0800 | [diff] [blame] | 583 | LIB_OBJS += $(COMPAT_OBJS) |
Petr Baudis | 8d7f586 | 2006-06-25 03:47:03 +0200 | [diff] [blame] | 584 | |
| 585 | ALL_CFLAGS += $(BASIC_CFLAGS) |
| 586 | ALL_LDFLAGS += $(BASIC_LDFLAGS) |
| 587 | |
Tom Prince | ec2d151 | 2005-10-11 18:47:33 -0700 | [diff] [blame] | 588 | export prefix TAR INSTALL DESTDIR SHELL_PATH template_dir |
Petr Baudis | d595a47 | 2006-06-24 18:35:12 -0700 | [diff] [blame] | 589 | |
| 590 | |
Petr Baudis | 28818ff | 2005-07-29 17:50:24 +0200 | [diff] [blame] | 591 | ### Build rules |
Linus Torvalds | 8996702 | 2005-04-30 13:19:56 -0700 | [diff] [blame] | 592 | |
Junio C Hamano | 7c2738c | 2006-10-01 21:41:46 -0700 | [diff] [blame] | 593 | all: $(ALL_PROGRAMS) $(BUILT_INS) git$X gitk gitweb/gitweb.cgi |
Petr Baudis | 28818ff | 2005-07-29 17:50:24 +0200 | [diff] [blame] | 594 | |
Alex Riesen | f848718 | 2006-12-04 10:50:04 +0100 | [diff] [blame] | 595 | all: |
| 596 | $(MAKE) -C perl PERL_PATH='$(PERL_PATH_SQ)' prefix='$(prefix_SQ)' all |
Junio C Hamano | d3af621 | 2005-08-06 12:50:14 -0700 | [diff] [blame] | 597 | $(MAKE) -C templates |
Nicolas Pitre | a310d43 | 2005-05-19 10:27:14 -0400 | [diff] [blame] | 598 | |
Junio C Hamano | 4dc0002 | 2006-01-12 21:42:25 -0800 | [diff] [blame] | 599 | strip: $(PROGRAMS) git$X |
| 600 | $(STRIP) $(STRIP_OPTS) $(PROGRAMS) git$X |
| 601 | |
Yakov Lerner | ca3bcab | 2006-06-15 01:36:00 +0300 | [diff] [blame] | 602 | git$X: git.c common-cmds.h $(BUILTIN_OBJS) $(GITLIBS) GIT-CFLAGS |
Michal Ostrowski | 77cb17e | 2006-01-10 21:12:17 -0500 | [diff] [blame] | 603 | $(CC) -DGIT_VERSION='"$(GIT_VERSION)"' \ |
Junio C Hamano | 8eef8e0 | 2006-03-31 16:23:46 -0800 | [diff] [blame] | 604 | $(ALL_CFLAGS) -o $@ $(filter %.c,$^) \ |
Linus Torvalds | 70827b1 | 2006-04-21 10:27:34 -0700 | [diff] [blame] | 605 | $(BUILTIN_OBJS) $(ALL_LDFLAGS) $(LIBS) |
Junio C Hamano | 6a2e50f | 2005-09-07 21:26:52 -0700 | [diff] [blame] | 606 | |
Junio C Hamano | f754fa9 | 2006-08-04 01:51:04 -0700 | [diff] [blame] | 607 | help.o: common-cmds.h |
Junio C Hamano | 08df617 | 2006-04-21 21:56:13 -0700 | [diff] [blame] | 608 | |
Junio C Hamano | a06f678 | 2006-09-24 19:49:47 -0700 | [diff] [blame] | 609 | git-merge-recur$X: git-merge-recursive$X |
| 610 | rm -f $@ && ln git-merge-recursive$X $@ |
| 611 | |
Junio C Hamano | 9173080 | 2006-04-10 17:37:58 -0700 | [diff] [blame] | 612 | $(BUILT_INS): git$X |
| 613 | rm -f $@ && ln git$X $@ |
| 614 | |
Fredrik Kuivinen | a87cd02 | 2006-03-09 17:24:19 +0100 | [diff] [blame] | 615 | common-cmds.h: Documentation/git-*.txt |
Jim Meyering | fc36f6a | 2006-05-25 18:52:01 +0200 | [diff] [blame] | 616 | ./generate-cmdlist.sh > $@+ |
| 617 | mv $@+ $@ |
Fredrik Kuivinen | a87cd02 | 2006-03-09 17:24:19 +0100 | [diff] [blame] | 618 | |
Andreas Ericsson | d6ebd25 | 2005-11-22 00:44:15 +0100 | [diff] [blame] | 619 | $(patsubst %.sh,%,$(SCRIPT_SH)) : % : %.sh |
Jim Meyering | fc36f6a | 2006-05-25 18:52:01 +0200 | [diff] [blame] | 620 | rm -f $@ $@+ |
Johannes Schindelin | 39c015c | 2006-02-18 12:40:22 +0100 | [diff] [blame] | 621 | sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \ |
Michal Rokos | d9bffc0 | 2006-07-08 17:32:04 +0200 | [diff] [blame] | 622 | -e 's|@@PERL@@|$(PERL_PATH_SQ)|g' \ |
Junio C Hamano | 3ff8cbe | 2005-10-04 12:41:35 -0700 | [diff] [blame] | 623 | -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \ |
Fernando J. Pereda | 6c5c62f | 2006-02-15 12:37:30 +0100 | [diff] [blame] | 624 | -e 's/@@NO_CURL@@/$(NO_CURL)/g' \ |
Jim Meyering | fc36f6a | 2006-05-25 18:52:01 +0200 | [diff] [blame] | 625 | $@.sh >$@+ |
| 626 | chmod +x $@+ |
| 627 | mv $@+ $@ |
Junio C Hamano | bc6146d | 2005-09-08 18:50:33 -0700 | [diff] [blame] | 628 | |
Alex Riesen | f848718 | 2006-12-04 10:50:04 +0100 | [diff] [blame] | 629 | $(patsubst %.perl,%,$(SCRIPT_PERL)): perl/perl.mak |
| 630 | |
| 631 | perl/perl.mak: GIT-CFLAGS |
| 632 | $(MAKE) -C perl PERL_PATH='$(PERL_PATH_SQ)' prefix='$(prefix_SQ)' $(@F) |
| 633 | |
Junio C Hamano | f6276fe | 2006-06-24 19:41:03 -0700 | [diff] [blame] | 634 | $(patsubst %.perl,%,$(SCRIPT_PERL)): % : %.perl |
Jim Meyering | fc36f6a | 2006-05-25 18:52:01 +0200 | [diff] [blame] | 635 | rm -f $@ $@+ |
Junio C Hamano | 893973a | 2006-06-29 17:02:21 -0700 | [diff] [blame] | 636 | INSTLIBDIR=`$(MAKE) -C perl -s --no-print-directory instlibdir` && \ |
Junio C Hamano | 998c4da | 2006-07-07 13:04:35 -0700 | [diff] [blame] | 637 | sed -e '1{' \ |
| 638 | -e ' s|#!.*perl|#!$(PERL_PATH_SQ)|' \ |
| 639 | -e ' h' \ |
| 640 | -e ' s=.*=use lib (split(/:/, $$ENV{GITPERLLIB} || "@@INSTLIBDIR@@"));=' \ |
| 641 | -e ' H' \ |
| 642 | -e ' x' \ |
| 643 | -e '}' \ |
Junio C Hamano | f6276fe | 2006-06-24 19:41:03 -0700 | [diff] [blame] | 644 | -e 's|@@INSTLIBDIR@@|'"$$INSTLIBDIR"'|g' \ |
Junio C Hamano | 3ff8cbe | 2005-10-04 12:41:35 -0700 | [diff] [blame] | 645 | -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \ |
Jim Meyering | fc36f6a | 2006-05-25 18:52:01 +0200 | [diff] [blame] | 646 | $@.perl >$@+ |
| 647 | chmod +x $@+ |
| 648 | mv $@+ $@ |
Junio C Hamano | bc6146d | 2005-09-08 18:50:33 -0700 | [diff] [blame] | 649 | |
Johannes Schindelin | 4eba0f3 | 2005-10-20 17:13:24 +0200 | [diff] [blame] | 650 | git-cherry-pick: git-revert |
Jim Meyering | fc36f6a | 2006-05-25 18:52:01 +0200 | [diff] [blame] | 651 | cp $< $@+ |
| 652 | mv $@+ $@ |
Johannes Schindelin | 4eba0f3 | 2005-10-20 17:13:24 +0200 | [diff] [blame] | 653 | |
Junio C Hamano | cf7bb58 | 2006-02-10 00:45:59 -0800 | [diff] [blame] | 654 | git-status: git-commit |
Jim Meyering | fc36f6a | 2006-05-25 18:52:01 +0200 | [diff] [blame] | 655 | cp $< $@+ |
| 656 | mv $@+ $@ |
Junio C Hamano | cf7bb58 | 2006-02-10 00:45:59 -0800 | [diff] [blame] | 657 | |
Martin Waitz | 5d043a3 | 2006-08-01 21:34:08 +0200 | [diff] [blame] | 658 | gitweb/gitweb.cgi: gitweb/gitweb.perl |
| 659 | rm -f $@ $@+ |
| 660 | sed -e '1s|#!.*perl|#!$(PERL_PATH_SQ)|' \ |
Junio C Hamano | 06c084d | 2006-08-02 13:50:20 -0700 | [diff] [blame] | 661 | -e 's|++GIT_VERSION++|$(GIT_VERSION)|g' \ |
| 662 | -e 's|++GIT_BINDIR++|$(bindir)|g' \ |
| 663 | -e 's|++GITWEB_CONFIG++|$(GITWEB_CONFIG)|g' \ |
Yasushi SHOJI | 2de21fa | 2006-08-15 07:50:49 +0900 | [diff] [blame] | 664 | -e 's|++GITWEB_HOME_LINK_STR++|$(GITWEB_HOME_LINK_STR)|g' \ |
Junio C Hamano | 06c084d | 2006-08-02 13:50:20 -0700 | [diff] [blame] | 665 | -e 's|++GITWEB_SITENAME++|$(GITWEB_SITENAME)|g' \ |
| 666 | -e 's|++GITWEB_PROJECTROOT++|$(GITWEB_PROJECTROOT)|g' \ |
Matthias Lederhofer | 32f4aac | 2006-09-17 00:31:01 +0200 | [diff] [blame] | 667 | -e 's|++GITWEB_EXPORT_OK++|$(GITWEB_EXPORT_OK)|g' \ |
| 668 | -e 's|++GITWEB_STRICT_EXPORT++|$(GITWEB_STRICT_EXPORT)|g' \ |
Jakub Narebski | 19a8721 | 2006-08-15 23:03:17 +0200 | [diff] [blame] | 669 | -e 's|++GITWEB_BASE_URL++|$(GITWEB_BASE_URL)|g' \ |
Junio C Hamano | 06c084d | 2006-08-02 13:50:20 -0700 | [diff] [blame] | 670 | -e 's|++GITWEB_LIST++|$(GITWEB_LIST)|g' \ |
| 671 | -e 's|++GITWEB_HOMETEXT++|$(GITWEB_HOMETEXT)|g' \ |
| 672 | -e 's|++GITWEB_CSS++|$(GITWEB_CSS)|g' \ |
| 673 | -e 's|++GITWEB_LOGO++|$(GITWEB_LOGO)|g' \ |
Jakub Narebski | 0b5deba | 2006-09-04 20:32:13 +0200 | [diff] [blame] | 674 | -e 's|++GITWEB_FAVICON++|$(GITWEB_FAVICON)|g' \ |
Alan Chandler | b2d3476 | 2006-10-03 13:49:03 +0100 | [diff] [blame] | 675 | -e 's|++GITWEB_SITE_HEADER++|$(GITWEB_SITE_HEADER)|g' \ |
| 676 | -e 's|++GITWEB_SITE_FOOTER++|$(GITWEB_SITE_FOOTER)|g' \ |
Martin Waitz | 5d043a3 | 2006-08-01 21:34:08 +0200 | [diff] [blame] | 677 | $< >$@+ |
| 678 | chmod +x $@+ |
| 679 | mv $@+ $@ |
| 680 | |
Eric Wong | a51d37c | 2006-07-01 15:14:14 -0700 | [diff] [blame] | 681 | git-instaweb: git-instaweb.sh gitweb/gitweb.cgi gitweb/gitweb.css |
| 682 | rm -f $@ $@+ |
| 683 | sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \ |
| 684 | -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \ |
| 685 | -e 's/@@NO_CURL@@/$(NO_CURL)/g' \ |
Michal Rokos | 6e959ab | 2006-07-08 17:27:10 +0200 | [diff] [blame] | 686 | -e '/@@GITWEB_CGI@@/r gitweb/gitweb.cgi' \ |
Johannes Schindelin | 0700228 | 2006-07-02 11:31:30 +0200 | [diff] [blame] | 687 | -e '/@@GITWEB_CGI@@/d' \ |
Michal Rokos | 6e959ab | 2006-07-08 17:27:10 +0200 | [diff] [blame] | 688 | -e '/@@GITWEB_CSS@@/r gitweb/gitweb.css' \ |
Johannes Schindelin | 0700228 | 2006-07-02 11:31:30 +0200 | [diff] [blame] | 689 | -e '/@@GITWEB_CSS@@/d' \ |
Martin Waitz | 5d043a3 | 2006-08-01 21:34:08 +0200 | [diff] [blame] | 690 | $@.sh > $@+ |
Eric Wong | a51d37c | 2006-07-01 15:14:14 -0700 | [diff] [blame] | 691 | chmod +x $@+ |
| 692 | mv $@+ $@ |
| 693 | |
Jakub Narebski | 3900145 | 2006-08-08 18:35:23 +0200 | [diff] [blame] | 694 | configure: configure.ac |
| 695 | rm -f $@ $<+ |
| 696 | sed -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \ |
| 697 | $< > $<+ |
| 698 | autoconf -o $@ $<+ |
| 699 | rm -f $<+ |
| 700 | |
Junio C Hamano | 9b88fce | 2005-12-27 14:40:17 -0800 | [diff] [blame] | 701 | # These can record GIT_VERSION |
| 702 | git$X git.spec \ |
| 703 | $(patsubst %.sh,%,$(SCRIPT_SH)) \ |
| 704 | $(patsubst %.perl,%,$(SCRIPT_PERL)) \ |
Junio C Hamano | 9b88fce | 2005-12-27 14:40:17 -0800 | [diff] [blame] | 705 | : GIT-VERSION-FILE |
Johannes Schindelin | e99fcf9 | 2005-12-22 20:38:23 +0100 | [diff] [blame] | 706 | |
Yakov Lerner | ca3bcab | 2006-06-15 01:36:00 +0300 | [diff] [blame] | 707 | %.o: %.c GIT-CFLAGS |
Pavel Roskin | b05701c | 2005-08-06 01:36:15 -0400 | [diff] [blame] | 708 | $(CC) -o $*.o -c $(ALL_CFLAGS) $< |
| 709 | %.o: %.S |
| 710 | $(CC) -o $*.o -c $(ALL_CFLAGS) $< |
| 711 | |
Yakov Lerner | ca3bcab | 2006-06-15 01:36:00 +0300 | [diff] [blame] | 712 | exec_cmd.o: exec_cmd.c GIT-CFLAGS |
Johannes Schindelin | 39c015c | 2006-02-18 12:40:22 +0100 | [diff] [blame] | 713 | $(CC) -o $*.o -c $(ALL_CFLAGS) '-DGIT_EXEC_PATH="$(gitexecdir_SQ)"' $< |
Yakov Lerner | c1f8064 | 2006-06-22 04:47:00 +0300 | [diff] [blame] | 714 | builtin-init-db.o: builtin-init-db.c GIT-CFLAGS |
| 715 | $(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] | 716 | |
Yakov Lerner | ca3bcab | 2006-06-15 01:36:00 +0300 | [diff] [blame] | 717 | http.o: http.c GIT-CFLAGS |
Nick Hengeveld | 20fc9bc | 2006-04-04 10:11:29 -0700 | [diff] [blame] | 718 | $(CC) -o $*.o -c $(ALL_CFLAGS) -DGIT_USER_AGENT='"git/$(GIT_VERSION)"' $< |
| 719 | |
Nick Hengeveld | 8d9fbe5 | 2006-04-04 05:33:18 -0700 | [diff] [blame] | 720 | ifdef NO_EXPAT |
Yakov Lerner | ca3bcab | 2006-06-15 01:36:00 +0300 | [diff] [blame] | 721 | http-fetch.o: http-fetch.c http.h GIT-CFLAGS |
Nick Hengeveld | 8d9fbe5 | 2006-04-04 05:33:18 -0700 | [diff] [blame] | 722 | $(CC) -o $*.o -c $(ALL_CFLAGS) -DNO_EXPAT $< |
| 723 | endif |
| 724 | |
Junio C Hamano | 8eef8e0 | 2006-03-31 16:23:46 -0800 | [diff] [blame] | 725 | git-%$X: %.o $(GITLIBS) |
Junio C Hamano | 94d2331 | 2005-11-13 01:46:13 -0800 | [diff] [blame] | 726 | $(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS) |
Daniel Barkalow | 6eb7ed5 | 2005-04-23 18:47:23 -0700 | [diff] [blame] | 727 | |
Johannes Schindelin | 2941cab | 2006-07-28 11:17:46 +0200 | [diff] [blame] | 728 | ssh-pull.o: ssh-fetch.c |
| 729 | ssh-push.o: ssh-upload.c |
H. Peter Anvin | 2f29dd5 | 2005-09-30 10:46:25 -0700 | [diff] [blame] | 730 | git-local-fetch$X: fetch.o |
| 731 | git-ssh-fetch$X: rsh.o fetch.o |
| 732 | git-ssh-upload$X: rsh.o |
| 733 | git-ssh-pull$X: rsh.o fetch.o |
| 734 | git-ssh-push$X: rsh.o |
Daniel Barkalow | 6eb7ed5 | 2005-04-23 18:47:23 -0700 | [diff] [blame] | 735 | |
Mike McCormack | f2561fd | 2006-03-10 14:32:50 +0900 | [diff] [blame] | 736 | git-imap-send$X: imap-send.o $(LIB_FILE) |
| 737 | |
Junio C Hamano | dd8239f | 2006-06-06 14:26:57 -0700 | [diff] [blame] | 738 | http.o http-fetch.o http-push.o: http.h |
Junio C Hamano | 8fced61 | 2006-07-03 00:53:13 -0700 | [diff] [blame] | 739 | git-http-fetch$X: fetch.o http.o http-fetch.o $(GITLIBS) |
Johannes Schindelin | 39c015c | 2006-02-18 12:40:22 +0100 | [diff] [blame] | 740 | $(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \ |
Nick Hengeveld | 8d9fbe5 | 2006-04-04 05:33:18 -0700 | [diff] [blame] | 741 | $(LIBS) $(CURL_LIBCURL) $(EXPAT_LIBEXPAT) |
Johannes Schindelin | 39c015c | 2006-02-18 12:40:22 +0100 | [diff] [blame] | 742 | |
Junio C Hamano | 8fced61 | 2006-07-03 00:53:13 -0700 | [diff] [blame] | 743 | git-http-push$X: revision.o http.o http-push.o $(GITLIBS) |
Johannes Schindelin | 39c015c | 2006-02-18 12:40:22 +0100 | [diff] [blame] | 744 | $(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \ |
| 745 | $(LIBS) $(CURL_LIBCURL) $(EXPAT_LIBEXPAT) |
| 746 | |
Linus Torvalds | 70827b1 | 2006-04-21 10:27:34 -0700 | [diff] [blame] | 747 | $(LIB_OBJS) $(BUILTIN_OBJS): $(LIB_H) |
Junio C Hamano | 1f33026 | 2006-06-22 15:43:47 -0700 | [diff] [blame] | 748 | $(patsubst git-%$X,%.o,$(PROGRAMS)): $(LIB_H) $(wildcard */*.h) |
Petr Baudis | e468305 | 2005-07-29 17:48:50 +0200 | [diff] [blame] | 749 | $(DIFF_OBJS): diffcore.h |
Linus Torvalds | e83c516 | 2005-04-07 15:13:13 -0700 | [diff] [blame] | 750 | |
Petr Baudis | 28818ff | 2005-07-29 17:50:24 +0200 | [diff] [blame] | 751 | $(LIB_FILE): $(LIB_OBJS) |
Junio C Hamano | 71459c1 | 2006-04-25 23:11:17 -0700 | [diff] [blame] | 752 | rm -f $@ && $(AR) rcs $@ $(LIB_OBJS) |
Petr Baudis | 28818ff | 2005-07-29 17:50:24 +0200 | [diff] [blame] | 753 | |
Johannes Schindelin | 857b933 | 2006-11-21 23:24:34 +0100 | [diff] [blame] | 754 | XDIFF_OBJS=xdiff/xdiffi.o xdiff/xprepare.o xdiff/xutils.o xdiff/xemit.o \ |
| 755 | xdiff/xmerge.o |
Andy Whitcroft | 17b96be | 2006-10-17 19:08:08 +0100 | [diff] [blame] | 756 | $(XDIFF_OBJS): xdiff/xinclude.h xdiff/xmacros.h xdiff/xdiff.h xdiff/xtypes.h \ |
| 757 | xdiff/xutils.h xdiff/xprepare.h xdiff/xdiffi.h xdiff/xemit.h |
Linus Torvalds | 3443546 | 2006-03-24 20:13:22 -0800 | [diff] [blame] | 758 | |
| 759 | $(XDIFF_LIB): $(XDIFF_OBJS) |
Junio C Hamano | 2d86d2c | 2006-04-26 03:12:58 -0700 | [diff] [blame] | 760 | rm -f $@ && $(AR) rcs $@ $(XDIFF_OBJS) |
Linus Torvalds | 3443546 | 2006-03-24 20:13:22 -0800 | [diff] [blame] | 761 | |
| 762 | |
Petr Baudis | d595a47 | 2006-06-24 18:35:12 -0700 | [diff] [blame] | 763 | perl/Makefile: perl/Git.pm perl/Makefile.PL GIT-CFLAGS |
Petr Baudis | 63df97a | 2006-06-24 04:34:36 +0200 | [diff] [blame] | 764 | (cd perl && $(PERL_PATH) Makefile.PL \ |
Petr Baudis | 18b0fc1 | 2006-09-23 20:20:47 +0200 | [diff] [blame] | 765 | PREFIX='$(prefix_SQ)') |
Petr Baudis | b1edc53 | 2006-06-24 04:34:29 +0200 | [diff] [blame] | 766 | |
Petr Baudis | 28818ff | 2005-07-29 17:50:24 +0200 | [diff] [blame] | 767 | doc: |
| 768 | $(MAKE) -C Documentation all |
| 769 | |
Fredrik Kuivinen | f81e7c6 | 2006-03-18 11:07:12 +0100 | [diff] [blame] | 770 | TAGS: |
| 771 | rm -f TAGS |
| 772 | find . -name '*.[hcS]' -print | xargs etags -a |
| 773 | |
| 774 | tags: |
| 775 | rm -f tags |
| 776 | find . -name '*.[hcS]' -print | xargs ctags -a |
Petr Baudis | 28818ff | 2005-07-29 17:50:24 +0200 | [diff] [blame] | 777 | |
Yakov Lerner | ca3bcab | 2006-06-15 01:36:00 +0300 | [diff] [blame] | 778 | ### Detect prefix changes |
Junio C Hamano | 7cdbff1 | 2006-11-20 00:49:31 -0800 | [diff] [blame] | 779 | TRACK_CFLAGS = $(subst ','\'',$(ALL_CFLAGS)):\ |
Yakov Lerner | ca3bcab | 2006-06-15 01:36:00 +0300 | [diff] [blame] | 780 | $(bindir_SQ):$(gitexecdir_SQ):$(template_dir_SQ):$(prefix_SQ) |
| 781 | |
| 782 | GIT-CFLAGS: .FORCE-GIT-CFLAGS |
| 783 | @FLAGS='$(TRACK_CFLAGS)'; \ |
| 784 | if test x"$$FLAGS" != x"`cat GIT-CFLAGS 2>/dev/null`" ; then \ |
| 785 | echo 1>&2 " * new build flags or prefix"; \ |
| 786 | echo "$$FLAGS" >GIT-CFLAGS; \ |
| 787 | fi |
| 788 | |
Petr Baudis | 28818ff | 2005-07-29 17:50:24 +0200 | [diff] [blame] | 789 | ### Testing rules |
| 790 | |
Johannes Schindelin | abb7c7b | 2006-02-18 13:01:18 +0100 | [diff] [blame] | 791 | # GNU make supports exporting all variables by "export" without parameters. |
| 792 | # However, the environment gets quite big, and some programs have problems |
| 793 | # with that. |
| 794 | |
Johannes Schindelin | 140245b | 2006-07-07 13:26:31 +0200 | [diff] [blame] | 795 | export NO_SVN_TESTS |
Johannes Schindelin | abb7c7b | 2006-02-18 13:01:18 +0100 | [diff] [blame] | 796 | |
Petr Baudis | 28818ff | 2005-07-29 17:50:24 +0200 | [diff] [blame] | 797 | test: all |
| 798 | $(MAKE) -C t/ all |
| 799 | |
Junio C Hamano | 4ccafd7 | 2005-11-02 12:01:06 -0800 | [diff] [blame] | 800 | test-date$X: test-date.c date.o ctype.o |
Junio C Hamano | 94d2331 | 2005-11-13 01:46:13 -0800 | [diff] [blame] | 801 | $(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) test-date.c date.o ctype.o |
Petr Baudis | 28818ff | 2005-07-29 17:50:24 +0200 | [diff] [blame] | 802 | |
Nicolas Pitre | 57b7315 | 2006-12-18 16:06:50 -0500 | [diff] [blame] | 803 | test-delta$X: test-delta.o diff-delta.o patch-delta.o $(GITLIBS) |
| 804 | $(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS) |
Petr Baudis | 28818ff | 2005-07-29 17:50:24 +0200 | [diff] [blame] | 805 | |
Junio C Hamano | 1744820 | 2006-04-23 20:20:25 -0700 | [diff] [blame] | 806 | test-dump-cache-tree$X: dump-cache-tree.o $(GITLIBS) |
| 807 | $(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS) |
| 808 | |
Junio C Hamano | b65bc21 | 2006-06-24 00:59:49 -0700 | [diff] [blame] | 809 | test-sha1$X: test-sha1.o $(GITLIBS) |
| 810 | $(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS) |
| 811 | |
| 812 | check-sha1:: test-sha1$X |
| 813 | ./test-sha1.sh |
| 814 | |
Petr Baudis | 28818ff | 2005-07-29 17:50:24 +0200 | [diff] [blame] | 815 | check: |
Junio C Hamano | 773b633 | 2005-12-14 13:32:52 -0800 | [diff] [blame] | 816 | 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] | 817 | |
| 818 | |
| 819 | |
| 820 | ### Installation rules |
| 821 | |
Andreas Ericsson | d6ebd25 | 2005-11-22 00:44:15 +0100 | [diff] [blame] | 822 | install: all |
Johannes Schindelin | 39c015c | 2006-02-18 12:40:22 +0100 | [diff] [blame] | 823 | $(INSTALL) -d -m755 '$(DESTDIR_SQ)$(bindir_SQ)' |
| 824 | $(INSTALL) -d -m755 '$(DESTDIR_SQ)$(gitexecdir_SQ)' |
| 825 | $(INSTALL) $(ALL_PROGRAMS) '$(DESTDIR_SQ)$(gitexecdir_SQ)' |
| 826 | $(INSTALL) git$X gitk '$(DESTDIR_SQ)$(bindir_SQ)' |
Ramsay Allan Jones | 7ffe709 | 2006-07-29 17:25:03 +0100 | [diff] [blame] | 827 | $(MAKE) -C templates DESTDIR='$(DESTDIR_SQ)' install |
Alex Riesen | f848718 | 2006-12-04 10:50:04 +0100 | [diff] [blame] | 828 | $(MAKE) -C perl prefix='$(prefix_SQ)' install |
Sean | 7f7e6ea | 2006-05-22 00:42:59 -0400 | [diff] [blame] | 829 | if test 'z$(bindir_SQ)' != 'z$(gitexecdir_SQ)'; \ |
| 830 | then \ |
| 831 | ln -f '$(DESTDIR_SQ)$(bindir_SQ)/git$X' \ |
| 832 | '$(DESTDIR_SQ)$(gitexecdir_SQ)/git$X' || \ |
| 833 | cp '$(DESTDIR_SQ)$(bindir_SQ)/git$X' \ |
| 834 | '$(DESTDIR_SQ)$(gitexecdir_SQ)/git$X'; \ |
| 835 | fi |
| 836 | $(foreach p,$(BUILT_INS), rm -f '$(DESTDIR_SQ)$(gitexecdir_SQ)/$p' && ln '$(DESTDIR_SQ)$(gitexecdir_SQ)/git$X' '$(DESTDIR_SQ)$(gitexecdir_SQ)/$p' ;) |
Petr Baudis | 28818ff | 2005-07-29 17:50:24 +0200 | [diff] [blame] | 837 | |
| 838 | install-doc: |
| 839 | $(MAKE) -C Documentation install |
| 840 | |
Eric Wong | 6538d1e | 2006-12-23 08:26:09 -0800 | [diff] [blame] | 841 | quick-install-doc: |
| 842 | $(MAKE) -C Documentation quick-install |
Petr Baudis | 28818ff | 2005-07-29 17:50:24 +0200 | [diff] [blame] | 843 | |
| 844 | |
| 845 | |
| 846 | ### Maintainer's dist rules |
| 847 | |
Junio C Hamano | 9b88fce | 2005-12-27 14:40:17 -0800 | [diff] [blame] | 848 | git.spec: git.spec.in |
Jim Meyering | fc36f6a | 2006-05-25 18:52:01 +0200 | [diff] [blame] | 849 | sed -e 's/@@VERSION@@/$(GIT_VERSION)/g' < $< > $@+ |
| 850 | mv $@+ $@ |
Chris Wright | a9db297 | 2005-07-07 13:09:50 -0700 | [diff] [blame] | 851 | |
Junio C Hamano | 27dedf0 | 2005-11-16 21:32:44 -0800 | [diff] [blame] | 852 | GIT_TARNAME=git-$(GIT_VERSION) |
Junio C Hamano | 9ccb64c | 2006-10-05 02:26:12 -0700 | [diff] [blame] | 853 | dist: git.spec git-archive |
| 854 | ./git-archive --format=tar \ |
| 855 | --prefix=$(GIT_TARNAME)/ HEAD^{tree} > $(GIT_TARNAME).tar |
Chris Wright | a9db297 | 2005-07-07 13:09:50 -0700 | [diff] [blame] | 856 | @mkdir -p $(GIT_TARNAME) |
Junio C Hamano | 27dedf0 | 2005-11-16 21:32:44 -0800 | [diff] [blame] | 857 | @cp git.spec $(GIT_TARNAME) |
H. Peter Anvin | 181129d | 2006-01-09 18:07:01 -0800 | [diff] [blame] | 858 | @echo $(GIT_VERSION) > $(GIT_TARNAME)/version |
| 859 | $(TAR) rf $(GIT_TARNAME).tar \ |
| 860 | $(GIT_TARNAME)/git.spec $(GIT_TARNAME)/version |
Chris Wright | a9db297 | 2005-07-07 13:09:50 -0700 | [diff] [blame] | 861 | @rm -rf $(GIT_TARNAME) |
Eric W. Biederman | 9dce3c0 | 2005-07-14 19:20:50 -0600 | [diff] [blame] | 862 | gzip -f -9 $(GIT_TARNAME).tar |
Chris Wright | a9db297 | 2005-07-07 13:09:50 -0700 | [diff] [blame] | 863 | |
| 864 | rpm: dist |
Junio C Hamano | 27dedf0 | 2005-11-16 21:32:44 -0800 | [diff] [blame] | 865 | $(RPMBUILD) -ta $(GIT_TARNAME).tar.gz |
Chris Wright | a9db297 | 2005-07-07 13:09:50 -0700 | [diff] [blame] | 866 | |
Tilman Sauerbeck | 52db049 | 2006-05-18 12:57:04 +0200 | [diff] [blame] | 867 | htmldocs = git-htmldocs-$(GIT_VERSION) |
| 868 | manpages = git-manpages-$(GIT_VERSION) |
| 869 | dist-doc: |
| 870 | rm -fr .doc-tmp-dir |
| 871 | mkdir .doc-tmp-dir |
| 872 | $(MAKE) -C Documentation WEBDOC_DEST=../.doc-tmp-dir install-webdoc |
| 873 | cd .doc-tmp-dir && $(TAR) cf ../$(htmldocs).tar . |
| 874 | gzip -n -9 -f $(htmldocs).tar |
| 875 | : |
| 876 | rm -fr .doc-tmp-dir |
| 877 | mkdir .doc-tmp-dir .doc-tmp-dir/man1 .doc-tmp-dir/man7 |
Martin Waitz | c536032 | 2006-05-25 14:37:46 +0200 | [diff] [blame] | 878 | $(MAKE) -C Documentation DESTDIR=./ \ |
Jakub Narebski | 7b8cf0c | 2006-06-29 23:26:54 +0200 | [diff] [blame] | 879 | man1dir=../.doc-tmp-dir/man1 \ |
| 880 | man7dir=../.doc-tmp-dir/man7 \ |
Tilman Sauerbeck | 52db049 | 2006-05-18 12:57:04 +0200 | [diff] [blame] | 881 | install |
| 882 | cd .doc-tmp-dir && $(TAR) cf ../$(manpages).tar . |
| 883 | gzip -n -9 -f $(manpages).tar |
| 884 | rm -fr .doc-tmp-dir |
| 885 | |
Petr Baudis | 28818ff | 2005-07-29 17:50:24 +0200 | [diff] [blame] | 886 | ### Cleaning rules |
Eric W. Biederman | 87a81c8 | 2005-07-14 19:21:57 -0600 | [diff] [blame] | 887 | |
Linus Torvalds | e83c516 | 2005-04-07 15:13:13 -0700 | [diff] [blame] | 888 | clean: |
Junio C Hamano | 3467fec | 2006-03-26 23:41:22 -0800 | [diff] [blame] | 889 | rm -f *.o mozilla-sha1/*.o arm/*.o ppc/*.o compat/*.o xdiff/*.o \ |
| 890 | $(LIB_FILE) $(XDIFF_LIB) |
A Large Angry SCM | e6bfaf3 | 2006-04-16 20:17:38 -0700 | [diff] [blame] | 891 | rm -f $(ALL_PROGRAMS) $(BUILT_INS) git$X |
Fredrik Kuivinen | f81e7c6 | 2006-03-18 11:07:12 +0100 | [diff] [blame] | 892 | rm -f *.spec *.pyc *.pyo */*.pyc */*.pyo common-cmds.h TAGS tags |
Jakub Narebski | 92b878a | 2006-07-08 23:07:07 +0200 | [diff] [blame] | 893 | rm -rf autom4te.cache |
Junio C Hamano | 1b1b678 | 2006-08-08 13:42:35 -0700 | [diff] [blame] | 894 | rm -f configure config.log config.mak.autogen config.mak.append config.status config.cache |
Tilman Sauerbeck | 52db049 | 2006-05-18 12:57:04 +0200 | [diff] [blame] | 895 | rm -rf $(GIT_TARNAME) .doc-tmp-dir |
Junio C Hamano | 5a571cd | 2005-08-12 01:03:07 -0700 | [diff] [blame] | 896 | rm -f $(GIT_TARNAME).tar.gz git-core_$(GIT_VERSION)-*.tar.gz |
Junio C Hamano | 9dc2164 | 2006-06-07 12:27:53 -0700 | [diff] [blame] | 897 | rm -f $(htmldocs).tar.gz $(manpages).tar.gz |
Junio C Hamano | 22987ae | 2006-08-01 16:23:47 -0700 | [diff] [blame] | 898 | rm -f gitweb/gitweb.cgi |
Thomas Glanzmann | ca67f00 | 2005-05-22 20:27:28 +0200 | [diff] [blame] | 899 | $(MAKE) -C Documentation/ clean |
Alex Riesen | f848718 | 2006-12-04 10:50:04 +0100 | [diff] [blame] | 900 | $(MAKE) -C perl clean |
Petr Baudis | b1edc53 | 2006-06-24 04:34:29 +0200 | [diff] [blame] | 901 | $(MAKE) -C templates/ clean |
Junio C Hamano | 4b7581f | 2005-08-02 17:24:11 -0700 | [diff] [blame] | 902 | $(MAKE) -C t/ clean |
Yakov Lerner | ca3bcab | 2006-06-15 01:36:00 +0300 | [diff] [blame] | 903 | rm -f GIT-VERSION-FILE GIT-CFLAGS |
Junio C Hamano | 9b88fce | 2005-12-27 14:40:17 -0800 | [diff] [blame] | 904 | |
Junio C Hamano | 4dc0002 | 2006-01-12 21:42:25 -0800 | [diff] [blame] | 905 | .PHONY: all install clean strip |
Yakov Lerner | ca3bcab | 2006-06-15 01:36:00 +0300 | [diff] [blame] | 906 | .PHONY: .FORCE-GIT-VERSION-FILE TAGS tags .FORCE-GIT-CFLAGS |
Junio C Hamano | d89056c | 2005-12-19 17:59:58 -0800 | [diff] [blame] | 907 | |
Junio C Hamano | 8c989ec | 2006-04-13 00:17:19 -0700 | [diff] [blame] | 908 | ### Check documentation |
| 909 | # |
| 910 | check-docs:: |
| 911 | @for v in $(ALL_PROGRAMS) $(BUILT_INS) git$X gitk; \ |
| 912 | do \ |
| 913 | case "$$v" in \ |
Junio C Hamano | 8c989ec | 2006-04-13 00:17:19 -0700 | [diff] [blame] | 914 | git-merge-octopus | git-merge-ours | git-merge-recursive | \ |
Junio C Hamano | c8b87ef | 2006-08-03 16:17:51 -0700 | [diff] [blame] | 915 | git-merge-resolve | git-merge-stupid | git-merge-recur | \ |
Junio C Hamano | 8c989ec | 2006-04-13 00:17:19 -0700 | [diff] [blame] | 916 | git-ssh-pull | git-ssh-push ) continue ;; \ |
| 917 | esac ; \ |
| 918 | test -f "Documentation/$$v.txt" || \ |
| 919 | echo "no doc: $$v"; \ |
| 920 | grep -q "^gitlink:$$v\[[0-9]\]::" Documentation/git.txt || \ |
| 921 | case "$$v" in \ |
| 922 | git) ;; \ |
| 923 | *) echo "no link: $$v";; \ |
| 924 | esac ; \ |
| 925 | done | sort |
Junio C Hamano | c74390e | 2006-11-05 11:26:21 -0800 | [diff] [blame] | 926 | |
| 927 | ### Make sure built-ins do not have dups and listed in git.c |
| 928 | # |
| 929 | check-builtins:: |
| 930 | ./check-builtins.sh |