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