blob: a7310f24015480ef31a52f05abee09d69aa1b8e6 [file] [log] [blame]
Junio C Hamano2731d042005-12-01 12:26:41 -08001# The default target of this Makefile is...
Junio C Hamano6fc301b2007-01-10 12:24:54 -08002all::
Junio C Hamano2731d042005-12-01 12:26:41 -08003
Shawn O. Pearce2314c942007-03-06 02:09:14 -05004# Define V=1 to have a more verbose compile.
Shawn O. Pearce74f2b2a2007-03-06 01:35:01 -05005#
Michal Rokosc4582f92008-03-05 16:46:13 +01006# Define SNPRINTF_RETURNS_BOGUS if your are on a system which snprintf()
7# or vsnprintf() return -1 instead of number of characters which would
8# have been written to the final string if enough space had been available.
9#
Brandon Caseycba22522008-02-08 20:32:47 -060010# Define FREAD_READS_DIRECTORIES if your are on a system which succeeds
11# when attempting to read from an fopen'ed directory.
12#
Linus Torvalds765ac8e2006-02-28 15:07:20 -080013# Define NO_OPENSSL environment variable if you do not have OpenSSL.
14# This also implies MOZILLA_SHA1.
Petr Baudis5bdac8b2005-07-29 17:48:26 +020015#
Johan Herland8da1e212008-06-15 12:14:12 +020016# Define NO_CURL if you do not have libcurl installed. git-http-pull and
Nick Hengeveld58e60dd2005-11-02 11:19:24 -080017# git-http-push are not built, and you cannot use http:// and https://
18# transports.
Johannes Schindelinb2c0bd62005-07-31 02:14:23 +020019#
Patrick Mauritz6d9bbc52005-09-19 16:11:19 +020020# Define CURLDIR=/foo/bar if your curl header and library files are in
21# /foo/bar/include and /foo/bar/lib directories.
22#
Nick Hengeveld58e60dd2005-11-02 11:19:24 -080023# Define NO_EXPAT if you do not have expat installed. git-http-push is
24# not built, and you cannot push using http:// and https:// transports.
25#
Serge van den Boom85b45182009-01-28 21:43:57 +010026# Define EXPATDIR=/foo/bar if your expat header and library files are in
27# /foo/bar/include and /foo/bar/lib directories.
28#
Junio C Hamano35a730f2006-01-19 17:13:51 -080029# Define NO_D_INO_IN_DIRENT if you don't have d_ino in your struct dirent.
30#
Junio C Hamano63be37b2006-01-19 17:13:57 -080031# Define NO_D_TYPE_IN_DIRENT if your platform defines DT_UNKNOWN but lacks
32# d_type in struct dirent (latest Cygwin -- will be fixed soonish).
33#
Ramsay Allan Jones579d1fb2006-07-30 16:38:28 +010034# Define NO_C99_FORMAT if your formatted IO functions (printf/scanf et.al.)
35# do not support the 'size specifiers' introduced by C99, namely ll, hh,
36# j, z, t. (representing long long int, char, intmax_t, size_t, ptrdiff_t).
Jakub Narebski465e6492006-08-04 17:55:58 +020037# some C compilers supported these specifiers prior to C99 as an extension.
Ramsay Allan Jones579d1fb2006-07-30 16:38:28 +010038#
Linus Torvaldsef34af22005-09-18 18:30:50 -070039# Define NO_STRCASESTR if you don't have strcasestr.
40#
René Scharfeb21b9f12007-09-07 00:32:54 +020041# Define NO_MEMMEM if you don't have memmem.
42#
Peter Eriksen817151e2006-06-24 16:01:25 +020043# Define NO_STRLCPY if you don't have strlcpy.
44#
Jason Riedybc6b4f52007-02-19 16:22:56 -080045# Define NO_STRTOUMAX if you don't have strtoumax in the C library.
46# If your compiler also does not support long long or does not have
47# strtoull, define NO_STRTOULL.
48#
Jason Riedye40b61f2005-12-02 15:08:28 -080049# Define NO_SETENV if you don't have setenv in the C library.
50#
Jakub Narebskibfa8fcc2008-01-18 02:03:51 +010051# Define NO_UNSETENV if you don't have unsetenv in the C library.
52#
Shawn O. Pearceca5bb5d2007-10-20 16:03:49 -040053# Define NO_MKDTEMP if you don't have mkdtemp in the C library.
54#
Robert Schiele26009732008-01-24 19:34:46 +010055# Define NO_SYS_SELECT_H if you don't have sys/select.h.
56#
Junio C Hamano9f0bb902006-05-02 00:40:24 -070057# Define NO_SYMLINK_HEAD if you never want .git/HEAD to be a symbolic link.
58# Enable it on Windows. By default, symrefs are still used.
Pavel Roskin2fabd212005-11-15 00:59:50 -050059#
Pavel Roskin02853582006-07-09 02:44:58 -070060# Define NO_SVN_TESTS if you want to skip time-consuming SVN interoperability
Eric Wong60d02cc2006-07-06 00:14:16 -070061# tests. These tests take up a significant amount of the total test time
62# but are not needed unless you plan to talk to SVN repos.
63#
Shawn Pearce8eb38ca2006-07-24 00:28:28 -040064# Define NO_FINK if you are building on Darwin/Mac OS X, have Fink
65# installed in /sw, but don't want GIT to link against any libraries
66# installed there. If defined you may specify your own (or Fink's)
67# include directories and library directories by defining CFLAGS
68# and LDFLAGS appropriately.
69#
70# Define NO_DARWIN_PORTS if you are building on Darwin/Mac OS X,
71# have DarwinPorts installed in /opt/local, but don't want GIT to
72# link against any libraries installed there. If defined you may
73# specify your own (or DarwinPort's) include directories and
74# library directories by defining CFLAGS and LDFLAGS appropriately.
75#
Petr Baudis5bdac8b2005-07-29 17:48:26 +020076# Define PPC_SHA1 environment variable when running make to make use of
77# a bundled SHA1 routine optimized for PowerPC.
Junio C Hamano597c9cc2005-09-07 12:22:56 -070078#
Nicolas Pitre7c6ef2f2005-09-20 12:27:13 -040079# Define ARM_SHA1 environment variable when running make to make use of
80# a bundled SHA1 routine optimized for ARM.
81#
Junio C Hamanof6af75d2006-06-23 17:57:48 -070082# Define MOZILLA_SHA1 environment variable when running make to make use of
83# a bundled SHA1 routine coming from Mozilla. It is GPL'd and should be fast
84# on non-x86 architectures (e.g. PowerPC), while the OpenSSL version (default
85# choice) has very fast version optimized for i586.
86#
Junio C Hamano597c9cc2005-09-07 12:22:56 -070087# Define NEEDS_SSL_WITH_CRYPTO if you need -lcrypto with -lssl (Darwin).
Patrick Mauritzf0ebff02005-09-06 01:24:03 +020088#
Junio C Hamano597c9cc2005-09-07 12:22:56 -070089# Define NEEDS_LIBICONV if linking with libc is not enough (Darwin).
Patrick Mauritzf0ebff02005-09-06 01:24:03 +020090#
91# Define NEEDS_SOCKET if linking with libc is not enough (SunOS,
92# Patrick Mauritz).
93#
Johannes Schindelin730d48a2005-10-08 15:54:36 -070094# Define NO_MMAP if you want to avoid mmap.
95#
Junio C Hamano46059cc2008-11-15 04:08:14 -080096# Define NO_PTHREADS if you do not have or do not want to use Pthreads.
97#
Stefan-W. Hahn69006792007-01-09 22:04:12 +010098# Define NO_PREAD if you have a problem with pread() system call (e.g.
99# cygwin.dll before v1.5.22).
100#
Shawn O. Pearce1510fea2006-12-14 06:15:57 -0500101# Define NO_FAST_WORKING_DIRECTORY if accessing objects in pack files is
102# generally faster on your platform than accessing the working directory.
103#
Shawn O. Pearcec8697532006-12-30 23:53:55 -0500104# Define NO_TRUSTABLE_FILEMODE if your filesystem may claim to support
105# the executable mode bit, but doesn't really do so.
106#
hpa49744d62005-09-28 16:52:21 -0700107# Define NO_IPV6 if you lack IPv6 support and getaddrinfo().
108#
Junio C Hamanobdc37f52006-01-19 17:13:32 -0800109# Define NO_SOCKADDR_STORAGE if your platform does not have struct
110# sockaddr_storage.
111#
Fernando J. Peredab6e56ec2006-02-16 09:38:01 +0100112# Define NO_ICONV if your libc does not properly support iconv.
113#
Ramsay Jonesfd547a92007-03-03 18:29:03 +0000114# Define OLD_ICONV if your library has an old iconv(), where the second
115# (input buffer pointer) parameter is declared with type (const char **).
116#
David Symonds609a2282007-11-07 14:24:28 +1100117# Define NO_DEFLATE_BOUND if your zlib does not have deflateBound.
118#
Matt Kraai20648872007-06-30 10:05:03 -0700119# Define NO_R_TO_GCC_LINKER if your gcc does not like "-R/path/lib"
120# that tells runtime paths to dynamic libraries;
121# "-Wl,-rpath=/path/lib" is used instead.
Junio C Hamanobbfc63d2006-12-27 14:17:35 -0800122#
Petr Baudis5bdac8b2005-07-29 17:48:26 +0200123# Define USE_NSEC below if you want git to care about sub-second file mtimes
124# and ctimes. Note that you need recent glibc (at least 2.2.4) for this, and
125# it will BREAK YOUR LOCAL DIFFS! show-diff and anything using it will likely
126# randomly break unless your underlying filesystem supports those sub-second
127# times (my ext3 doesn't).
Junio C Hamanof6af75d2006-06-23 17:57:48 -0700128#
Petr Baudis5bdac8b2005-07-29 17:48:26 +0200129# Define USE_STDEV below if you want git to care about the underlying device
Johannes Schindelin10455d22007-11-30 11:35:23 +0000130# change being considered an inode change from the update-index perspective.
Alex Riesenf8487182006-12-04 10:50:04 +0100131#
Junio C Hamanofdb2a2a2008-08-18 21:57:16 +0200132# Define NO_ST_BLOCKS_IN_STRUCT_STAT if your platform does not have st_blocks
133# field that counts the on-disk footprint in 512-byte blocks.
134#
Junio C Hamano4c7100a2007-06-14 22:20:16 -0700135# Define ASCIIDOC8 if you want to format documentation with AsciiDoc 8
136#
Jonas Fonseca7f55cf42007-11-14 10:38:46 +0100137# Define DOCBOOK_XSL_172 if you want to format man pages with DocBook XSL v1.72.
138#
Alex Riesenf8487182006-12-04 10:50:04 +0100139# Define NO_PERL_MAKEMAKER if you cannot use Makefiles generated by perl's
140# MakeMaker (e.g. using ActiveState under Cygwin).
141#
Eygene Ryabinkin3cfaf112007-03-28 04:00:23 -0700142# Define NO_TCLTK if you do not want Tcl/Tk GUI.
143#
Shawn O. Pearce5f5dbd72007-05-07 23:36:31 -0400144# The TCL_PATH variable governs the location of the Tcl interpreter
145# used to optimize git-gui for your system. Only used if NO_TCLTK
146# is not set. Defaults to the bare 'tclsh'.
147#
148# The TCLTK_PATH variable governs the location of the Tcl/Tk interpreter.
Eygene Ryabinkin81b63c72007-03-28 04:12:07 -0700149# If not set it defaults to the bare 'wish'. If it is set to the empty
150# string then NO_TCLTK will be forced (this is used by configure script).
151#
Nicolas Pitre8ecce682007-09-06 02:13:11 -0400152# Define THREADED_DELTA_SEARCH if you have pthreads and wish to exploit
153# parallel delta searching when packing objects.
154#
Brian Downing43fe9012008-02-05 15:10:44 -0600155# Define INTERNAL_QSORT to use Git's implementation of qsort(), which
156# is a simplified version of the merge sort used in glibc. This is
157# recommended if Git triggers O(n^2) behavior in your platform's qsort().
158#
Jeff King5f7c6432008-03-12 17:39:16 -0400159# Define NO_EXTERNAL_GREP if you don't want "git grep" to ever call
160# your external grep (e.g., if your system lacks grep, if its grep is
161# broken, or spawning external process is slower than built-in grep git has).
Petr Baudis5bdac8b2005-07-29 17:48:26 +0200162
Junio C Hamano9b88fce2005-12-27 14:40:17 -0800163GIT-VERSION-FILE: .FORCE-GIT-VERSION-FILE
Fredrik Kuivinen36546382006-02-14 00:15:14 +0100164 @$(SHELL_PATH) ./GIT-VERSION-GEN
Junio C Hamano9b88fce2005-12-27 14:40:17 -0800165-include GIT-VERSION-FILE
Petr Baudis5bdac8b2005-07-29 17:48:26 +0200166
Paul Jakmae15f5452006-02-20 23:36:28 +0000167uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not')
168uname_M := $(shell sh -c 'uname -m 2>/dev/null || echo not')
169uname_O := $(shell sh -c 'uname -o 2>/dev/null || echo not')
170uname_R := $(shell sh -c 'uname -r 2>/dev/null || echo not')
171uname_P := $(shell sh -c 'uname -p 2>/dev/null || echo not')
Junio C Hamano46059cc2008-11-15 04:08:14 -0800172uname_V := $(shell sh -c 'uname -v 2>/dev/null || echo not')
Paul Jakmae15f5452006-02-20 23:36:28 +0000173
Junio C Hamano94d23312005-11-13 01:46:13 -0800174# CFLAGS and LDFLAGS are for the users to override from the command line.
Junio C Hamano12aa7452005-11-04 23:50:09 -0800175
Pavel Roskinb05701c2005-08-06 01:36:15 -0400176CFLAGS = -g -O2 -Wall
Junio C Hamano94d23312005-11-13 01:46:13 -0800177LDFLAGS =
Junio C Hamano12aa7452005-11-04 23:50:09 -0800178ALL_CFLAGS = $(CFLAGS)
Junio C Hamano94d23312005-11-13 01:46:13 -0800179ALL_LDFLAGS = $(LDFLAGS)
Junio C Hamano4dc00022006-01-12 21:42:25 -0800180STRIP ?= strip
Thomas Glanzmann29c2cce2005-05-07 10:41:54 +0200181
Johannes Sixt49fa65a2008-07-23 21:12:18 +0200182# Among the variables below, these:
183# gitexecdir
184# template_dir
185# htmldir
186# ETC_GITCONFIG (but not sysconfdir)
187# can be specified as a relative path ../some/where/else (which must begin
188# with ../); this is interpreted as relative to $(bindir) and "git" at
189# runtime figures out where they are based on the path to the executable.
190# This can help installing the suite in a relocatable way.
191
Pavel Roskinb05701c2005-08-06 01:36:15 -0400192prefix = $(HOME)
193bindir = $(prefix)/bin
Sergei Organov8e566f22007-12-06 21:33:01 +0300194mandir = $(prefix)/share/man
Junio C Hamanoa149a1a2007-12-10 01:35:29 -0800195infodir = $(prefix)/share/info
Nguyễn Thái Ngọc Duyf28ac702007-11-28 23:21:57 +0700196gitexecdir = $(prefix)/libexec/git-core
Johannes Sixt93547682007-06-11 10:02:17 +0200197sharedir = $(prefix)/share
Johannes Sixtd52fd422007-06-11 11:10:47 +0200198template_dir = $(sharedir)/git-core/templates
Christian Couder5d6491c2007-12-02 06:07:55 +0100199htmldir=$(sharedir)/doc/git-doc
Josh Triplettb51b8bb2007-04-24 00:51:35 -0700200ifeq ($(prefix),/usr)
201sysconfdir = /etc
202else
203sysconfdir = $(prefix)/etc
204endif
Robert Schiele10861be2007-08-01 06:30:35 +0200205lib = lib
Josh Triplettb51b8bb2007-04-24 00:51:35 -0700206ETC_GITCONFIG = $(sysconfdir)/gitconfig
Petr Baudisa682ef92005-08-05 01:56:38 +0200207# DESTDIR=
Petr Baudis5c2a7fb2005-04-13 02:14:06 -0700208
Martin Waitz5d043a32006-08-01 21:34:08 +0200209# default configuration for gitweb
Jeff Kingc8d138a2006-08-02 15:23:34 -0400210GITWEB_CONFIG = gitweb_config.perl
Gerrit Pape17a8b252008-03-26 18:11:19 +0000211GITWEB_CONFIG_SYSTEM = /etc/gitweb.conf
Yasushi SHOJI2de21fa2006-08-15 07:50:49 +0900212GITWEB_HOME_LINK_STR = projects
Martin Waitz5d043a32006-08-01 21:34:08 +0200213GITWEB_SITENAME =
214GITWEB_PROJECTROOT = /pub/git
Luke Luca5e9492007-10-16 20:45:25 -0700215GITWEB_PROJECT_MAXDEPTH = 2007
Matthias Lederhofer32f4aac2006-09-17 00:31:01 +0200216GITWEB_EXPORT_OK =
217GITWEB_STRICT_EXPORT =
Jakub Narebski19a87212006-08-15 23:03:17 +0200218GITWEB_BASE_URL =
Martin Waitz5d043a32006-08-01 21:34:08 +0200219GITWEB_LIST =
220GITWEB_HOMETEXT = indextext.html
221GITWEB_CSS = gitweb.css
Martin Waitz281f2f62006-07-31 00:38:39 +0200222GITWEB_LOGO = git-logo.png
Jakub Narebski0b5deba2006-09-04 20:32:13 +0200223GITWEB_FAVICON = git-favicon.png
Alan Chandlerb2d34762006-10-03 13:49:03 +0100224GITWEB_SITE_HEADER =
225GITWEB_SITE_FOOTER =
Martin Waitz5d043a32006-08-01 21:34:08 +0200226
Johannes Sixt49fa65a2008-07-23 21:12:18 +0200227export prefix bindir sharedir htmldir sysconfdir
Jakub Narebskie14421b2006-06-29 22:11:25 +0200228
Pavel Roskinb05701c2005-08-06 01:36:15 -0400229CC = gcc
230AR = ar
Emil Medve4cb08df2007-07-14 12:51:44 -0500231RM = rm -f
Junio C Hamano229a7ed2005-09-23 10:41:40 -0700232TAR = tar
David Kastrup89b2f192007-07-29 15:23:28 -0700233FIND = find
Pavel Roskinb05701c2005-08-06 01:36:15 -0400234INSTALL = install
235RPMBUILD = rpmbuild
Shawn O. Pearce5f5dbd72007-05-07 23:36:31 -0400236TCL_PATH = tclsh
Eygene Ryabinkin81b63c72007-03-28 04:12:07 -0700237TCLTK_PATH = wish
David M. Syzdek158629b2008-11-02 14:43:20 -0900238PTHREAD_LIBS = -lpthread
Linus Torvaldse83c5162005-04-07 15:13:13 -0700239
Shawn O. Pearce5f5dbd72007-05-07 23:36:31 -0400240export TCL_PATH TCLTK_PATH
241
Linus Torvalds44c9e852005-07-03 10:02:35 -0700242# sparse is architecture-neutral, which means that we need to tell it
243# explicitly what architecture to check for. Fix this up for yours..
Pavel Roskinb05701c2005-08-06 01:36:15 -0400244SPARSE_FLAGS = -D__BIG_ENDIAN__ -D__powerpc__
Linus Torvalds44c9e852005-07-03 10:02:35 -0700245
Petr Baudis28818ff2005-07-29 17:50:24 +0200246
247
248### --- END CONFIGURATION SECTION ---
249
Petr Baudis8d7f5862006-06-25 03:47:03 +0200250# Those must not be GNU-specific; they are shared with perl/ which may
Petr Baudis18b0fc12006-09-23 20:20:47 +0200251# be built by a different compiler. (Note that this is an artifact now
252# but it still might be nice to keep that distinction.)
253BASIC_CFLAGS =
254BASIC_LDFLAGS =
Petr Baudis8d7f5862006-06-25 03:47:03 +0200255
Junio C Hamano74ca5e62008-03-12 01:46:26 -0700256SCRIPT_SH += git-am.sh
257SCRIPT_SH += git-bisect.sh
Junio C Hamano74ca5e62008-03-12 01:46:26 -0700258SCRIPT_SH += git-filter-branch.sh
259SCRIPT_SH += git-lost-found.sh
260SCRIPT_SH += git-merge-octopus.sh
261SCRIPT_SH += git-merge-one-file.sh
262SCRIPT_SH += git-merge-resolve.sh
Junio C Hamano74ca5e62008-03-12 01:46:26 -0700263SCRIPT_SH += git-mergetool.sh
264SCRIPT_SH += git-parse-remote.sh
265SCRIPT_SH += git-pull.sh
266SCRIPT_SH += git-quiltimport.sh
267SCRIPT_SH += git-rebase--interactive.sh
268SCRIPT_SH += git-rebase.sh
269SCRIPT_SH += git-repack.sh
270SCRIPT_SH += git-request-pull.sh
271SCRIPT_SH += git-sh-setup.sh
272SCRIPT_SH += git-stash.sh
273SCRIPT_SH += git-submodule.sh
274SCRIPT_SH += git-web--browse.sh
Petr Baudis28818ff2005-07-29 17:50:24 +0200275
Junio C Hamano74ca5e62008-03-12 01:46:26 -0700276SCRIPT_PERL += git-add--interactive.perl
277SCRIPT_PERL += git-archimport.perl
278SCRIPT_PERL += git-cvsexportcommit.perl
279SCRIPT_PERL += git-cvsimport.perl
280SCRIPT_PERL += git-cvsserver.perl
281SCRIPT_PERL += git-relink.perl
282SCRIPT_PERL += git-send-email.perl
283SCRIPT_PERL += git-svn.perl
Junio C Hamano60036a42005-07-30 17:31:47 -0700284
Andreas Ericssond6ebd252005-11-22 00:44:15 +0100285SCRIPTS = $(patsubst %.sh,%,$(SCRIPT_SH)) \
286 $(patsubst %.perl,%,$(SCRIPT_PERL)) \
Shawn O. Pearcee475fe12007-11-23 15:35:08 -0500287 git-instaweb
Andreas Ericssond6ebd252005-11-22 00:44:15 +0100288
Junio C Hamano42f77402006-08-15 21:38:07 -0700289# Empty...
290EXTRA_PROGRAMS =
Andreas Ericssond6ebd252005-11-22 00:44:15 +0100291
Junio C Hamano74ca5e62008-03-12 01:46:26 -0700292# ... and all the rest that could be moved out of bindir to gitexecdir
293PROGRAMS += $(EXTRA_PROGRAMS)
Junio C Hamano74ca5e62008-03-12 01:46:26 -0700294PROGRAMS += git-fast-import$X
295PROGRAMS += git-fetch-pack$X
296PROGRAMS += git-hash-object$X
Junio C Hamano74ca5e62008-03-12 01:46:26 -0700297PROGRAMS += git-index-pack$X
298PROGRAMS += git-merge-index$X
299PROGRAMS += git-merge-tree$X
300PROGRAMS += git-mktag$X
301PROGRAMS += git-mktree$X
302PROGRAMS += git-pack-redundant$X
303PROGRAMS += git-patch-id$X
Junio C Hamano74ca5e62008-03-12 01:46:26 -0700304PROGRAMS += git-send-pack$X
Johannes Sixte705d752008-09-08 12:46:55 +0200305PROGRAMS += git-shell$X
Junio C Hamano74ca5e62008-03-12 01:46:26 -0700306PROGRAMS += git-show-index$X
307PROGRAMS += git-unpack-file$X
308PROGRAMS += git-update-server-info$X
309PROGRAMS += git-upload-pack$X
310PROGRAMS += git-var$X
311
Junio C Hamano17368552008-02-23 11:08:25 -0800312# List built-in command $C whose implementation cmd_$C() is not in
313# builtin-$C.o but is linked in as part of some other command.
Junio C Hamano74ca5e62008-03-12 01:46:26 -0700314BUILT_INS += $(patsubst builtin-%.o,git-%$X,$(BUILTIN_OBJS))
315
316BUILT_INS += git-cherry-pick$X
317BUILT_INS += git-cherry$X
318BUILT_INS += git-format-patch$X
319BUILT_INS += git-fsck-objects$X
320BUILT_INS += git-get-tar-commit-id$X
321BUILT_INS += git-init$X
322BUILT_INS += git-merge-subtree$X
323BUILT_INS += git-peek-remote$X
324BUILT_INS += git-repo-config$X
325BUILT_INS += git-show$X
Junio C Hamano24b1f652008-12-03 00:30:34 -0800326BUILT_INS += git-stage$X
Junio C Hamano74ca5e62008-03-12 01:46:26 -0700327BUILT_INS += git-status$X
328BUILT_INS += git-whatchanged$X
Junio C Hamano91730802006-04-10 17:37:58 -0700329
Junio C Hamanob42934d2006-01-12 21:37:17 -0800330# what 'all' will build and 'install' will install, in gitexecdir
Junio C Hamano6506e152007-02-06 21:27:09 -0800331ALL_PROGRAMS = $(PROGRAMS) $(SCRIPTS)
Linus Torvaldse83c5162005-04-07 15:13:13 -0700332
Eygene Ryabinkin3cfaf112007-03-28 04:00:23 -0700333# what 'all' will build but not install in gitexecdir
334OTHER_PROGRAMS = git$X gitweb/gitweb.cgi
Eygene Ryabinkin3cfaf112007-03-28 04:00:23 -0700335
Ryan Anderson3d320512005-11-21 00:11:22 -0500336# Set paths to tools early so that they can be used for version tests.
337ifndef SHELL_PATH
338 SHELL_PATH = /bin/sh
339endif
340ifndef PERL_PATH
341 PERL_PATH = /usr/bin/perl
342endif
Junio C Hamano720d1502005-09-10 17:46:27 -0700343
Luben Tuikov3a793472006-12-14 23:03:03 -0800344export PERL_PATH
345
Linus Torvalds0a02ce72005-04-18 12:49:39 -0700346LIB_FILE=libgit.a
Linus Torvalds34435462006-03-24 20:13:22 -0800347XDIFF_LIB=xdiff/lib.a
Linus Torvalds0a02ce72005-04-18 12:49:39 -0700348
Junio C Hamano74ca5e62008-03-12 01:46:26 -0700349LIB_H += archive.h
350LIB_H += attr.h
351LIB_H += blob.h
352LIB_H += builtin.h
353LIB_H += cache.h
354LIB_H += cache-tree.h
355LIB_H += commit.h
Johannes Sixtf4626df2007-12-01 21:24:59 +0100356LIB_H += compat/mingw.h
Dmitry Potapovadbc0b62008-09-30 17:53:47 +0400357LIB_H += compat/cygwin.h
Junio C Hamano74ca5e62008-03-12 01:46:26 -0700358LIB_H += csum-file.h
359LIB_H += decorate.h
360LIB_H += delta.h
361LIB_H += diffcore.h
362LIB_H += diff.h
363LIB_H += dir.h
364LIB_H += fsck.h
365LIB_H += git-compat-util.h
Adam Simpkinsc12172d2008-05-04 03:36:53 -0700366LIB_H += graph.h
Junio C Hamano74ca5e62008-03-12 01:46:26 -0700367LIB_H += grep.h
368LIB_H += hash.h
Miklos Vajna940208a2008-07-30 01:16:58 +0200369LIB_H += help.h
Johannes Schindelin8af84da2008-08-31 15:50:23 +0200370LIB_H += levenshtein.h
Junio C Hamano74ca5e62008-03-12 01:46:26 -0700371LIB_H += list-objects.h
372LIB_H += ll-merge.h
373LIB_H += log-tree.h
374LIB_H += mailmap.h
Miklos Vajnadb3a9542008-09-03 01:49:05 +0200375LIB_H += merge-recursive.h
Junio C Hamano74ca5e62008-03-12 01:46:26 -0700376LIB_H += object.h
377LIB_H += pack.h
Johan Herland94e724a2008-06-15 16:05:06 +0200378LIB_H += pack-refs.h
Junio C Hamano74ca5e62008-03-12 01:46:26 -0700379LIB_H += pack-revindex.h
380LIB_H += parse-options.h
381LIB_H += patch-ids.h
Johannes Schindelinc455c872008-07-21 19:03:49 +0100382LIB_H += string-list.h
Junio C Hamano74ca5e62008-03-12 01:46:26 -0700383LIB_H += pkt-line.h
384LIB_H += progress.h
385LIB_H += quote.h
386LIB_H += reflog-walk.h
387LIB_H += refs.h
388LIB_H += remote.h
Stephan Beyer5b2fd952008-07-09 14:58:57 +0200389LIB_H += rerere.h
Junio C Hamano74ca5e62008-03-12 01:46:26 -0700390LIB_H += revision.h
391LIB_H += run-command.h
Junio C Hamano628522e2007-12-29 02:05:47 -0800392LIB_H += sha1-lookup.h
Junio C Hamano74ca5e62008-03-12 01:46:26 -0700393LIB_H += sideband.h
394LIB_H += strbuf.h
395LIB_H += tag.h
396LIB_H += transport.h
397LIB_H += tree.h
398LIB_H += tree-walk.h
399LIB_H += unpack-trees.h
Jeff Kingbe58e702008-10-05 17:43:21 -0400400LIB_H += userdiff.h
Junio C Hamano74ca5e62008-03-12 01:46:26 -0700401LIB_H += utf8.h
Junio C Hamanod3d20b82008-05-26 14:56:19 -0700402LIB_H += wt-status.h
Junio C Hamano8f3f9b02005-07-23 17:54:41 -0700403
Dmitry Potapov5b8e6f82008-06-28 00:46:42 +0400404LIB_OBJS += abspath.o
Junio C Hamano74ca5e62008-03-12 01:46:26 -0700405LIB_OBJS += alias.o
406LIB_OBJS += alloc.o
407LIB_OBJS += archive.o
408LIB_OBJS += archive-tar.o
409LIB_OBJS += archive-zip.o
410LIB_OBJS += attr.o
411LIB_OBJS += base85.o
412LIB_OBJS += blob.o
413LIB_OBJS += branch.o
414LIB_OBJS += bundle.o
415LIB_OBJS += cache-tree.o
416LIB_OBJS += color.o
417LIB_OBJS += combine-diff.o
418LIB_OBJS += commit.o
419LIB_OBJS += config.o
420LIB_OBJS += connect.o
421LIB_OBJS += convert.o
422LIB_OBJS += copy.o
423LIB_OBJS += csum-file.o
424LIB_OBJS += ctype.o
425LIB_OBJS += date.o
426LIB_OBJS += decorate.o
427LIB_OBJS += diffcore-break.o
428LIB_OBJS += diffcore-delta.o
429LIB_OBJS += diffcore-order.o
430LIB_OBJS += diffcore-pickaxe.o
431LIB_OBJS += diffcore-rename.o
432LIB_OBJS += diff-delta.o
Junio C Hamano0569e9b2008-05-23 22:28:56 -0700433LIB_OBJS += diff-no-index.o
Junio C Hamano74ca5e62008-03-12 01:46:26 -0700434LIB_OBJS += diff-lib.o
435LIB_OBJS += diff.o
436LIB_OBJS += dir.o
Stephan Beyerd82f33e2008-07-25 18:28:41 +0200437LIB_OBJS += editor.o
Junio C Hamano74ca5e62008-03-12 01:46:26 -0700438LIB_OBJS += entry.o
439LIB_OBJS += environment.o
440LIB_OBJS += exec_cmd.o
441LIB_OBJS += fsck.o
Adam Simpkinsc12172d2008-05-04 03:36:53 -0700442LIB_OBJS += graph.o
Junio C Hamano74ca5e62008-03-12 01:46:26 -0700443LIB_OBJS += grep.o
444LIB_OBJS += hash.o
445LIB_OBJS += help.o
446LIB_OBJS += ident.o
Johannes Schindelin8af84da2008-08-31 15:50:23 +0200447LIB_OBJS += levenshtein.o
Junio C Hamano74ca5e62008-03-12 01:46:26 -0700448LIB_OBJS += list-objects.o
449LIB_OBJS += ll-merge.o
450LIB_OBJS += lockfile.o
451LIB_OBJS += log-tree.o
452LIB_OBJS += mailmap.o
453LIB_OBJS += match-trees.o
454LIB_OBJS += merge-file.o
Miklos Vajna9047ebb2008-08-12 18:45:14 +0200455LIB_OBJS += merge-recursive.o
Linus Torvalds96872bc2008-03-21 13:16:24 -0700456LIB_OBJS += name-hash.o
Junio C Hamano74ca5e62008-03-12 01:46:26 -0700457LIB_OBJS += object.o
458LIB_OBJS += pack-check.o
Johan Herland94e724a2008-06-15 16:05:06 +0200459LIB_OBJS += pack-refs.o
Junio C Hamano74ca5e62008-03-12 01:46:26 -0700460LIB_OBJS += pack-revindex.o
461LIB_OBJS += pack-write.o
462LIB_OBJS += pager.o
463LIB_OBJS += parse-options.o
464LIB_OBJS += patch-delta.o
465LIB_OBJS += patch-ids.o
Johannes Schindelinc455c872008-07-21 19:03:49 +0100466LIB_OBJS += string-list.o
Junio C Hamano74ca5e62008-03-12 01:46:26 -0700467LIB_OBJS += path.o
468LIB_OBJS += pkt-line.o
469LIB_OBJS += pretty.o
470LIB_OBJS += progress.o
471LIB_OBJS += quote.o
472LIB_OBJS += reachable.o
473LIB_OBJS += read-cache.o
474LIB_OBJS += reflog-walk.o
475LIB_OBJS += refs.o
476LIB_OBJS += remote.o
Stephan Beyer5b2fd952008-07-09 14:58:57 +0200477LIB_OBJS += rerere.o
Junio C Hamano74ca5e62008-03-12 01:46:26 -0700478LIB_OBJS += revision.o
479LIB_OBJS += run-command.o
480LIB_OBJS += server-info.o
481LIB_OBJS += setup.o
482LIB_OBJS += sha1_file.o
Junio C Hamano628522e2007-12-29 02:05:47 -0800483LIB_OBJS += sha1-lookup.o
Junio C Hamano74ca5e62008-03-12 01:46:26 -0700484LIB_OBJS += sha1_name.o
485LIB_OBJS += shallow.o
486LIB_OBJS += sideband.o
487LIB_OBJS += strbuf.o
488LIB_OBJS += symlinks.o
489LIB_OBJS += tag.o
490LIB_OBJS += trace.o
491LIB_OBJS += transport.o
492LIB_OBJS += tree-diff.o
493LIB_OBJS += tree.o
494LIB_OBJS += tree-walk.o
495LIB_OBJS += unpack-trees.o
Jeff Kingbe58e702008-10-05 17:43:21 -0400496LIB_OBJS += userdiff.o
Junio C Hamano74ca5e62008-03-12 01:46:26 -0700497LIB_OBJS += usage.o
498LIB_OBJS += utf8.o
499LIB_OBJS += walker.o
Linus Torvalds112db552008-06-22 12:19:25 -0700500LIB_OBJS += wrapper.o
Junio C Hamano74ca5e62008-03-12 01:46:26 -0700501LIB_OBJS += write_or_die.o
502LIB_OBJS += ws.o
503LIB_OBJS += wt-status.o
504LIB_OBJS += xdiff-interface.o
Linus Torvalds671c9b72008-11-13 16:36:30 -0800505LIB_OBJS += preload-index.o
Josef Weidendorferb1bf95b2005-07-31 21:17:43 +0200506
Junio C Hamano74ca5e62008-03-12 01:46:26 -0700507BUILTIN_OBJS += builtin-add.o
508BUILTIN_OBJS += builtin-annotate.o
509BUILTIN_OBJS += builtin-apply.o
510BUILTIN_OBJS += builtin-archive.o
511BUILTIN_OBJS += builtin-blame.o
512BUILTIN_OBJS += builtin-branch.o
513BUILTIN_OBJS += builtin-bundle.o
514BUILTIN_OBJS += builtin-cat-file.o
515BUILTIN_OBJS += builtin-check-attr.o
516BUILTIN_OBJS += builtin-check-ref-format.o
517BUILTIN_OBJS += builtin-checkout-index.o
518BUILTIN_OBJS += builtin-checkout.o
519BUILTIN_OBJS += builtin-clean.o
Daniel Barkalow8434c2f2008-04-27 13:39:30 -0400520BUILTIN_OBJS += builtin-clone.o
Junio C Hamano74ca5e62008-03-12 01:46:26 -0700521BUILTIN_OBJS += builtin-commit-tree.o
522BUILTIN_OBJS += builtin-commit.o
523BUILTIN_OBJS += builtin-config.o
524BUILTIN_OBJS += builtin-count-objects.o
525BUILTIN_OBJS += builtin-describe.o
526BUILTIN_OBJS += builtin-diff-files.o
527BUILTIN_OBJS += builtin-diff-index.o
528BUILTIN_OBJS += builtin-diff-tree.o
529BUILTIN_OBJS += builtin-diff.o
530BUILTIN_OBJS += builtin-fast-export.o
531BUILTIN_OBJS += builtin-fetch--tool.o
532BUILTIN_OBJS += builtin-fetch-pack.o
533BUILTIN_OBJS += builtin-fetch.o
534BUILTIN_OBJS += builtin-fmt-merge-msg.o
535BUILTIN_OBJS += builtin-for-each-ref.o
536BUILTIN_OBJS += builtin-fsck.o
537BUILTIN_OBJS += builtin-gc.o
538BUILTIN_OBJS += builtin-grep.o
Miklos Vajna3d78d1f2008-08-02 10:08:38 +0200539BUILTIN_OBJS += builtin-help.o
Junio C Hamano74ca5e62008-03-12 01:46:26 -0700540BUILTIN_OBJS += builtin-init-db.o
541BUILTIN_OBJS += builtin-log.o
542BUILTIN_OBJS += builtin-ls-files.o
543BUILTIN_OBJS += builtin-ls-remote.o
544BUILTIN_OBJS += builtin-ls-tree.o
545BUILTIN_OBJS += builtin-mailinfo.o
546BUILTIN_OBJS += builtin-mailsplit.o
Miklos Vajna1c7b76b2008-07-07 19:24:20 +0200547BUILTIN_OBJS += builtin-merge.o
Junio C Hamano74ca5e62008-03-12 01:46:26 -0700548BUILTIN_OBJS += builtin-merge-base.o
549BUILTIN_OBJS += builtin-merge-file.o
550BUILTIN_OBJS += builtin-merge-ours.o
551BUILTIN_OBJS += builtin-merge-recursive.o
552BUILTIN_OBJS += builtin-mv.o
553BUILTIN_OBJS += builtin-name-rev.o
554BUILTIN_OBJS += builtin-pack-objects.o
555BUILTIN_OBJS += builtin-pack-refs.o
556BUILTIN_OBJS += builtin-prune-packed.o
557BUILTIN_OBJS += builtin-prune.o
558BUILTIN_OBJS += builtin-push.o
559BUILTIN_OBJS += builtin-read-tree.o
Junio C Hamanobe5908a2008-09-09 01:27:08 -0700560BUILTIN_OBJS += builtin-receive-pack.o
Junio C Hamano74ca5e62008-03-12 01:46:26 -0700561BUILTIN_OBJS += builtin-reflog.o
562BUILTIN_OBJS += builtin-remote.o
563BUILTIN_OBJS += builtin-rerere.o
564BUILTIN_OBJS += builtin-reset.o
565BUILTIN_OBJS += builtin-rev-list.o
566BUILTIN_OBJS += builtin-rev-parse.o
567BUILTIN_OBJS += builtin-revert.o
568BUILTIN_OBJS += builtin-rm.o
569BUILTIN_OBJS += builtin-send-pack.o
570BUILTIN_OBJS += builtin-shortlog.o
571BUILTIN_OBJS += builtin-show-branch.o
572BUILTIN_OBJS += builtin-show-ref.o
573BUILTIN_OBJS += builtin-stripspace.o
574BUILTIN_OBJS += builtin-symbolic-ref.o
575BUILTIN_OBJS += builtin-tag.o
576BUILTIN_OBJS += builtin-tar-tree.o
577BUILTIN_OBJS += builtin-unpack-objects.o
578BUILTIN_OBJS += builtin-update-index.o
579BUILTIN_OBJS += builtin-update-ref.o
580BUILTIN_OBJS += builtin-upload-archive.o
581BUILTIN_OBJS += builtin-verify-pack.o
582BUILTIN_OBJS += builtin-verify-tag.o
583BUILTIN_OBJS += builtin-write-tree.o
Linus Torvalds70827b12006-04-21 10:27:34 -0700584
Johannes Schindelin54c261f2006-03-27 01:14:52 +0200585GITLIBS = $(LIB_FILE) $(XDIFF_LIB)
Robert Schielebef19da2007-07-29 20:35:45 +0200586EXTLIBS =
Linus Torvaldscef661f2005-04-21 12:33:22 -0700587
Junio C Hamano229a7ed2005-09-23 10:41:40 -0700588#
589# Platform specific tweaks
590#
Junio C Hamanof7c15342005-10-09 12:52:35 -0700591
592# We choose to avoid "if .. else if .. else .. endif endif"
593# because maintaining the nesting to match is a pain. If
594# we had "elif" things would have been much nicer...
Junio C Hamanof7c15342005-10-09 12:52:35 -0700595
Peter Eriksen817151e2006-06-24 16:01:25 +0200596ifeq ($(uname_S),Linux)
597 NO_STRLCPY = YesPlease
Pierre Habouzit38bd64972008-07-21 11:23:43 +0200598 THREADED_DELTA_SEARCH = YesPlease
Peter Eriksen817151e2006-06-24 16:01:25 +0200599endif
Gerrit Papeca7a7412006-07-29 16:26:18 +0000600ifeq ($(uname_S),GNU/kFreeBSD)
601 NO_STRLCPY = YesPlease
Pierre Habouzit38bd64972008-07-21 11:23:43 +0200602 THREADED_DELTA_SEARCH = YesPlease
Gerrit Papeca7a7412006-07-29 16:26:18 +0000603endif
Boyd Lynn Gerber457bb452008-06-08 14:47:54 -0600604ifeq ($(uname_S),UnixWare)
605 CC = cc
606 NEEDS_SOCKET = YesPlease
607 NEEDS_NSL = YesPlease
608 NEEDS_SSL_WITH_CRYPTO = YesPlease
609 NEEDS_LIBICONV = YesPlease
610 SHELL_PATH = /usr/local/bin/bash
611 NO_IPV6 = YesPlease
612 NO_HSTRERROR = YesPlease
613 BASIC_CFLAGS += -Kthread
614 BASIC_CFLAGS += -I/usr/local/include
615 BASIC_LDFLAGS += -L/usr/local/lib
616 INSTALL = ginstall
617 TAR = gtar
618 NO_STRCASESTR = YesPlease
619 NO_MEMMEM = YesPlease
620endif
621ifeq ($(uname_S),SCO_SV)
622 ifeq ($(uname_R),3.2)
623 CFLAGS = -O2
624 endif
625 ifeq ($(uname_R),5)
626 CC = cc
627 BASIC_CFLAGS += -Kthread
628 endif
629 NEEDS_SOCKET = YesPlease
630 NEEDS_NSL = YesPlease
631 NEEDS_SSL_WITH_CRYPTO = YesPlease
632 NEEDS_LIBICONV = YesPlease
633 SHELL_PATH = /usr/bin/bash
634 NO_IPV6 = YesPlease
635 NO_HSTRERROR = YesPlease
636 BASIC_CFLAGS += -I/usr/local/include
637 BASIC_LDFLAGS += -L/usr/local/lib
638 NO_STRCASESTR = YesPlease
639 NO_MEMMEM = YesPlease
640 INSTALL = ginstall
641 TAR = gtar
642endif
Junio C Hamanof7c15342005-10-09 12:52:35 -0700643ifeq ($(uname_S),Darwin)
Junio C Hamano597c9cc2005-09-07 12:22:56 -0700644 NEEDS_SSL_WITH_CRYPTO = YesPlease
645 NEEDS_LIBICONV = YesPlease
Wincent Colaiutafe4aafb2007-12-06 20:07:03 +0100646 ifneq ($(shell expr "$(uname_R)" : '9\.'),2)
647 OLD_ICONV = UnfortunatelyYes
648 endif
Peter Eriksen817151e2006-06-24 16:01:25 +0200649 NO_STRLCPY = YesPlease
Shawn O. Pearce3d594052007-09-09 01:09:17 -0400650 NO_MEMMEM = YesPlease
Arjen Laarhoven954597b2008-12-17 09:20:25 +0100651 THREADED_DELTA_SEARCH = YesPlease
Junio C Hamano597c9cc2005-09-07 12:22:56 -0700652endif
Junio C Hamanof7c15342005-10-09 12:52:35 -0700653ifeq ($(uname_S),SunOS)
Patrick Mauritzf0ebff02005-09-06 01:24:03 +0200654 NEEDS_SOCKET = YesPlease
Junio C Hamano5a90d4a2005-09-11 22:25:49 -0700655 NEEDS_NSL = YesPlease
Junio C Hamano229a7ed2005-09-23 10:41:40 -0700656 SHELL_PATH = /bin/bash
657 NO_STRCASESTR = YesPlease
René Scharfeb21b9f12007-09-07 00:32:54 +0200658 NO_MEMMEM = YesPlease
Alex Riesenfa0c87c2007-06-13 20:54:32 +0200659 NO_HSTRERROR = YesPlease
Guido Ostkamp4e0da762007-11-16 19:59:58 +0100660 NO_MKDTEMP = YesPlease
David Soria Parra6e2dfb12008-10-02 02:08:47 +0200661 OLD_ICONV = UnfortunatelyYes
Jason Riedye40b61f2005-12-02 15:08:28 -0800662 ifeq ($(uname_R),5.8)
Jason Riedy731043f2006-01-25 12:38:36 -0800663 NO_UNSETENV = YesPlease
Jason Riedye40b61f2005-12-02 15:08:28 -0800664 NO_SETENV = YesPlease
Dennis Stosberg66c45092006-08-15 11:01:22 +0200665 NO_C99_FORMAT = YesPlease
Jason Riedybc6b4f52007-02-19 16:22:56 -0800666 NO_STRTOUMAX = YesPlease
Jason Riedye40b61f2005-12-02 15:08:28 -0800667 endif
Dennis Stosberg40d88d42006-04-11 11:42:26 -0700668 ifeq ($(uname_R),5.9)
669 NO_UNSETENV = YesPlease
670 NO_SETENV = YesPlease
Dennis Stosberg66c45092006-08-15 11:01:22 +0200671 NO_C99_FORMAT = YesPlease
Jason Riedybc6b4f52007-02-19 16:22:56 -0800672 NO_STRTOUMAX = YesPlease
Dennis Stosberg40d88d42006-04-11 11:42:26 -0700673 endif
Junio C Hamano229a7ed2005-09-23 10:41:40 -0700674 INSTALL = ginstall
675 TAR = gtar
Petr Baudis8d7f5862006-06-25 03:47:03 +0200676 BASIC_CFLAGS += -D__EXTENSIONS__
Patrick Mauritzf0ebff02005-09-06 01:24:03 +0200677endif
Junio C Hamanof7c15342005-10-09 12:52:35 -0700678ifeq ($(uname_O),Cygwin)
Junio C Hamano63be37b2006-01-19 17:13:57 -0800679 NO_D_TYPE_IN_DIRENT = YesPlease
Junio C Hamano35a730f2006-01-19 17:13:51 -0800680 NO_D_INO_IN_DIRENT = YesPlease
hpa17754512005-09-28 16:37:37 -0700681 NO_STRCASESTR = YesPlease
René Scharfeb21b9f12007-09-07 00:32:54 +0200682 NO_MEMMEM = YesPlease
Junio C Hamano9f0bb902006-05-02 00:40:24 -0700683 NO_SYMLINK_HEAD = YesPlease
hpa17754512005-09-28 16:37:37 -0700684 NEEDS_LIBICONV = YesPlease
Shawn O. Pearce1510fea2006-12-14 06:15:57 -0500685 NO_FAST_WORKING_DIRECTORY = UnfortunatelyYes
Shawn O. Pearcec8697532006-12-30 23:53:55 -0500686 NO_TRUSTABLE_FILEMODE = UnfortunatelyYes
Pascal Obry7a4a2e12007-12-01 10:49:22 +0100687 OLD_ICONV = UnfortunatelyYes
Junio C Hamano2e67a5f2005-11-17 11:29:47 -0800688 # There are conflicting reports about this.
689 # On some boxes NO_MMAP is needed, and not so elsewhere.
Junio C Hamano87ac1392006-12-27 15:12:31 -0800690 # Try commenting this out if you suspect MMAP is more efficient
691 NO_MMAP = YesPlease
hpa49744d62005-09-28 16:52:21 -0700692 NO_IPV6 = YesPlease
Peter Anvina23cd8e2005-09-28 19:08:37 -0700693 X = .exe
Nicolas Pitre7c6ef2f2005-09-20 12:27:13 -0400694endif
Alecs Kingb3bf9742006-01-27 02:04:30 +0800695ifeq ($(uname_S),FreeBSD)
696 NEEDS_LIBICONV = YesPlease
Robert Boonea2f22db2007-09-10 11:43:35 -0500697 NO_MEMMEM = YesPlease
Petr Baudis8d7f5862006-06-25 03:47:03 +0200698 BASIC_CFLAGS += -I/usr/local/include
699 BASIC_LDFLAGS += -L/usr/local/lib
Alex Riesen81a24b52008-03-05 00:15:39 +0100700 DIR_HAS_BSD_GROUP_SEMANTICS = YesPlease
Pierre Habouzit38bd64972008-07-21 11:23:43 +0200701 THREADED_DELTA_SEARCH = YesPlease
David M. Syzdek069bb572008-10-26 03:52:47 -0800702 ifeq ($(shell expr "$(uname_R)" : '4\.'),2)
David M. Syzdek158629b2008-11-02 14:43:20 -0900703 PTHREAD_LIBS = -pthread
David M. Syzdek069bb572008-10-26 03:52:47 -0800704 NO_UINTMAX_T = YesPlease
705 NO_STRTOUMAX = YesPlease
706 endif
Alecs Kingb3bf9742006-01-27 02:04:30 +0800707endif
Junio C Hamanof7c15342005-10-09 12:52:35 -0700708ifeq ($(uname_S),OpenBSD)
Junio C Hamano5fb41e82005-10-10 11:51:11 -0700709 NO_STRCASESTR = YesPlease
René Scharfeb21b9f12007-09-07 00:32:54 +0200710 NO_MEMMEM = YesPlease
Han Boetes18c5a522005-10-01 08:23:26 +0200711 NEEDS_LIBICONV = YesPlease
Petr Baudis8d7f5862006-06-25 03:47:03 +0200712 BASIC_CFLAGS += -I/usr/local/include
713 BASIC_LDFLAGS += -L/usr/local/lib
Pierre Habouzit38bd64972008-07-21 11:23:43 +0200714 THREADED_DELTA_SEARCH = YesPlease
Junio C Hamano94d23312005-11-13 01:46:13 -0800715endif
716ifeq ($(uname_S),NetBSD)
Dennis Stosberge88856b2006-05-11 19:35:31 +0200717 ifeq ($(shell expr "$(uname_R)" : '[01]\.'),2)
718 NEEDS_LIBICONV = YesPlease
719 endif
Petr Baudis8d7f5862006-06-25 03:47:03 +0200720 BASIC_CFLAGS += -I/usr/pkg/include
Junio C Hamanof5b904d2008-08-16 21:56:24 -0700721 BASIC_LDFLAGS += -L/usr/pkg/lib $(CC_LD_DYNPATH)/usr/pkg/lib
Pierre Habouzit38bd64972008-07-21 11:23:43 +0200722 THREADED_DELTA_SEARCH = YesPlease
Han Boetes18c5a522005-10-01 08:23:26 +0200723endif
Jason Riedya6da9392005-12-06 14:20:16 -0800724ifeq ($(uname_S),AIX)
725 NO_STRCASESTR=YesPlease
René Scharfeb21b9f12007-09-07 00:32:54 +0200726 NO_MEMMEM = YesPlease
Mike Ralphson377d9c42008-05-07 09:35:55 +0100727 NO_MKDTEMP = YesPlease
Peter Eriksen817151e2006-06-24 16:01:25 +0200728 NO_STRLCPY = YesPlease
Mike Ralphson377d9c42008-05-07 09:35:55 +0100729 FREAD_READS_DIRECTORIES = UnfortunatelyYes
730 INTERNAL_QSORT = UnfortunatelyYes
Jason Riedya6da9392005-12-06 14:20:16 -0800731 NEEDS_LIBICONV=YesPlease
Mike Ralphson377d9c42008-05-07 09:35:55 +0100732 BASIC_CFLAGS += -D_LARGE_FILES
Junio C Hamano46059cc2008-11-15 04:08:14 -0800733 ifneq ($(shell expr "$(uname_V)" : '[1234]'),1)
734 THREADED_DELTA_SEARCH = YesPlease
735 else
736 NO_PTHREADS = YesPlease
737 endif
Jason Riedya6da9392005-12-06 14:20:16 -0800738endif
Thomas Schwingec29ba0c2007-08-02 10:56:42 +0200739ifeq ($(uname_S),GNU)
740 # GNU/Hurd
741 NO_STRLCPY=YesPlease
742endif
Johannes Schindelin289c4b32006-02-17 15:23:41 +0100743ifeq ($(uname_S),IRIX64)
744 NO_IPV6=YesPlease
745 NO_SETENV=YesPlease
746 NO_STRCASESTR=YesPlease
René Scharfeb21b9f12007-09-07 00:32:54 +0200747 NO_MEMMEM = YesPlease
Peter Eriksen817151e2006-06-24 16:01:25 +0200748 NO_STRLCPY = YesPlease
Johannes Schindelin289c4b32006-02-17 15:23:41 +0100749 NO_SOCKADDR_STORAGE=YesPlease
750 SHELL_PATH=/usr/gnu/bin/bash
Petr Baudis8d7f5862006-06-25 03:47:03 +0200751 BASIC_CFLAGS += -DPATH_MAX=1024
Johannes Schindelin289c4b32006-02-17 15:23:41 +0100752 # for now, build 32-bit version
Petr Baudis8d7f5862006-06-25 03:47:03 +0200753 BASIC_LDFLAGS += -L/usr/lib32
Johannes Schindelin289c4b32006-02-17 15:23:41 +0100754endif
Robert Schiele81cc66a2008-01-24 19:35:20 +0100755ifeq ($(uname_S),HP-UX)
756 NO_IPV6=YesPlease
757 NO_SETENV=YesPlease
758 NO_STRCASESTR=YesPlease
759 NO_MEMMEM = YesPlease
760 NO_STRLCPY = YesPlease
761 NO_MKDTEMP = YesPlease
762 NO_UNSETENV = YesPlease
763 NO_HSTRERROR = YesPlease
764 NO_SYS_SELECT_H = YesPlease
Miklos Vajna7d770162008-08-24 00:07:55 +0200765 SNPRINTF_RETURNS_BOGUS = YesPlease
Robert Schiele81cc66a2008-01-24 19:35:20 +0100766endif
Dmitry Potapovadbc0b62008-09-30 17:53:47 +0400767ifneq (,$(findstring CYGWIN,$(uname_S)))
768 COMPAT_OBJS += compat/cygwin.o
769endif
Johannes Sixtf4626df2007-12-01 21:24:59 +0100770ifneq (,$(findstring MINGW,$(uname_S)))
771 NO_MMAP = YesPlease
772 NO_PREAD = YesPlease
773 NO_OPENSSL = YesPlease
774 NO_CURL = YesPlease
775 NO_SYMLINK_HEAD = YesPlease
776 NO_IPV6 = YesPlease
777 NO_SETENV = YesPlease
778 NO_UNSETENV = YesPlease
779 NO_STRCASESTR = YesPlease
780 NO_STRLCPY = YesPlease
781 NO_MEMMEM = YesPlease
Junio C Hamano46059cc2008-11-15 04:08:14 -0800782 NO_PTHREADS = YesPlease
Johannes Sixtf4626df2007-12-01 21:24:59 +0100783 NEEDS_LIBICONV = YesPlease
784 OLD_ICONV = YesPlease
785 NO_C99_FORMAT = YesPlease
786 NO_STRTOUMAX = YesPlease
787 NO_MKDTEMP = YesPlease
788 SNPRINTF_RETURNS_BOGUS = YesPlease
789 NO_SVN_TESTS = YesPlease
790 NO_PERL_MAKEMAKER = YesPlease
791 NO_POSIX_ONLY_PROGRAMS = YesPlease
Junio C Hamanofdb2a2a2008-08-18 21:57:16 +0200792 NO_ST_BLOCKS_IN_STRUCT_STAT = YesPlease
Arjen Laarhoven3632cfc2008-09-07 20:45:37 +0200793 COMPAT_CFLAGS += -D__USE_MINGW_ACCESS -DNOGDI -Icompat -Icompat/regex -Icompat/fnmatch
Johannes Sixtf4626df2007-12-01 21:24:59 +0100794 COMPAT_CFLAGS += -DSNPRINTF_SIZE_CORR=1
Johannes Sixt23326d12007-12-08 20:57:25 +0100795 COMPAT_CFLAGS += -DSTRIP_EXTENSION=\".exe\"
Arjen Laarhoven3632cfc2008-09-07 20:45:37 +0200796 COMPAT_OBJS += compat/mingw.o compat/fnmatch/fnmatch.o compat/regex/regex.o compat/winansi.o
Johannes Sixtf4626df2007-12-01 21:24:59 +0100797 EXTLIBS += -lws2_32
798 X = .exe
Johannes Sixtbf74a882008-07-21 21:19:56 +0200799 gitexecdir = ../libexec/git-core
Johannes Sixt85124392007-11-30 22:28:38 +0100800 template_dir = ../share/git-core/templates/
801 ETC_GITCONFIG = ../etc/gitconfig
Johannes Sixtf4626df2007-12-01 21:24:59 +0100802endif
Junio C Hamanof7c15342005-10-09 12:52:35 -0700803ifneq (,$(findstring arm,$(uname_M)))
804 ARM_SHA1 = YesPlease
805endif
Junio C Hamano597c9cc2005-09-07 12:22:56 -0700806
Jakub Narebski55667712006-07-03 01:56:48 +0200807-include config.mak.autogen
Johannes Schindelinf2d6a252005-10-11 15:22:47 -0700808-include config.mak
Linus Torvaldscef661f2005-04-21 12:33:22 -0700809
Brian Gernhardt59f86742006-12-12 12:01:47 -0500810ifeq ($(uname_S),Darwin)
811 ifndef NO_FINK
812 ifeq ($(shell test -d /sw/lib && echo y),y)
813 BASIC_CFLAGS += -I/sw/include
814 BASIC_LDFLAGS += -L/sw/lib
815 endif
816 endif
817 ifndef NO_DARWIN_PORTS
818 ifeq ($(shell test -d /opt/local/lib && echo y),y)
819 BASIC_CFLAGS += -I/opt/local/include
820 BASIC_LDFLAGS += -L/opt/local/lib
821 endif
822 endif
Ted Pavlicf7d9d042009-01-26 14:03:59 -0500823 PTHREAD_LIBS =
Brian Gernhardt59f86742006-12-12 12:01:47 -0500824endif
825
Junio C Hamanof5b904d2008-08-16 21:56:24 -0700826ifndef CC_LD_DYNPATH
827 ifdef NO_R_TO_GCC_LINKER
828 # Some gcc does not accept and pass -R to the linker to specify
829 # the runtime dynamic library path.
830 CC_LD_DYNPATH = -Wl,-rpath,
831 else
832 CC_LD_DYNPATH = -R
833 endif
Junio C Hamanobbfc63d2006-12-27 14:17:35 -0800834endif
835
Daniel Barkalow30ae7642007-09-10 23:02:45 -0400836ifdef NO_CURL
837 BASIC_CFLAGS += -DNO_CURL
838else
Junio C Hamano229a7ed2005-09-23 10:41:40 -0700839 ifdef CURLDIR
Robert Schiele10861be2007-08-01 06:30:35 +0200840 # Try "-Wl,-rpath=$(CURLDIR)/$(lib)" in such a case.
Petr Baudis8d7f5862006-06-25 03:47:03 +0200841 BASIC_CFLAGS += -I$(CURLDIR)/include
Robert Schiele10861be2007-08-01 06:30:35 +0200842 CURL_LIBCURL = -L$(CURLDIR)/$(lib) $(CC_LD_DYNPATH)$(CURLDIR)/$(lib) -lcurl
Junio C Hamano229a7ed2005-09-23 10:41:40 -0700843 else
844 CURL_LIBCURL = -lcurl
845 endif
Daniel Barkalow30ae7642007-09-10 23:02:45 -0400846 BUILTIN_OBJS += builtin-http-fetch.o
847 EXTLIBS += $(CURL_LIBCURL)
Johannes Schindelinccfc02a2007-10-15 14:52:25 +0100848 LIB_OBJS += http.o http-walker.o
Nick Hengeveld08900982005-11-18 17:08:36 -0800849 curl_check := $(shell (echo 070908; curl-config --vernum) | sort -r | sed -ne 2p)
850 ifeq "$(curl_check)" "070908"
851 ifndef NO_EXPAT
Nick Hengeveld08900982005-11-18 17:08:36 -0800852 PROGRAMS += git-http-push$X
853 endif
Nick Hengeveld58e60dd2005-11-02 11:19:24 -0800854 endif
Johannes Schindelin459a21b2006-04-05 16:22:40 +0200855 ifndef NO_EXPAT
Serge van den Boom85b45182009-01-28 21:43:57 +0100856 ifdef EXPATDIR
857 BASIC_CFLAGS += -I$(EXPATDIR)/include
858 EXPAT_LIBEXPAT = -L$(EXPATDIR)/$(lib) $(CC_LD_DYNPATH)$(EXPATDIR)/$(lib) -lexpat
859 else
860 EXPAT_LIBEXPAT = -lexpat
861 endif
Johannes Schindelin459a21b2006-04-05 16:22:40 +0200862 endif
Junio C Hamano229a7ed2005-09-23 10:41:40 -0700863endif
864
Robert Schielebef19da2007-07-29 20:35:45 +0200865ifdef ZLIB_PATH
866 BASIC_CFLAGS += -I$(ZLIB_PATH)/include
Robert Schiele10861be2007-08-01 06:30:35 +0200867 EXTLIBS += -L$(ZLIB_PATH)/$(lib) $(CC_LD_DYNPATH)$(ZLIB_PATH)/$(lib)
Robert Schielebef19da2007-07-29 20:35:45 +0200868endif
869EXTLIBS += -lz
870
Johannes Sixt58eda022007-12-01 11:10:54 +0100871ifndef NO_POSIX_ONLY_PROGRAMS
872 PROGRAMS += git-daemon$X
873 PROGRAMS += git-imap-send$X
874endif
Petr Baudisdd53c7a2005-07-29 17:50:51 +0200875ifndef NO_OPENSSL
Junio C Hamano215a7ad2005-09-07 17:26:23 -0700876 OPENSSL_LIBSSL = -lssl
Junio C Hamano455a7f32005-09-30 13:31:16 -0700877 ifdef OPENSSLDIR
Petr Baudis8d7f5862006-06-25 03:47:03 +0200878 BASIC_CFLAGS += -I$(OPENSSLDIR)/include
Robert Schiele10861be2007-08-01 06:30:35 +0200879 OPENSSL_LINK = -L$(OPENSSLDIR)/$(lib) $(CC_LD_DYNPATH)$(OPENSSLDIR)/$(lib)
Junio C Hamano455a7f32005-09-30 13:31:16 -0700880 else
881 OPENSSL_LINK =
882 endif
Petr Baudisdd53c7a2005-07-29 17:50:51 +0200883else
Petr Baudis8d7f5862006-06-25 03:47:03 +0200884 BASIC_CFLAGS += -DNO_OPENSSL
Junio C Hamano215a7ad2005-09-07 17:26:23 -0700885 MOZILLA_SHA1 = 1
886 OPENSSL_LIBSSL =
Petr Baudisdd53c7a2005-07-29 17:50:51 +0200887endif
Junio C Hamano597c9cc2005-09-07 12:22:56 -0700888ifdef NEEDS_SSL_WITH_CRYPTO
Junio C Hamano455a7f32005-09-30 13:31:16 -0700889 LIB_4_CRYPTO = $(OPENSSL_LINK) -lcrypto -lssl
Junio C Hamano597c9cc2005-09-07 12:22:56 -0700890else
Junio C Hamano455a7f32005-09-30 13:31:16 -0700891 LIB_4_CRYPTO = $(OPENSSL_LINK) -lcrypto
Junio C Hamano597c9cc2005-09-07 12:22:56 -0700892endif
893ifdef NEEDS_LIBICONV
Junio C Hamano455a7f32005-09-30 13:31:16 -0700894 ifdef ICONVDIR
Petr Baudis8d7f5862006-06-25 03:47:03 +0200895 BASIC_CFLAGS += -I$(ICONVDIR)/include
Robert Schiele10861be2007-08-01 06:30:35 +0200896 ICONV_LINK = -L$(ICONVDIR)/$(lib) $(CC_LD_DYNPATH)$(ICONVDIR)/$(lib)
Junio C Hamano455a7f32005-09-30 13:31:16 -0700897 else
898 ICONV_LINK =
899 endif
Petr Baudisd595a472006-06-24 18:35:12 -0700900 EXTLIBS += $(ICONV_LINK) -liconv
Junio C Hamano597c9cc2005-09-07 12:22:56 -0700901endif
Patrick Mauritzf0ebff02005-09-06 01:24:03 +0200902ifdef NEEDS_SOCKET
Petr Baudisd595a472006-06-24 18:35:12 -0700903 EXTLIBS += -lsocket
Patrick Mauritzf0ebff02005-09-06 01:24:03 +0200904endif
Junio C Hamano5a90d4a2005-09-11 22:25:49 -0700905ifdef NEEDS_NSL
Petr Baudisd595a472006-06-24 18:35:12 -0700906 EXTLIBS += -lnsl
Junio C Hamano5a90d4a2005-09-11 22:25:49 -0700907endif
Junio C Hamano63be37b2006-01-19 17:13:57 -0800908ifdef NO_D_TYPE_IN_DIRENT
Petr Baudis8d7f5862006-06-25 03:47:03 +0200909 BASIC_CFLAGS += -DNO_D_TYPE_IN_DIRENT
Junio C Hamano63be37b2006-01-19 17:13:57 -0800910endif
Junio C Hamano35a730f2006-01-19 17:13:51 -0800911ifdef NO_D_INO_IN_DIRENT
Petr Baudis8d7f5862006-06-25 03:47:03 +0200912 BASIC_CFLAGS += -DNO_D_INO_IN_DIRENT
Junio C Hamano35a730f2006-01-19 17:13:51 -0800913endif
Junio C Hamanofdb2a2a2008-08-18 21:57:16 +0200914ifdef NO_ST_BLOCKS_IN_STRUCT_STAT
915 BASIC_CFLAGS += -DNO_ST_BLOCKS_IN_STRUCT_STAT
916endif
Ramsay Allan Jones579d1fb2006-07-30 16:38:28 +0100917ifdef NO_C99_FORMAT
Junio C Hamano8188e732007-02-05 16:53:12 -0800918 BASIC_CFLAGS += -DNO_C99_FORMAT
Ramsay Allan Jones579d1fb2006-07-30 16:38:28 +0100919endif
Michal Rokosc4582f92008-03-05 16:46:13 +0100920ifdef SNPRINTF_RETURNS_BOGUS
921 COMPAT_CFLAGS += -DSNPRINTF_RETURNS_BOGUS
922 COMPAT_OBJS += compat/snprintf.o
923endif
Brandon Caseycba22522008-02-08 20:32:47 -0600924ifdef FREAD_READS_DIRECTORIES
925 COMPAT_CFLAGS += -DFREAD_READS_DIRECTORIES
926 COMPAT_OBJS += compat/fopen.o
927endif
Junio C Hamano9f0bb902006-05-02 00:40:24 -0700928ifdef NO_SYMLINK_HEAD
Petr Baudis8d7f5862006-06-25 03:47:03 +0200929 BASIC_CFLAGS += -DNO_SYMLINK_HEAD
Junio C Hamano9f0bb902006-05-02 00:40:24 -0700930endif
Linus Torvaldsef34af22005-09-18 18:30:50 -0700931ifdef NO_STRCASESTR
Junio C Hamano4050c0d2005-12-05 11:54:29 -0800932 COMPAT_CFLAGS += -DNO_STRCASESTR
Jason Riedye40b61f2005-12-02 15:08:28 -0800933 COMPAT_OBJS += compat/strcasestr.o
934endif
Peter Eriksen817151e2006-06-24 16:01:25 +0200935ifdef NO_STRLCPY
936 COMPAT_CFLAGS += -DNO_STRLCPY
937 COMPAT_OBJS += compat/strlcpy.o
938endif
Jason Riedybc6b4f52007-02-19 16:22:56 -0800939ifdef NO_STRTOUMAX
940 COMPAT_CFLAGS += -DNO_STRTOUMAX
941 COMPAT_OBJS += compat/strtoumax.o
942endif
943ifdef NO_STRTOULL
944 COMPAT_CFLAGS += -DNO_STRTOULL
945endif
Jason Riedye40b61f2005-12-02 15:08:28 -0800946ifdef NO_SETENV
Junio C Hamano4050c0d2005-12-05 11:54:29 -0800947 COMPAT_CFLAGS += -DNO_SETENV
Jason Riedye40b61f2005-12-02 15:08:28 -0800948 COMPAT_OBJS += compat/setenv.o
Linus Torvaldsef34af22005-09-18 18:30:50 -0700949endif
Shawn O. Pearceca5bb5d2007-10-20 16:03:49 -0400950ifdef NO_MKDTEMP
951 COMPAT_CFLAGS += -DNO_MKDTEMP
952 COMPAT_OBJS += compat/mkdtemp.o
953endif
Johannes Schindelin104ff342006-08-29 12:51:14 +0200954ifdef NO_UNSETENV
Jason Riedy731043f2006-01-25 12:38:36 -0800955 COMPAT_CFLAGS += -DNO_UNSETENV
956 COMPAT_OBJS += compat/unsetenv.o
957endif
Robert Schiele26009732008-01-24 19:34:46 +0100958ifdef NO_SYS_SELECT_H
959 BASIC_CFLAGS += -DNO_SYS_SELECT_H
960endif
Johannes Schindelin730d48a2005-10-08 15:54:36 -0700961ifdef NO_MMAP
Junio C Hamano4050c0d2005-12-05 11:54:29 -0800962 COMPAT_CFLAGS += -DNO_MMAP
Jason Riedye40b61f2005-12-02 15:08:28 -0800963 COMPAT_OBJS += compat/mmap.o
Johannes Schindelin730d48a2005-10-08 15:54:36 -0700964endif
Stefan-W. Hahn69006792007-01-09 22:04:12 +0100965ifdef NO_PREAD
966 COMPAT_CFLAGS += -DNO_PREAD
967 COMPAT_OBJS += compat/pread.o
968endif
Shawn O. Pearce1510fea2006-12-14 06:15:57 -0500969ifdef NO_FAST_WORKING_DIRECTORY
970 BASIC_CFLAGS += -DNO_FAST_WORKING_DIRECTORY
971endif
Shawn O. Pearcec8697532006-12-30 23:53:55 -0500972ifdef NO_TRUSTABLE_FILEMODE
973 BASIC_CFLAGS += -DNO_TRUSTABLE_FILEMODE
974endif
hpa49744d62005-09-28 16:52:21 -0700975ifdef NO_IPV6
Petr Baudis8d7f5862006-06-25 03:47:03 +0200976 BASIC_CFLAGS += -DNO_IPV6
Junio C Hamanobdc37f52006-01-19 17:13:32 -0800977endif
David M. Syzdek0bc3e782008-10-26 03:52:37 -0800978ifdef NO_UINTMAX_T
979 BASIC_CFLAGS += -Duintmax_t=uint32_t
980endif
Junio C Hamanobdc37f52006-01-19 17:13:32 -0800981ifdef NO_SOCKADDR_STORAGE
982ifdef NO_IPV6
Petr Baudis8d7f5862006-06-25 03:47:03 +0200983 BASIC_CFLAGS += -Dsockaddr_storage=sockaddr_in
Junio C Hamanobdc37f52006-01-19 17:13:32 -0800984else
Petr Baudis8d7f5862006-06-25 03:47:03 +0200985 BASIC_CFLAGS += -Dsockaddr_storage=sockaddr_in6
Junio C Hamanobdc37f52006-01-19 17:13:32 -0800986endif
hpa49744d62005-09-28 16:52:21 -0700987endif
Yakov Lerner6ba68ab2006-05-22 00:37:00 +0300988ifdef NO_INET_NTOP
989 LIB_OBJS += compat/inet_ntop.o
990endif
Jon Loeligerdd467622006-09-26 09:47:43 -0500991ifdef NO_INET_PTON
992 LIB_OBJS += compat/inet_pton.o
993endif
Linus Torvaldscef661f2005-04-21 12:33:22 -0700994
Fernando J. Peredab6e56ec2006-02-16 09:38:01 +0100995ifdef NO_ICONV
Petr Baudis8d7f5862006-06-25 03:47:03 +0200996 BASIC_CFLAGS += -DNO_ICONV
Fernando J. Peredab6e56ec2006-02-16 09:38:01 +0100997endif
998
Ramsay Jonesfd547a92007-03-03 18:29:03 +0000999ifdef OLD_ICONV
1000 BASIC_CFLAGS += -DOLD_ICONV
1001endif
1002
David Symonds609a2282007-11-07 14:24:28 +11001003ifdef NO_DEFLATE_BOUND
1004 BASIC_CFLAGS += -DNO_DEFLATE_BOUND
1005endif
1006
Nicolas Pitre7c6ef2f2005-09-20 12:27:13 -04001007ifdef PPC_SHA1
1008 SHA1_HEADER = "ppc/sha1.h"
1009 LIB_OBJS += ppc/sha1.o ppc/sha1ppc.o
1010else
1011ifdef ARM_SHA1
1012 SHA1_HEADER = "arm/sha1.h"
1013 LIB_OBJS += arm/sha1.o arm/sha1_arm.o
1014else
1015ifdef MOZILLA_SHA1
1016 SHA1_HEADER = "mozilla-sha1/sha1.h"
1017 LIB_OBJS += mozilla-sha1/sha1.o
1018else
1019 SHA1_HEADER = <openssl/sha.h>
Petr Baudisd595a472006-06-24 18:35:12 -07001020 EXTLIBS += $(LIB_4_CRYPTO)
Nicolas Pitre7c6ef2f2005-09-20 12:27:13 -04001021endif
1022endif
1023endif
Alex Riesenf8487182006-12-04 10:50:04 +01001024ifdef NO_PERL_MAKEMAKER
1025 export NO_PERL_MAKEMAKER
1026endif
Alex Riesenfa0c87c2007-06-13 20:54:32 +02001027ifdef NO_HSTRERROR
1028 COMPAT_CFLAGS += -DNO_HSTRERROR
1029 COMPAT_OBJS += compat/hstrerror.o
1030endif
René Scharfeb21b9f12007-09-07 00:32:54 +02001031ifdef NO_MEMMEM
1032 COMPAT_CFLAGS += -DNO_MEMMEM
1033 COMPAT_OBJS += compat/memmem.o
1034endif
Brian Downing43fe9012008-02-05 15:10:44 -06001035ifdef INTERNAL_QSORT
1036 COMPAT_CFLAGS += -DINTERNAL_QSORT
1037 COMPAT_OBJS += compat/qsort.o
1038endif
Alex Riesenb7774342007-03-07 00:44:49 +01001039
Junio C Hamano46059cc2008-11-15 04:08:14 -08001040ifdef NO_PTHREADS
1041 THREADED_DELTA_SEARCH =
1042 BASIC_CFLAGS += -DNO_PTHREADS
1043else
1044 EXTLIBS += $(PTHREAD_LIBS)
1045endif
1046
Nicolas Pitre8ecce682007-09-06 02:13:11 -04001047ifdef THREADED_DELTA_SEARCH
1048 BASIC_CFLAGS += -DTHREADED_DELTA_SEARCH
Andreas Ericsson833e3df2008-02-22 20:11:56 -06001049 LIB_OBJS += thread-utils.o
Nicolas Pitre8ecce682007-09-06 02:13:11 -04001050endif
Alex Riesen81a24b52008-03-05 00:15:39 +01001051ifdef DIR_HAS_BSD_GROUP_SEMANTICS
1052 COMPAT_CFLAGS += -DDIR_HAS_BSD_GROUP_SEMANTICS
1053endif
Jeff King5f7c6432008-03-12 17:39:16 -04001054ifdef NO_EXTERNAL_GREP
1055 BASIC_CFLAGS += -DNO_EXTERNAL_GREP
1056endif
Nicolas Pitre8ecce682007-09-06 02:13:11 -04001057
Eygene Ryabinkin81b63c72007-03-28 04:12:07 -07001058ifeq ($(TCLTK_PATH),)
1059NO_TCLTK=NoThanks
1060endif
1061
Fernando J. Pereda3b486cd2007-04-04 22:42:33 +02001062QUIET_SUBDIR0 = +$(MAKE) -C # space to separate -C and subdir
Alex Riesenb7774342007-03-07 00:44:49 +01001063QUIET_SUBDIR1 =
1064
Alex Riesena6f37092007-03-07 00:05:34 +01001065ifneq ($(findstring $(MAKEFLAGS),w),w)
1066PRINT_DIR = --no-print-directory
1067else # "make -w"
1068NO_SUBDIR = :
1069endif
1070
Alex Riesenb7774342007-03-07 00:44:49 +01001071ifneq ($(findstring $(MAKEFLAGS),s),s)
Shawn O. Pearce2314c942007-03-06 02:09:14 -05001072ifndef V
Alex Riesen31d03992007-03-06 23:37:18 +01001073 QUIET_CC = @echo ' ' CC $@;
Shawn O. Pearce74f2b2a2007-03-06 01:35:01 -05001074 QUIET_AR = @echo ' ' AR $@;
1075 QUIET_LINK = @echo ' ' LINK $@;
1076 QUIET_BUILT_IN = @echo ' ' BUILTIN $@;
1077 QUIET_GEN = @echo ' ' GEN $@;
Fernando J. Pereda3b486cd2007-04-04 22:42:33 +02001078 QUIET_SUBDIR0 = +@subdir=
Alex Riesena6f37092007-03-07 00:05:34 +01001079 QUIET_SUBDIR1 = ;$(NO_SUBDIR) echo ' ' SUBDIR $$subdir; \
1080 $(MAKE) $(PRINT_DIR) -C $$subdir
Shawn O. Pearce2314c942007-03-06 02:09:14 -05001081 export V
Alex Riesen31d03992007-03-06 23:37:18 +01001082 export QUIET_GEN
Alex Riesenb7774342007-03-07 00:44:49 +01001083 export QUIET_BUILT_IN
1084endif
Shawn O. Pearce74f2b2a2007-03-06 01:35:01 -05001085endif
Nicolas Pitre7c6ef2f2005-09-20 12:27:13 -04001086
Junio C Hamano4c7100a2007-06-14 22:20:16 -07001087ifdef ASCIIDOC8
1088 export ASCIIDOC8
1089endif
1090
Pavel Roskinaddf88e2006-07-09 03:44:30 -04001091# Shell quote (do not use $(call) to accommodate ancient setups);
Johannes Schindelin39c015c2006-02-18 12:40:22 +01001092
1093SHA1_HEADER_SQ = $(subst ','\'',$(SHA1_HEADER))
Johannes Schindelin32043c92007-02-14 12:48:14 +01001094ETC_GITCONFIG_SQ = $(subst ','\'',$(ETC_GITCONFIG))
Johannes Schindelin39c015c2006-02-18 12:40:22 +01001095
1096DESTDIR_SQ = $(subst ','\'',$(DESTDIR))
1097bindir_SQ = $(subst ','\'',$(bindir))
Sergei Organov8e566f22007-12-06 21:33:01 +03001098mandir_SQ = $(subst ','\'',$(mandir))
Junio C Hamanoa149a1a2007-12-10 01:35:29 -08001099infodir_SQ = $(subst ','\'',$(infodir))
Johannes Schindelin39c015c2006-02-18 12:40:22 +01001100gitexecdir_SQ = $(subst ','\'',$(gitexecdir))
1101template_dir_SQ = $(subst ','\'',$(template_dir))
Christian Couder5d6491c2007-12-02 06:07:55 +01001102htmldir_SQ = $(subst ','\'',$(htmldir))
Yakov Lernerca3bcab2006-06-15 01:36:00 +03001103prefix_SQ = $(subst ','\'',$(prefix))
Johannes Schindelin39c015c2006-02-18 12:40:22 +01001104
1105SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH))
1106PERL_PATH_SQ = $(subst ','\'',$(PERL_PATH))
Eygene Ryabinkin81b63c72007-03-28 04:12:07 -07001107TCLTK_PATH_SQ = $(subst ','\'',$(TCLTK_PATH))
Johannes Schindelin39c015c2006-02-18 12:40:22 +01001108
Petr Baudisd595a472006-06-24 18:35:12 -07001109LIBS = $(GITLIBS) $(EXTLIBS)
1110
Johannes Schindelin32043c92007-02-14 12:48:14 +01001111BASIC_CFLAGS += -DSHA1_HEADER='$(SHA1_HEADER_SQ)' \
Johannes Sixt506b17b2007-11-13 21:05:05 +01001112 $(COMPAT_CFLAGS)
Jason Riedye40b61f2005-12-02 15:08:28 -08001113LIB_OBJS += $(COMPAT_OBJS)
Petr Baudis8d7f5862006-06-25 03:47:03 +02001114
1115ALL_CFLAGS += $(BASIC_CFLAGS)
1116ALL_LDFLAGS += $(BASIC_LDFLAGS)
1117
Shawn O. Pearcea42cbac2007-05-07 23:53:06 -04001118export TAR INSTALL DESTDIR SHELL_PATH
Petr Baudisd595a472006-06-24 18:35:12 -07001119
1120
Petr Baudis28818ff2005-07-29 17:50:24 +02001121### Build rules
Linus Torvalds89967022005-04-30 13:19:56 -07001122
Brandon Caseyc94c8e52008-08-07 14:03:42 -05001123SHELL = $(SHELL_PATH)
1124
Brandon Casey6dc46272008-08-07 14:06:26 -05001125all:: shell_compatibility_test $(ALL_PROGRAMS) $(BUILT_INS) $(OTHER_PROGRAMS) GIT-BUILD-OPTIONS
Junio C Hamano6fc301b2007-01-10 12:24:54 -08001126ifneq (,$X)
Eric Blake0d768f72008-08-15 15:01:03 +00001127 $(foreach p,$(patsubst %$X,%,$(filter %$X,$(ALL_PROGRAMS) $(BUILT_INS) git$X)), test '$p' -ef '$p$X' || $(RM) '$p';)
Junio C Hamano6fc301b2007-01-10 12:24:54 -08001128endif
Petr Baudis28818ff2005-07-29 17:50:24 +02001129
Junio C Hamano6fc301b2007-01-10 12:24:54 -08001130all::
Eygene Ryabinkin3cfaf112007-03-28 04:00:23 -07001131ifndef NO_TCLTK
Junio C Hamanoe84a0632008-07-28 00:02:48 -07001132 $(QUIET_SUBDIR0)git-gui $(QUIET_SUBDIR1) gitexecdir='$(gitexec_instdir_SQ)' all
Junio C Hamano62ba5142007-11-17 10:51:16 -08001133 $(QUIET_SUBDIR0)gitk-git $(QUIET_SUBDIR1) all
Eygene Ryabinkin3cfaf112007-03-28 04:00:23 -07001134endif
Shawn O. Pearce74f2b2a2007-03-06 01:35:01 -05001135 $(QUIET_SUBDIR0)perl $(QUIET_SUBDIR1) PERL_PATH='$(PERL_PATH_SQ)' prefix='$(prefix_SQ)' all
1136 $(QUIET_SUBDIR0)templates $(QUIET_SUBDIR1)
Nicolas Pitrea310d432005-05-19 10:27:14 -04001137
Brandon Casey6dc46272008-08-07 14:06:26 -05001138please_set_SHELL_PATH_to_a_more_modern_shell:
1139 @$$(:)
1140
1141shell_compatibility_test: please_set_SHELL_PATH_to_a_more_modern_shell
1142
Junio C Hamano4dc00022006-01-12 21:42:25 -08001143strip: $(PROGRAMS) git$X
1144 $(STRIP) $(STRIP_OPTS) $(PROGRAMS) git$X
1145
Junio C Hamano334d28a2007-06-13 01:28:21 -07001146git.o: git.c common-cmds.h GIT-CFLAGS
1147 $(QUIET_CC)$(CC) -DGIT_VERSION='"$(GIT_VERSION)"' \
1148 $(ALL_CFLAGS) -c $(filter %.c,$^)
1149
1150git$X: git.o $(BUILTIN_OBJS) $(GITLIBS)
Matt McCutchen54dadbd2007-07-09 21:30:39 -04001151 $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ git.o \
Linus Torvalds70827b12006-04-21 10:27:34 -07001152 $(BUILTIN_OBJS) $(ALL_LDFLAGS) $(LIBS)
Junio C Hamano6a2e50f2005-09-07 21:26:52 -07001153
Miklos Vajna3d78d1f2008-08-02 10:08:38 +02001154builtin-help.o: builtin-help.c common-cmds.h GIT-CFLAGS
Junio C Hamanoa149a1a2007-12-10 01:35:29 -08001155 $(QUIET_CC)$(CC) -o $*.o -c $(ALL_CFLAGS) \
Christian Couder482cce82008-02-02 07:32:33 +01001156 '-DGIT_HTML_PATH="$(htmldir_SQ)"' \
Junio C Hamanoa149a1a2007-12-10 01:35:29 -08001157 '-DGIT_MAN_PATH="$(mandir_SQ)"' \
1158 '-DGIT_INFO_PATH="$(infodir_SQ)"' $<
Junio C Hamano08df6172006-04-21 21:56:13 -07001159
Junio C Hamano91730802006-04-10 17:37:58 -07001160$(BUILT_INS): git$X
Andreas Färber3e073dc2008-08-25 17:33:03 +02001161 $(QUIET_BUILT_IN)$(RM) $@ && \
1162 ln git$X $@ 2>/dev/null || \
1163 ln -s git$X $@ 2>/dev/null || \
1164 cp git$X $@
Junio C Hamano91730802006-04-10 17:37:58 -07001165
Junio C Hamano79d30662007-12-01 23:39:19 -08001166common-cmds.h: ./generate-cmdlist.sh command-list.txt
Junio C Hamano48dd1da2007-06-13 02:00:01 -07001167
Junio C Hamano766b0842007-04-05 15:03:48 -07001168common-cmds.h: $(wildcard Documentation/git-*.txt)
Shawn O. Pearce74f2b2a2007-03-06 01:35:01 -05001169 $(QUIET_GEN)./generate-cmdlist.sh > $@+ && mv $@+ $@
Fredrik Kuivinena87cd022006-03-09 17:24:19 +01001170
Andreas Ericssond6ebd252005-11-22 00:44:15 +01001171$(patsubst %.sh,%,$(SCRIPT_SH)) : % : %.sh
Emil Medve4cb08df2007-07-14 12:51:44 -05001172 $(QUIET_GEN)$(RM) $@ $@+ && \
Johannes Schindelin39c015c2006-02-18 12:40:22 +01001173 sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \
Jeff King4bf9f272008-03-12 17:41:39 -04001174 -e 's|@SHELL_PATH@|$(SHELL_PATH_SQ)|' \
Michal Rokosd9bffc02006-07-08 17:32:04 +02001175 -e 's|@@PERL@@|$(PERL_PATH_SQ)|g' \
Junio C Hamano3ff8cbe2005-10-04 12:41:35 -07001176 -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \
Fernando J. Pereda6c5c62f2006-02-15 12:37:30 +01001177 -e 's/@@NO_CURL@@/$(NO_CURL)/g' \
Shawn O. Pearce74f2b2a2007-03-06 01:35:01 -05001178 $@.sh >$@+ && \
1179 chmod +x $@+ && \
Jim Meyeringfc36f6a2006-05-25 18:52:01 +02001180 mv $@+ $@
Junio C Hamanobc6146d2005-09-08 18:50:33 -07001181
Alex Riesenf8487182006-12-04 10:50:04 +01001182$(patsubst %.perl,%,$(SCRIPT_PERL)): perl/perl.mak
1183
Alex Riesend1a20572007-10-25 22:17:24 +02001184perl/perl.mak: GIT-CFLAGS perl/Makefile perl/Makefile.PL
Alex Riesen31d03992007-03-06 23:37:18 +01001185 $(QUIET_SUBDIR0)perl $(QUIET_SUBDIR1) PERL_PATH='$(PERL_PATH_SQ)' prefix='$(prefix_SQ)' $(@F)
Alex Riesenf8487182006-12-04 10:50:04 +01001186
Junio C Hamanof6276fe2006-06-24 19:41:03 -07001187$(patsubst %.perl,%,$(SCRIPT_PERL)): % : %.perl
Emil Medve4cb08df2007-07-14 12:51:44 -05001188 $(QUIET_GEN)$(RM) $@ $@+ && \
Jim Meyeringe8839322007-09-25 08:42:16 +02001189 INSTLIBDIR=`MAKEFLAGS= $(MAKE) -C perl -s --no-print-directory instlibdir` && \
Junio C Hamano998c4da2006-07-07 13:04:35 -07001190 sed -e '1{' \
1191 -e ' s|#!.*perl|#!$(PERL_PATH_SQ)|' \
1192 -e ' h' \
1193 -e ' s=.*=use lib (split(/:/, $$ENV{GITPERLLIB} || "@@INSTLIBDIR@@"));=' \
1194 -e ' H' \
1195 -e ' x' \
1196 -e '}' \
Junio C Hamanof6276fe2006-06-24 19:41:03 -07001197 -e 's|@@INSTLIBDIR@@|'"$$INSTLIBDIR"'|g' \
Junio C Hamano3ff8cbe2005-10-04 12:41:35 -07001198 -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \
Shawn O. Pearce74f2b2a2007-03-06 01:35:01 -05001199 $@.perl >$@+ && \
1200 chmod +x $@+ && \
Jim Meyeringfc36f6a2006-05-25 18:52:01 +02001201 mv $@+ $@
Junio C Hamanobc6146d2005-09-08 18:50:33 -07001202
Martin Waitz5d043a32006-08-01 21:34:08 +02001203gitweb/gitweb.cgi: gitweb/gitweb.perl
Emil Medve4cb08df2007-07-14 12:51:44 -05001204 $(QUIET_GEN)$(RM) $@ $@+ && \
Martin Waitz5d043a32006-08-01 21:34:08 +02001205 sed -e '1s|#!.*perl|#!$(PERL_PATH_SQ)|' \
Junio C Hamano06c084d2006-08-02 13:50:20 -07001206 -e 's|++GIT_VERSION++|$(GIT_VERSION)|g' \
1207 -e 's|++GIT_BINDIR++|$(bindir)|g' \
1208 -e 's|++GITWEB_CONFIG++|$(GITWEB_CONFIG)|g' \
Gerrit Pape26ffcb72008-04-05 16:37:18 +00001209 -e 's|++GITWEB_CONFIG_SYSTEM++|$(GITWEB_CONFIG_SYSTEM)|g' \
Yasushi SHOJI2de21fa2006-08-15 07:50:49 +09001210 -e 's|++GITWEB_HOME_LINK_STR++|$(GITWEB_HOME_LINK_STR)|g' \
Junio C Hamano06c084d2006-08-02 13:50:20 -07001211 -e 's|++GITWEB_SITENAME++|$(GITWEB_SITENAME)|g' \
1212 -e 's|++GITWEB_PROJECTROOT++|$(GITWEB_PROJECTROOT)|g' \
Luke Luca5e9492007-10-16 20:45:25 -07001213 -e 's|"++GITWEB_PROJECT_MAXDEPTH++"|$(GITWEB_PROJECT_MAXDEPTH)|g' \
Matthias Lederhofer32f4aac2006-09-17 00:31:01 +02001214 -e 's|++GITWEB_EXPORT_OK++|$(GITWEB_EXPORT_OK)|g' \
1215 -e 's|++GITWEB_STRICT_EXPORT++|$(GITWEB_STRICT_EXPORT)|g' \
Jakub Narebski19a87212006-08-15 23:03:17 +02001216 -e 's|++GITWEB_BASE_URL++|$(GITWEB_BASE_URL)|g' \
Junio C Hamano06c084d2006-08-02 13:50:20 -07001217 -e 's|++GITWEB_LIST++|$(GITWEB_LIST)|g' \
1218 -e 's|++GITWEB_HOMETEXT++|$(GITWEB_HOMETEXT)|g' \
1219 -e 's|++GITWEB_CSS++|$(GITWEB_CSS)|g' \
1220 -e 's|++GITWEB_LOGO++|$(GITWEB_LOGO)|g' \
Jakub Narebski0b5deba2006-09-04 20:32:13 +02001221 -e 's|++GITWEB_FAVICON++|$(GITWEB_FAVICON)|g' \
Alan Chandlerb2d34762006-10-03 13:49:03 +01001222 -e 's|++GITWEB_SITE_HEADER++|$(GITWEB_SITE_HEADER)|g' \
1223 -e 's|++GITWEB_SITE_FOOTER++|$(GITWEB_SITE_FOOTER)|g' \
Shawn O. Pearce74f2b2a2007-03-06 01:35:01 -05001224 $< >$@+ && \
1225 chmod +x $@+ && \
Martin Waitz5d043a32006-08-01 21:34:08 +02001226 mv $@+ $@
1227
Eric Wonga51d37c2006-07-01 15:14:14 -07001228git-instaweb: git-instaweb.sh gitweb/gitweb.cgi gitweb/gitweb.css
Emil Medve4cb08df2007-07-14 12:51:44 -05001229 $(QUIET_GEN)$(RM) $@ $@+ && \
Eric Wonga51d37c2006-07-01 15:14:14 -07001230 sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \
1231 -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \
1232 -e 's/@@NO_CURL@@/$(NO_CURL)/g' \
Michal Rokos6e959ab2006-07-08 17:27:10 +02001233 -e '/@@GITWEB_CGI@@/r gitweb/gitweb.cgi' \
Johannes Schindelin07002282006-07-02 11:31:30 +02001234 -e '/@@GITWEB_CGI@@/d' \
Michal Rokos6e959ab2006-07-08 17:27:10 +02001235 -e '/@@GITWEB_CSS@@/r gitweb/gitweb.css' \
Johannes Schindelin07002282006-07-02 11:31:30 +02001236 -e '/@@GITWEB_CSS@@/d' \
Charles Baileyc5699692007-12-19 12:25:27 +00001237 -e 's|@@PERL@@|$(PERL_PATH_SQ)|g' \
Shawn O. Pearce74f2b2a2007-03-06 01:35:01 -05001238 $@.sh > $@+ && \
1239 chmod +x $@+ && \
Eric Wonga51d37c2006-07-01 15:14:14 -07001240 mv $@+ $@
1241
Jakub Narebski39001452006-08-08 18:35:23 +02001242configure: configure.ac
Emil Medve4cb08df2007-07-14 12:51:44 -05001243 $(QUIET_GEN)$(RM) $@ $<+ && \
Jakub Narebski39001452006-08-08 18:35:23 +02001244 sed -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \
Shawn O. Pearce74f2b2a2007-03-06 01:35:01 -05001245 $< > $<+ && \
1246 autoconf -o $@ $<+ && \
Emil Medve4cb08df2007-07-14 12:51:44 -05001247 $(RM) $<+
Jakub Narebski39001452006-08-08 18:35:23 +02001248
Junio C Hamano9b88fce2005-12-27 14:40:17 -08001249# These can record GIT_VERSION
Matt McCutchen54dadbd2007-07-09 21:30:39 -04001250git.o git.spec \
Junio C Hamano9b88fce2005-12-27 14:40:17 -08001251 $(patsubst %.sh,%,$(SCRIPT_SH)) \
1252 $(patsubst %.perl,%,$(SCRIPT_PERL)) \
Junio C Hamano9b88fce2005-12-27 14:40:17 -08001253 : GIT-VERSION-FILE
Johannes Schindeline99fcf92005-12-22 20:38:23 +01001254
Yakov Lernerca3bcab2006-06-15 01:36:00 +03001255%.o: %.c GIT-CFLAGS
Shawn O. Pearce74f2b2a2007-03-06 01:35:01 -05001256 $(QUIET_CC)$(CC) -o $*.o -c $(ALL_CFLAGS) $<
Linus Torvaldse36cb1c2007-05-30 10:42:41 -07001257%.s: %.c GIT-CFLAGS
1258 $(QUIET_CC)$(CC) -S $(ALL_CFLAGS) $<
Pavel Roskinb05701c2005-08-06 01:36:15 -04001259%.o: %.S
Shawn O. Pearce74f2b2a2007-03-06 01:35:01 -05001260 $(QUIET_CC)$(CC) -o $*.o -c $(ALL_CFLAGS) $<
Pavel Roskinb05701c2005-08-06 01:36:15 -04001261
Yakov Lernerca3bcab2006-06-15 01:36:00 +03001262exec_cmd.o: exec_cmd.c GIT-CFLAGS
Shawn O. Pearce74f2b2a2007-03-06 01:35:01 -05001263 $(QUIET_CC)$(CC) -o $*.o -c $(ALL_CFLAGS) '-DGIT_EXEC_PATH="$(gitexecdir_SQ)"' $<
Yakov Lernerc1f80642006-06-22 04:47:00 +03001264builtin-init-db.o: builtin-init-db.c GIT-CFLAGS
Shawn O. Pearce74f2b2a2007-03-06 01:35:01 -05001265 $(QUIET_CC)$(CC) -o $*.o -c $(ALL_CFLAGS) -DDEFAULT_GIT_TEMPLATE_DIR='"$(template_dir_SQ)"' $<
Michal Ostrowski77cb17e2006-01-10 21:12:17 -05001266
Johannes Sixt506b17b2007-11-13 21:05:05 +01001267config.o: config.c GIT-CFLAGS
1268 $(QUIET_CC)$(CC) -o $*.o -c $(ALL_CFLAGS) -DETC_GITCONFIG='"$(ETC_GITCONFIG_SQ)"' $<
1269
Yakov Lernerca3bcab2006-06-15 01:36:00 +03001270http.o: http.c GIT-CFLAGS
Shawn O. Pearce74f2b2a2007-03-06 01:35:01 -05001271 $(QUIET_CC)$(CC) -o $*.o -c $(ALL_CFLAGS) -DGIT_USER_AGENT='"git/$(GIT_VERSION)"' $<
Nick Hengeveld20fc9bc2006-04-04 10:11:29 -07001272
Nick Hengeveld8d9fbe52006-04-04 05:33:18 -07001273ifdef NO_EXPAT
Daniel Barkalow30ae7642007-09-10 23:02:45 -04001274http-walker.o: http-walker.c http.h GIT-CFLAGS
Shawn O. Pearce74f2b2a2007-03-06 01:35:01 -05001275 $(QUIET_CC)$(CC) -o $*.o -c $(ALL_CFLAGS) -DNO_EXPAT $<
Nick Hengeveld8d9fbe52006-04-04 05:33:18 -07001276endif
1277
Junio C Hamano8eef8e02006-03-31 16:23:46 -08001278git-%$X: %.o $(GITLIBS)
Shawn O. Pearce74f2b2a2007-03-06 01:35:01 -05001279 $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS)
Daniel Barkalow6eb7ed52005-04-23 18:47:23 -07001280
Robert Shearman684ec6c2008-07-09 22:29:00 +01001281git-imap-send$X: imap-send.o $(GITLIBS)
1282 $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
1283 $(LIBS) $(OPENSSL_LINK) $(OPENSSL_LIBSSL)
Mike McCormackf2561fd2006-03-10 14:32:50 +09001284
Mike Hommey923e3ec2008-01-26 13:19:02 +01001285http.o http-walker.o http-push.o transport.o: http.h
Johannes Schindelin39c015c2006-02-18 12:40:22 +01001286
Junio C Hamano8fced612006-07-03 00:53:13 -07001287git-http-push$X: revision.o http.o http-push.o $(GITLIBS)
Shawn O. Pearce74f2b2a2007-03-06 01:35:01 -05001288 $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
Johannes Schindelin39c015c2006-02-18 12:40:22 +01001289 $(LIBS) $(CURL_LIBCURL) $(EXPAT_LIBEXPAT)
1290
Johannes Schindelinccfc02a2007-10-15 14:52:25 +01001291$(LIB_OBJS) $(BUILTIN_OBJS): $(LIB_H)
Junio C Hamano1f330262006-06-22 15:43:47 -07001292$(patsubst git-%$X,%.o,$(PROGRAMS)): $(LIB_H) $(wildcard */*.h)
Junio C Hamanofa470162007-12-14 22:08:25 -08001293builtin-revert.o wt-status.o: wt-status.h
Linus Torvaldse83c5162005-04-07 15:13:13 -07001294
Petr Baudis28818ff2005-07-29 17:50:24 +02001295$(LIB_FILE): $(LIB_OBJS)
Emil Medve4cb08df2007-07-14 12:51:44 -05001296 $(QUIET_AR)$(RM) $@ && $(AR) rcs $@ $(LIB_OBJS)
Petr Baudis28818ff2005-07-29 17:50:24 +02001297
Johannes Schindelin857b9332006-11-21 23:24:34 +01001298XDIFF_OBJS=xdiff/xdiffi.o xdiff/xprepare.o xdiff/xutils.o xdiff/xemit.o \
Johannes Schindelin34292bd2009-01-01 17:39:17 +01001299 xdiff/xmerge.o xdiff/xpatience.o
Andy Whitcroft17b96be2006-10-17 19:08:08 +01001300$(XDIFF_OBJS): xdiff/xinclude.h xdiff/xmacros.h xdiff/xdiff.h xdiff/xtypes.h \
1301 xdiff/xutils.h xdiff/xprepare.h xdiff/xdiffi.h xdiff/xemit.h
Linus Torvalds34435462006-03-24 20:13:22 -08001302
1303$(XDIFF_LIB): $(XDIFF_OBJS)
Emil Medve4cb08df2007-07-14 12:51:44 -05001304 $(QUIET_AR)$(RM) $@ && $(AR) rcs $@ $(XDIFF_OBJS)
Linus Torvalds34435462006-03-24 20:13:22 -08001305
1306
Petr Baudis28818ff2005-07-29 17:50:24 +02001307doc:
1308 $(MAKE) -C Documentation all
1309
Michael J Gruber414851a2008-09-10 10:19:34 +02001310man:
1311 $(MAKE) -C Documentation man
1312
1313html:
1314 $(MAKE) -C Documentation html
1315
David Kastrup47398092007-08-06 12:22:57 +02001316info:
1317 $(MAKE) -C Documentation info
1318
Miklos Vajnaa325a1a2008-12-10 23:44:50 +01001319pdf:
1320 $(MAKE) -C Documentation pdf
1321
Fredrik Kuivinenf81e7c62006-03-18 11:07:12 +01001322TAGS:
Emil Medve4cb08df2007-07-14 12:51:44 -05001323 $(RM) TAGS
David Kastrup89b2f192007-07-29 15:23:28 -07001324 $(FIND) . -name '*.[hcS]' -print | xargs etags -a
Fredrik Kuivinenf81e7c62006-03-18 11:07:12 +01001325
1326tags:
Emil Medve4cb08df2007-07-14 12:51:44 -05001327 $(RM) tags
David Kastrup89b2f192007-07-29 15:23:28 -07001328 $(FIND) . -name '*.[hcS]' -print | xargs ctags -a
Petr Baudis28818ff2005-07-29 17:50:24 +02001329
Kristof Provosta2a91502007-10-06 16:24:42 +02001330cscope:
1331 $(RM) cscope*
1332 $(FIND) . -name '*.[hcS]' -print | xargs cscope -b
1333
Yakov Lernerca3bcab2006-06-15 01:36:00 +03001334### Detect prefix changes
Junio C Hamano7cdbff12006-11-20 00:49:31 -08001335TRACK_CFLAGS = $(subst ','\'',$(ALL_CFLAGS)):\
Yakov Lernerca3bcab2006-06-15 01:36:00 +03001336 $(bindir_SQ):$(gitexecdir_SQ):$(template_dir_SQ):$(prefix_SQ)
1337
1338GIT-CFLAGS: .FORCE-GIT-CFLAGS
1339 @FLAGS='$(TRACK_CFLAGS)'; \
1340 if test x"$$FLAGS" != x"`cat GIT-CFLAGS 2>/dev/null`" ; then \
1341 echo 1>&2 " * new build flags or prefix"; \
1342 echo "$$FLAGS" >GIT-CFLAGS; \
1343 fi
1344
Junio C Hamanobfce5082008-07-25 12:35:10 -07001345# We need to apply sq twice, once to protect from the shell
1346# that runs GIT-BUILD-OPTIONS, and then again to protect it
1347# and the first level quoting from the shell that runs "echo".
Jeff King7cf7f542008-02-24 14:40:45 -05001348GIT-BUILD-OPTIONS: .FORCE-GIT-BUILD-OPTIONS
Junio C Hamanobfce5082008-07-25 12:35:10 -07001349 @echo SHELL_PATH=\''$(subst ','\'',$(SHELL_PATH_SQ))'\' >$@
1350 @echo TAR=\''$(subst ','\'',$(subst ','\'',$(TAR)))'\' >>$@
Jeff King7cf7f542008-02-24 14:40:45 -05001351
Eygene Ryabinkin6bdb18a2007-03-28 04:22:02 -07001352### Detect Tck/Tk interpreter path changes
1353ifndef NO_TCLTK
1354TRACK_VARS = $(subst ','\'',-DTCLTK_PATH='$(TCLTK_PATH_SQ)')
1355
1356GIT-GUI-VARS: .FORCE-GIT-GUI-VARS
1357 @VARS='$(TRACK_VARS)'; \
1358 if test x"$$VARS" != x"`cat $@ 2>/dev/null`" ; then \
1359 echo 1>&2 " * new Tcl/Tk interpreter location"; \
1360 echo "$$VARS" >$@; \
1361 fi
1362
1363.PHONY: .FORCE-GIT-GUI-VARS
1364endif
1365
Petr Baudis28818ff2005-07-29 17:50:24 +02001366### Testing rules
1367
Jeff King9002ec32009-01-11 06:25:06 -05001368TEST_PROGRAMS += test-chmtime$X
René Scharfeb4285c72009-01-17 16:50:13 +01001369TEST_PROGRAMS += test-ctype$X
Jeff King9002ec32009-01-11 06:25:06 -05001370TEST_PROGRAMS += test-date$X
1371TEST_PROGRAMS += test-delta$X
1372TEST_PROGRAMS += test-genrandom$X
1373TEST_PROGRAMS += test-match-trees$X
1374TEST_PROGRAMS += test-parse-options$X
1375TEST_PROGRAMS += test-path-utils$X
1376TEST_PROGRAMS += test-sha1$X
Junio C Hamano96651ef2007-04-28 15:32:49 -07001377
1378all:: $(TEST_PROGRAMS)
1379
Johannes Schindelinabb7c7b2006-02-18 13:01:18 +01001380# GNU make supports exporting all variables by "export" without parameters.
1381# However, the environment gets quite big, and some programs have problems
1382# with that.
1383
Johannes Schindelin140245b2006-07-07 13:26:31 +02001384export NO_SVN_TESTS
Johannes Schindelinabb7c7b2006-02-18 13:01:18 +01001385
Junio C Hamano96651ef2007-04-28 15:32:49 -07001386test: all
Petr Baudis28818ff2005-07-29 17:50:24 +02001387 $(MAKE) -C t/ all
1388
René Scharfeb4285c72009-01-17 16:50:13 +01001389test-ctype$X: ctype.o
1390
Julian Phillips5c5ba732007-05-31 00:18:24 +01001391test-date$X: date.o ctype.o
Petr Baudis28818ff2005-07-29 17:50:24 +02001392
Julian Phillips5c5ba732007-05-31 00:18:24 +01001393test-delta$X: diff-delta.o patch-delta.o
Petr Baudis28818ff2005-07-29 17:50:24 +02001394
Alex Riesen481424e2007-11-14 00:16:36 +01001395test-parse-options$X: parse-options.o
1396
Junio C Hamanofa8fe282007-08-30 19:14:31 -07001397.PRECIOUS: $(patsubst test-%$X,test-%.o,$(TEST_PROGRAMS))
1398
Julian Phillips5c5ba732007-05-31 00:18:24 +01001399test-%$X: test-%.o $(GITLIBS)
1400 $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS)
Nicolas Pitre2dca1af2007-04-11 13:59:51 -04001401
Junio C Hamanob65bc212006-06-24 00:59:49 -07001402check-sha1:: test-sha1$X
1403 ./test-sha1.sh
1404
René Scharfe7c4c9f42007-01-04 19:33:48 +01001405check: common-cmds.h
Junio C Hamano912f9982008-11-11 13:12:17 -08001406 if sparse; \
1407 then \
1408 for i in *.c; \
1409 do \
1410 sparse $(ALL_CFLAGS) $(SPARSE_FLAGS) $$i || exit; \
1411 done; \
1412 else \
1413 echo 2>&1 "Did you mean 'make test'?"; \
1414 exit 1; \
1415 fi
Petr Baudis28818ff2005-07-29 17:50:24 +02001416
Linus Torvalds36e5e702007-06-30 11:49:17 -07001417remove-dashes:
Miklos Vajnab4f02d32008-07-11 02:12:06 +02001418 ./fixup-builtins $(BUILT_INS) $(PROGRAMS) $(SCRIPTS)
Petr Baudis28818ff2005-07-29 17:50:24 +02001419
1420### Installation rules
1421
Johannes Sixt0b50b862008-01-01 22:15:21 +01001422ifeq ($(firstword $(subst /, ,$(template_dir))),..)
Johannes Sixt966c6ed2008-07-21 21:19:53 +02001423template_instdir = $(bindir)/$(template_dir)
Johannes Sixt0b50b862008-01-01 22:15:21 +01001424else
1425template_instdir = $(template_dir)
1426endif
1427export template_instdir
1428
Johannes Sixt49fa65a2008-07-23 21:12:18 +02001429ifeq ($(firstword $(subst /, ,$(gitexecdir))),..)
1430gitexec_instdir = $(bindir)/$(gitexecdir)
1431else
1432gitexec_instdir = $(gitexecdir)
1433endif
1434gitexec_instdir_SQ = $(subst ','\'',$(gitexec_instdir))
1435export gitexec_instdir
1436
Andreas Ericssond6ebd252005-11-22 00:44:15 +01001437install: all
Robert Schiele41650762007-12-01 18:05:40 +01001438 $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(bindir_SQ)'
Johannes Sixt49fa65a2008-07-23 21:12:18 +02001439 $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(gitexec_instdir_SQ)'
1440 $(INSTALL) $(ALL_PROGRAMS) '$(DESTDIR_SQ)$(gitexec_instdir_SQ)'
Nanako Shiraishiede4caf2008-09-10 20:03:18 +09001441 $(INSTALL) git$X git-upload-pack$X git-receive-pack$X git-upload-archive$X git-shell$X git-cvsserver '$(DESTDIR_SQ)$(bindir_SQ)'
Ramsay Allan Jones7ffe7092006-07-29 17:25:03 +01001442 $(MAKE) -C templates DESTDIR='$(DESTDIR_SQ)' install
Gerrit Pape28072a52007-12-10 09:31:02 +00001443 $(MAKE) -C perl prefix='$(prefix_SQ)' DESTDIR='$(DESTDIR_SQ)' install
Eygene Ryabinkin3cfaf112007-03-28 04:00:23 -07001444ifndef NO_TCLTK
Junio C Hamano62ba5142007-11-17 10:51:16 -08001445 $(MAKE) -C gitk-git install
Johannes Sixt49fa65a2008-07-23 21:12:18 +02001446 $(MAKE) -C git-gui gitexecdir='$(gitexec_instdir_SQ)' install
Eygene Ryabinkin3cfaf112007-03-28 04:00:23 -07001447endif
Junio C Hamano6fc301b2007-01-10 12:24:54 -08001448ifneq (,$X)
Johannes Sixt49fa65a2008-07-23 21:12:18 +02001449 $(foreach p,$(patsubst %$X,%,$(filter %$X,$(ALL_PROGRAMS) $(BUILT_INS) git$X)), $(RM) '$(DESTDIR_SQ)$(gitexec_instdir_SQ)/$p';)
Junio C Hamano6fc301b2007-01-10 12:24:54 -08001450endif
Johannes Sixt46beb552008-07-21 21:19:51 +02001451 bindir=$$(cd '$(DESTDIR_SQ)$(bindir_SQ)' && pwd) && \
Johannes Sixt49fa65a2008-07-23 21:12:18 +02001452 execdir=$$(cd '$(DESTDIR_SQ)$(gitexec_instdir_SQ)' && pwd) && \
Andreas Färber3e073dc2008-08-25 17:33:03 +02001453 { $(RM) "$$execdir/git-add$X" && \
1454 ln git-add$X "$$execdir/git-add$X" 2>/dev/null || \
1455 cp git-add$X "$$execdir/git-add$X"; } && \
Brandon Caseyb56c79c2009-01-19 19:44:03 -06001456 { for p in $(filter-out git-add$X,$(BUILT_INS)); do \
1457 $(RM) "$$execdir/$$p" && \
1458 ln "$$execdir/git-add$X" "$$execdir/$$p" 2>/dev/null || \
1459 ln -s "git-add$X" "$$execdir/$$p" 2>/dev/null || \
1460 cp "$$execdir/git-add$X" "$$execdir/$$p" || exit; \
1461 done } && \
Johannes Sixt7b4b59a2008-07-21 21:19:58 +02001462 ./check_bindir "z$$bindir" "z$$execdir" "$$bindir/git-add$X"
Petr Baudis28818ff2005-07-29 17:50:24 +02001463
1464install-doc:
1465 $(MAKE) -C Documentation install
1466
Markus Heidelbergb1a46b72008-11-02 18:53:03 +01001467install-man:
1468 $(MAKE) -C Documentation install-man
1469
Teemu Likonenae081f32008-06-10 11:34:25 +03001470install-html:
1471 $(MAKE) -C Documentation install-html
1472
David Kastrup47398092007-08-06 12:22:57 +02001473install-info:
1474 $(MAKE) -C Documentation install-info
1475
Miklos Vajnaa325a1a2008-12-10 23:44:50 +01001476install-pdf:
1477 $(MAKE) -C Documentation install-pdf
1478
Eric Wong6538d1e2006-12-23 08:26:09 -08001479quick-install-doc:
1480 $(MAKE) -C Documentation quick-install
Petr Baudis28818ff2005-07-29 17:50:24 +02001481
Markus Heidelbergb1a46b72008-11-02 18:53:03 +01001482quick-install-man:
1483 $(MAKE) -C Documentation quick-install-man
1484
Michael J Gruber6fe570d2008-09-09 22:44:17 +02001485quick-install-html:
1486 $(MAKE) -C Documentation quick-install-html
1487
Petr Baudis28818ff2005-07-29 17:50:24 +02001488
1489
1490### Maintainer's dist rules
1491
Junio C Hamano9b88fce2005-12-27 14:40:17 -08001492git.spec: git.spec.in
Jim Meyeringfc36f6a2006-05-25 18:52:01 +02001493 sed -e 's/@@VERSION@@/$(GIT_VERSION)/g' < $< > $@+
1494 mv $@+ $@
Chris Wrighta9db2972005-07-07 13:09:50 -07001495
Junio C Hamano27dedf02005-11-16 21:32:44 -08001496GIT_TARNAME=git-$(GIT_VERSION)
Shawn O. Pearce6c0f8692008-02-24 00:38:04 -05001497dist: git.spec git-archive$(X) configure
Junio C Hamano9ccb64c2006-10-05 02:26:12 -07001498 ./git-archive --format=tar \
1499 --prefix=$(GIT_TARNAME)/ HEAD^{tree} > $(GIT_TARNAME).tar
Chris Wrighta9db2972005-07-07 13:09:50 -07001500 @mkdir -p $(GIT_TARNAME)
Matthias Lederhoferf58494b2007-06-18 23:30:36 +02001501 @cp git.spec configure $(GIT_TARNAME)
H. Peter Anvin181129d2006-01-09 18:07:01 -08001502 @echo $(GIT_VERSION) > $(GIT_TARNAME)/version
Shawn O. Pearced647c2e2007-02-12 18:20:34 -05001503 @$(MAKE) -C git-gui TARDIR=../$(GIT_TARNAME)/git-gui dist-version
H. Peter Anvin181129d2006-01-09 18:07:01 -08001504 $(TAR) rf $(GIT_TARNAME).tar \
Shawn O. Pearced647c2e2007-02-12 18:20:34 -05001505 $(GIT_TARNAME)/git.spec \
Matthias Lederhoferf58494b2007-06-18 23:30:36 +02001506 $(GIT_TARNAME)/configure \
Shawn O. Pearced647c2e2007-02-12 18:20:34 -05001507 $(GIT_TARNAME)/version \
Shawn O. Pearce115f0fe2007-03-12 13:40:31 -04001508 $(GIT_TARNAME)/git-gui/version
Emil Medve4cb08df2007-07-14 12:51:44 -05001509 @$(RM) -r $(GIT_TARNAME)
Eric W. Biederman9dce3c02005-07-14 19:20:50 -06001510 gzip -f -9 $(GIT_TARNAME).tar
Chris Wrighta9db2972005-07-07 13:09:50 -07001511
1512rpm: dist
Junio C Hamano27dedf02005-11-16 21:32:44 -08001513 $(RPMBUILD) -ta $(GIT_TARNAME).tar.gz
Chris Wrighta9db2972005-07-07 13:09:50 -07001514
Tilman Sauerbeck52db0492006-05-18 12:57:04 +02001515htmldocs = git-htmldocs-$(GIT_VERSION)
1516manpages = git-manpages-$(GIT_VERSION)
1517dist-doc:
Emil Medve4cb08df2007-07-14 12:51:44 -05001518 $(RM) -r .doc-tmp-dir
Tilman Sauerbeck52db0492006-05-18 12:57:04 +02001519 mkdir .doc-tmp-dir
1520 $(MAKE) -C Documentation WEBDOC_DEST=../.doc-tmp-dir install-webdoc
1521 cd .doc-tmp-dir && $(TAR) cf ../$(htmldocs).tar .
1522 gzip -n -9 -f $(htmldocs).tar
1523 :
Emil Medve4cb08df2007-07-14 12:51:44 -05001524 $(RM) -r .doc-tmp-dir
Junio C Hamano4392da42007-04-19 20:47:04 -07001525 mkdir -p .doc-tmp-dir/man1 .doc-tmp-dir/man5 .doc-tmp-dir/man7
Martin Waitzc5360322006-05-25 14:37:46 +02001526 $(MAKE) -C Documentation DESTDIR=./ \
Jakub Narebski7b8cf0c2006-06-29 23:26:54 +02001527 man1dir=../.doc-tmp-dir/man1 \
Junio C Hamano4392da42007-04-19 20:47:04 -07001528 man5dir=../.doc-tmp-dir/man5 \
Jakub Narebski7b8cf0c2006-06-29 23:26:54 +02001529 man7dir=../.doc-tmp-dir/man7 \
Tilman Sauerbeck52db0492006-05-18 12:57:04 +02001530 install
1531 cd .doc-tmp-dir && $(TAR) cf ../$(manpages).tar .
1532 gzip -n -9 -f $(manpages).tar
Emil Medve4cb08df2007-07-14 12:51:44 -05001533 $(RM) -r .doc-tmp-dir
Tilman Sauerbeck52db0492006-05-18 12:57:04 +02001534
Petr Baudis28818ff2005-07-29 17:50:24 +02001535### Cleaning rules
Eric W. Biederman87a81c82005-07-14 19:21:57 -06001536
Mathias Megyei922aa802007-10-04 23:49:19 +02001537distclean: clean
1538 $(RM) configure
1539
Linus Torvaldse83c5162005-04-07 15:13:13 -07001540clean:
Emil Medve4cb08df2007-07-14 12:51:44 -05001541 $(RM) *.o mozilla-sha1/*.o arm/*.o ppc/*.o compat/*.o xdiff/*.o \
Junio C Hamano4cfc24a2008-08-19 18:05:39 -07001542 $(LIB_FILE) $(XDIFF_LIB)
Emil Medve4cb08df2007-07-14 12:51:44 -05001543 $(RM) $(ALL_PROGRAMS) $(BUILT_INS) git$X
1544 $(RM) $(TEST_PROGRAMS)
Kristof Provosta2a91502007-10-06 16:24:42 +02001545 $(RM) *.spec *.pyc *.pyo */*.pyc */*.pyo common-cmds.h TAGS tags cscope*
Emil Medve4cb08df2007-07-14 12:51:44 -05001546 $(RM) -r autom4te.cache
Mathias Megyei922aa802007-10-04 23:49:19 +02001547 $(RM) config.log config.mak.autogen config.mak.append config.status config.cache
Emil Medve4cb08df2007-07-14 12:51:44 -05001548 $(RM) -r $(GIT_TARNAME) .doc-tmp-dir
1549 $(RM) $(GIT_TARNAME).tar.gz git-core_$(GIT_VERSION)-*.tar.gz
1550 $(RM) $(htmldocs).tar.gz $(manpages).tar.gz
1551 $(RM) gitweb/gitweb.cgi
Thomas Glanzmannca67f002005-05-22 20:27:28 +02001552 $(MAKE) -C Documentation/ clean
Alex Riesenf8487182006-12-04 10:50:04 +01001553 $(MAKE) -C perl clean
Petr Baudisb1edc532006-06-24 04:34:29 +02001554 $(MAKE) -C templates/ clean
Junio C Hamano4b7581f2005-08-02 17:24:11 -07001555 $(MAKE) -C t/ clean
Eygene Ryabinkin3cfaf112007-03-28 04:00:23 -07001556ifndef NO_TCLTK
Junio C Hamano62ba5142007-11-17 10:51:16 -08001557 $(MAKE) -C gitk-git clean
Eygene Ryabinkin3cfaf112007-03-28 04:00:23 -07001558 $(MAKE) -C git-gui clean
1559endif
Jeff King7cf7f542008-02-24 14:40:45 -05001560 $(RM) GIT-VERSION-FILE GIT-CFLAGS GIT-GUI-VARS GIT-BUILD-OPTIONS
Junio C Hamano9b88fce2005-12-27 14:40:17 -08001561
Junio C Hamano4dc00022006-01-12 21:42:25 -08001562.PHONY: all install clean strip
Brandon Casey6dc46272008-08-07 14:06:26 -05001563.PHONY: shell_compatibility_test please_set_SHELL_PATH_to_a_more_modern_shell
Kristof Provosta2a91502007-10-06 16:24:42 +02001564.PHONY: .FORCE-GIT-VERSION-FILE TAGS tags cscope .FORCE-GIT-CFLAGS
Jeff King7cf7f542008-02-24 14:40:45 -05001565.PHONY: .FORCE-GIT-BUILD-OPTIONS
Junio C Hamanod89056c2005-12-19 17:59:58 -08001566
Junio C Hamano8c989ec2006-04-13 00:17:19 -07001567### Check documentation
1568#
1569check-docs::
Junio C Hamano3f7ce642007-11-08 18:38:27 -08001570 @(for v in $(ALL_PROGRAMS) $(BUILT_INS) git gitk; \
Junio C Hamano8c989ec2006-04-13 00:17:19 -07001571 do \
1572 case "$$v" in \
Junio C Hamano8c989ec2006-04-13 00:17:19 -07001573 git-merge-octopus | git-merge-ours | git-merge-recursive | \
Miklos Vajna51add762008-07-05 16:43:51 +02001574 git-merge-resolve | git-merge-subtree | \
Junio C Hamano5c66d0d2008-01-17 22:52:40 -08001575 git-fsck-objects | git-init-db | \
Junio C Hamano5b4617c2007-12-14 22:02:57 -08001576 git-?*--?* ) continue ;; \
Junio C Hamano8c989ec2006-04-13 00:17:19 -07001577 esac ; \
1578 test -f "Documentation/$$v.txt" || \
1579 echo "no doc: $$v"; \
Junio C Hamano79d30662007-12-01 23:39:19 -08001580 sed -e '/^#/d' command-list.txt | \
Junio C Hamano4b02c522007-02-13 22:45:22 -08001581 grep -q "^$$v[ ]" || \
Junio C Hamano8c989ec2006-04-13 00:17:19 -07001582 case "$$v" in \
1583 git) ;; \
1584 *) echo "no link: $$v";; \
1585 esac ; \
Junio C Hamano3f7ce642007-11-08 18:38:27 -08001586 done; \
1587 ( \
Junio C Hamano79d30662007-12-01 23:39:19 -08001588 sed -e '/^#/d' \
Junio C Hamano3f7ce642007-11-08 18:38:27 -08001589 -e 's/[ ].*//' \
Junio C Hamano79d30662007-12-01 23:39:19 -08001590 -e 's/^/listed /' command-list.txt; \
Junio C Hamano3f7ce642007-11-08 18:38:27 -08001591 ls -1 Documentation/git*txt | \
1592 sed -e 's|Documentation/|documented |' \
1593 -e 's/\.txt//'; \
1594 ) | while read how cmd; \
1595 do \
1596 case "$$how,$$cmd" in \
1597 *,git-citool | \
1598 *,git-gui | \
Christian Couder0f6f1952007-12-04 06:44:29 +01001599 *,git-help | \
Junio C Hamano3f7ce642007-11-08 18:38:27 -08001600 documented,gitattributes | \
1601 documented,gitignore | \
1602 documented,gitmodules | \
Pierre Habouzit2f7ee082007-12-13 11:20:01 +01001603 documented,gitcli | \
Junio C Hamano3f7ce642007-11-08 18:38:27 -08001604 documented,git-tools | \
Junio C Hamanod0594be2008-06-15 13:43:32 -07001605 documented,gitcore-tutorial | \
1606 documented,gitcvs-migration | \
1607 documented,gitdiffcore | \
1608 documented,gitglossary | \
1609 documented,githooks | \
1610 documented,gitrepository-layout | \
1611 documented,gittutorial | \
1612 documented,gittutorial-2 | \
Junio C Hamano3f7ce642007-11-08 18:38:27 -08001613 sentinel,not,matching,is,ok ) continue ;; \
1614 esac; \
1615 case " $(ALL_PROGRAMS) $(BUILT_INS) git gitk " in \
1616 *" $$cmd "*) ;; \
1617 *) echo "removed but $$how: $$cmd" ;; \
1618 esac; \
1619 done ) | sort
Junio C Hamanoc74390e2006-11-05 11:26:21 -08001620
1621### Make sure built-ins do not have dups and listed in git.c
1622#
1623check-builtins::
1624 ./check-builtins.sh
Junio C Hamano11c57e62008-01-14 15:10:38 -08001625