Junio C Hamano | 2731d04 | 2005-12-01 12:26:41 -0800 | [diff] [blame] | 1 | # The default target of this Makefile is... |
| 2 | all: |
| 3 | |
Petr Baudis | 5bdac8b | 2005-07-29 17:48:26 +0200 | [diff] [blame] | 4 | # Define MOZILLA_SHA1 environment variable when running make to make use of |
| 5 | # a bundled SHA1 routine coming from Mozilla. It is GPL'd and should be fast |
| 6 | # on non-x86 architectures (e.g. PowerPC), while the OpenSSL version (default |
| 7 | # choice) has very fast version optimized for i586. |
| 8 | # |
Linus Torvalds | 765ac8e | 2006-02-28 15:07:20 -0800 | [diff] [blame] | 9 | # Define NO_OPENSSL environment variable if you do not have OpenSSL. |
| 10 | # This also implies MOZILLA_SHA1. |
Petr Baudis | 5bdac8b | 2005-07-29 17:48:26 +0200 | [diff] [blame] | 11 | # |
Nick Hengeveld | 58e60dd | 2005-11-02 11:19:24 -0800 | [diff] [blame] | 12 | # Define NO_CURL if you do not have curl installed. git-http-pull and |
| 13 | # git-http-push are not built, and you cannot use http:// and https:// |
| 14 | # transports. |
Johannes Schindelin | b2c0bd6 | 2005-07-31 02:14:23 +0200 | [diff] [blame] | 15 | # |
Patrick Mauritz | 6d9bbc5 | 2005-09-19 16:11:19 +0200 | [diff] [blame] | 16 | # Define CURLDIR=/foo/bar if your curl header and library files are in |
| 17 | # /foo/bar/include and /foo/bar/lib directories. |
| 18 | # |
Nick Hengeveld | 58e60dd | 2005-11-02 11:19:24 -0800 | [diff] [blame] | 19 | # Define NO_EXPAT if you do not have expat installed. git-http-push is |
| 20 | # not built, and you cannot push using http:// and https:// transports. |
| 21 | # |
Junio C Hamano | 35a730f | 2006-01-19 17:13:51 -0800 | [diff] [blame] | 22 | # Define NO_D_INO_IN_DIRENT if you don't have d_ino in your struct dirent. |
| 23 | # |
Junio C Hamano | 63be37b | 2006-01-19 17:13:57 -0800 | [diff] [blame] | 24 | # Define NO_D_TYPE_IN_DIRENT if your platform defines DT_UNKNOWN but lacks |
| 25 | # d_type in struct dirent (latest Cygwin -- will be fixed soonish). |
| 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 | 597c9cc | 2005-09-07 12:22:56 -0700 | [diff] [blame] | 58 | # Define NEEDS_SSL_WITH_CRYPTO if you need -lcrypto with -lssl (Darwin). |
Patrick Mauritz | f0ebff0 | 2005-09-06 01:24:03 +0200 | [diff] [blame] | 59 | # |
Junio C Hamano | 597c9cc | 2005-09-07 12:22:56 -0700 | [diff] [blame] | 60 | # Define NEEDS_LIBICONV if linking with libc is not enough (Darwin). |
Patrick Mauritz | f0ebff0 | 2005-09-06 01:24:03 +0200 | [diff] [blame] | 61 | # |
| 62 | # Define NEEDS_SOCKET if linking with libc is not enough (SunOS, |
| 63 | # Patrick Mauritz). |
| 64 | # |
Johannes Schindelin | 730d48a | 2005-10-08 15:54:36 -0700 | [diff] [blame] | 65 | # Define NO_MMAP if you want to avoid mmap. |
| 66 | # |
Junio C Hamano | 343d35c | 2005-09-19 19:47:54 -0700 | [diff] [blame] | 67 | # Define WITH_OWN_SUBPROCESS_PY if you want to use with python 2.3. |
| 68 | # |
hpa | 49744d6 | 2005-09-28 16:52:21 -0700 | [diff] [blame] | 69 | # Define NO_IPV6 if you lack IPv6 support and getaddrinfo(). |
| 70 | # |
Junio C Hamano | bdc37f5 | 2006-01-19 17:13:32 -0800 | [diff] [blame] | 71 | # Define NO_SOCKADDR_STORAGE if your platform does not have struct |
| 72 | # sockaddr_storage. |
| 73 | # |
Fernando J. Pereda | b6e56ec | 2006-02-16 09:38:01 +0100 | [diff] [blame] | 74 | # Define NO_ICONV if your libc does not properly support iconv. |
| 75 | # |
Johannes Schindelin | 5b5d4d9 | 2006-02-17 15:23:16 +0100 | [diff] [blame] | 76 | # Define NO_ACCURATE_DIFF if your diff program at least sometimes misses |
| 77 | # a missing newline at the end of the file. |
| 78 | # |
Pavel Roskin | addf88e | 2006-07-09 03:44:30 -0400 | [diff] [blame] | 79 | # Define NO_PYTHON if you want to lose all benefits of the recursive merge. |
Johannes Schindelin | abb7c7b | 2006-02-18 13:01:18 +0100 | [diff] [blame] | 80 | # |
Petr Baudis | 5bdac8b | 2005-07-29 17:48:26 +0200 | [diff] [blame] | 81 | # Define COLLISION_CHECK below if you believe that SHA1's |
Petr Baudis | 5c2a7fb | 2005-04-13 02:14:06 -0700 | [diff] [blame] | 82 | # 1461501637330902918203684832716283019655932542976 hashes do not give you |
Petr Baudis | 5bdac8b | 2005-07-29 17:48:26 +0200 | [diff] [blame] | 83 | # sufficient guarantee that no collisions between objects will ever happen. |
| 84 | |
Petr Baudis | 5bdac8b | 2005-07-29 17:48:26 +0200 | [diff] [blame] | 85 | # Define USE_NSEC below if you want git to care about sub-second file mtimes |
| 86 | # and ctimes. Note that you need recent glibc (at least 2.2.4) for this, and |
| 87 | # it will BREAK YOUR LOCAL DIFFS! show-diff and anything using it will likely |
| 88 | # randomly break unless your underlying filesystem supports those sub-second |
| 89 | # times (my ext3 doesn't). |
| 90 | |
Petr Baudis | 5bdac8b | 2005-07-29 17:48:26 +0200 | [diff] [blame] | 91 | # Define USE_STDEV below if you want git to care about the underlying device |
| 92 | # change being considered an inode change from the update-cache perspective. |
| 93 | |
Junio C Hamano | 9b88fce | 2005-12-27 14:40:17 -0800 | [diff] [blame] | 94 | GIT-VERSION-FILE: .FORCE-GIT-VERSION-FILE |
Fredrik Kuivinen | 3654638 | 2006-02-14 00:15:14 +0100 | [diff] [blame] | 95 | @$(SHELL_PATH) ./GIT-VERSION-GEN |
Junio C Hamano | 9b88fce | 2005-12-27 14:40:17 -0800 | [diff] [blame] | 96 | -include GIT-VERSION-FILE |
Petr Baudis | 5bdac8b | 2005-07-29 17:48:26 +0200 | [diff] [blame] | 97 | |
Paul Jakma | e15f545 | 2006-02-20 23:36:28 +0000 | [diff] [blame] | 98 | uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not') |
| 99 | uname_M := $(shell sh -c 'uname -m 2>/dev/null || echo not') |
| 100 | uname_O := $(shell sh -c 'uname -o 2>/dev/null || echo not') |
| 101 | uname_R := $(shell sh -c 'uname -r 2>/dev/null || echo not') |
| 102 | uname_P := $(shell sh -c 'uname -p 2>/dev/null || echo not') |
| 103 | |
Junio C Hamano | 94d2331 | 2005-11-13 01:46:13 -0800 | [diff] [blame] | 104 | # 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] | 105 | |
Pavel Roskin | b05701c | 2005-08-06 01:36:15 -0400 | [diff] [blame] | 106 | CFLAGS = -g -O2 -Wall |
Junio C Hamano | 94d2331 | 2005-11-13 01:46:13 -0800 | [diff] [blame] | 107 | LDFLAGS = |
Junio C Hamano | 12aa745 | 2005-11-04 23:50:09 -0800 | [diff] [blame] | 108 | ALL_CFLAGS = $(CFLAGS) |
Junio C Hamano | 94d2331 | 2005-11-13 01:46:13 -0800 | [diff] [blame] | 109 | ALL_LDFLAGS = $(LDFLAGS) |
Junio C Hamano | 4dc0002 | 2006-01-12 21:42:25 -0800 | [diff] [blame] | 110 | STRIP ?= strip |
Thomas Glanzmann | 29c2cce | 2005-05-07 10:41:54 +0200 | [diff] [blame] | 111 | |
Pavel Roskin | b05701c | 2005-08-06 01:36:15 -0400 | [diff] [blame] | 112 | prefix = $(HOME) |
| 113 | bindir = $(prefix)/bin |
Paul Jakma | e15f545 | 2006-02-20 23:36:28 +0000 | [diff] [blame] | 114 | gitexecdir = $(bindir) |
Pavel Roskin | b05701c | 2005-08-06 01:36:15 -0400 | [diff] [blame] | 115 | template_dir = $(prefix)/share/git-core/templates/ |
Junio C Hamano | 720d150 | 2005-09-10 17:46:27 -0700 | [diff] [blame] | 116 | GIT_PYTHON_DIR = $(prefix)/share/git-core/python |
Petr Baudis | a682ef9 | 2005-08-05 01:56:38 +0200 | [diff] [blame] | 117 | # DESTDIR= |
Petr Baudis | 5c2a7fb | 2005-04-13 02:14:06 -0700 | [diff] [blame] | 118 | |
Pavel Roskin | b05701c | 2005-08-06 01:36:15 -0400 | [diff] [blame] | 119 | CC = gcc |
| 120 | AR = ar |
Junio C Hamano | 229a7ed | 2005-09-23 10:41:40 -0700 | [diff] [blame] | 121 | TAR = tar |
Pavel Roskin | b05701c | 2005-08-06 01:36:15 -0400 | [diff] [blame] | 122 | INSTALL = install |
| 123 | RPMBUILD = rpmbuild |
Linus Torvalds | e83c516 | 2005-04-07 15:13:13 -0700 | [diff] [blame] | 124 | |
Linus Torvalds | 44c9e85 | 2005-07-03 10:02:35 -0700 | [diff] [blame] | 125 | # sparse is architecture-neutral, which means that we need to tell it |
| 126 | # explicitly what architecture to check for. Fix this up for yours.. |
Pavel Roskin | b05701c | 2005-08-06 01:36:15 -0400 | [diff] [blame] | 127 | SPARSE_FLAGS = -D__BIG_ENDIAN__ -D__powerpc__ |
Linus Torvalds | 44c9e85 | 2005-07-03 10:02:35 -0700 | [diff] [blame] | 128 | |
Petr Baudis | 28818ff | 2005-07-29 17:50:24 +0200 | [diff] [blame] | 129 | |
| 130 | |
| 131 | ### --- END CONFIGURATION SECTION --- |
| 132 | |
Junio C Hamano | 215a7ad | 2005-09-07 17:26:23 -0700 | [diff] [blame] | 133 | SCRIPT_SH = \ |
Linus Torvalds | c699f9b | 2006-05-17 21:21:04 -0700 | [diff] [blame] | 134 | git-bisect.sh git-branch.sh git-checkout.sh \ |
Pavel Roskin | c3b831b | 2006-04-05 02:00:48 -0400 | [diff] [blame] | 135 | git-cherry.sh git-clean.sh git-clone.sh git-commit.sh \ |
Junio C Hamano | 230f544 | 2006-05-03 23:54:34 -0700 | [diff] [blame] | 136 | git-fetch.sh \ |
Junio C Hamano | 6856373 | 2006-05-21 02:48:21 -0700 | [diff] [blame] | 137 | git-ls-remote.sh \ |
Junio C Hamano | e32faa8 | 2005-12-19 18:03:31 -0800 | [diff] [blame] | 138 | git-merge-one-file.sh git-parse-remote.sh \ |
Linus Torvalds | ba84a79 | 2006-07-06 10:16:22 -0700 | [diff] [blame] | 139 | git-pull.sh git-rebase.sh \ |
Junio C Hamano | 215a7ad | 2005-09-07 17:26:23 -0700 | [diff] [blame] | 140 | git-repack.sh git-request-pull.sh git-reset.sh \ |
Linus Torvalds | d9b814c | 2006-05-19 16:19:34 -0700 | [diff] [blame] | 141 | git-resolve.sh git-revert.sh git-sh-setup.sh \ |
Junio C Hamano | 7b763f7 | 2006-05-01 23:14:58 -0700 | [diff] [blame] | 142 | git-tag.sh git-verify-tag.sh \ |
Junio C Hamano | d1c5f2a | 2005-10-07 03:44:18 -0700 | [diff] [blame] | 143 | git-applymbox.sh git-applypatch.sh git-am.sh \ |
Junio C Hamano | 2276aa6 | 2005-09-10 17:56:19 -0700 | [diff] [blame] | 144 | git-merge.sh git-merge-stupid.sh git-merge-octopus.sh \ |
Linus Torvalds | 63dffdf | 2006-05-16 16:46:31 -0700 | [diff] [blame] | 145 | git-merge-resolve.sh git-merge-ours.sh \ |
Eric W. Biederman | d3d8f36 | 2006-05-17 12:44:40 -0600 | [diff] [blame] | 146 | git-lost-found.sh git-quiltimport.sh |
Petr Baudis | 28818ff | 2005-07-29 17:50:24 +0200 | [diff] [blame] | 147 | |
Junio C Hamano | 215a7ad | 2005-09-07 17:26:23 -0700 | [diff] [blame] | 148 | SCRIPT_PERL = \ |
| 149 | git-archimport.perl git-cvsimport.perl git-relink.perl \ |
Johannes Schindelin | 00449f9 | 2006-07-03 17:18:43 +0200 | [diff] [blame] | 150 | git-shortlog.perl git-rerere.perl \ |
Junio C Hamano | 98214e9 | 2006-02-22 19:20:55 -0800 | [diff] [blame] | 151 | git-annotate.perl git-cvsserver.perl \ |
Eric Wong | 15739c8 | 2006-05-14 19:26:56 -0700 | [diff] [blame] | 152 | git-svnimport.perl git-mv.perl git-cvsexportcommit.perl \ |
Eric Wong | 60d02cc | 2006-07-06 00:14:16 -0700 | [diff] [blame] | 153 | git-send-email.perl git-svn.perl |
Junio C Hamano | 60036a4 | 2005-07-30 17:31:47 -0700 | [diff] [blame] | 154 | |
Junio C Hamano | 720d150 | 2005-09-10 17:46:27 -0700 | [diff] [blame] | 155 | SCRIPT_PYTHON = \ |
Fredrik Kuivinen | e4cf17c | 2005-09-13 08:22:26 +0200 | [diff] [blame] | 156 | git-merge-recursive.py |
Junio C Hamano | 720d150 | 2005-09-10 17:46:27 -0700 | [diff] [blame] | 157 | |
Andreas Ericsson | d6ebd25 | 2005-11-22 00:44:15 +0100 | [diff] [blame] | 158 | SCRIPTS = $(patsubst %.sh,%,$(SCRIPT_SH)) \ |
| 159 | $(patsubst %.perl,%,$(SCRIPT_PERL)) \ |
| 160 | $(patsubst %.py,%,$(SCRIPT_PYTHON)) \ |
Eric Wong | a51d37c | 2006-07-01 15:14:14 -0700 | [diff] [blame] | 161 | git-cherry-pick git-status git-instaweb |
Andreas Ericsson | d6ebd25 | 2005-11-22 00:44:15 +0100 | [diff] [blame] | 162 | |
Junio C Hamano | 8eef8e0 | 2006-03-31 16:23:46 -0800 | [diff] [blame] | 163 | # The ones that do not have to link with lcrypto, lz nor xdiff. |
Junio C Hamano | 597c9cc | 2005-09-07 12:22:56 -0700 | [diff] [blame] | 164 | SIMPLE_PROGRAMS = \ |
Lukas Sandström | 7499c99 | 2006-06-13 22:21:53 +0200 | [diff] [blame] | 165 | git-daemon$X |
Junio C Hamano | 597c9cc | 2005-09-07 12:22:56 -0700 | [diff] [blame] | 166 | |
Junio C Hamano | b42934d | 2006-01-12 21:37:17 -0800 | [diff] [blame] | 167 | # ... 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] | 168 | PROGRAMS = \ |
Junio C Hamano | efc7fa5 | 2006-06-20 23:54:26 -0700 | [diff] [blame] | 169 | git-checkout-index$X \ |
Peter Eriksen | e8cc9cd | 2006-05-23 14:15:36 +0200 | [diff] [blame] | 170 | git-convert-objects$X git-fetch-pack$X git-fsck-objects$X \ |
Timo Hirvonen | c3c8835 | 2006-05-19 13:03:57 +0300 | [diff] [blame] | 171 | 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] | 172 | git-merge-base$X \ |
Junio C Hamano | 83f5053 | 2006-02-20 21:50:01 -0800 | [diff] [blame] | 173 | git-merge-index$X git-mktag$X git-mktree$X git-pack-objects$X git-patch-id$X \ |
Christian Couder | 895f10c | 2006-06-03 18:45:43 +0200 | [diff] [blame] | 174 | git-peek-remote$X git-prune-packed$X git-receive-pack$X \ |
Peter Eriksen | 51ce34b | 2006-05-23 14:15:35 +0200 | [diff] [blame] | 175 | git-send-pack$X git-shell$X \ |
Peter Anvin | 79a9d8e | 2005-10-03 12:04:44 -0700 | [diff] [blame] | 176 | git-show-index$X git-ssh-fetch$X \ |
Peter Eriksen | 56d1398 | 2006-05-23 14:15:31 +0200 | [diff] [blame] | 177 | git-ssh-upload$X git-unpack-file$X \ |
Lukas Sandström | fefe81c | 2006-06-13 22:21:57 +0200 | [diff] [blame] | 178 | git-unpack-objects$X git-update-server-info$X \ |
Lukas Sandström | 8ed05fb | 2006-06-13 22:21:42 +0200 | [diff] [blame] | 179 | git-upload-pack$X git-verify-pack$X \ |
Lukas Sandström | 854b462 | 2006-06-13 22:22:00 +0200 | [diff] [blame] | 180 | git-symbolic-ref$X \ |
Linus Torvalds | 908e531 | 2005-12-24 13:50:45 -0800 | [diff] [blame] | 181 | git-name-rev$X git-pack-redundant$X git-repo-config$X git-var$X \ |
Mike McCormack | f2561fd | 2006-03-10 14:32:50 +0900 | [diff] [blame] | 182 | git-describe$X git-merge-tree$X git-blame$X git-imap-send$X |
Andreas Ericsson | d6ebd25 | 2005-11-22 00:44:15 +0100 | [diff] [blame] | 183 | |
Lukas Sandström | 854b462 | 2006-06-13 22:22:00 +0200 | [diff] [blame] | 184 | BUILT_INS = git-log$X git-whatchanged$X git-show$X git-update-ref$X \ |
Lukas Sandström | e690e84 | 2006-06-13 22:21:46 +0200 | [diff] [blame] | 185 | git-count-objects$X git-diff$X git-push$X git-mailsplit$X \ |
Lukas Sandström | 7499c99 | 2006-06-13 22:21:53 +0200 | [diff] [blame] | 186 | git-grep$X git-add$X git-rm$X git-rev-list$X git-stripspace$X \ |
Lukas Sandström | 34488e3 | 2006-06-13 22:21:50 +0200 | [diff] [blame] | 187 | git-check-ref-format$X git-rev-parse$X git-mailinfo$X \ |
Junio C Hamano | 73f0a15 | 2006-05-24 12:19:47 -0700 | [diff] [blame] | 188 | git-init-db$X git-tar-tree$X git-upload-tar$X git-format-patch$X \ |
Rene Scharfe | 52ba03c | 2006-06-10 16:13:41 +0200 | [diff] [blame] | 189 | git-ls-files$X git-ls-tree$X git-get-tar-commit-id$X \ |
Lukas Sandström | 8ed05fb | 2006-06-13 22:21:42 +0200 | [diff] [blame] | 190 | git-read-tree$X git-commit-tree$X git-write-tree$X \ |
Lukas Sandström | fefe81c | 2006-06-13 22:21:57 +0200 | [diff] [blame] | 191 | git-apply$X git-show-branch$X git-diff-files$X git-update-index$X \ |
Johannes Schindelin | 00449f9 | 2006-07-03 17:18:43 +0200 | [diff] [blame] | 192 | git-diff-index$X git-diff-stages$X git-diff-tree$X git-cat-file$X \ |
Linus Torvalds | ba84a79 | 2006-07-06 10:16:22 -0700 | [diff] [blame] | 193 | git-fmt-merge-msg$X git-prune$X |
Junio C Hamano | 9173080 | 2006-04-10 17:37:58 -0700 | [diff] [blame] | 194 | |
Junio C Hamano | b42934d | 2006-01-12 21:37:17 -0800 | [diff] [blame] | 195 | # what 'all' will build and 'install' will install, in gitexecdir |
Junio C Hamano | f94fbbe | 2006-04-11 11:29:36 -0700 | [diff] [blame] | 196 | ALL_PROGRAMS = $(PROGRAMS) $(SIMPLE_PROGRAMS) $(SCRIPTS) |
Linus Torvalds | e83c516 | 2005-04-07 15:13:13 -0700 | [diff] [blame] | 197 | |
Junio C Hamano | 894a8a8 | 2005-09-30 00:27:11 -0700 | [diff] [blame] | 198 | # Backward compatibility -- to be removed after 1.0 |
H. Peter Anvin | 2f29dd5 | 2005-09-30 10:46:25 -0700 | [diff] [blame] | 199 | PROGRAMS += git-ssh-pull$X git-ssh-push$X |
Junio C Hamano | f71a69a | 2005-09-15 14:56:37 -0700 | [diff] [blame] | 200 | |
Ryan Anderson | 3d32051 | 2005-11-21 00:11:22 -0500 | [diff] [blame] | 201 | # Set paths to tools early so that they can be used for version tests. |
| 202 | ifndef SHELL_PATH |
| 203 | SHELL_PATH = /bin/sh |
| 204 | endif |
| 205 | ifndef PERL_PATH |
| 206 | PERL_PATH = /usr/bin/perl |
| 207 | endif |
| 208 | ifndef PYTHON_PATH |
| 209 | PYTHON_PATH = /usr/bin/python |
| 210 | endif |
| 211 | |
Junio C Hamano | 720d150 | 2005-09-10 17:46:27 -0700 | [diff] [blame] | 212 | PYMODULES = \ |
| 213 | gitMergeCommon.py |
| 214 | |
Linus Torvalds | 0a02ce7 | 2005-04-18 12:49:39 -0700 | [diff] [blame] | 215 | LIB_FILE=libgit.a |
Linus Torvalds | 3443546 | 2006-03-24 20:13:22 -0800 | [diff] [blame] | 216 | XDIFF_LIB=xdiff/lib.a |
Linus Torvalds | 0a02ce7 | 2005-04-18 12:49:39 -0700 | [diff] [blame] | 217 | |
Junio C Hamano | 215a7ad | 2005-09-07 17:26:23 -0700 | [diff] [blame] | 218 | LIB_H = \ |
Junio C Hamano | f5948cf | 2006-03-04 02:51:19 -0800 | [diff] [blame] | 219 | blob.h cache.h commit.h csum-file.h delta.h \ |
Linus Torvalds | 765ac8e | 2006-02-28 15:07:20 -0800 | [diff] [blame] | 220 | diff.h object.h pack.h pkt-line.h quote.h refs.h \ |
Junio C Hamano | 1b0c717 | 2006-03-29 22:55:43 -0800 | [diff] [blame] | 221 | run-command.h strbuf.h tag.h tree.h git-compat-util.h revision.h \ |
Linus Torvalds | 453ec4b | 2006-05-16 19:02:14 -0700 | [diff] [blame] | 222 | tree-walk.h log-tree.h dir.h |
Junio C Hamano | 8f3f9b0 | 2005-07-23 17:54:41 -0700 | [diff] [blame] | 223 | |
Junio C Hamano | 215a7ad | 2005-09-07 17:26:23 -0700 | [diff] [blame] | 224 | DIFF_OBJS = \ |
Junio C Hamano | 6973dca | 2006-04-21 23:57:45 -0700 | [diff] [blame] | 225 | diff.o diff-lib.o diffcore-break.o diffcore-order.o \ |
Junio C Hamano | 6541675 | 2006-02-28 16:01:36 -0800 | [diff] [blame] | 226 | 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] | 227 | diffcore-delta.o log-tree.o |
Josef Weidendorfer | b1bf95b | 2005-07-31 21:17:43 +0200 | [diff] [blame] | 228 | |
Junio C Hamano | 215a7ad | 2005-09-07 17:26:23 -0700 | [diff] [blame] | 229 | LIB_OBJS = \ |
Junio C Hamano | 283c8ee | 2006-05-20 00:56:11 -0700 | [diff] [blame] | 230 | blob.o commit.o connect.o csum-file.o cache-tree.o base85.o \ |
Junio C Hamano | 021b6e4 | 2006-06-06 12:51:49 -0700 | [diff] [blame] | 231 | date.o diff-delta.o entry.o exec_cmd.o ident.o lockfile.o \ |
Junio C Hamano | 215a7ad | 2005-09-07 17:26:23 -0700 | [diff] [blame] | 232 | object.o pack-check.o patch-delta.o path.o pkt-line.o \ |
Linus Torvalds | 3e4339e | 2006-06-18 11:45:02 -0700 | [diff] [blame] | 233 | 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] | 234 | 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] | 235 | tag.o tree.o usage.o config.o environment.o ctype.o copy.o \ |
Junio C Hamano | d9ea73e | 2006-04-05 02:03:58 -0700 | [diff] [blame] | 236 | fetch-clone.o revision.o pager.o tree-walk.o xdiff-interface.o \ |
Linus Torvalds | 0c79938 | 2006-06-28 22:06:36 -0700 | [diff] [blame] | 237 | alloc.o merge-file.o $(DIFF_OBJS) |
Junio C Hamano | d19938a | 2005-05-09 17:57:56 -0700 | [diff] [blame] | 238 | |
Linus Torvalds | 70827b1 | 2006-04-21 10:27:34 -0700 | [diff] [blame] | 239 | BUILTIN_OBJS = \ |
Junio C Hamano | efca578 | 2006-05-15 18:12:06 -0700 | [diff] [blame] | 240 | builtin-log.o builtin-help.o builtin-count.o builtin-diff.o builtin-push.o \ |
Linus Torvalds | d9b814c | 2006-05-19 16:19:34 -0700 | [diff] [blame] | 241 | builtin-grep.o builtin-add.o builtin-rev-list.o builtin-check-ref-format.o \ |
Christian Couder | 895f10c | 2006-06-03 18:45:43 +0200 | [diff] [blame] | 242 | builtin-rm.o builtin-init-db.o builtin-rev-parse.o \ |
Lukas Sandström | fefe81c | 2006-06-13 22:21:57 +0200 | [diff] [blame] | 243 | builtin-tar-tree.o builtin-upload-tar.o builtin-update-index.o \ |
Lukas Sandström | 8ed05fb | 2006-06-13 22:21:42 +0200 | [diff] [blame] | 244 | builtin-ls-files.o builtin-ls-tree.o builtin-write-tree.o \ |
Lukas Sandström | 34488e3 | 2006-06-13 22:21:50 +0200 | [diff] [blame] | 245 | builtin-read-tree.o builtin-commit-tree.o builtin-mailinfo.o \ |
Peter Eriksen | e8cc9cd | 2006-05-23 14:15:36 +0200 | [diff] [blame] | 246 | builtin-apply.o builtin-show-branch.o builtin-diff-files.o \ |
Timo Hirvonen | f81daef | 2006-05-24 14:08:46 +0300 | [diff] [blame] | 247 | builtin-diff-index.o builtin-diff-stages.o builtin-diff-tree.o \ |
Lukas Sandström | 854b462 | 2006-06-13 22:22:00 +0200 | [diff] [blame] | 248 | builtin-cat-file.o builtin-mailsplit.o builtin-stripspace.o \ |
Linus Torvalds | ba84a79 | 2006-07-06 10:16:22 -0700 | [diff] [blame] | 249 | builtin-update-ref.o builtin-fmt-merge-msg.o builtin-prune.o |
Linus Torvalds | 70827b1 | 2006-04-21 10:27:34 -0700 | [diff] [blame] | 250 | |
Johannes Schindelin | 54c261f | 2006-03-27 01:14:52 +0200 | [diff] [blame] | 251 | GITLIBS = $(LIB_FILE) $(XDIFF_LIB) |
| 252 | LIBS = $(GITLIBS) -lz |
Linus Torvalds | cef661f | 2005-04-21 12:33:22 -0700 | [diff] [blame] | 253 | |
Junio C Hamano | 229a7ed | 2005-09-23 10:41:40 -0700 | [diff] [blame] | 254 | # |
| 255 | # Platform specific tweaks |
| 256 | # |
Junio C Hamano | f7c1534 | 2005-10-09 12:52:35 -0700 | [diff] [blame] | 257 | |
| 258 | # We choose to avoid "if .. else if .. else .. endif endif" |
| 259 | # because maintaining the nesting to match is a pain. If |
| 260 | # we had "elif" things would have been much nicer... |
Junio C Hamano | f7c1534 | 2005-10-09 12:52:35 -0700 | [diff] [blame] | 261 | |
Peter Eriksen | 817151e | 2006-06-24 16:01:25 +0200 | [diff] [blame] | 262 | ifeq ($(uname_S),Linux) |
| 263 | NO_STRLCPY = YesPlease |
| 264 | endif |
Junio C Hamano | f7c1534 | 2005-10-09 12:52:35 -0700 | [diff] [blame] | 265 | ifeq ($(uname_S),Darwin) |
Junio C Hamano | 597c9cc | 2005-09-07 12:22:56 -0700 | [diff] [blame] | 266 | NEEDS_SSL_WITH_CRYPTO = YesPlease |
| 267 | NEEDS_LIBICONV = YesPlease |
Peter Eriksen | 817151e | 2006-06-24 16:01:25 +0200 | [diff] [blame] | 268 | NO_STRLCPY = YesPlease |
Shawn Pearce | 8eb38ca | 2006-07-24 00:28:28 -0400 | [diff] [blame^] | 269 | ifndef NO_FINK |
| 270 | ifeq ($(shell test -d /sw/lib && echo y),y) |
| 271 | ALL_CFLAGS += -I/sw/include |
| 272 | ALL_LDFLAGS += -L/sw/lib |
| 273 | endif |
Shawn Pearce | e3601e8 | 2006-02-28 09:03:48 -0500 | [diff] [blame] | 274 | endif |
Shawn Pearce | 8eb38ca | 2006-07-24 00:28:28 -0400 | [diff] [blame^] | 275 | ifndef NO_DARWIN_PORTS |
| 276 | ifeq ($(shell test -d /opt/local/lib && echo y),y) |
| 277 | ALL_CFLAGS += -I/opt/local/include |
| 278 | ALL_LDFLAGS += -L/opt/local/lib |
| 279 | endif |
Shawn Pearce | e3601e8 | 2006-02-28 09:03:48 -0500 | [diff] [blame] | 280 | endif |
Junio C Hamano | 597c9cc | 2005-09-07 12:22:56 -0700 | [diff] [blame] | 281 | endif |
Junio C Hamano | f7c1534 | 2005-10-09 12:52:35 -0700 | [diff] [blame] | 282 | ifeq ($(uname_S),SunOS) |
Patrick Mauritz | f0ebff0 | 2005-09-06 01:24:03 +0200 | [diff] [blame] | 283 | NEEDS_SOCKET = YesPlease |
Junio C Hamano | 5a90d4a | 2005-09-11 22:25:49 -0700 | [diff] [blame] | 284 | NEEDS_NSL = YesPlease |
Junio C Hamano | 229a7ed | 2005-09-23 10:41:40 -0700 | [diff] [blame] | 285 | SHELL_PATH = /bin/bash |
| 286 | NO_STRCASESTR = YesPlease |
Peter Eriksen | 817151e | 2006-06-24 16:01:25 +0200 | [diff] [blame] | 287 | NO_STRLCPY = YesPlease |
Jason Riedy | e40b61f | 2005-12-02 15:08:28 -0800 | [diff] [blame] | 288 | ifeq ($(uname_R),5.8) |
Paul Jakma | e15f545 | 2006-02-20 23:36:28 +0000 | [diff] [blame] | 289 | NEEDS_LIBICONV = YesPlease |
Jason Riedy | 731043f | 2006-01-25 12:38:36 -0800 | [diff] [blame] | 290 | NO_UNSETENV = YesPlease |
Jason Riedy | e40b61f | 2005-12-02 15:08:28 -0800 | [diff] [blame] | 291 | NO_SETENV = YesPlease |
| 292 | endif |
Dennis Stosberg | 40d88d4 | 2006-04-11 11:42:26 -0700 | [diff] [blame] | 293 | ifeq ($(uname_R),5.9) |
| 294 | NO_UNSETENV = YesPlease |
| 295 | NO_SETENV = YesPlease |
| 296 | endif |
Junio C Hamano | 229a7ed | 2005-09-23 10:41:40 -0700 | [diff] [blame] | 297 | INSTALL = ginstall |
| 298 | TAR = gtar |
Junio C Hamano | 12aa745 | 2005-11-04 23:50:09 -0800 | [diff] [blame] | 299 | ALL_CFLAGS += -D__EXTENSIONS__ |
Patrick Mauritz | f0ebff0 | 2005-09-06 01:24:03 +0200 | [diff] [blame] | 300 | endif |
Junio C Hamano | f7c1534 | 2005-10-09 12:52:35 -0700 | [diff] [blame] | 301 | ifeq ($(uname_O),Cygwin) |
Junio C Hamano | 63be37b | 2006-01-19 17:13:57 -0800 | [diff] [blame] | 302 | NO_D_TYPE_IN_DIRENT = YesPlease |
Junio C Hamano | 35a730f | 2006-01-19 17:13:51 -0800 | [diff] [blame] | 303 | NO_D_INO_IN_DIRENT = YesPlease |
hpa | 1775451 | 2005-09-28 16:37:37 -0700 | [diff] [blame] | 304 | NO_STRCASESTR = YesPlease |
Peter Eriksen | 817151e | 2006-06-24 16:01:25 +0200 | [diff] [blame] | 305 | NO_STRLCPY = YesPlease |
Junio C Hamano | 9f0bb90 | 2006-05-02 00:40:24 -0700 | [diff] [blame] | 306 | NO_SYMLINK_HEAD = YesPlease |
hpa | 1775451 | 2005-09-28 16:37:37 -0700 | [diff] [blame] | 307 | NEEDS_LIBICONV = YesPlease |
Junio C Hamano | 2e67a5f | 2005-11-17 11:29:47 -0800 | [diff] [blame] | 308 | # There are conflicting reports about this. |
| 309 | # On some boxes NO_MMAP is needed, and not so elsewhere. |
| 310 | # Try uncommenting this if you see things break -- YMMV. |
| 311 | # NO_MMAP = YesPlease |
hpa | 49744d6 | 2005-09-28 16:52:21 -0700 | [diff] [blame] | 312 | NO_IPV6 = YesPlease |
Peter Anvin | a23cd8e | 2005-09-28 19:08:37 -0700 | [diff] [blame] | 313 | X = .exe |
Nicolas Pitre | 7c6ef2f | 2005-09-20 12:27:13 -0400 | [diff] [blame] | 314 | endif |
Alecs King | b3bf974 | 2006-01-27 02:04:30 +0800 | [diff] [blame] | 315 | ifeq ($(uname_S),FreeBSD) |
| 316 | NEEDS_LIBICONV = YesPlease |
| 317 | ALL_CFLAGS += -I/usr/local/include |
| 318 | ALL_LDFLAGS += -L/usr/local/lib |
| 319 | endif |
Junio C Hamano | f7c1534 | 2005-10-09 12:52:35 -0700 | [diff] [blame] | 320 | ifeq ($(uname_S),OpenBSD) |
Junio C Hamano | 5fb41e8 | 2005-10-10 11:51:11 -0700 | [diff] [blame] | 321 | NO_STRCASESTR = YesPlease |
Han Boetes | 18c5a52 | 2005-10-01 08:23:26 +0200 | [diff] [blame] | 322 | NEEDS_LIBICONV = YesPlease |
Junio C Hamano | 94d2331 | 2005-11-13 01:46:13 -0800 | [diff] [blame] | 323 | ALL_CFLAGS += -I/usr/local/include |
| 324 | ALL_LDFLAGS += -L/usr/local/lib |
| 325 | endif |
| 326 | ifeq ($(uname_S),NetBSD) |
Dennis Stosberg | e88856b | 2006-05-11 19:35:31 +0200 | [diff] [blame] | 327 | ifeq ($(shell expr "$(uname_R)" : '[01]\.'),2) |
| 328 | NEEDS_LIBICONV = YesPlease |
| 329 | endif |
Junio C Hamano | 94d2331 | 2005-11-13 01:46:13 -0800 | [diff] [blame] | 330 | ALL_CFLAGS += -I/usr/pkg/include |
| 331 | ALL_LDFLAGS += -L/usr/pkg/lib -Wl,-rpath,/usr/pkg/lib |
Han Boetes | 18c5a52 | 2005-10-01 08:23:26 +0200 | [diff] [blame] | 332 | endif |
Jason Riedy | a6da939 | 2005-12-06 14:20:16 -0800 | [diff] [blame] | 333 | ifeq ($(uname_S),AIX) |
| 334 | NO_STRCASESTR=YesPlease |
Peter Eriksen | 817151e | 2006-06-24 16:01:25 +0200 | [diff] [blame] | 335 | NO_STRLCPY = YesPlease |
Jason Riedy | a6da939 | 2005-12-06 14:20:16 -0800 | [diff] [blame] | 336 | NEEDS_LIBICONV=YesPlease |
| 337 | endif |
Johannes Schindelin | 289c4b3 | 2006-02-17 15:23:41 +0100 | [diff] [blame] | 338 | ifeq ($(uname_S),IRIX64) |
| 339 | NO_IPV6=YesPlease |
| 340 | NO_SETENV=YesPlease |
| 341 | NO_STRCASESTR=YesPlease |
Peter Eriksen | 817151e | 2006-06-24 16:01:25 +0200 | [diff] [blame] | 342 | NO_STRLCPY = YesPlease |
Johannes Schindelin | 289c4b3 | 2006-02-17 15:23:41 +0100 | [diff] [blame] | 343 | NO_SOCKADDR_STORAGE=YesPlease |
| 344 | SHELL_PATH=/usr/gnu/bin/bash |
| 345 | ALL_CFLAGS += -DPATH_MAX=1024 |
| 346 | # for now, build 32-bit version |
| 347 | ALL_LDFLAGS += -L/usr/lib32 |
| 348 | endif |
Junio C Hamano | f7c1534 | 2005-10-09 12:52:35 -0700 | [diff] [blame] | 349 | ifneq (,$(findstring arm,$(uname_M))) |
| 350 | ARM_SHA1 = YesPlease |
| 351 | endif |
Junio C Hamano | 597c9cc | 2005-09-07 12:22:56 -0700 | [diff] [blame] | 352 | |
Johannes Schindelin | f2d6a25 | 2005-10-11 15:22:47 -0700 | [diff] [blame] | 353 | -include config.mak |
Linus Torvalds | cef661f | 2005-04-21 12:33:22 -0700 | [diff] [blame] | 354 | |
Timo Hirvonen | b34403a | 2005-12-01 03:32:01 +0200 | [diff] [blame] | 355 | ifdef WITH_OWN_SUBPROCESS_PY |
| 356 | PYMODULES += compat/subprocess.py |
| 357 | else |
Johannes Schindelin | a348ab7 | 2006-02-19 21:13:48 +0100 | [diff] [blame] | 358 | ifeq ($(NO_PYTHON),) |
| 359 | ifneq ($(shell $(PYTHON_PATH) -c 'import subprocess;print"OK"' 2>/dev/null),OK) |
| 360 | PYMODULES += compat/subprocess.py |
| 361 | endif |
Timo Hirvonen | b34403a | 2005-12-01 03:32:01 +0200 | [diff] [blame] | 362 | endif |
| 363 | endif |
| 364 | |
Junio C Hamano | 229a7ed | 2005-09-23 10:41:40 -0700 | [diff] [blame] | 365 | ifndef NO_CURL |
| 366 | ifdef CURLDIR |
Junio C Hamano | 94d2331 | 2005-11-13 01:46:13 -0800 | [diff] [blame] | 367 | # This is still problematic -- gcc does not always want -R. |
Junio C Hamano | 12aa745 | 2005-11-04 23:50:09 -0800 | [diff] [blame] | 368 | ALL_CFLAGS += -I$(CURLDIR)/include |
Junio C Hamano | 229a7ed | 2005-09-23 10:41:40 -0700 | [diff] [blame] | 369 | CURL_LIBCURL = -L$(CURLDIR)/lib -R$(CURLDIR)/lib -lcurl |
| 370 | else |
| 371 | CURL_LIBCURL = -lcurl |
| 372 | endif |
H. Peter Anvin | 2f29dd5 | 2005-09-30 10:46:25 -0700 | [diff] [blame] | 373 | PROGRAMS += git-http-fetch$X |
Nick Hengeveld | 0890098 | 2005-11-18 17:08:36 -0800 | [diff] [blame] | 374 | curl_check := $(shell (echo 070908; curl-config --vernum) | sort -r | sed -ne 2p) |
| 375 | ifeq "$(curl_check)" "070908" |
| 376 | ifndef NO_EXPAT |
Nick Hengeveld | 0890098 | 2005-11-18 17:08:36 -0800 | [diff] [blame] | 377 | PROGRAMS += git-http-push$X |
| 378 | endif |
Nick Hengeveld | 58e60dd | 2005-11-02 11:19:24 -0800 | [diff] [blame] | 379 | endif |
Johannes Schindelin | 459a21b | 2006-04-05 16:22:40 +0200 | [diff] [blame] | 380 | ifndef NO_EXPAT |
| 381 | EXPAT_LIBEXPAT = -lexpat |
| 382 | endif |
Junio C Hamano | 229a7ed | 2005-09-23 10:41:40 -0700 | [diff] [blame] | 383 | endif |
| 384 | |
Petr Baudis | dd53c7a | 2005-07-29 17:50:51 +0200 | [diff] [blame] | 385 | ifndef NO_OPENSSL |
Junio C Hamano | 215a7ad | 2005-09-07 17:26:23 -0700 | [diff] [blame] | 386 | OPENSSL_LIBSSL = -lssl |
Junio C Hamano | 455a7f3 | 2005-09-30 13:31:16 -0700 | [diff] [blame] | 387 | ifdef OPENSSLDIR |
| 388 | # Again this may be problematic -- gcc does not always want -R. |
Junio C Hamano | 12aa745 | 2005-11-04 23:50:09 -0800 | [diff] [blame] | 389 | ALL_CFLAGS += -I$(OPENSSLDIR)/include |
Junio C Hamano | 455a7f3 | 2005-09-30 13:31:16 -0700 | [diff] [blame] | 390 | OPENSSL_LINK = -L$(OPENSSLDIR)/lib -R$(OPENSSLDIR)/lib |
| 391 | else |
| 392 | OPENSSL_LINK = |
| 393 | endif |
Petr Baudis | dd53c7a | 2005-07-29 17:50:51 +0200 | [diff] [blame] | 394 | else |
Junio C Hamano | 12aa745 | 2005-11-04 23:50:09 -0800 | [diff] [blame] | 395 | ALL_CFLAGS += -DNO_OPENSSL |
Junio C Hamano | 215a7ad | 2005-09-07 17:26:23 -0700 | [diff] [blame] | 396 | MOZILLA_SHA1 = 1 |
| 397 | OPENSSL_LIBSSL = |
Petr Baudis | dd53c7a | 2005-07-29 17:50:51 +0200 | [diff] [blame] | 398 | endif |
Junio C Hamano | 597c9cc | 2005-09-07 12:22:56 -0700 | [diff] [blame] | 399 | ifdef NEEDS_SSL_WITH_CRYPTO |
Junio C Hamano | 455a7f3 | 2005-09-30 13:31:16 -0700 | [diff] [blame] | 400 | LIB_4_CRYPTO = $(OPENSSL_LINK) -lcrypto -lssl |
Junio C Hamano | 597c9cc | 2005-09-07 12:22:56 -0700 | [diff] [blame] | 401 | else |
Junio C Hamano | 455a7f3 | 2005-09-30 13:31:16 -0700 | [diff] [blame] | 402 | LIB_4_CRYPTO = $(OPENSSL_LINK) -lcrypto |
Junio C Hamano | 597c9cc | 2005-09-07 12:22:56 -0700 | [diff] [blame] | 403 | endif |
| 404 | ifdef NEEDS_LIBICONV |
Junio C Hamano | 455a7f3 | 2005-09-30 13:31:16 -0700 | [diff] [blame] | 405 | ifdef ICONVDIR |
| 406 | # Again this may be problematic -- gcc does not always want -R. |
Junio C Hamano | 12aa745 | 2005-11-04 23:50:09 -0800 | [diff] [blame] | 407 | ALL_CFLAGS += -I$(ICONVDIR)/include |
Junio C Hamano | 455a7f3 | 2005-09-30 13:31:16 -0700 | [diff] [blame] | 408 | ICONV_LINK = -L$(ICONVDIR)/lib -R$(ICONVDIR)/lib |
| 409 | else |
| 410 | ICONV_LINK = |
| 411 | endif |
Lukas Sandström | 34488e3 | 2006-06-13 22:21:50 +0200 | [diff] [blame] | 412 | LIBS += $(ICONV_LINK) -liconv |
Junio C Hamano | 597c9cc | 2005-09-07 12:22:56 -0700 | [diff] [blame] | 413 | endif |
Patrick Mauritz | f0ebff0 | 2005-09-06 01:24:03 +0200 | [diff] [blame] | 414 | ifdef NEEDS_SOCKET |
| 415 | LIBS += -lsocket |
| 416 | SIMPLE_LIB += -lsocket |
| 417 | endif |
Junio C Hamano | 5a90d4a | 2005-09-11 22:25:49 -0700 | [diff] [blame] | 418 | ifdef NEEDS_NSL |
| 419 | LIBS += -lnsl |
| 420 | SIMPLE_LIB += -lnsl |
| 421 | endif |
Junio C Hamano | 63be37b | 2006-01-19 17:13:57 -0800 | [diff] [blame] | 422 | ifdef NO_D_TYPE_IN_DIRENT |
| 423 | ALL_CFLAGS += -DNO_D_TYPE_IN_DIRENT |
| 424 | endif |
Junio C Hamano | 35a730f | 2006-01-19 17:13:51 -0800 | [diff] [blame] | 425 | ifdef NO_D_INO_IN_DIRENT |
| 426 | ALL_CFLAGS += -DNO_D_INO_IN_DIRENT |
| 427 | endif |
Junio C Hamano | 9f0bb90 | 2006-05-02 00:40:24 -0700 | [diff] [blame] | 428 | ifdef NO_SYMLINK_HEAD |
| 429 | ALL_CFLAGS += -DNO_SYMLINK_HEAD |
| 430 | endif |
Linus Torvalds | ef34af2 | 2005-09-18 18:30:50 -0700 | [diff] [blame] | 431 | ifdef NO_STRCASESTR |
Junio C Hamano | 4050c0d | 2005-12-05 11:54:29 -0800 | [diff] [blame] | 432 | COMPAT_CFLAGS += -DNO_STRCASESTR |
Jason Riedy | e40b61f | 2005-12-02 15:08:28 -0800 | [diff] [blame] | 433 | COMPAT_OBJS += compat/strcasestr.o |
| 434 | endif |
Peter Eriksen | 817151e | 2006-06-24 16:01:25 +0200 | [diff] [blame] | 435 | ifdef NO_STRLCPY |
| 436 | COMPAT_CFLAGS += -DNO_STRLCPY |
| 437 | COMPAT_OBJS += compat/strlcpy.o |
| 438 | endif |
Jason Riedy | e40b61f | 2005-12-02 15:08:28 -0800 | [diff] [blame] | 439 | ifdef NO_SETENV |
Junio C Hamano | 4050c0d | 2005-12-05 11:54:29 -0800 | [diff] [blame] | 440 | COMPAT_CFLAGS += -DNO_SETENV |
Jason Riedy | e40b61f | 2005-12-02 15:08:28 -0800 | [diff] [blame] | 441 | COMPAT_OBJS += compat/setenv.o |
Linus Torvalds | ef34af2 | 2005-09-18 18:30:50 -0700 | [diff] [blame] | 442 | endif |
Jason Riedy | 731043f | 2006-01-25 12:38:36 -0800 | [diff] [blame] | 443 | ifdef NO_SETENV |
| 444 | COMPAT_CFLAGS += -DNO_UNSETENV |
| 445 | COMPAT_OBJS += compat/unsetenv.o |
| 446 | endif |
Johannes Schindelin | 730d48a | 2005-10-08 15:54:36 -0700 | [diff] [blame] | 447 | ifdef NO_MMAP |
Junio C Hamano | 4050c0d | 2005-12-05 11:54:29 -0800 | [diff] [blame] | 448 | COMPAT_CFLAGS += -DNO_MMAP |
Jason Riedy | e40b61f | 2005-12-02 15:08:28 -0800 | [diff] [blame] | 449 | COMPAT_OBJS += compat/mmap.o |
Johannes Schindelin | 730d48a | 2005-10-08 15:54:36 -0700 | [diff] [blame] | 450 | endif |
hpa | 49744d6 | 2005-09-28 16:52:21 -0700 | [diff] [blame] | 451 | ifdef NO_IPV6 |
Junio C Hamano | bdc37f5 | 2006-01-19 17:13:32 -0800 | [diff] [blame] | 452 | ALL_CFLAGS += -DNO_IPV6 |
| 453 | endif |
| 454 | ifdef NO_SOCKADDR_STORAGE |
| 455 | ifdef NO_IPV6 |
| 456 | ALL_CFLAGS += -Dsockaddr_storage=sockaddr_in |
| 457 | else |
| 458 | ALL_CFLAGS += -Dsockaddr_storage=sockaddr_in6 |
| 459 | endif |
hpa | 49744d6 | 2005-09-28 16:52:21 -0700 | [diff] [blame] | 460 | endif |
Yakov Lerner | 6ba68ab | 2006-05-22 00:37:00 +0300 | [diff] [blame] | 461 | ifdef NO_INET_NTOP |
| 462 | LIB_OBJS += compat/inet_ntop.o |
| 463 | endif |
Linus Torvalds | cef661f | 2005-04-21 12:33:22 -0700 | [diff] [blame] | 464 | |
Fernando J. Pereda | b6e56ec | 2006-02-16 09:38:01 +0100 | [diff] [blame] | 465 | ifdef NO_ICONV |
| 466 | ALL_CFLAGS += -DNO_ICONV |
| 467 | endif |
| 468 | |
Nicolas Pitre | 7c6ef2f | 2005-09-20 12:27:13 -0400 | [diff] [blame] | 469 | ifdef PPC_SHA1 |
| 470 | SHA1_HEADER = "ppc/sha1.h" |
| 471 | LIB_OBJS += ppc/sha1.o ppc/sha1ppc.o |
| 472 | else |
| 473 | ifdef ARM_SHA1 |
| 474 | SHA1_HEADER = "arm/sha1.h" |
| 475 | LIB_OBJS += arm/sha1.o arm/sha1_arm.o |
| 476 | else |
| 477 | ifdef MOZILLA_SHA1 |
| 478 | SHA1_HEADER = "mozilla-sha1/sha1.h" |
| 479 | LIB_OBJS += mozilla-sha1/sha1.o |
| 480 | else |
| 481 | SHA1_HEADER = <openssl/sha.h> |
| 482 | LIBS += $(LIB_4_CRYPTO) |
| 483 | endif |
| 484 | endif |
| 485 | endif |
Johannes Schindelin | 5b5d4d9 | 2006-02-17 15:23:16 +0100 | [diff] [blame] | 486 | ifdef NO_ACCURATE_DIFF |
| 487 | ALL_CFLAGS += -DNO_ACCURATE_DIFF |
| 488 | endif |
Nicolas Pitre | 7c6ef2f | 2005-09-20 12:27:13 -0400 | [diff] [blame] | 489 | |
Pavel Roskin | addf88e | 2006-07-09 03:44:30 -0400 | [diff] [blame] | 490 | # Shell quote (do not use $(call) to accommodate ancient setups); |
Johannes Schindelin | 39c015c | 2006-02-18 12:40:22 +0100 | [diff] [blame] | 491 | |
| 492 | SHA1_HEADER_SQ = $(subst ','\'',$(SHA1_HEADER)) |
| 493 | |
| 494 | DESTDIR_SQ = $(subst ','\'',$(DESTDIR)) |
| 495 | bindir_SQ = $(subst ','\'',$(bindir)) |
| 496 | gitexecdir_SQ = $(subst ','\'',$(gitexecdir)) |
| 497 | template_dir_SQ = $(subst ','\'',$(template_dir)) |
Yakov Lerner | ca3bcab | 2006-06-15 01:36:00 +0300 | [diff] [blame] | 498 | prefix_SQ = $(subst ','\'',$(prefix)) |
Johannes Schindelin | 39c015c | 2006-02-18 12:40:22 +0100 | [diff] [blame] | 499 | |
| 500 | SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH)) |
| 501 | PERL_PATH_SQ = $(subst ','\'',$(PERL_PATH)) |
| 502 | PYTHON_PATH_SQ = $(subst ','\'',$(PYTHON_PATH)) |
| 503 | GIT_PYTHON_DIR_SQ = $(subst ','\'',$(GIT_PYTHON_DIR)) |
| 504 | |
| 505 | ALL_CFLAGS += -DSHA1_HEADER='$(SHA1_HEADER_SQ)' $(COMPAT_CFLAGS) |
Jason Riedy | e40b61f | 2005-12-02 15:08:28 -0800 | [diff] [blame] | 506 | LIB_OBJS += $(COMPAT_OBJS) |
Tom Prince | ec2d151 | 2005-10-11 18:47:33 -0700 | [diff] [blame] | 507 | export prefix TAR INSTALL DESTDIR SHELL_PATH template_dir |
Petr Baudis | 28818ff | 2005-07-29 17:50:24 +0200 | [diff] [blame] | 508 | ### Build rules |
Linus Torvalds | 8996702 | 2005-04-30 13:19:56 -0700 | [diff] [blame] | 509 | |
Junio C Hamano | f94fbbe | 2006-04-11 11:29:36 -0700 | [diff] [blame] | 510 | all: $(ALL_PROGRAMS) $(BUILT_INS) git$X gitk |
Petr Baudis | 28818ff | 2005-07-29 17:50:24 +0200 | [diff] [blame] | 511 | |
Junio C Hamano | d3af621 | 2005-08-06 12:50:14 -0700 | [diff] [blame] | 512 | all: |
| 513 | $(MAKE) -C templates |
Nicolas Pitre | a310d43 | 2005-05-19 10:27:14 -0400 | [diff] [blame] | 514 | |
Junio C Hamano | 4dc0002 | 2006-01-12 21:42:25 -0800 | [diff] [blame] | 515 | strip: $(PROGRAMS) git$X |
| 516 | $(STRIP) $(STRIP_OPTS) $(PROGRAMS) git$X |
| 517 | |
Yakov Lerner | ca3bcab | 2006-06-15 01:36:00 +0300 | [diff] [blame] | 518 | git$X: git.c common-cmds.h $(BUILTIN_OBJS) $(GITLIBS) GIT-CFLAGS |
Michal Ostrowski | 77cb17e | 2006-01-10 21:12:17 -0500 | [diff] [blame] | 519 | $(CC) -DGIT_VERSION='"$(GIT_VERSION)"' \ |
Junio C Hamano | 8eef8e0 | 2006-03-31 16:23:46 -0800 | [diff] [blame] | 520 | $(ALL_CFLAGS) -o $@ $(filter %.c,$^) \ |
Linus Torvalds | 70827b1 | 2006-04-21 10:27:34 -0700 | [diff] [blame] | 521 | $(BUILTIN_OBJS) $(ALL_LDFLAGS) $(LIBS) |
Junio C Hamano | 6a2e50f | 2005-09-07 21:26:52 -0700 | [diff] [blame] | 522 | |
Junio C Hamano | 08df617 | 2006-04-21 21:56:13 -0700 | [diff] [blame] | 523 | builtin-help.o: common-cmds.h |
| 524 | |
Junio C Hamano | 9173080 | 2006-04-10 17:37:58 -0700 | [diff] [blame] | 525 | $(BUILT_INS): git$X |
| 526 | rm -f $@ && ln git$X $@ |
| 527 | |
Fredrik Kuivinen | a87cd02 | 2006-03-09 17:24:19 +0100 | [diff] [blame] | 528 | common-cmds.h: Documentation/git-*.txt |
Jim Meyering | fc36f6a | 2006-05-25 18:52:01 +0200 | [diff] [blame] | 529 | ./generate-cmdlist.sh > $@+ |
| 530 | mv $@+ $@ |
Fredrik Kuivinen | a87cd02 | 2006-03-09 17:24:19 +0100 | [diff] [blame] | 531 | |
Andreas Ericsson | d6ebd25 | 2005-11-22 00:44:15 +0100 | [diff] [blame] | 532 | $(patsubst %.sh,%,$(SCRIPT_SH)) : % : %.sh |
Jim Meyering | fc36f6a | 2006-05-25 18:52:01 +0200 | [diff] [blame] | 533 | rm -f $@ $@+ |
Johannes Schindelin | 39c015c | 2006-02-18 12:40:22 +0100 | [diff] [blame] | 534 | sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \ |
Michal Rokos | d9bffc0 | 2006-07-08 17:32:04 +0200 | [diff] [blame] | 535 | -e 's|@@PERL@@|$(PERL_PATH_SQ)|g' \ |
Junio C Hamano | 3ff8cbe | 2005-10-04 12:41:35 -0700 | [diff] [blame] | 536 | -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \ |
Fernando J. Pereda | 6c5c62f | 2006-02-15 12:37:30 +0100 | [diff] [blame] | 537 | -e 's/@@NO_CURL@@/$(NO_CURL)/g' \ |
Johannes Schindelin | abb7c7b | 2006-02-18 13:01:18 +0100 | [diff] [blame] | 538 | -e 's/@@NO_PYTHON@@/$(NO_PYTHON)/g' \ |
Jim Meyering | fc36f6a | 2006-05-25 18:52:01 +0200 | [diff] [blame] | 539 | $@.sh >$@+ |
| 540 | chmod +x $@+ |
| 541 | mv $@+ $@ |
Junio C Hamano | bc6146d | 2005-09-08 18:50:33 -0700 | [diff] [blame] | 542 | |
| 543 | $(patsubst %.perl,%,$(SCRIPT_PERL)) : % : %.perl |
Jim Meyering | fc36f6a | 2006-05-25 18:52:01 +0200 | [diff] [blame] | 544 | rm -f $@ $@+ |
Johannes Schindelin | 39c015c | 2006-02-18 12:40:22 +0100 | [diff] [blame] | 545 | sed -e '1s|#!.*perl|#!$(PERL_PATH_SQ)|' \ |
Junio C Hamano | 3ff8cbe | 2005-10-04 12:41:35 -0700 | [diff] [blame] | 546 | -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \ |
Jim Meyering | fc36f6a | 2006-05-25 18:52:01 +0200 | [diff] [blame] | 547 | $@.perl >$@+ |
| 548 | chmod +x $@+ |
| 549 | mv $@+ $@ |
Junio C Hamano | bc6146d | 2005-09-08 18:50:33 -0700 | [diff] [blame] | 550 | |
Yakov Lerner | ca3bcab | 2006-06-15 01:36:00 +0300 | [diff] [blame] | 551 | $(patsubst %.py,%,$(SCRIPT_PYTHON)) : % : %.py GIT-CFLAGS |
Jim Meyering | fc36f6a | 2006-05-25 18:52:01 +0200 | [diff] [blame] | 552 | rm -f $@ $@+ |
Johannes Schindelin | 39c015c | 2006-02-18 12:40:22 +0100 | [diff] [blame] | 553 | sed -e '1s|#!.*python|#!$(PYTHON_PATH_SQ)|' \ |
| 554 | -e 's|@@GIT_PYTHON_PATH@@|$(GIT_PYTHON_DIR_SQ)|g' \ |
Junio C Hamano | 3ff8cbe | 2005-10-04 12:41:35 -0700 | [diff] [blame] | 555 | -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \ |
Jim Meyering | fc36f6a | 2006-05-25 18:52:01 +0200 | [diff] [blame] | 556 | $@.py >$@+ |
| 557 | chmod +x $@+ |
| 558 | mv $@+ $@ |
Junio C Hamano | 720d150 | 2005-09-10 17:46:27 -0700 | [diff] [blame] | 559 | |
Johannes Schindelin | 4eba0f3 | 2005-10-20 17:13:24 +0200 | [diff] [blame] | 560 | git-cherry-pick: git-revert |
Jim Meyering | fc36f6a | 2006-05-25 18:52:01 +0200 | [diff] [blame] | 561 | cp $< $@+ |
| 562 | mv $@+ $@ |
Johannes Schindelin | 4eba0f3 | 2005-10-20 17:13:24 +0200 | [diff] [blame] | 563 | |
Junio C Hamano | cf7bb58 | 2006-02-10 00:45:59 -0800 | [diff] [blame] | 564 | git-status: git-commit |
Jim Meyering | fc36f6a | 2006-05-25 18:52:01 +0200 | [diff] [blame] | 565 | cp $< $@+ |
| 566 | mv $@+ $@ |
Junio C Hamano | cf7bb58 | 2006-02-10 00:45:59 -0800 | [diff] [blame] | 567 | |
Eric Wong | a51d37c | 2006-07-01 15:14:14 -0700 | [diff] [blame] | 568 | git-instaweb: git-instaweb.sh gitweb/gitweb.cgi gitweb/gitweb.css |
| 569 | rm -f $@ $@+ |
| 570 | sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \ |
| 571 | -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \ |
| 572 | -e 's/@@NO_CURL@@/$(NO_CURL)/g' \ |
| 573 | -e 's/@@NO_PYTHON@@/$(NO_PYTHON)/g' \ |
Michal Rokos | 6e959ab | 2006-07-08 17:27:10 +0200 | [diff] [blame] | 574 | -e '/@@GITWEB_CGI@@/r gitweb/gitweb.cgi' \ |
Johannes Schindelin | 0700228 | 2006-07-02 11:31:30 +0200 | [diff] [blame] | 575 | -e '/@@GITWEB_CGI@@/d' \ |
Michal Rokos | 6e959ab | 2006-07-08 17:27:10 +0200 | [diff] [blame] | 576 | -e '/@@GITWEB_CSS@@/r gitweb/gitweb.css' \ |
Johannes Schindelin | 0700228 | 2006-07-02 11:31:30 +0200 | [diff] [blame] | 577 | -e '/@@GITWEB_CSS@@/d' \ |
| 578 | $@.sh > $@+ |
Eric Wong | a51d37c | 2006-07-01 15:14:14 -0700 | [diff] [blame] | 579 | chmod +x $@+ |
| 580 | mv $@+ $@ |
| 581 | |
Junio C Hamano | 9b88fce | 2005-12-27 14:40:17 -0800 | [diff] [blame] | 582 | # These can record GIT_VERSION |
| 583 | git$X git.spec \ |
| 584 | $(patsubst %.sh,%,$(SCRIPT_SH)) \ |
| 585 | $(patsubst %.perl,%,$(SCRIPT_PERL)) \ |
| 586 | $(patsubst %.py,%,$(SCRIPT_PYTHON)) \ |
| 587 | : GIT-VERSION-FILE |
Johannes Schindelin | e99fcf9 | 2005-12-22 20:38:23 +0100 | [diff] [blame] | 588 | |
Yakov Lerner | ca3bcab | 2006-06-15 01:36:00 +0300 | [diff] [blame] | 589 | %.o: %.c GIT-CFLAGS |
Pavel Roskin | b05701c | 2005-08-06 01:36:15 -0400 | [diff] [blame] | 590 | $(CC) -o $*.o -c $(ALL_CFLAGS) $< |
| 591 | %.o: %.S |
| 592 | $(CC) -o $*.o -c $(ALL_CFLAGS) $< |
| 593 | |
Yakov Lerner | ca3bcab | 2006-06-15 01:36:00 +0300 | [diff] [blame] | 594 | exec_cmd.o: exec_cmd.c GIT-CFLAGS |
Johannes Schindelin | 39c015c | 2006-02-18 12:40:22 +0100 | [diff] [blame] | 595 | $(CC) -o $*.o -c $(ALL_CFLAGS) '-DGIT_EXEC_PATH="$(gitexecdir_SQ)"' $< |
Yakov Lerner | c1f8064 | 2006-06-22 04:47:00 +0300 | [diff] [blame] | 596 | builtin-init-db.o: builtin-init-db.c GIT-CFLAGS |
| 597 | $(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] | 598 | |
Yakov Lerner | ca3bcab | 2006-06-15 01:36:00 +0300 | [diff] [blame] | 599 | http.o: http.c GIT-CFLAGS |
Nick Hengeveld | 20fc9bc | 2006-04-04 10:11:29 -0700 | [diff] [blame] | 600 | $(CC) -o $*.o -c $(ALL_CFLAGS) -DGIT_USER_AGENT='"git/$(GIT_VERSION)"' $< |
| 601 | |
Nick Hengeveld | 8d9fbe5 | 2006-04-04 05:33:18 -0700 | [diff] [blame] | 602 | ifdef NO_EXPAT |
Yakov Lerner | ca3bcab | 2006-06-15 01:36:00 +0300 | [diff] [blame] | 603 | http-fetch.o: http-fetch.c http.h GIT-CFLAGS |
Nick Hengeveld | 8d9fbe5 | 2006-04-04 05:33:18 -0700 | [diff] [blame] | 604 | $(CC) -o $*.o -c $(ALL_CFLAGS) -DNO_EXPAT $< |
| 605 | endif |
| 606 | |
Junio C Hamano | 8eef8e0 | 2006-03-31 16:23:46 -0800 | [diff] [blame] | 607 | git-%$X: %.o $(GITLIBS) |
Junio C Hamano | 94d2331 | 2005-11-13 01:46:13 -0800 | [diff] [blame] | 608 | $(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS) |
Daniel Barkalow | 6eb7ed5 | 2005-04-23 18:47:23 -0700 | [diff] [blame] | 609 | |
Junio C Hamano | 597c9cc | 2005-09-07 12:22:56 -0700 | [diff] [blame] | 610 | $(SIMPLE_PROGRAMS) : $(LIB_FILE) |
H. Peter Anvin | 2f29dd5 | 2005-09-30 10:46:25 -0700 | [diff] [blame] | 611 | $(SIMPLE_PROGRAMS) : git-%$X : %.o |
Junio C Hamano | 94d2331 | 2005-11-13 01:46:13 -0800 | [diff] [blame] | 612 | $(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \ |
| 613 | $(LIB_FILE) $(SIMPLE_LIB) |
Junio C Hamano | 597c9cc | 2005-09-07 12:22:56 -0700 | [diff] [blame] | 614 | |
H. Peter Anvin | 2f29dd5 | 2005-09-30 10:46:25 -0700 | [diff] [blame] | 615 | git-local-fetch$X: fetch.o |
| 616 | git-ssh-fetch$X: rsh.o fetch.o |
| 617 | git-ssh-upload$X: rsh.o |
| 618 | git-ssh-pull$X: rsh.o fetch.o |
| 619 | git-ssh-push$X: rsh.o |
Daniel Barkalow | 6eb7ed5 | 2005-04-23 18:47:23 -0700 | [diff] [blame] | 620 | |
Mike McCormack | f2561fd | 2006-03-10 14:32:50 +0900 | [diff] [blame] | 621 | git-imap-send$X: imap-send.o $(LIB_FILE) |
| 622 | |
Junio C Hamano | dd8239f | 2006-06-06 14:26:57 -0700 | [diff] [blame] | 623 | http.o http-fetch.o http-push.o: http.h |
Junio C Hamano | 8fced61 | 2006-07-03 00:53:13 -0700 | [diff] [blame] | 624 | git-http-fetch$X: fetch.o http.o http-fetch.o $(GITLIBS) |
Johannes Schindelin | 39c015c | 2006-02-18 12:40:22 +0100 | [diff] [blame] | 625 | $(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \ |
Nick Hengeveld | 8d9fbe5 | 2006-04-04 05:33:18 -0700 | [diff] [blame] | 626 | $(LIBS) $(CURL_LIBCURL) $(EXPAT_LIBEXPAT) |
Johannes Schindelin | 39c015c | 2006-02-18 12:40:22 +0100 | [diff] [blame] | 627 | |
Junio C Hamano | 8fced61 | 2006-07-03 00:53:13 -0700 | [diff] [blame] | 628 | git-http-push$X: revision.o http.o http-push.o $(GITLIBS) |
Johannes Schindelin | 39c015c | 2006-02-18 12:40:22 +0100 | [diff] [blame] | 629 | $(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \ |
| 630 | $(LIBS) $(CURL_LIBCURL) $(EXPAT_LIBEXPAT) |
| 631 | |
Linus Torvalds | 70827b1 | 2006-04-21 10:27:34 -0700 | [diff] [blame] | 632 | $(LIB_OBJS) $(BUILTIN_OBJS): $(LIB_H) |
Junio C Hamano | 1f33026 | 2006-06-22 15:43:47 -0700 | [diff] [blame] | 633 | $(patsubst git-%$X,%.o,$(PROGRAMS)): $(LIB_H) $(wildcard */*.h) |
Petr Baudis | e468305 | 2005-07-29 17:48:50 +0200 | [diff] [blame] | 634 | $(DIFF_OBJS): diffcore.h |
Linus Torvalds | e83c516 | 2005-04-07 15:13:13 -0700 | [diff] [blame] | 635 | |
Petr Baudis | 28818ff | 2005-07-29 17:50:24 +0200 | [diff] [blame] | 636 | $(LIB_FILE): $(LIB_OBJS) |
Junio C Hamano | 71459c1 | 2006-04-25 23:11:17 -0700 | [diff] [blame] | 637 | rm -f $@ && $(AR) rcs $@ $(LIB_OBJS) |
Petr Baudis | 28818ff | 2005-07-29 17:50:24 +0200 | [diff] [blame] | 638 | |
Linus Torvalds | 3443546 | 2006-03-24 20:13:22 -0800 | [diff] [blame] | 639 | XDIFF_OBJS=xdiff/xdiffi.o xdiff/xprepare.o xdiff/xutils.o xdiff/xemit.o |
| 640 | |
| 641 | $(XDIFF_LIB): $(XDIFF_OBJS) |
Junio C Hamano | 2d86d2c | 2006-04-26 03:12:58 -0700 | [diff] [blame] | 642 | rm -f $@ && $(AR) rcs $@ $(XDIFF_OBJS) |
Linus Torvalds | 3443546 | 2006-03-24 20:13:22 -0800 | [diff] [blame] | 643 | |
| 644 | |
Petr Baudis | 28818ff | 2005-07-29 17:50:24 +0200 | [diff] [blame] | 645 | doc: |
| 646 | $(MAKE) -C Documentation all |
| 647 | |
Fredrik Kuivinen | f81e7c6 | 2006-03-18 11:07:12 +0100 | [diff] [blame] | 648 | TAGS: |
| 649 | rm -f TAGS |
| 650 | find . -name '*.[hcS]' -print | xargs etags -a |
| 651 | |
| 652 | tags: |
| 653 | rm -f tags |
| 654 | find . -name '*.[hcS]' -print | xargs ctags -a |
Petr Baudis | 28818ff | 2005-07-29 17:50:24 +0200 | [diff] [blame] | 655 | |
Yakov Lerner | ca3bcab | 2006-06-15 01:36:00 +0300 | [diff] [blame] | 656 | ### Detect prefix changes |
Junio C Hamano | bbc932c | 2006-06-22 02:04:27 -0700 | [diff] [blame] | 657 | TRACK_CFLAGS = $(subst ','\'',$(ALL_CFLAGS)):$(GIT_PYTHON_DIR_SQ):\ |
Yakov Lerner | ca3bcab | 2006-06-15 01:36:00 +0300 | [diff] [blame] | 658 | $(bindir_SQ):$(gitexecdir_SQ):$(template_dir_SQ):$(prefix_SQ) |
| 659 | |
| 660 | GIT-CFLAGS: .FORCE-GIT-CFLAGS |
| 661 | @FLAGS='$(TRACK_CFLAGS)'; \ |
| 662 | if test x"$$FLAGS" != x"`cat GIT-CFLAGS 2>/dev/null`" ; then \ |
| 663 | echo 1>&2 " * new build flags or prefix"; \ |
| 664 | echo "$$FLAGS" >GIT-CFLAGS; \ |
| 665 | fi |
| 666 | |
Petr Baudis | 28818ff | 2005-07-29 17:50:24 +0200 | [diff] [blame] | 667 | ### Testing rules |
| 668 | |
Johannes Schindelin | abb7c7b | 2006-02-18 13:01:18 +0100 | [diff] [blame] | 669 | # GNU make supports exporting all variables by "export" without parameters. |
| 670 | # However, the environment gets quite big, and some programs have problems |
| 671 | # with that. |
| 672 | |
| 673 | export NO_PYTHON |
Johannes Schindelin | 140245b | 2006-07-07 13:26:31 +0200 | [diff] [blame] | 674 | export NO_SVN_TESTS |
Johannes Schindelin | abb7c7b | 2006-02-18 13:01:18 +0100 | [diff] [blame] | 675 | |
Petr Baudis | 28818ff | 2005-07-29 17:50:24 +0200 | [diff] [blame] | 676 | test: all |
| 677 | $(MAKE) -C t/ all |
| 678 | |
Junio C Hamano | 4ccafd7 | 2005-11-02 12:01:06 -0800 | [diff] [blame] | 679 | test-date$X: test-date.c date.o ctype.o |
Junio C Hamano | 94d2331 | 2005-11-13 01:46:13 -0800 | [diff] [blame] | 680 | $(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] | 681 | |
H. Peter Anvin | 2f29dd5 | 2005-09-30 10:46:25 -0700 | [diff] [blame] | 682 | test-delta$X: test-delta.c diff-delta.o patch-delta.o |
Nicolas Pitre | 3dc5a9e | 2006-04-29 00:58:05 -0400 | [diff] [blame] | 683 | $(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $^ |
Petr Baudis | 28818ff | 2005-07-29 17:50:24 +0200 | [diff] [blame] | 684 | |
Junio C Hamano | 1744820 | 2006-04-23 20:20:25 -0700 | [diff] [blame] | 685 | test-dump-cache-tree$X: dump-cache-tree.o $(GITLIBS) |
| 686 | $(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS) |
| 687 | |
Junio C Hamano | b65bc21 | 2006-06-24 00:59:49 -0700 | [diff] [blame] | 688 | test-sha1$X: test-sha1.o $(GITLIBS) |
| 689 | $(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS) |
| 690 | |
| 691 | check-sha1:: test-sha1$X |
| 692 | ./test-sha1.sh |
| 693 | |
Petr Baudis | 28818ff | 2005-07-29 17:50:24 +0200 | [diff] [blame] | 694 | check: |
Junio C Hamano | 773b633 | 2005-12-14 13:32:52 -0800 | [diff] [blame] | 695 | 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] | 696 | |
| 697 | |
| 698 | |
| 699 | ### Installation rules |
| 700 | |
Andreas Ericsson | d6ebd25 | 2005-11-22 00:44:15 +0100 | [diff] [blame] | 701 | install: all |
Johannes Schindelin | 39c015c | 2006-02-18 12:40:22 +0100 | [diff] [blame] | 702 | $(INSTALL) -d -m755 '$(DESTDIR_SQ)$(bindir_SQ)' |
| 703 | $(INSTALL) -d -m755 '$(DESTDIR_SQ)$(gitexecdir_SQ)' |
| 704 | $(INSTALL) $(ALL_PROGRAMS) '$(DESTDIR_SQ)$(gitexecdir_SQ)' |
| 705 | $(INSTALL) git$X gitk '$(DESTDIR_SQ)$(bindir_SQ)' |
Junio C Hamano | 8d5afef | 2005-08-02 16:45:21 -0700 | [diff] [blame] | 706 | $(MAKE) -C templates install |
Johannes Schindelin | 39c015c | 2006-02-18 12:40:22 +0100 | [diff] [blame] | 707 | $(INSTALL) -d -m755 '$(DESTDIR_SQ)$(GIT_PYTHON_DIR_SQ)' |
| 708 | $(INSTALL) $(PYMODULES) '$(DESTDIR_SQ)$(GIT_PYTHON_DIR_SQ)' |
Sean | 7f7e6ea | 2006-05-22 00:42:59 -0400 | [diff] [blame] | 709 | if test 'z$(bindir_SQ)' != 'z$(gitexecdir_SQ)'; \ |
| 710 | then \ |
| 711 | ln -f '$(DESTDIR_SQ)$(bindir_SQ)/git$X' \ |
| 712 | '$(DESTDIR_SQ)$(gitexecdir_SQ)/git$X' || \ |
| 713 | cp '$(DESTDIR_SQ)$(bindir_SQ)/git$X' \ |
| 714 | '$(DESTDIR_SQ)$(gitexecdir_SQ)/git$X'; \ |
| 715 | fi |
| 716 | $(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] | 717 | |
| 718 | install-doc: |
| 719 | $(MAKE) -C Documentation install |
| 720 | |
| 721 | |
| 722 | |
| 723 | |
| 724 | ### Maintainer's dist rules |
| 725 | |
Junio C Hamano | 9b88fce | 2005-12-27 14:40:17 -0800 | [diff] [blame] | 726 | git.spec: git.spec.in |
Jim Meyering | fc36f6a | 2006-05-25 18:52:01 +0200 | [diff] [blame] | 727 | sed -e 's/@@VERSION@@/$(GIT_VERSION)/g' < $< > $@+ |
| 728 | mv $@+ $@ |
Chris Wright | a9db297 | 2005-07-07 13:09:50 -0700 | [diff] [blame] | 729 | |
Junio C Hamano | 27dedf0 | 2005-11-16 21:32:44 -0800 | [diff] [blame] | 730 | GIT_TARNAME=git-$(GIT_VERSION) |
| 731 | dist: git.spec git-tar-tree |
Rene Scharfe | 9cd625b | 2006-06-18 15:25:33 +0200 | [diff] [blame] | 732 | ./git-tar-tree HEAD^{tree} $(GIT_TARNAME) > $(GIT_TARNAME).tar |
Chris Wright | a9db297 | 2005-07-07 13:09:50 -0700 | [diff] [blame] | 733 | @mkdir -p $(GIT_TARNAME) |
Junio C Hamano | 27dedf0 | 2005-11-16 21:32:44 -0800 | [diff] [blame] | 734 | @cp git.spec $(GIT_TARNAME) |
H. Peter Anvin | 181129d | 2006-01-09 18:07:01 -0800 | [diff] [blame] | 735 | @echo $(GIT_VERSION) > $(GIT_TARNAME)/version |
| 736 | $(TAR) rf $(GIT_TARNAME).tar \ |
| 737 | $(GIT_TARNAME)/git.spec $(GIT_TARNAME)/version |
Chris Wright | a9db297 | 2005-07-07 13:09:50 -0700 | [diff] [blame] | 738 | @rm -rf $(GIT_TARNAME) |
Eric W. Biederman | 9dce3c0 | 2005-07-14 19:20:50 -0600 | [diff] [blame] | 739 | gzip -f -9 $(GIT_TARNAME).tar |
Chris Wright | a9db297 | 2005-07-07 13:09:50 -0700 | [diff] [blame] | 740 | |
| 741 | rpm: dist |
Junio C Hamano | 27dedf0 | 2005-11-16 21:32:44 -0800 | [diff] [blame] | 742 | $(RPMBUILD) -ta $(GIT_TARNAME).tar.gz |
Chris Wright | a9db297 | 2005-07-07 13:09:50 -0700 | [diff] [blame] | 743 | |
Tilman Sauerbeck | 52db049 | 2006-05-18 12:57:04 +0200 | [diff] [blame] | 744 | htmldocs = git-htmldocs-$(GIT_VERSION) |
| 745 | manpages = git-manpages-$(GIT_VERSION) |
| 746 | dist-doc: |
| 747 | rm -fr .doc-tmp-dir |
| 748 | mkdir .doc-tmp-dir |
| 749 | $(MAKE) -C Documentation WEBDOC_DEST=../.doc-tmp-dir install-webdoc |
| 750 | cd .doc-tmp-dir && $(TAR) cf ../$(htmldocs).tar . |
| 751 | gzip -n -9 -f $(htmldocs).tar |
| 752 | : |
| 753 | rm -fr .doc-tmp-dir |
| 754 | mkdir .doc-tmp-dir .doc-tmp-dir/man1 .doc-tmp-dir/man7 |
Martin Waitz | c536032 | 2006-05-25 14:37:46 +0200 | [diff] [blame] | 755 | $(MAKE) -C Documentation DESTDIR=./ \ |
Tilman Sauerbeck | 52db049 | 2006-05-18 12:57:04 +0200 | [diff] [blame] | 756 | man1=../.doc-tmp-dir/man1 \ |
| 757 | man7=../.doc-tmp-dir/man7 \ |
| 758 | install |
| 759 | cd .doc-tmp-dir && $(TAR) cf ../$(manpages).tar . |
| 760 | gzip -n -9 -f $(manpages).tar |
| 761 | rm -fr .doc-tmp-dir |
| 762 | |
Petr Baudis | 28818ff | 2005-07-29 17:50:24 +0200 | [diff] [blame] | 763 | ### Cleaning rules |
Eric W. Biederman | 87a81c8 | 2005-07-14 19:21:57 -0600 | [diff] [blame] | 764 | |
Linus Torvalds | e83c516 | 2005-04-07 15:13:13 -0700 | [diff] [blame] | 765 | clean: |
Junio C Hamano | 3467fec | 2006-03-26 23:41:22 -0800 | [diff] [blame] | 766 | rm -f *.o mozilla-sha1/*.o arm/*.o ppc/*.o compat/*.o xdiff/*.o \ |
| 767 | $(LIB_FILE) $(XDIFF_LIB) |
A Large Angry SCM | e6bfaf3 | 2006-04-16 20:17:38 -0700 | [diff] [blame] | 768 | rm -f $(ALL_PROGRAMS) $(BUILT_INS) git$X |
Fredrik Kuivinen | f81e7c6 | 2006-03-18 11:07:12 +0100 | [diff] [blame] | 769 | rm -f *.spec *.pyc *.pyo */*.pyc */*.pyo common-cmds.h TAGS tags |
Tilman Sauerbeck | 52db049 | 2006-05-18 12:57:04 +0200 | [diff] [blame] | 770 | rm -rf $(GIT_TARNAME) .doc-tmp-dir |
Junio C Hamano | 5a571cd | 2005-08-12 01:03:07 -0700 | [diff] [blame] | 771 | 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] | 772 | rm -f $(htmldocs).tar.gz $(manpages).tar.gz |
Thomas Glanzmann | ca67f00 | 2005-05-22 20:27:28 +0200 | [diff] [blame] | 773 | $(MAKE) -C Documentation/ clean |
Junio C Hamano | 229a7ed | 2005-09-23 10:41:40 -0700 | [diff] [blame] | 774 | $(MAKE) -C templates clean |
Junio C Hamano | 4b7581f | 2005-08-02 17:24:11 -0700 | [diff] [blame] | 775 | $(MAKE) -C t/ clean |
Yakov Lerner | ca3bcab | 2006-06-15 01:36:00 +0300 | [diff] [blame] | 776 | rm -f GIT-VERSION-FILE GIT-CFLAGS |
Junio C Hamano | 9b88fce | 2005-12-27 14:40:17 -0800 | [diff] [blame] | 777 | |
Junio C Hamano | 4dc0002 | 2006-01-12 21:42:25 -0800 | [diff] [blame] | 778 | .PHONY: all install clean strip |
Yakov Lerner | ca3bcab | 2006-06-15 01:36:00 +0300 | [diff] [blame] | 779 | .PHONY: .FORCE-GIT-VERSION-FILE TAGS tags .FORCE-GIT-CFLAGS |
Junio C Hamano | d89056c | 2005-12-19 17:59:58 -0800 | [diff] [blame] | 780 | |
Junio C Hamano | 8c989ec | 2006-04-13 00:17:19 -0700 | [diff] [blame] | 781 | ### Check documentation |
| 782 | # |
| 783 | check-docs:: |
| 784 | @for v in $(ALL_PROGRAMS) $(BUILT_INS) git$X gitk; \ |
| 785 | do \ |
| 786 | case "$$v" in \ |
Junio C Hamano | 8c989ec | 2006-04-13 00:17:19 -0700 | [diff] [blame] | 787 | git-merge-octopus | git-merge-ours | git-merge-recursive | \ |
| 788 | git-merge-resolve | git-merge-stupid | \ |
| 789 | git-ssh-pull | git-ssh-push ) continue ;; \ |
| 790 | esac ; \ |
| 791 | test -f "Documentation/$$v.txt" || \ |
| 792 | echo "no doc: $$v"; \ |
| 793 | grep -q "^gitlink:$$v\[[0-9]\]::" Documentation/git.txt || \ |
| 794 | case "$$v" in \ |
| 795 | git) ;; \ |
| 796 | *) echo "no link: $$v";; \ |
| 797 | esac ; \ |
| 798 | done | sort |