blob: 22b8a378c65cdfa7dfc7a6edaa0aae47662461b7 [file] [log] [blame]
Junio C Hamano2731d042005-12-01 12:26:41 -08001# The default target of this Makefile is...
2all:
3
Linus Torvalds765ac8e2006-02-28 15:07:20 -08004# Define NO_OPENSSL environment variable if you do not have OpenSSL.
5# This also implies MOZILLA_SHA1.
Petr Baudis5bdac8b2005-07-29 17:48:26 +02006#
Nick Hengeveld58e60dd2005-11-02 11:19:24 -08007# 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 Schindelinb2c0bd62005-07-31 02:14:23 +020010#
Patrick Mauritz6d9bbc52005-09-19 16:11:19 +020011# Define CURLDIR=/foo/bar if your curl header and library files are in
12# /foo/bar/include and /foo/bar/lib directories.
13#
Nick Hengeveld58e60dd2005-11-02 11:19:24 -080014# 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 Hamano35a730f2006-01-19 17:13:51 -080017# Define NO_D_INO_IN_DIRENT if you don't have d_ino in your struct dirent.
18#
Junio C Hamano63be37b2006-01-19 17:13:57 -080019# Define NO_D_TYPE_IN_DIRENT if your platform defines DT_UNKNOWN but lacks
20# d_type in struct dirent (latest Cygwin -- will be fixed soonish).
21#
Ramsay Allan Jones579d1fb2006-07-30 16:38:28 +010022# Define NO_C99_FORMAT if your formatted IO functions (printf/scanf et.al.)
23# do not support the 'size specifiers' introduced by C99, namely ll, hh,
24# j, z, t. (representing long long int, char, intmax_t, size_t, ptrdiff_t).
Jakub Narebski465e6492006-08-04 17:55:58 +020025# some C compilers supported these specifiers prior to C99 as an extension.
Ramsay Allan Jones579d1fb2006-07-30 16:38:28 +010026#
Linus Torvaldsef34af22005-09-18 18:30:50 -070027# Define NO_STRCASESTR if you don't have strcasestr.
28#
Peter Eriksen817151e2006-06-24 16:01:25 +020029# Define NO_STRLCPY if you don't have strlcpy.
30#
Jason Riedye40b61f2005-12-02 15:08:28 -080031# Define NO_SETENV if you don't have setenv in the C library.
32#
Junio C Hamano9f0bb902006-05-02 00:40:24 -070033# 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 Roskin2fabd212005-11-15 00:59:50 -050035#
Pavel Roskin02853582006-07-09 02:44:58 -070036# Define NO_SVN_TESTS if you want to skip time-consuming SVN interoperability
Eric Wong60d02cc2006-07-06 00:14:16 -070037# 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 Pearce8eb38ca2006-07-24 00:28:28 -040040# 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 Baudis5bdac8b2005-07-29 17:48:26 +020052# Define PPC_SHA1 environment variable when running make to make use of
53# a bundled SHA1 routine optimized for PowerPC.
Junio C Hamano597c9cc2005-09-07 12:22:56 -070054#
Nicolas Pitre7c6ef2f2005-09-20 12:27:13 -040055# Define ARM_SHA1 environment variable when running make to make use of
56# a bundled SHA1 routine optimized for ARM.
57#
Junio C Hamanof6af75d2006-06-23 17:57:48 -070058# Define MOZILLA_SHA1 environment variable when running make to make use of
59# a bundled SHA1 routine coming from Mozilla. It is GPL'd and should be fast
60# on non-x86 architectures (e.g. PowerPC), while the OpenSSL version (default
61# choice) has very fast version optimized for i586.
62#
Junio C Hamano597c9cc2005-09-07 12:22:56 -070063# Define NEEDS_SSL_WITH_CRYPTO if you need -lcrypto with -lssl (Darwin).
Patrick Mauritzf0ebff02005-09-06 01:24:03 +020064#
Junio C Hamano597c9cc2005-09-07 12:22:56 -070065# Define NEEDS_LIBICONV if linking with libc is not enough (Darwin).
Patrick Mauritzf0ebff02005-09-06 01:24:03 +020066#
67# Define NEEDS_SOCKET if linking with libc is not enough (SunOS,
68# Patrick Mauritz).
69#
Johannes Schindelin730d48a2005-10-08 15:54:36 -070070# Define NO_MMAP if you want to avoid mmap.
71#
Shawn O. Pearce1510fea2006-12-14 06:15:57 -050072# Define NO_FAST_WORKING_DIRECTORY if accessing objects in pack files is
73# generally faster on your platform than accessing the working directory.
74#
hpa49744d62005-09-28 16:52:21 -070075# Define NO_IPV6 if you lack IPv6 support and getaddrinfo().
76#
Junio C Hamanobdc37f52006-01-19 17:13:32 -080077# Define NO_SOCKADDR_STORAGE if your platform does not have struct
78# sockaddr_storage.
79#
Fernando J. Peredab6e56ec2006-02-16 09:38:01 +010080# Define NO_ICONV if your libc does not properly support iconv.
81#
Junio C Hamanobbfc63d2006-12-27 14:17:35 -080082# Define NO_R_TO_GCC if your gcc does not like "-R/path/lib" that
83# tells runtime paths to dynamic libraries; "-Wl,-rpath=/path/lib"
84# is used instead.
85#
Petr Baudis5bdac8b2005-07-29 17:48:26 +020086# Define USE_NSEC below if you want git to care about sub-second file mtimes
87# and ctimes. Note that you need recent glibc (at least 2.2.4) for this, and
88# it will BREAK YOUR LOCAL DIFFS! show-diff and anything using it will likely
89# randomly break unless your underlying filesystem supports those sub-second
90# times (my ext3 doesn't).
Junio C Hamanof6af75d2006-06-23 17:57:48 -070091#
Petr Baudis5bdac8b2005-07-29 17:48:26 +020092# Define USE_STDEV below if you want git to care about the underlying device
93# change being considered an inode change from the update-cache perspective.
Alex Riesenf8487182006-12-04 10:50:04 +010094#
95# Define NO_PERL_MAKEMAKER if you cannot use Makefiles generated by perl's
96# MakeMaker (e.g. using ActiveState under Cygwin).
97#
Petr Baudis5bdac8b2005-07-29 17:48:26 +020098
Junio C Hamano9b88fce2005-12-27 14:40:17 -080099GIT-VERSION-FILE: .FORCE-GIT-VERSION-FILE
Fredrik Kuivinen36546382006-02-14 00:15:14 +0100100 @$(SHELL_PATH) ./GIT-VERSION-GEN
Junio C Hamano9b88fce2005-12-27 14:40:17 -0800101-include GIT-VERSION-FILE
Petr Baudis5bdac8b2005-07-29 17:48:26 +0200102
Paul Jakmae15f5452006-02-20 23:36:28 +0000103uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not')
104uname_M := $(shell sh -c 'uname -m 2>/dev/null || echo not')
105uname_O := $(shell sh -c 'uname -o 2>/dev/null || echo not')
106uname_R := $(shell sh -c 'uname -r 2>/dev/null || echo not')
107uname_P := $(shell sh -c 'uname -p 2>/dev/null || echo not')
108
Junio C Hamano94d23312005-11-13 01:46:13 -0800109# CFLAGS and LDFLAGS are for the users to override from the command line.
Junio C Hamano12aa7452005-11-04 23:50:09 -0800110
Pavel Roskinb05701c2005-08-06 01:36:15 -0400111CFLAGS = -g -O2 -Wall
Junio C Hamano94d23312005-11-13 01:46:13 -0800112LDFLAGS =
Junio C Hamano12aa7452005-11-04 23:50:09 -0800113ALL_CFLAGS = $(CFLAGS)
Junio C Hamano94d23312005-11-13 01:46:13 -0800114ALL_LDFLAGS = $(LDFLAGS)
Junio C Hamano4dc00022006-01-12 21:42:25 -0800115STRIP ?= strip
Thomas Glanzmann29c2cce2005-05-07 10:41:54 +0200116
Pavel Roskinb05701c2005-08-06 01:36:15 -0400117prefix = $(HOME)
118bindir = $(prefix)/bin
Paul Jakmae15f5452006-02-20 23:36:28 +0000119gitexecdir = $(bindir)
Pavel Roskinb05701c2005-08-06 01:36:15 -0400120template_dir = $(prefix)/share/git-core/templates/
Petr Baudisa682ef92005-08-05 01:56:38 +0200121# DESTDIR=
Petr Baudis5c2a7fb2005-04-13 02:14:06 -0700122
Martin Waitz5d043a32006-08-01 21:34:08 +0200123# default configuration for gitweb
Jeff Kingc8d138a2006-08-02 15:23:34 -0400124GITWEB_CONFIG = gitweb_config.perl
Yasushi SHOJI2de21fa2006-08-15 07:50:49 +0900125GITWEB_HOME_LINK_STR = projects
Martin Waitz5d043a32006-08-01 21:34:08 +0200126GITWEB_SITENAME =
127GITWEB_PROJECTROOT = /pub/git
Matthias Lederhofer32f4aac2006-09-17 00:31:01 +0200128GITWEB_EXPORT_OK =
129GITWEB_STRICT_EXPORT =
Jakub Narebski19a87212006-08-15 23:03:17 +0200130GITWEB_BASE_URL =
Martin Waitz5d043a32006-08-01 21:34:08 +0200131GITWEB_LIST =
132GITWEB_HOMETEXT = indextext.html
133GITWEB_CSS = gitweb.css
Martin Waitz281f2f62006-07-31 00:38:39 +0200134GITWEB_LOGO = git-logo.png
Jakub Narebski0b5deba2006-09-04 20:32:13 +0200135GITWEB_FAVICON = git-favicon.png
Alan Chandlerb2d34762006-10-03 13:49:03 +0100136GITWEB_SITE_HEADER =
137GITWEB_SITE_FOOTER =
Martin Waitz5d043a32006-08-01 21:34:08 +0200138
Junio C Hamano7cdbff12006-11-20 00:49:31 -0800139export prefix bindir gitexecdir template_dir
Jakub Narebskie14421b2006-06-29 22:11:25 +0200140
Pavel Roskinb05701c2005-08-06 01:36:15 -0400141CC = gcc
142AR = ar
Junio C Hamano229a7ed2005-09-23 10:41:40 -0700143TAR = tar
Pavel Roskinb05701c2005-08-06 01:36:15 -0400144INSTALL = install
145RPMBUILD = rpmbuild
Linus Torvaldse83c5162005-04-07 15:13:13 -0700146
Linus Torvalds44c9e852005-07-03 10:02:35 -0700147# sparse is architecture-neutral, which means that we need to tell it
148# explicitly what architecture to check for. Fix this up for yours..
Pavel Roskinb05701c2005-08-06 01:36:15 -0400149SPARSE_FLAGS = -D__BIG_ENDIAN__ -D__powerpc__
Linus Torvalds44c9e852005-07-03 10:02:35 -0700150
Petr Baudis28818ff2005-07-29 17:50:24 +0200151
152
153### --- END CONFIGURATION SECTION ---
154
Petr Baudis8d7f5862006-06-25 03:47:03 +0200155# Those must not be GNU-specific; they are shared with perl/ which may
Petr Baudis18b0fc12006-09-23 20:20:47 +0200156# be built by a different compiler. (Note that this is an artifact now
157# but it still might be nice to keep that distinction.)
158BASIC_CFLAGS =
159BASIC_LDFLAGS =
Petr Baudis8d7f5862006-06-25 03:47:03 +0200160
Junio C Hamano215a7ad2005-09-07 17:26:23 -0700161SCRIPT_SH = \
Lars Hjemlic31820c2006-10-23 23:27:45 +0200162 git-bisect.sh git-checkout.sh \
Rene Scharfee8276332006-10-24 01:01:57 +0200163 git-clean.sh git-clone.sh git-commit.sh \
Shawn O. Pearce30f610b2006-12-27 02:17:59 -0500164 git-fetch.sh git-gc.sh \
Junio C Hamano68563732006-05-21 02:48:21 -0700165 git-ls-remote.sh \
Junio C Hamanoe32faa82005-12-19 18:03:31 -0800166 git-merge-one-file.sh git-parse-remote.sh \
Linus Torvaldsba84a792006-07-06 10:16:22 -0700167 git-pull.sh git-rebase.sh \
Junio C Hamano215a7ad2005-09-07 17:26:23 -0700168 git-repack.sh git-request-pull.sh git-reset.sh \
Linus Torvaldsd9b814c2006-05-19 16:19:34 -0700169 git-resolve.sh git-revert.sh git-sh-setup.sh \
Junio C Hamano7b763f72006-05-01 23:14:58 -0700170 git-tag.sh git-verify-tag.sh \
Junio C Hamanod1c5f2a2005-10-07 03:44:18 -0700171 git-applymbox.sh git-applypatch.sh git-am.sh \
Junio C Hamano2276aa62005-09-10 17:56:19 -0700172 git-merge.sh git-merge-stupid.sh git-merge-octopus.sh \
Linus Torvalds63dffdf2006-05-16 16:46:31 -0700173 git-merge-resolve.sh git-merge-ours.sh \
Eric W. Biedermand3d8f362006-05-17 12:44:40 -0600174 git-lost-found.sh git-quiltimport.sh
Petr Baudis28818ff2005-07-29 17:50:24 +0200175
Junio C Hamano215a7ad2005-09-07 17:26:23 -0700176SCRIPT_PERL = \
Junio C Hamano5cde71d2006-12-10 20:55:50 -0800177 git-add--interactive.perl \
Junio C Hamano215a7ad2005-09-07 17:26:23 -0700178 git-archimport.perl git-cvsimport.perl git-relink.perl \
Ryan Andersonf789e342006-10-09 03:32:05 -0700179 git-cvsserver.perl \
Johannes Schindelin11be42a2006-07-26 03:52:35 +0200180 git-svnimport.perl git-cvsexportcommit.perl \
Eric Wong60d02cc2006-07-06 00:14:16 -0700181 git-send-email.perl git-svn.perl
Junio C Hamano60036a42005-07-30 17:31:47 -0700182
Andreas Ericssond6ebd252005-11-22 00:44:15 +0100183SCRIPTS = $(patsubst %.sh,%,$(SCRIPT_SH)) \
184 $(patsubst %.perl,%,$(SCRIPT_PERL)) \
Eric Wonga51d37c2006-07-01 15:14:14 -0700185 git-cherry-pick git-status git-instaweb
Andreas Ericssond6ebd252005-11-22 00:44:15 +0100186
Junio C Hamanob42934d2006-01-12 21:37:17 -0800187# ... and all the rest that could be moved out of bindir to gitexecdir
Junio C Hamano215a7ad2005-09-07 17:26:23 -0700188PROGRAMS = \
Peter Eriksene8cc9cd2006-05-23 14:15:36 +0200189 git-convert-objects$X git-fetch-pack$X git-fsck-objects$X \
Timo Hirvonenc3c88352006-05-19 13:03:57 +0300190 git-hash-object$X git-index-pack$X git-local-fetch$X \
Lukas Sandström34488e32006-06-13 22:21:50 +0200191 git-merge-base$X \
Shawn O. Pearceaf8ffbe2006-11-05 02:28:25 -0500192 git-daemon$X \
Matthias Kestenholz5d4a6002006-08-03 17:24:36 +0200193 git-merge-index$X git-mktag$X git-mktree$X git-patch-id$X \
Matthias Kestenholz53bb2c02006-08-02 18:32:32 +0200194 git-peek-remote$X git-receive-pack$X \
Peter Eriksen51ce34b2006-05-23 14:15:35 +0200195 git-send-pack$X git-shell$X \
Peter Anvin79a9d8e2005-10-03 12:04:44 -0700196 git-show-index$X git-ssh-fetch$X \
Peter Eriksen56d13982006-05-23 14:15:31 +0200197 git-ssh-upload$X git-unpack-file$X \
Matthias Kestenholz64413632006-08-03 17:24:37 +0200198 git-update-server-info$X \
Lukas Sandström8ed05fb2006-06-13 22:21:42 +0200199 git-upload-pack$X git-verify-pack$X \
Matthias Kestenholzd6b64ed2006-08-03 17:24:35 +0200200 git-pack-redundant$X git-var$X \
Junio C Hamanoacca6872006-11-08 18:47:54 -0800201 git-describe$X git-merge-tree$X git-imap-send$X \
Junio C Hamanoa06f6782006-09-24 19:49:47 -0700202 git-merge-recursive$X \
Junio C Hamano42f77402006-08-15 21:38:07 -0700203 $(EXTRA_PROGRAMS)
204
205# Empty...
206EXTRA_PROGRAMS =
Andreas Ericssond6ebd252005-11-22 00:44:15 +0100207
Junio C Hamanoe4141562006-08-04 01:23:19 -0700208BUILT_INS = \
Rene Scharfee8276332006-10-24 01:01:57 +0200209 git-format-patch$X git-show$X git-whatchanged$X git-cherry$X \
Junio C Hamanof754fa92006-08-04 01:51:04 -0700210 git-get-tar-commit-id$X \
211 $(patsubst builtin-%.o,git-%$X,$(BUILTIN_OBJS))
Junio C Hamano91730802006-04-10 17:37:58 -0700212
Junio C Hamanob42934d2006-01-12 21:37:17 -0800213# what 'all' will build and 'install' will install, in gitexecdir
Shawn O. Pearceaf8ffbe2006-11-05 02:28:25 -0500214ALL_PROGRAMS = $(PROGRAMS) $(SCRIPTS) \
Junio C Hamano7c2738c2006-10-01 21:41:46 -0700215 git-merge-recur$X
Linus Torvaldse83c5162005-04-07 15:13:13 -0700216
Junio C Hamano894a8a82005-09-30 00:27:11 -0700217# Backward compatibility -- to be removed after 1.0
H. Peter Anvin2f29dd52005-09-30 10:46:25 -0700218PROGRAMS += git-ssh-pull$X git-ssh-push$X
Junio C Hamanof71a69a2005-09-15 14:56:37 -0700219
Ryan Anderson3d320512005-11-21 00:11:22 -0500220# Set paths to tools early so that they can be used for version tests.
221ifndef SHELL_PATH
222 SHELL_PATH = /bin/sh
223endif
224ifndef PERL_PATH
225 PERL_PATH = /usr/bin/perl
226endif
Junio C Hamano720d1502005-09-10 17:46:27 -0700227
Luben Tuikov3a793472006-12-14 23:03:03 -0800228export PERL_PATH
229
Linus Torvalds0a02ce72005-04-18 12:49:39 -0700230LIB_FILE=libgit.a
Linus Torvalds34435462006-03-24 20:13:22 -0800231XDIFF_LIB=xdiff/lib.a
Linus Torvalds0a02ce72005-04-18 12:49:39 -0700232
Junio C Hamano215a7ad2005-09-07 17:26:23 -0700233LIB_H = \
Junio C Hamano83b5d2f2006-09-17 16:02:52 -0700234 archive.h blob.h cache.h commit.h csum-file.h delta.h grep.h \
Junio C Hamano4405fb72006-09-17 18:32:03 -0700235 diff.h object.h pack.h pkt-line.h quote.h refs.h list-objects.h sideband.h \
Junio C Hamano1b0c7172006-03-29 22:55:43 -0800236 run-command.h strbuf.h tag.h tree.h git-compat-util.h revision.h \
Johannes Schindelin9e832662006-12-22 22:06:08 +0100237 tree-walk.h log-tree.h dir.h path-list.h unpack-trees.h builtin.h \
238 utf8.h
Junio C Hamano8f3f9b02005-07-23 17:54:41 -0700239
Junio C Hamano215a7ad2005-09-07 17:26:23 -0700240DIFF_OBJS = \
Junio C Hamano6973dca2006-04-21 23:57:45 -0700241 diff.o diff-lib.o diffcore-break.o diffcore-order.o \
Junio C Hamano65416752006-02-28 16:01:36 -0800242 diffcore-pickaxe.o diffcore-rename.o tree-diff.o combine-diff.o \
Junio C Hamano5f1c3f02006-04-09 01:11:11 -0700243 diffcore-delta.o log-tree.o
Josef Weidendorferb1bf95b2005-07-31 21:17:43 +0200244
Junio C Hamano215a7ad2005-09-07 17:26:23 -0700245LIB_OBJS = \
Junio C Hamano283c8ee2006-05-20 00:56:11 -0700246 blob.o commit.o connect.o csum-file.o cache-tree.o base85.o \
Jon Loeliger49ba83f2006-09-19 20:31:51 -0500247 date.o diff-delta.o entry.o exec_cmd.o ident.o \
248 interpolate.o \
249 lockfile.o \
Junio C Hamano49a52b12006-09-10 01:06:33 -0700250 object.o pack-check.o patch-delta.o path.o pkt-line.o sideband.o \
Linus Torvalds3e4339e2006-06-18 11:45:02 -0700251 quote.o read-cache.o refs.o run-command.o dir.o object-refs.o \
Junio C Hamano215a7ad2005-09-07 17:26:23 -0700252 server-info.o setup.o sha1_file.o sha1_name.o strbuf.o \
Junio C Hamanof3123c42005-10-22 01:28:13 -0700253 tag.o tree.o usage.o config.o environment.o ctype.o copy.o \
Nicolas Pitreda093d32006-11-01 17:06:23 -0500254 revision.o pager.o tree-walk.o xdiff-interface.o \
Junio C Hamano83b5d2f2006-09-17 16:02:52 -0700255 write_or_die.o trace.o list-objects.o grep.o \
Jeff King7c92fe02006-09-08 04:03:18 -0400256 alloc.o merge-file.o path-list.o help.o unpack-trees.o $(DIFF_OBJS) \
Johannes Schindelin9e832662006-12-22 22:06:08 +0100257 color.o wt-status.o archive-zip.o archive-tar.o \
258 utf8.o
Junio C Hamanod19938a2005-05-09 17:57:56 -0700259
Linus Torvalds70827b12006-04-21 10:27:34 -0700260BUILTIN_OBJS = \
Junio C Hamanof754fa92006-08-04 01:51:04 -0700261 builtin-add.o \
Ryan Andersonf789e342006-10-09 03:32:05 -0700262 builtin-annotate.o \
Junio C Hamanof754fa92006-08-04 01:51:04 -0700263 builtin-apply.o \
Franck Bui-Huu4df096a2006-09-07 15:12:02 +0200264 builtin-archive.o \
Junio C Hamanoacca6872006-11-08 18:47:54 -0800265 builtin-blame.o \
Lars Hjemlic31820c2006-10-23 23:27:45 +0200266 builtin-branch.o \
Junio C Hamanof754fa92006-08-04 01:51:04 -0700267 builtin-cat-file.o \
Junio C Hamanoe4141562006-08-04 01:23:19 -0700268 builtin-checkout-index.o \
Junio C Hamanof754fa92006-08-04 01:51:04 -0700269 builtin-check-ref-format.o \
270 builtin-commit-tree.o \
271 builtin-count-objects.o \
272 builtin-diff.o \
273 builtin-diff-files.o \
274 builtin-diff-index.o \
275 builtin-diff-stages.o \
276 builtin-diff-tree.o \
277 builtin-fmt-merge-msg.o \
Junio C Hamano9f613dd2006-09-15 13:30:02 -0700278 builtin-for-each-ref.o \
Junio C Hamanof754fa92006-08-04 01:51:04 -0700279 builtin-grep.o \
280 builtin-init-db.o \
281 builtin-log.o \
282 builtin-ls-files.o \
283 builtin-ls-tree.o \
284 builtin-mailinfo.o \
285 builtin-mailsplit.o \
Johannes Schindelinba1f5f32006-12-06 16:26:06 +0100286 builtin-merge-file.o \
Junio C Hamanof754fa92006-08-04 01:51:04 -0700287 builtin-mv.o \
288 builtin-name-rev.o \
289 builtin-pack-objects.o \
290 builtin-prune.o \
291 builtin-prune-packed.o \
292 builtin-push.o \
293 builtin-read-tree.o \
Junio C Hamano4264dc12006-12-19 00:23:12 -0800294 builtin-reflog.o \
Junio C Hamanof754fa92006-08-04 01:51:04 -0700295 builtin-repo-config.o \
Johannes Schindelin658f3652006-12-20 17:39:41 +0100296 builtin-rerere.o \
Junio C Hamanof754fa92006-08-04 01:51:04 -0700297 builtin-rev-list.o \
298 builtin-rev-parse.o \
299 builtin-rm.o \
Jeff Kingc91f0d92006-09-08 04:05:34 -0400300 builtin-runstatus.o \
Johannes Schindelinb8ec5922006-10-22 13:23:31 +0200301 builtin-shortlog.o \
Junio C Hamanof754fa92006-08-04 01:51:04 -0700302 builtin-show-branch.o \
303 builtin-stripspace.o \
304 builtin-symbolic-ref.o \
305 builtin-tar-tree.o \
306 builtin-unpack-objects.o \
307 builtin-update-index.o \
308 builtin-update-ref.o \
Franck Bui-Huu39345a22006-09-07 15:12:05 +0200309 builtin-upload-archive.o \
Rene Scharfe2e3ed672006-08-10 17:02:38 +0200310 builtin-verify-pack.o \
Rene Scharfee4fbbfe2006-08-26 23:19:21 +0200311 builtin-write-tree.o \
Junio C Hamanoeaf12a82006-09-21 00:40:28 -0700312 builtin-show-ref.o \
Linus Torvaldse1e22e32006-09-11 16:37:32 -0700313 builtin-pack-refs.o
Linus Torvalds70827b12006-04-21 10:27:34 -0700314
Johannes Schindelin54c261f2006-03-27 01:14:52 +0200315GITLIBS = $(LIB_FILE) $(XDIFF_LIB)
Petr Baudisd595a472006-06-24 18:35:12 -0700316EXTLIBS = -lz
Linus Torvaldscef661f2005-04-21 12:33:22 -0700317
Junio C Hamano229a7ed2005-09-23 10:41:40 -0700318#
319# Platform specific tweaks
320#
Junio C Hamanof7c15342005-10-09 12:52:35 -0700321
322# We choose to avoid "if .. else if .. else .. endif endif"
323# because maintaining the nesting to match is a pain. If
324# we had "elif" things would have been much nicer...
Junio C Hamanof7c15342005-10-09 12:52:35 -0700325
Peter Eriksen817151e2006-06-24 16:01:25 +0200326ifeq ($(uname_S),Linux)
327 NO_STRLCPY = YesPlease
328endif
Gerrit Papeca7a7412006-07-29 16:26:18 +0000329ifeq ($(uname_S),GNU/kFreeBSD)
330 NO_STRLCPY = YesPlease
331endif
Junio C Hamanof7c15342005-10-09 12:52:35 -0700332ifeq ($(uname_S),Darwin)
Junio C Hamano597c9cc2005-09-07 12:22:56 -0700333 NEEDS_SSL_WITH_CRYPTO = YesPlease
334 NEEDS_LIBICONV = YesPlease
Peter Eriksen817151e2006-06-24 16:01:25 +0200335 NO_STRLCPY = YesPlease
Junio C Hamano597c9cc2005-09-07 12:22:56 -0700336endif
Junio C Hamanof7c15342005-10-09 12:52:35 -0700337ifeq ($(uname_S),SunOS)
Patrick Mauritzf0ebff02005-09-06 01:24:03 +0200338 NEEDS_SOCKET = YesPlease
Junio C Hamano5a90d4a2005-09-11 22:25:49 -0700339 NEEDS_NSL = YesPlease
Junio C Hamano229a7ed2005-09-23 10:41:40 -0700340 SHELL_PATH = /bin/bash
341 NO_STRCASESTR = YesPlease
Jason Riedye40b61f2005-12-02 15:08:28 -0800342 ifeq ($(uname_R),5.8)
Paul Jakmae15f5452006-02-20 23:36:28 +0000343 NEEDS_LIBICONV = YesPlease
Jason Riedy731043f2006-01-25 12:38:36 -0800344 NO_UNSETENV = YesPlease
Jason Riedye40b61f2005-12-02 15:08:28 -0800345 NO_SETENV = YesPlease
Dennis Stosberg66c45092006-08-15 11:01:22 +0200346 NO_C99_FORMAT = YesPlease
Jason Riedye40b61f2005-12-02 15:08:28 -0800347 endif
Dennis Stosberg40d88d42006-04-11 11:42:26 -0700348 ifeq ($(uname_R),5.9)
349 NO_UNSETENV = YesPlease
350 NO_SETENV = YesPlease
Dennis Stosberg66c45092006-08-15 11:01:22 +0200351 NO_C99_FORMAT = YesPlease
Dennis Stosberg40d88d42006-04-11 11:42:26 -0700352 endif
Junio C Hamano229a7ed2005-09-23 10:41:40 -0700353 INSTALL = ginstall
354 TAR = gtar
Petr Baudis8d7f5862006-06-25 03:47:03 +0200355 BASIC_CFLAGS += -D__EXTENSIONS__
Patrick Mauritzf0ebff02005-09-06 01:24:03 +0200356endif
Junio C Hamanof7c15342005-10-09 12:52:35 -0700357ifeq ($(uname_O),Cygwin)
Junio C Hamano63be37b2006-01-19 17:13:57 -0800358 NO_D_TYPE_IN_DIRENT = YesPlease
Junio C Hamano35a730f2006-01-19 17:13:51 -0800359 NO_D_INO_IN_DIRENT = YesPlease
hpa17754512005-09-28 16:37:37 -0700360 NO_STRCASESTR = YesPlease
Junio C Hamano9f0bb902006-05-02 00:40:24 -0700361 NO_SYMLINK_HEAD = YesPlease
hpa17754512005-09-28 16:37:37 -0700362 NEEDS_LIBICONV = YesPlease
Junio C Hamano70b9c592006-08-02 15:44:07 -0700363 NO_C99_FORMAT = YesPlease
Shawn O. Pearce1510fea2006-12-14 06:15:57 -0500364 NO_FAST_WORKING_DIRECTORY = UnfortunatelyYes
Junio C Hamano2e67a5f2005-11-17 11:29:47 -0800365 # There are conflicting reports about this.
366 # On some boxes NO_MMAP is needed, and not so elsewhere.
Junio C Hamano87ac1392006-12-27 15:12:31 -0800367 # Try commenting this out if you suspect MMAP is more efficient
368 NO_MMAP = YesPlease
hpa49744d62005-09-28 16:52:21 -0700369 NO_IPV6 = YesPlease
Peter Anvina23cd8e2005-09-28 19:08:37 -0700370 X = .exe
Nicolas Pitre7c6ef2f2005-09-20 12:27:13 -0400371endif
Alecs Kingb3bf9742006-01-27 02:04:30 +0800372ifeq ($(uname_S),FreeBSD)
373 NEEDS_LIBICONV = YesPlease
Petr Baudis8d7f5862006-06-25 03:47:03 +0200374 BASIC_CFLAGS += -I/usr/local/include
375 BASIC_LDFLAGS += -L/usr/local/lib
Alecs Kingb3bf9742006-01-27 02:04:30 +0800376endif
Junio C Hamanof7c15342005-10-09 12:52:35 -0700377ifeq ($(uname_S),OpenBSD)
Junio C Hamano5fb41e82005-10-10 11:51:11 -0700378 NO_STRCASESTR = YesPlease
Han Boetes18c5a522005-10-01 08:23:26 +0200379 NEEDS_LIBICONV = YesPlease
Petr Baudis8d7f5862006-06-25 03:47:03 +0200380 BASIC_CFLAGS += -I/usr/local/include
381 BASIC_LDFLAGS += -L/usr/local/lib
Junio C Hamano94d23312005-11-13 01:46:13 -0800382endif
383ifeq ($(uname_S),NetBSD)
Dennis Stosberge88856b2006-05-11 19:35:31 +0200384 ifeq ($(shell expr "$(uname_R)" : '[01]\.'),2)
385 NEEDS_LIBICONV = YesPlease
386 endif
Petr Baudis8d7f5862006-06-25 03:47:03 +0200387 BASIC_CFLAGS += -I/usr/pkg/include
388 BASIC_LDFLAGS += -L/usr/pkg/lib
389 ALL_LDFLAGS += -Wl,-rpath,/usr/pkg/lib
Han Boetes18c5a522005-10-01 08:23:26 +0200390endif
Jason Riedya6da9392005-12-06 14:20:16 -0800391ifeq ($(uname_S),AIX)
392 NO_STRCASESTR=YesPlease
Peter Eriksen817151e2006-06-24 16:01:25 +0200393 NO_STRLCPY = YesPlease
Jason Riedya6da9392005-12-06 14:20:16 -0800394 NEEDS_LIBICONV=YesPlease
395endif
Johannes Schindelin289c4b32006-02-17 15:23:41 +0100396ifeq ($(uname_S),IRIX64)
397 NO_IPV6=YesPlease
398 NO_SETENV=YesPlease
399 NO_STRCASESTR=YesPlease
Peter Eriksen817151e2006-06-24 16:01:25 +0200400 NO_STRLCPY = YesPlease
Johannes Schindelin289c4b32006-02-17 15:23:41 +0100401 NO_SOCKADDR_STORAGE=YesPlease
402 SHELL_PATH=/usr/gnu/bin/bash
Petr Baudis8d7f5862006-06-25 03:47:03 +0200403 BASIC_CFLAGS += -DPATH_MAX=1024
Johannes Schindelin289c4b32006-02-17 15:23:41 +0100404 # for now, build 32-bit version
Petr Baudis8d7f5862006-06-25 03:47:03 +0200405 BASIC_LDFLAGS += -L/usr/lib32
Johannes Schindelin289c4b32006-02-17 15:23:41 +0100406endif
Junio C Hamanof7c15342005-10-09 12:52:35 -0700407ifneq (,$(findstring arm,$(uname_M)))
408 ARM_SHA1 = YesPlease
409endif
Junio C Hamano597c9cc2005-09-07 12:22:56 -0700410
Jakub Narebski55667712006-07-03 01:56:48 +0200411-include config.mak.autogen
Johannes Schindelinf2d6a252005-10-11 15:22:47 -0700412-include config.mak
Linus Torvaldscef661f2005-04-21 12:33:22 -0700413
Brian Gernhardt59f86742006-12-12 12:01:47 -0500414ifeq ($(uname_S),Darwin)
415 ifndef NO_FINK
416 ifeq ($(shell test -d /sw/lib && echo y),y)
417 BASIC_CFLAGS += -I/sw/include
418 BASIC_LDFLAGS += -L/sw/lib
419 endif
420 endif
421 ifndef NO_DARWIN_PORTS
422 ifeq ($(shell test -d /opt/local/lib && echo y),y)
423 BASIC_CFLAGS += -I/opt/local/include
424 BASIC_LDFLAGS += -L/opt/local/lib
425 endif
426 endif
427endif
428
Junio C Hamanobbfc63d2006-12-27 14:17:35 -0800429ifdef NO_R_TO_GCC_LINKER
430 # Some gcc does not accept and pass -R to the linker to specify
431 # the runtime dynamic library path.
432 CC_LD_DYNPATH = -Wl,-rpath=
433else
434 CC_LD_DYNPATH = -R
435endif
436
Junio C Hamano229a7ed2005-09-23 10:41:40 -0700437ifndef NO_CURL
438 ifdef CURLDIR
Junio C Hamanobbfc63d2006-12-27 14:17:35 -0800439 # Try "-Wl,-rpath=$(CURLDIR)/lib" in such a case.
Petr Baudis8d7f5862006-06-25 03:47:03 +0200440 BASIC_CFLAGS += -I$(CURLDIR)/include
Junio C Hamanobbfc63d2006-12-27 14:17:35 -0800441 CURL_LIBCURL = -L$(CURLDIR)/lib $(CC_LD_DYNPATH)$(CURLDIR)/lib -lcurl
Junio C Hamano229a7ed2005-09-23 10:41:40 -0700442 else
443 CURL_LIBCURL = -lcurl
444 endif
H. Peter Anvin2f29dd52005-09-30 10:46:25 -0700445 PROGRAMS += git-http-fetch$X
Nick Hengeveld08900982005-11-18 17:08:36 -0800446 curl_check := $(shell (echo 070908; curl-config --vernum) | sort -r | sed -ne 2p)
447 ifeq "$(curl_check)" "070908"
448 ifndef NO_EXPAT
Nick Hengeveld08900982005-11-18 17:08:36 -0800449 PROGRAMS += git-http-push$X
450 endif
Nick Hengeveld58e60dd2005-11-02 11:19:24 -0800451 endif
Johannes Schindelin459a21b2006-04-05 16:22:40 +0200452 ifndef NO_EXPAT
453 EXPAT_LIBEXPAT = -lexpat
454 endif
Junio C Hamano229a7ed2005-09-23 10:41:40 -0700455endif
456
Petr Baudisdd53c7a2005-07-29 17:50:51 +0200457ifndef NO_OPENSSL
Junio C Hamano215a7ad2005-09-07 17:26:23 -0700458 OPENSSL_LIBSSL = -lssl
Junio C Hamano455a7f32005-09-30 13:31:16 -0700459 ifdef OPENSSLDIR
Petr Baudis8d7f5862006-06-25 03:47:03 +0200460 BASIC_CFLAGS += -I$(OPENSSLDIR)/include
Junio C Hamanobbfc63d2006-12-27 14:17:35 -0800461 OPENSSL_LINK = -L$(OPENSSLDIR)/lib $(CC_LD_DYNPATH)$(OPENSSLDIR)/lib
Junio C Hamano455a7f32005-09-30 13:31:16 -0700462 else
463 OPENSSL_LINK =
464 endif
Petr Baudisdd53c7a2005-07-29 17:50:51 +0200465else
Petr Baudis8d7f5862006-06-25 03:47:03 +0200466 BASIC_CFLAGS += -DNO_OPENSSL
Junio C Hamano215a7ad2005-09-07 17:26:23 -0700467 MOZILLA_SHA1 = 1
468 OPENSSL_LIBSSL =
Petr Baudisdd53c7a2005-07-29 17:50:51 +0200469endif
Junio C Hamano597c9cc2005-09-07 12:22:56 -0700470ifdef NEEDS_SSL_WITH_CRYPTO
Junio C Hamano455a7f32005-09-30 13:31:16 -0700471 LIB_4_CRYPTO = $(OPENSSL_LINK) -lcrypto -lssl
Junio C Hamano597c9cc2005-09-07 12:22:56 -0700472else
Junio C Hamano455a7f32005-09-30 13:31:16 -0700473 LIB_4_CRYPTO = $(OPENSSL_LINK) -lcrypto
Junio C Hamano597c9cc2005-09-07 12:22:56 -0700474endif
475ifdef NEEDS_LIBICONV
Junio C Hamano455a7f32005-09-30 13:31:16 -0700476 ifdef ICONVDIR
Petr Baudis8d7f5862006-06-25 03:47:03 +0200477 BASIC_CFLAGS += -I$(ICONVDIR)/include
Junio C Hamanobbfc63d2006-12-27 14:17:35 -0800478 ICONV_LINK = -L$(ICONVDIR)/lib $(CC_LD_DYNPATH)$(ICONVDIR)/lib
Junio C Hamano455a7f32005-09-30 13:31:16 -0700479 else
480 ICONV_LINK =
481 endif
Petr Baudisd595a472006-06-24 18:35:12 -0700482 EXTLIBS += $(ICONV_LINK) -liconv
Junio C Hamano597c9cc2005-09-07 12:22:56 -0700483endif
Patrick Mauritzf0ebff02005-09-06 01:24:03 +0200484ifdef NEEDS_SOCKET
Petr Baudisd595a472006-06-24 18:35:12 -0700485 EXTLIBS += -lsocket
Patrick Mauritzf0ebff02005-09-06 01:24:03 +0200486endif
Junio C Hamano5a90d4a2005-09-11 22:25:49 -0700487ifdef NEEDS_NSL
Petr Baudisd595a472006-06-24 18:35:12 -0700488 EXTLIBS += -lnsl
Junio C Hamano5a90d4a2005-09-11 22:25:49 -0700489endif
Junio C Hamano63be37b2006-01-19 17:13:57 -0800490ifdef NO_D_TYPE_IN_DIRENT
Petr Baudis8d7f5862006-06-25 03:47:03 +0200491 BASIC_CFLAGS += -DNO_D_TYPE_IN_DIRENT
Junio C Hamano63be37b2006-01-19 17:13:57 -0800492endif
Junio C Hamano35a730f2006-01-19 17:13:51 -0800493ifdef NO_D_INO_IN_DIRENT
Petr Baudis8d7f5862006-06-25 03:47:03 +0200494 BASIC_CFLAGS += -DNO_D_INO_IN_DIRENT
Junio C Hamano35a730f2006-01-19 17:13:51 -0800495endif
Ramsay Allan Jones579d1fb2006-07-30 16:38:28 +0100496ifdef NO_C99_FORMAT
497 ALL_CFLAGS += -DNO_C99_FORMAT
498endif
Junio C Hamano9f0bb902006-05-02 00:40:24 -0700499ifdef NO_SYMLINK_HEAD
Petr Baudis8d7f5862006-06-25 03:47:03 +0200500 BASIC_CFLAGS += -DNO_SYMLINK_HEAD
Junio C Hamano9f0bb902006-05-02 00:40:24 -0700501endif
Linus Torvaldsef34af22005-09-18 18:30:50 -0700502ifdef NO_STRCASESTR
Junio C Hamano4050c0d2005-12-05 11:54:29 -0800503 COMPAT_CFLAGS += -DNO_STRCASESTR
Jason Riedye40b61f2005-12-02 15:08:28 -0800504 COMPAT_OBJS += compat/strcasestr.o
505endif
Peter Eriksen817151e2006-06-24 16:01:25 +0200506ifdef NO_STRLCPY
507 COMPAT_CFLAGS += -DNO_STRLCPY
508 COMPAT_OBJS += compat/strlcpy.o
509endif
Jason Riedye40b61f2005-12-02 15:08:28 -0800510ifdef NO_SETENV
Junio C Hamano4050c0d2005-12-05 11:54:29 -0800511 COMPAT_CFLAGS += -DNO_SETENV
Jason Riedye40b61f2005-12-02 15:08:28 -0800512 COMPAT_OBJS += compat/setenv.o
Linus Torvaldsef34af22005-09-18 18:30:50 -0700513endif
Johannes Schindelin104ff342006-08-29 12:51:14 +0200514ifdef NO_UNSETENV
Jason Riedy731043f2006-01-25 12:38:36 -0800515 COMPAT_CFLAGS += -DNO_UNSETENV
516 COMPAT_OBJS += compat/unsetenv.o
517endif
Johannes Schindelin730d48a2005-10-08 15:54:36 -0700518ifdef NO_MMAP
Junio C Hamano4050c0d2005-12-05 11:54:29 -0800519 COMPAT_CFLAGS += -DNO_MMAP
Jason Riedye40b61f2005-12-02 15:08:28 -0800520 COMPAT_OBJS += compat/mmap.o
Johannes Schindelin730d48a2005-10-08 15:54:36 -0700521endif
Shawn O. Pearce1510fea2006-12-14 06:15:57 -0500522ifdef NO_FAST_WORKING_DIRECTORY
523 BASIC_CFLAGS += -DNO_FAST_WORKING_DIRECTORY
524endif
hpa49744d62005-09-28 16:52:21 -0700525ifdef NO_IPV6
Petr Baudis8d7f5862006-06-25 03:47:03 +0200526 BASIC_CFLAGS += -DNO_IPV6
Junio C Hamanobdc37f52006-01-19 17:13:32 -0800527endif
528ifdef NO_SOCKADDR_STORAGE
529ifdef NO_IPV6
Petr Baudis8d7f5862006-06-25 03:47:03 +0200530 BASIC_CFLAGS += -Dsockaddr_storage=sockaddr_in
Junio C Hamanobdc37f52006-01-19 17:13:32 -0800531else
Petr Baudis8d7f5862006-06-25 03:47:03 +0200532 BASIC_CFLAGS += -Dsockaddr_storage=sockaddr_in6
Junio C Hamanobdc37f52006-01-19 17:13:32 -0800533endif
hpa49744d62005-09-28 16:52:21 -0700534endif
Yakov Lerner6ba68ab2006-05-22 00:37:00 +0300535ifdef NO_INET_NTOP
536 LIB_OBJS += compat/inet_ntop.o
537endif
Jon Loeligerdd467622006-09-26 09:47:43 -0500538ifdef NO_INET_PTON
539 LIB_OBJS += compat/inet_pton.o
540endif
Linus Torvaldscef661f2005-04-21 12:33:22 -0700541
Fernando J. Peredab6e56ec2006-02-16 09:38:01 +0100542ifdef NO_ICONV
Petr Baudis8d7f5862006-06-25 03:47:03 +0200543 BASIC_CFLAGS += -DNO_ICONV
Fernando J. Peredab6e56ec2006-02-16 09:38:01 +0100544endif
545
Nicolas Pitre7c6ef2f2005-09-20 12:27:13 -0400546ifdef PPC_SHA1
547 SHA1_HEADER = "ppc/sha1.h"
548 LIB_OBJS += ppc/sha1.o ppc/sha1ppc.o
549else
550ifdef ARM_SHA1
551 SHA1_HEADER = "arm/sha1.h"
552 LIB_OBJS += arm/sha1.o arm/sha1_arm.o
553else
554ifdef MOZILLA_SHA1
555 SHA1_HEADER = "mozilla-sha1/sha1.h"
556 LIB_OBJS += mozilla-sha1/sha1.o
557else
558 SHA1_HEADER = <openssl/sha.h>
Petr Baudisd595a472006-06-24 18:35:12 -0700559 EXTLIBS += $(LIB_4_CRYPTO)
Nicolas Pitre7c6ef2f2005-09-20 12:27:13 -0400560endif
561endif
562endif
Alex Riesenf8487182006-12-04 10:50:04 +0100563ifdef NO_PERL_MAKEMAKER
564 export NO_PERL_MAKEMAKER
565endif
Nicolas Pitre7c6ef2f2005-09-20 12:27:13 -0400566
Pavel Roskinaddf88e2006-07-09 03:44:30 -0400567# Shell quote (do not use $(call) to accommodate ancient setups);
Johannes Schindelin39c015c2006-02-18 12:40:22 +0100568
569SHA1_HEADER_SQ = $(subst ','\'',$(SHA1_HEADER))
570
571DESTDIR_SQ = $(subst ','\'',$(DESTDIR))
572bindir_SQ = $(subst ','\'',$(bindir))
573gitexecdir_SQ = $(subst ','\'',$(gitexecdir))
574template_dir_SQ = $(subst ','\'',$(template_dir))
Yakov Lernerca3bcab2006-06-15 01:36:00 +0300575prefix_SQ = $(subst ','\'',$(prefix))
Johannes Schindelin39c015c2006-02-18 12:40:22 +0100576
577SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH))
578PERL_PATH_SQ = $(subst ','\'',$(PERL_PATH))
Johannes Schindelin39c015c2006-02-18 12:40:22 +0100579
Petr Baudisd595a472006-06-24 18:35:12 -0700580LIBS = $(GITLIBS) $(EXTLIBS)
581
Petr Baudis8d7f5862006-06-25 03:47:03 +0200582BASIC_CFLAGS += -DSHA1_HEADER='$(SHA1_HEADER_SQ)' $(COMPAT_CFLAGS)
Jason Riedye40b61f2005-12-02 15:08:28 -0800583LIB_OBJS += $(COMPAT_OBJS)
Petr Baudis8d7f5862006-06-25 03:47:03 +0200584
585ALL_CFLAGS += $(BASIC_CFLAGS)
586ALL_LDFLAGS += $(BASIC_LDFLAGS)
587
Tom Princeec2d1512005-10-11 18:47:33 -0700588export prefix TAR INSTALL DESTDIR SHELL_PATH template_dir
Petr Baudisd595a472006-06-24 18:35:12 -0700589
590
Petr Baudis28818ff2005-07-29 17:50:24 +0200591### Build rules
Linus Torvalds89967022005-04-30 13:19:56 -0700592
Junio C Hamano7c2738c2006-10-01 21:41:46 -0700593all: $(ALL_PROGRAMS) $(BUILT_INS) git$X gitk gitweb/gitweb.cgi
Petr Baudis28818ff2005-07-29 17:50:24 +0200594
Alex Riesenf8487182006-12-04 10:50:04 +0100595all:
596 $(MAKE) -C perl PERL_PATH='$(PERL_PATH_SQ)' prefix='$(prefix_SQ)' all
Junio C Hamanod3af6212005-08-06 12:50:14 -0700597 $(MAKE) -C templates
Nicolas Pitrea310d432005-05-19 10:27:14 -0400598
Junio C Hamano4dc00022006-01-12 21:42:25 -0800599strip: $(PROGRAMS) git$X
600 $(STRIP) $(STRIP_OPTS) $(PROGRAMS) git$X
601
Yakov Lernerca3bcab2006-06-15 01:36:00 +0300602git$X: git.c common-cmds.h $(BUILTIN_OBJS) $(GITLIBS) GIT-CFLAGS
Michal Ostrowski77cb17e2006-01-10 21:12:17 -0500603 $(CC) -DGIT_VERSION='"$(GIT_VERSION)"' \
Junio C Hamano8eef8e02006-03-31 16:23:46 -0800604 $(ALL_CFLAGS) -o $@ $(filter %.c,$^) \
Linus Torvalds70827b12006-04-21 10:27:34 -0700605 $(BUILTIN_OBJS) $(ALL_LDFLAGS) $(LIBS)
Junio C Hamano6a2e50f2005-09-07 21:26:52 -0700606
Junio C Hamanof754fa92006-08-04 01:51:04 -0700607help.o: common-cmds.h
Junio C Hamano08df6172006-04-21 21:56:13 -0700608
Junio C Hamanoa06f6782006-09-24 19:49:47 -0700609git-merge-recur$X: git-merge-recursive$X
610 rm -f $@ && ln git-merge-recursive$X $@
611
Junio C Hamano91730802006-04-10 17:37:58 -0700612$(BUILT_INS): git$X
613 rm -f $@ && ln git$X $@
614
Fredrik Kuivinena87cd022006-03-09 17:24:19 +0100615common-cmds.h: Documentation/git-*.txt
Jim Meyeringfc36f6a2006-05-25 18:52:01 +0200616 ./generate-cmdlist.sh > $@+
617 mv $@+ $@
Fredrik Kuivinena87cd022006-03-09 17:24:19 +0100618
Andreas Ericssond6ebd252005-11-22 00:44:15 +0100619$(patsubst %.sh,%,$(SCRIPT_SH)) : % : %.sh
Jim Meyeringfc36f6a2006-05-25 18:52:01 +0200620 rm -f $@ $@+
Johannes Schindelin39c015c2006-02-18 12:40:22 +0100621 sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \
Michal Rokosd9bffc02006-07-08 17:32:04 +0200622 -e 's|@@PERL@@|$(PERL_PATH_SQ)|g' \
Junio C Hamano3ff8cbe2005-10-04 12:41:35 -0700623 -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \
Fernando J. Pereda6c5c62f2006-02-15 12:37:30 +0100624 -e 's/@@NO_CURL@@/$(NO_CURL)/g' \
Jim Meyeringfc36f6a2006-05-25 18:52:01 +0200625 $@.sh >$@+
626 chmod +x $@+
627 mv $@+ $@
Junio C Hamanobc6146d2005-09-08 18:50:33 -0700628
Alex Riesenf8487182006-12-04 10:50:04 +0100629$(patsubst %.perl,%,$(SCRIPT_PERL)): perl/perl.mak
630
631perl/perl.mak: GIT-CFLAGS
632 $(MAKE) -C perl PERL_PATH='$(PERL_PATH_SQ)' prefix='$(prefix_SQ)' $(@F)
633
Junio C Hamanof6276fe2006-06-24 19:41:03 -0700634$(patsubst %.perl,%,$(SCRIPT_PERL)): % : %.perl
Jim Meyeringfc36f6a2006-05-25 18:52:01 +0200635 rm -f $@ $@+
Junio C Hamano893973a2006-06-29 17:02:21 -0700636 INSTLIBDIR=`$(MAKE) -C perl -s --no-print-directory instlibdir` && \
Junio C Hamano998c4da2006-07-07 13:04:35 -0700637 sed -e '1{' \
638 -e ' s|#!.*perl|#!$(PERL_PATH_SQ)|' \
639 -e ' h' \
640 -e ' s=.*=use lib (split(/:/, $$ENV{GITPERLLIB} || "@@INSTLIBDIR@@"));=' \
641 -e ' H' \
642 -e ' x' \
643 -e '}' \
Junio C Hamanof6276fe2006-06-24 19:41:03 -0700644 -e 's|@@INSTLIBDIR@@|'"$$INSTLIBDIR"'|g' \
Junio C Hamano3ff8cbe2005-10-04 12:41:35 -0700645 -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \
Jim Meyeringfc36f6a2006-05-25 18:52:01 +0200646 $@.perl >$@+
647 chmod +x $@+
648 mv $@+ $@
Junio C Hamanobc6146d2005-09-08 18:50:33 -0700649
Johannes Schindelin4eba0f32005-10-20 17:13:24 +0200650git-cherry-pick: git-revert
Jim Meyeringfc36f6a2006-05-25 18:52:01 +0200651 cp $< $@+
652 mv $@+ $@
Johannes Schindelin4eba0f32005-10-20 17:13:24 +0200653
Junio C Hamanocf7bb582006-02-10 00:45:59 -0800654git-status: git-commit
Jim Meyeringfc36f6a2006-05-25 18:52:01 +0200655 cp $< $@+
656 mv $@+ $@
Junio C Hamanocf7bb582006-02-10 00:45:59 -0800657
Martin Waitz5d043a32006-08-01 21:34:08 +0200658gitweb/gitweb.cgi: gitweb/gitweb.perl
659 rm -f $@ $@+
660 sed -e '1s|#!.*perl|#!$(PERL_PATH_SQ)|' \
Junio C Hamano06c084d2006-08-02 13:50:20 -0700661 -e 's|++GIT_VERSION++|$(GIT_VERSION)|g' \
662 -e 's|++GIT_BINDIR++|$(bindir)|g' \
663 -e 's|++GITWEB_CONFIG++|$(GITWEB_CONFIG)|g' \
Yasushi SHOJI2de21fa2006-08-15 07:50:49 +0900664 -e 's|++GITWEB_HOME_LINK_STR++|$(GITWEB_HOME_LINK_STR)|g' \
Junio C Hamano06c084d2006-08-02 13:50:20 -0700665 -e 's|++GITWEB_SITENAME++|$(GITWEB_SITENAME)|g' \
666 -e 's|++GITWEB_PROJECTROOT++|$(GITWEB_PROJECTROOT)|g' \
Matthias Lederhofer32f4aac2006-09-17 00:31:01 +0200667 -e 's|++GITWEB_EXPORT_OK++|$(GITWEB_EXPORT_OK)|g' \
668 -e 's|++GITWEB_STRICT_EXPORT++|$(GITWEB_STRICT_EXPORT)|g' \
Jakub Narebski19a87212006-08-15 23:03:17 +0200669 -e 's|++GITWEB_BASE_URL++|$(GITWEB_BASE_URL)|g' \
Junio C Hamano06c084d2006-08-02 13:50:20 -0700670 -e 's|++GITWEB_LIST++|$(GITWEB_LIST)|g' \
671 -e 's|++GITWEB_HOMETEXT++|$(GITWEB_HOMETEXT)|g' \
672 -e 's|++GITWEB_CSS++|$(GITWEB_CSS)|g' \
673 -e 's|++GITWEB_LOGO++|$(GITWEB_LOGO)|g' \
Jakub Narebski0b5deba2006-09-04 20:32:13 +0200674 -e 's|++GITWEB_FAVICON++|$(GITWEB_FAVICON)|g' \
Alan Chandlerb2d34762006-10-03 13:49:03 +0100675 -e 's|++GITWEB_SITE_HEADER++|$(GITWEB_SITE_HEADER)|g' \
676 -e 's|++GITWEB_SITE_FOOTER++|$(GITWEB_SITE_FOOTER)|g' \
Martin Waitz5d043a32006-08-01 21:34:08 +0200677 $< >$@+
678 chmod +x $@+
679 mv $@+ $@
680
Eric Wonga51d37c2006-07-01 15:14:14 -0700681git-instaweb: git-instaweb.sh gitweb/gitweb.cgi gitweb/gitweb.css
682 rm -f $@ $@+
683 sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \
684 -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \
685 -e 's/@@NO_CURL@@/$(NO_CURL)/g' \
Michal Rokos6e959ab2006-07-08 17:27:10 +0200686 -e '/@@GITWEB_CGI@@/r gitweb/gitweb.cgi' \
Johannes Schindelin07002282006-07-02 11:31:30 +0200687 -e '/@@GITWEB_CGI@@/d' \
Michal Rokos6e959ab2006-07-08 17:27:10 +0200688 -e '/@@GITWEB_CSS@@/r gitweb/gitweb.css' \
Johannes Schindelin07002282006-07-02 11:31:30 +0200689 -e '/@@GITWEB_CSS@@/d' \
Martin Waitz5d043a32006-08-01 21:34:08 +0200690 $@.sh > $@+
Eric Wonga51d37c2006-07-01 15:14:14 -0700691 chmod +x $@+
692 mv $@+ $@
693
Jakub Narebski39001452006-08-08 18:35:23 +0200694configure: configure.ac
695 rm -f $@ $<+
696 sed -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \
697 $< > $<+
698 autoconf -o $@ $<+
699 rm -f $<+
700
Junio C Hamano9b88fce2005-12-27 14:40:17 -0800701# These can record GIT_VERSION
702git$X git.spec \
703 $(patsubst %.sh,%,$(SCRIPT_SH)) \
704 $(patsubst %.perl,%,$(SCRIPT_PERL)) \
Junio C Hamano9b88fce2005-12-27 14:40:17 -0800705 : GIT-VERSION-FILE
Johannes Schindeline99fcf92005-12-22 20:38:23 +0100706
Yakov Lernerca3bcab2006-06-15 01:36:00 +0300707%.o: %.c GIT-CFLAGS
Pavel Roskinb05701c2005-08-06 01:36:15 -0400708 $(CC) -o $*.o -c $(ALL_CFLAGS) $<
709%.o: %.S
710 $(CC) -o $*.o -c $(ALL_CFLAGS) $<
711
Yakov Lernerca3bcab2006-06-15 01:36:00 +0300712exec_cmd.o: exec_cmd.c GIT-CFLAGS
Johannes Schindelin39c015c2006-02-18 12:40:22 +0100713 $(CC) -o $*.o -c $(ALL_CFLAGS) '-DGIT_EXEC_PATH="$(gitexecdir_SQ)"' $<
Yakov Lernerc1f80642006-06-22 04:47:00 +0300714builtin-init-db.o: builtin-init-db.c GIT-CFLAGS
715 $(CC) -o $*.o -c $(ALL_CFLAGS) -DDEFAULT_GIT_TEMPLATE_DIR='"$(template_dir_SQ)"' $<
Michal Ostrowski77cb17e2006-01-10 21:12:17 -0500716
Yakov Lernerca3bcab2006-06-15 01:36:00 +0300717http.o: http.c GIT-CFLAGS
Nick Hengeveld20fc9bc2006-04-04 10:11:29 -0700718 $(CC) -o $*.o -c $(ALL_CFLAGS) -DGIT_USER_AGENT='"git/$(GIT_VERSION)"' $<
719
Nick Hengeveld8d9fbe52006-04-04 05:33:18 -0700720ifdef NO_EXPAT
Yakov Lernerca3bcab2006-06-15 01:36:00 +0300721http-fetch.o: http-fetch.c http.h GIT-CFLAGS
Nick Hengeveld8d9fbe52006-04-04 05:33:18 -0700722 $(CC) -o $*.o -c $(ALL_CFLAGS) -DNO_EXPAT $<
723endif
724
Junio C Hamano8eef8e02006-03-31 16:23:46 -0800725git-%$X: %.o $(GITLIBS)
Junio C Hamano94d23312005-11-13 01:46:13 -0800726 $(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS)
Daniel Barkalow6eb7ed52005-04-23 18:47:23 -0700727
Johannes Schindelin2941cab2006-07-28 11:17:46 +0200728ssh-pull.o: ssh-fetch.c
729ssh-push.o: ssh-upload.c
H. Peter Anvin2f29dd52005-09-30 10:46:25 -0700730git-local-fetch$X: fetch.o
731git-ssh-fetch$X: rsh.o fetch.o
732git-ssh-upload$X: rsh.o
733git-ssh-pull$X: rsh.o fetch.o
734git-ssh-push$X: rsh.o
Daniel Barkalow6eb7ed52005-04-23 18:47:23 -0700735
Mike McCormackf2561fd2006-03-10 14:32:50 +0900736git-imap-send$X: imap-send.o $(LIB_FILE)
737
Junio C Hamanodd8239f2006-06-06 14:26:57 -0700738http.o http-fetch.o http-push.o: http.h
Junio C Hamano8fced612006-07-03 00:53:13 -0700739git-http-fetch$X: fetch.o http.o http-fetch.o $(GITLIBS)
Johannes Schindelin39c015c2006-02-18 12:40:22 +0100740 $(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
Nick Hengeveld8d9fbe52006-04-04 05:33:18 -0700741 $(LIBS) $(CURL_LIBCURL) $(EXPAT_LIBEXPAT)
Johannes Schindelin39c015c2006-02-18 12:40:22 +0100742
Junio C Hamano8fced612006-07-03 00:53:13 -0700743git-http-push$X: revision.o http.o http-push.o $(GITLIBS)
Johannes Schindelin39c015c2006-02-18 12:40:22 +0100744 $(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
745 $(LIBS) $(CURL_LIBCURL) $(EXPAT_LIBEXPAT)
746
Linus Torvalds70827b12006-04-21 10:27:34 -0700747$(LIB_OBJS) $(BUILTIN_OBJS): $(LIB_H)
Junio C Hamano1f330262006-06-22 15:43:47 -0700748$(patsubst git-%$X,%.o,$(PROGRAMS)): $(LIB_H) $(wildcard */*.h)
Petr Baudise4683052005-07-29 17:48:50 +0200749$(DIFF_OBJS): diffcore.h
Linus Torvaldse83c5162005-04-07 15:13:13 -0700750
Petr Baudis28818ff2005-07-29 17:50:24 +0200751$(LIB_FILE): $(LIB_OBJS)
Junio C Hamano71459c12006-04-25 23:11:17 -0700752 rm -f $@ && $(AR) rcs $@ $(LIB_OBJS)
Petr Baudis28818ff2005-07-29 17:50:24 +0200753
Johannes Schindelin857b9332006-11-21 23:24:34 +0100754XDIFF_OBJS=xdiff/xdiffi.o xdiff/xprepare.o xdiff/xutils.o xdiff/xemit.o \
755 xdiff/xmerge.o
Andy Whitcroft17b96be2006-10-17 19:08:08 +0100756$(XDIFF_OBJS): xdiff/xinclude.h xdiff/xmacros.h xdiff/xdiff.h xdiff/xtypes.h \
757 xdiff/xutils.h xdiff/xprepare.h xdiff/xdiffi.h xdiff/xemit.h
Linus Torvalds34435462006-03-24 20:13:22 -0800758
759$(XDIFF_LIB): $(XDIFF_OBJS)
Junio C Hamano2d86d2c2006-04-26 03:12:58 -0700760 rm -f $@ && $(AR) rcs $@ $(XDIFF_OBJS)
Linus Torvalds34435462006-03-24 20:13:22 -0800761
762
Petr Baudisd595a472006-06-24 18:35:12 -0700763perl/Makefile: perl/Git.pm perl/Makefile.PL GIT-CFLAGS
Petr Baudis63df97a2006-06-24 04:34:36 +0200764 (cd perl && $(PERL_PATH) Makefile.PL \
Petr Baudis18b0fc12006-09-23 20:20:47 +0200765 PREFIX='$(prefix_SQ)')
Petr Baudisb1edc532006-06-24 04:34:29 +0200766
Petr Baudis28818ff2005-07-29 17:50:24 +0200767doc:
768 $(MAKE) -C Documentation all
769
Fredrik Kuivinenf81e7c62006-03-18 11:07:12 +0100770TAGS:
771 rm -f TAGS
772 find . -name '*.[hcS]' -print | xargs etags -a
773
774tags:
775 rm -f tags
776 find . -name '*.[hcS]' -print | xargs ctags -a
Petr Baudis28818ff2005-07-29 17:50:24 +0200777
Yakov Lernerca3bcab2006-06-15 01:36:00 +0300778### Detect prefix changes
Junio C Hamano7cdbff12006-11-20 00:49:31 -0800779TRACK_CFLAGS = $(subst ','\'',$(ALL_CFLAGS)):\
Yakov Lernerca3bcab2006-06-15 01:36:00 +0300780 $(bindir_SQ):$(gitexecdir_SQ):$(template_dir_SQ):$(prefix_SQ)
781
782GIT-CFLAGS: .FORCE-GIT-CFLAGS
783 @FLAGS='$(TRACK_CFLAGS)'; \
784 if test x"$$FLAGS" != x"`cat GIT-CFLAGS 2>/dev/null`" ; then \
785 echo 1>&2 " * new build flags or prefix"; \
786 echo "$$FLAGS" >GIT-CFLAGS; \
787 fi
788
Petr Baudis28818ff2005-07-29 17:50:24 +0200789### Testing rules
790
Johannes Schindelinabb7c7b2006-02-18 13:01:18 +0100791# GNU make supports exporting all variables by "export" without parameters.
792# However, the environment gets quite big, and some programs have problems
793# with that.
794
Johannes Schindelin140245b2006-07-07 13:26:31 +0200795export NO_SVN_TESTS
Johannes Schindelinabb7c7b2006-02-18 13:01:18 +0100796
Petr Baudis28818ff2005-07-29 17:50:24 +0200797test: all
798 $(MAKE) -C t/ all
799
Junio C Hamano4ccafd72005-11-02 12:01:06 -0800800test-date$X: test-date.c date.o ctype.o
Junio C Hamano94d23312005-11-13 01:46:13 -0800801 $(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) test-date.c date.o ctype.o
Petr Baudis28818ff2005-07-29 17:50:24 +0200802
Nicolas Pitre57b73152006-12-18 16:06:50 -0500803test-delta$X: test-delta.o diff-delta.o patch-delta.o $(GITLIBS)
804 $(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS)
Petr Baudis28818ff2005-07-29 17:50:24 +0200805
Junio C Hamano17448202006-04-23 20:20:25 -0700806test-dump-cache-tree$X: dump-cache-tree.o $(GITLIBS)
807 $(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS)
808
Junio C Hamanob65bc212006-06-24 00:59:49 -0700809test-sha1$X: test-sha1.o $(GITLIBS)
810 $(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS)
811
812check-sha1:: test-sha1$X
813 ./test-sha1.sh
814
Petr Baudis28818ff2005-07-29 17:50:24 +0200815check:
Junio C Hamano773b6332005-12-14 13:32:52 -0800816 for i in *.c; do sparse $(ALL_CFLAGS) $(SPARSE_FLAGS) $$i || exit; done
Petr Baudis28818ff2005-07-29 17:50:24 +0200817
818
819
820### Installation rules
821
Andreas Ericssond6ebd252005-11-22 00:44:15 +0100822install: all
Johannes Schindelin39c015c2006-02-18 12:40:22 +0100823 $(INSTALL) -d -m755 '$(DESTDIR_SQ)$(bindir_SQ)'
824 $(INSTALL) -d -m755 '$(DESTDIR_SQ)$(gitexecdir_SQ)'
825 $(INSTALL) $(ALL_PROGRAMS) '$(DESTDIR_SQ)$(gitexecdir_SQ)'
826 $(INSTALL) git$X gitk '$(DESTDIR_SQ)$(bindir_SQ)'
Ramsay Allan Jones7ffe7092006-07-29 17:25:03 +0100827 $(MAKE) -C templates DESTDIR='$(DESTDIR_SQ)' install
Alex Riesenf8487182006-12-04 10:50:04 +0100828 $(MAKE) -C perl prefix='$(prefix_SQ)' install
Sean7f7e6ea2006-05-22 00:42:59 -0400829 if test 'z$(bindir_SQ)' != 'z$(gitexecdir_SQ)'; \
830 then \
831 ln -f '$(DESTDIR_SQ)$(bindir_SQ)/git$X' \
832 '$(DESTDIR_SQ)$(gitexecdir_SQ)/git$X' || \
833 cp '$(DESTDIR_SQ)$(bindir_SQ)/git$X' \
834 '$(DESTDIR_SQ)$(gitexecdir_SQ)/git$X'; \
835 fi
836 $(foreach p,$(BUILT_INS), rm -f '$(DESTDIR_SQ)$(gitexecdir_SQ)/$p' && ln '$(DESTDIR_SQ)$(gitexecdir_SQ)/git$X' '$(DESTDIR_SQ)$(gitexecdir_SQ)/$p' ;)
Petr Baudis28818ff2005-07-29 17:50:24 +0200837
838install-doc:
839 $(MAKE) -C Documentation install
840
Eric Wong6538d1e2006-12-23 08:26:09 -0800841quick-install-doc:
842 $(MAKE) -C Documentation quick-install
Petr Baudis28818ff2005-07-29 17:50:24 +0200843
844
845
846### Maintainer's dist rules
847
Junio C Hamano9b88fce2005-12-27 14:40:17 -0800848git.spec: git.spec.in
Jim Meyeringfc36f6a2006-05-25 18:52:01 +0200849 sed -e 's/@@VERSION@@/$(GIT_VERSION)/g' < $< > $@+
850 mv $@+ $@
Chris Wrighta9db2972005-07-07 13:09:50 -0700851
Junio C Hamano27dedf02005-11-16 21:32:44 -0800852GIT_TARNAME=git-$(GIT_VERSION)
Junio C Hamano9ccb64c2006-10-05 02:26:12 -0700853dist: git.spec git-archive
854 ./git-archive --format=tar \
855 --prefix=$(GIT_TARNAME)/ HEAD^{tree} > $(GIT_TARNAME).tar
Chris Wrighta9db2972005-07-07 13:09:50 -0700856 @mkdir -p $(GIT_TARNAME)
Junio C Hamano27dedf02005-11-16 21:32:44 -0800857 @cp git.spec $(GIT_TARNAME)
H. Peter Anvin181129d2006-01-09 18:07:01 -0800858 @echo $(GIT_VERSION) > $(GIT_TARNAME)/version
859 $(TAR) rf $(GIT_TARNAME).tar \
860 $(GIT_TARNAME)/git.spec $(GIT_TARNAME)/version
Chris Wrighta9db2972005-07-07 13:09:50 -0700861 @rm -rf $(GIT_TARNAME)
Eric W. Biederman9dce3c02005-07-14 19:20:50 -0600862 gzip -f -9 $(GIT_TARNAME).tar
Chris Wrighta9db2972005-07-07 13:09:50 -0700863
864rpm: dist
Junio C Hamano27dedf02005-11-16 21:32:44 -0800865 $(RPMBUILD) -ta $(GIT_TARNAME).tar.gz
Chris Wrighta9db2972005-07-07 13:09:50 -0700866
Tilman Sauerbeck52db0492006-05-18 12:57:04 +0200867htmldocs = git-htmldocs-$(GIT_VERSION)
868manpages = git-manpages-$(GIT_VERSION)
869dist-doc:
870 rm -fr .doc-tmp-dir
871 mkdir .doc-tmp-dir
872 $(MAKE) -C Documentation WEBDOC_DEST=../.doc-tmp-dir install-webdoc
873 cd .doc-tmp-dir && $(TAR) cf ../$(htmldocs).tar .
874 gzip -n -9 -f $(htmldocs).tar
875 :
876 rm -fr .doc-tmp-dir
877 mkdir .doc-tmp-dir .doc-tmp-dir/man1 .doc-tmp-dir/man7
Martin Waitzc5360322006-05-25 14:37:46 +0200878 $(MAKE) -C Documentation DESTDIR=./ \
Jakub Narebski7b8cf0c2006-06-29 23:26:54 +0200879 man1dir=../.doc-tmp-dir/man1 \
880 man7dir=../.doc-tmp-dir/man7 \
Tilman Sauerbeck52db0492006-05-18 12:57:04 +0200881 install
882 cd .doc-tmp-dir && $(TAR) cf ../$(manpages).tar .
883 gzip -n -9 -f $(manpages).tar
884 rm -fr .doc-tmp-dir
885
Petr Baudis28818ff2005-07-29 17:50:24 +0200886### Cleaning rules
Eric W. Biederman87a81c82005-07-14 19:21:57 -0600887
Linus Torvaldse83c5162005-04-07 15:13:13 -0700888clean:
Junio C Hamano3467fec2006-03-26 23:41:22 -0800889 rm -f *.o mozilla-sha1/*.o arm/*.o ppc/*.o compat/*.o xdiff/*.o \
890 $(LIB_FILE) $(XDIFF_LIB)
A Large Angry SCMe6bfaf32006-04-16 20:17:38 -0700891 rm -f $(ALL_PROGRAMS) $(BUILT_INS) git$X
Fredrik Kuivinenf81e7c62006-03-18 11:07:12 +0100892 rm -f *.spec *.pyc *.pyo */*.pyc */*.pyo common-cmds.h TAGS tags
Jakub Narebski92b878a2006-07-08 23:07:07 +0200893 rm -rf autom4te.cache
Junio C Hamano1b1b6782006-08-08 13:42:35 -0700894 rm -f configure config.log config.mak.autogen config.mak.append config.status config.cache
Tilman Sauerbeck52db0492006-05-18 12:57:04 +0200895 rm -rf $(GIT_TARNAME) .doc-tmp-dir
Junio C Hamano5a571cd2005-08-12 01:03:07 -0700896 rm -f $(GIT_TARNAME).tar.gz git-core_$(GIT_VERSION)-*.tar.gz
Junio C Hamano9dc21642006-06-07 12:27:53 -0700897 rm -f $(htmldocs).tar.gz $(manpages).tar.gz
Junio C Hamano22987ae2006-08-01 16:23:47 -0700898 rm -f gitweb/gitweb.cgi
Thomas Glanzmannca67f002005-05-22 20:27:28 +0200899 $(MAKE) -C Documentation/ clean
Alex Riesenf8487182006-12-04 10:50:04 +0100900 $(MAKE) -C perl clean
Petr Baudisb1edc532006-06-24 04:34:29 +0200901 $(MAKE) -C templates/ clean
Junio C Hamano4b7581f2005-08-02 17:24:11 -0700902 $(MAKE) -C t/ clean
Yakov Lernerca3bcab2006-06-15 01:36:00 +0300903 rm -f GIT-VERSION-FILE GIT-CFLAGS
Junio C Hamano9b88fce2005-12-27 14:40:17 -0800904
Junio C Hamano4dc00022006-01-12 21:42:25 -0800905.PHONY: all install clean strip
Yakov Lernerca3bcab2006-06-15 01:36:00 +0300906.PHONY: .FORCE-GIT-VERSION-FILE TAGS tags .FORCE-GIT-CFLAGS
Junio C Hamanod89056c2005-12-19 17:59:58 -0800907
Junio C Hamano8c989ec2006-04-13 00:17:19 -0700908### Check documentation
909#
910check-docs::
911 @for v in $(ALL_PROGRAMS) $(BUILT_INS) git$X gitk; \
912 do \
913 case "$$v" in \
Junio C Hamano8c989ec2006-04-13 00:17:19 -0700914 git-merge-octopus | git-merge-ours | git-merge-recursive | \
Junio C Hamanoc8b87ef2006-08-03 16:17:51 -0700915 git-merge-resolve | git-merge-stupid | git-merge-recur | \
Junio C Hamano8c989ec2006-04-13 00:17:19 -0700916 git-ssh-pull | git-ssh-push ) continue ;; \
917 esac ; \
918 test -f "Documentation/$$v.txt" || \
919 echo "no doc: $$v"; \
920 grep -q "^gitlink:$$v\[[0-9]\]::" Documentation/git.txt || \
921 case "$$v" in \
922 git) ;; \
923 *) echo "no link: $$v";; \
924 esac ; \
925 done | sort
Junio C Hamanoc74390e2006-11-05 11:26:21 -0800926
927### Make sure built-ins do not have dups and listed in git.c
928#
929check-builtins::
930 ./check-builtins.sh