]>
Commit | Line | Data |
---|---|---|
2731d048 | 1 | # The default target of this Makefile is... |
6fc301bb | 2 | all:: |
2731d048 | 3 | |
2314c947 | 4 | # Define V=1 to have a more verbose compile. |
74f2b2a8 | 5 | # |
c4582f93 MR |
6 | # 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 | # | |
cba22528 BC |
10 | # Define FREAD_READS_DIRECTORIES if your are on a system which succeeds |
11 | # when attempting to read from an fopen'ed directory. | |
12 | # | |
765ac8ec LT |
13 | # Define NO_OPENSSL environment variable if you do not have OpenSSL. |
14 | # This also implies MOZILLA_SHA1. | |
2cb45e95 | 15 | # |
58e60dd2 NH |
16 | # Define NO_CURL if you do not have curl installed. git-http-pull and |
17 | # git-http-push are not built, and you cannot use http:// and https:// | |
18 | # transports. | |
b2c0bd65 | 19 | # |
6d9bbc50 PM |
20 | # Define CURLDIR=/foo/bar if your curl header and library files are in |
21 | # /foo/bar/include and /foo/bar/lib directories. | |
22 | # | |
58e60dd2 NH |
23 | # 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 | # | |
35a730f0 JH |
26 | # Define NO_D_INO_IN_DIRENT if you don't have d_ino in your struct dirent. |
27 | # | |
63be37b0 JH |
28 | # Define NO_D_TYPE_IN_DIRENT if your platform defines DT_UNKNOWN but lacks |
29 | # d_type in struct dirent (latest Cygwin -- will be fixed soonish). | |
30 | # | |
579d1fbf RJ |
31 | # Define NO_C99_FORMAT if your formatted IO functions (printf/scanf et.al.) |
32 | # do not support the 'size specifiers' introduced by C99, namely ll, hh, | |
33 | # j, z, t. (representing long long int, char, intmax_t, size_t, ptrdiff_t). | |
465e649d | 34 | # some C compilers supported these specifiers prior to C99 as an extension. |
579d1fbf | 35 | # |
ef34af24 LT |
36 | # Define NO_STRCASESTR if you don't have strcasestr. |
37 | # | |
b21b9f1d RS |
38 | # Define NO_MEMMEM if you don't have memmem. |
39 | # | |
817151e6 PE |
40 | # Define NO_STRLCPY if you don't have strlcpy. |
41 | # | |
bc6b4f52 JR |
42 | # Define NO_STRTOUMAX if you don't have strtoumax in the C library. |
43 | # If your compiler also does not support long long or does not have | |
44 | # strtoull, define NO_STRTOULL. | |
45 | # | |
e40b61fb JR |
46 | # Define NO_SETENV if you don't have setenv in the C library. |
47 | # | |
bfa8fccf JN |
48 | # Define NO_UNSETENV if you don't have unsetenv in the C library. |
49 | # | |
ca5bb5d5 SP |
50 | # Define NO_MKDTEMP if you don't have mkdtemp in the C library. |
51 | # | |
2600973f RS |
52 | # Define NO_SYS_SELECT_H if you don't have sys/select.h. |
53 | # | |
9f0bb90d JH |
54 | # Define NO_SYMLINK_HEAD if you never want .git/HEAD to be a symbolic link. |
55 | # Enable it on Windows. By default, symrefs are still used. | |
2fabd217 | 56 | # |
02853588 | 57 | # Define NO_SVN_TESTS if you want to skip time-consuming SVN interoperability |
60d02ccc EW |
58 | # tests. These tests take up a significant amount of the total test time |
59 | # but are not needed unless you plan to talk to SVN repos. | |
60 | # | |
8eb38cad SP |
61 | # Define NO_FINK if you are building on Darwin/Mac OS X, have Fink |
62 | # installed in /sw, but don't want GIT to link against any libraries | |
63 | # installed there. If defined you may specify your own (or Fink's) | |
64 | # include directories and library directories by defining CFLAGS | |
65 | # and LDFLAGS appropriately. | |
66 | # | |
67 | # Define NO_DARWIN_PORTS if you are building on Darwin/Mac OS X, | |
68 | # have DarwinPorts installed in /opt/local, but don't want GIT to | |
69 | # link against any libraries installed there. If defined you may | |
70 | # specify your own (or DarwinPort's) include directories and | |
71 | # library directories by defining CFLAGS and LDFLAGS appropriately. | |
72 | # | |
5bdac8b3 PB |
73 | # Define PPC_SHA1 environment variable when running make to make use of |
74 | # a bundled SHA1 routine optimized for PowerPC. | |
597c9cc5 | 75 | # |
7c6ef2f2 NP |
76 | # Define ARM_SHA1 environment variable when running make to make use of |
77 | # a bundled SHA1 routine optimized for ARM. | |
78 | # | |
f6af75d2 JH |
79 | # Define MOZILLA_SHA1 environment variable when running make to make use of |
80 | # a bundled SHA1 routine coming from Mozilla. It is GPL'd and should be fast | |
81 | # on non-x86 architectures (e.g. PowerPC), while the OpenSSL version (default | |
82 | # choice) has very fast version optimized for i586. | |
83 | # | |
597c9cc5 | 84 | # Define NEEDS_SSL_WITH_CRYPTO if you need -lcrypto with -lssl (Darwin). |
f0ebff0d | 85 | # |
597c9cc5 | 86 | # Define NEEDS_LIBICONV if linking with libc is not enough (Darwin). |
f0ebff0d PM |
87 | # |
88 | # Define NEEDS_SOCKET if linking with libc is not enough (SunOS, | |
89 | # Patrick Mauritz). | |
90 | # | |
730d48a2 JS |
91 | # Define NO_MMAP if you want to avoid mmap. |
92 | # | |
6900679c SH |
93 | # Define NO_PREAD if you have a problem with pread() system call (e.g. |
94 | # cygwin.dll before v1.5.22). | |
95 | # | |
1510fea7 SP |
96 | # Define NO_FAST_WORKING_DIRECTORY if accessing objects in pack files is |
97 | # generally faster on your platform than accessing the working directory. | |
98 | # | |
c869753e SP |
99 | # Define NO_TRUSTABLE_FILEMODE if your filesystem may claim to support |
100 | # the executable mode bit, but doesn't really do so. | |
101 | # | |
49744d63 PA |
102 | # Define NO_IPV6 if you lack IPv6 support and getaddrinfo(). |
103 | # | |
bdc37f5a JH |
104 | # Define NO_SOCKADDR_STORAGE if your platform does not have struct |
105 | # sockaddr_storage. | |
106 | # | |
b6e56eca FP |
107 | # Define NO_ICONV if your libc does not properly support iconv. |
108 | # | |
fd547a97 RJ |
109 | # Define OLD_ICONV if your library has an old iconv(), where the second |
110 | # (input buffer pointer) parameter is declared with type (const char **). | |
111 | # | |
609a2289 DS |
112 | # Define NO_DEFLATE_BOUND if your zlib does not have deflateBound. |
113 | # | |
20648877 MK |
114 | # Define NO_R_TO_GCC_LINKER if your gcc does not like "-R/path/lib" |
115 | # that tells runtime paths to dynamic libraries; | |
116 | # "-Wl,-rpath=/path/lib" is used instead. | |
bbfc63dd | 117 | # |
5bdac8b3 PB |
118 | # Define USE_NSEC below if you want git to care about sub-second file mtimes |
119 | # and ctimes. Note that you need recent glibc (at least 2.2.4) for this, and | |
120 | # it will BREAK YOUR LOCAL DIFFS! show-diff and anything using it will likely | |
121 | # randomly break unless your underlying filesystem supports those sub-second | |
122 | # times (my ext3 doesn't). | |
f6af75d2 | 123 | # |
5bdac8b3 | 124 | # Define USE_STDEV below if you want git to care about the underlying device |
10455d2a | 125 | # change being considered an inode change from the update-index perspective. |
f848718a | 126 | # |
4c7100a9 JH |
127 | # Define ASCIIDOC8 if you want to format documentation with AsciiDoc 8 |
128 | # | |
7f55cf45 JF |
129 | # Define DOCBOOK_XSL_172 if you want to format man pages with DocBook XSL v1.72. |
130 | # | |
f848718a AR |
131 | # Define NO_PERL_MAKEMAKER if you cannot use Makefiles generated by perl's |
132 | # MakeMaker (e.g. using ActiveState under Cygwin). | |
133 | # | |
3cfaf11b ER |
134 | # Define NO_TCLTK if you do not want Tcl/Tk GUI. |
135 | # | |
5f5dbd71 SP |
136 | # The TCL_PATH variable governs the location of the Tcl interpreter |
137 | # used to optimize git-gui for your system. Only used if NO_TCLTK | |
138 | # is not set. Defaults to the bare 'tclsh'. | |
139 | # | |
140 | # The TCLTK_PATH variable governs the location of the Tcl/Tk interpreter. | |
81b63c70 ER |
141 | # If not set it defaults to the bare 'wish'. If it is set to the empty |
142 | # string then NO_TCLTK will be forced (this is used by configure script). | |
143 | # | |
8ecce684 NP |
144 | # Define THREADED_DELTA_SEARCH if you have pthreads and wish to exploit |
145 | # parallel delta searching when packing objects. | |
146 | # | |
43fe901b BD |
147 | # Define INTERNAL_QSORT to use Git's implementation of qsort(), which |
148 | # is a simplified version of the merge sort used in glibc. This is | |
149 | # recommended if Git triggers O(n^2) behavior in your platform's qsort(). | |
150 | # | |
5bdac8b3 | 151 | |
9b88fcef | 152 | GIT-VERSION-FILE: .FORCE-GIT-VERSION-FILE |
36546385 | 153 | @$(SHELL_PATH) ./GIT-VERSION-GEN |
9b88fcef | 154 | -include GIT-VERSION-FILE |
a9db2974 | 155 | |
e15f5451 PJ |
156 | uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not') |
157 | uname_M := $(shell sh -c 'uname -m 2>/dev/null || echo not') | |
158 | uname_O := $(shell sh -c 'uname -o 2>/dev/null || echo not') | |
159 | uname_R := $(shell sh -c 'uname -r 2>/dev/null || echo not') | |
160 | uname_P := $(shell sh -c 'uname -p 2>/dev/null || echo not') | |
161 | ||
94d23317 | 162 | # CFLAGS and LDFLAGS are for the users to override from the command line. |
12aa7456 | 163 | |
b05701c5 | 164 | CFLAGS = -g -O2 -Wall |
94d23317 | 165 | LDFLAGS = |
12aa7456 | 166 | ALL_CFLAGS = $(CFLAGS) |
94d23317 | 167 | ALL_LDFLAGS = $(LDFLAGS) |
4dc00021 | 168 | STRIP ?= strip |
29c2cce4 | 169 | |
b05701c5 PR |
170 | prefix = $(HOME) |
171 | bindir = $(prefix)/bin | |
8e566f24 | 172 | mandir = $(prefix)/share/man |
a149a1a4 | 173 | infodir = $(prefix)/share/info |
e15f5451 | 174 | gitexecdir = $(bindir) |
9354768a | 175 | sharedir = $(prefix)/share |
d52fd42a | 176 | template_dir = $(sharedir)/git-core/templates |
5d6491c7 | 177 | htmldir=$(sharedir)/doc/git-doc |
b51b8bbf JT |
178 | ifeq ($(prefix),/usr) |
179 | sysconfdir = /etc | |
180 | else | |
181 | sysconfdir = $(prefix)/etc | |
182 | endif | |
10861bea | 183 | lib = lib |
b51b8bbf | 184 | ETC_GITCONFIG = $(sysconfdir)/gitconfig |
a682ef9f | 185 | # DESTDIR= |
5c2a7fbc | 186 | |
5d043a3d | 187 | # default configuration for gitweb |
c8d138a8 | 188 | GITWEB_CONFIG = gitweb_config.perl |
2de21fac | 189 | GITWEB_HOME_LINK_STR = projects |
5d043a3d MW |
190 | GITWEB_SITENAME = |
191 | GITWEB_PROJECTROOT = /pub/git | |
ca5e9495 | 192 | GITWEB_PROJECT_MAXDEPTH = 2007 |
32f4aacc ML |
193 | GITWEB_EXPORT_OK = |
194 | GITWEB_STRICT_EXPORT = | |
19a8721e | 195 | GITWEB_BASE_URL = |
5d043a3d MW |
196 | GITWEB_LIST = |
197 | GITWEB_HOMETEXT = indextext.html | |
198 | GITWEB_CSS = gitweb.css | |
281f2f6b | 199 | GITWEB_LOGO = git-logo.png |
0b5deba1 | 200 | GITWEB_FAVICON = git-favicon.png |
b2d3476e AC |
201 | GITWEB_SITE_HEADER = |
202 | GITWEB_SITE_FOOTER = | |
5d043a3d | 203 | |
5d6491c7 | 204 | export prefix bindir gitexecdir sharedir template_dir htmldir sysconfdir |
e14421b9 | 205 | |
b05701c5 PR |
206 | CC = gcc |
207 | AR = ar | |
4cb08df5 | 208 | RM = rm -f |
229a7ed7 | 209 | TAR = tar |
89b2f19c | 210 | FIND = find |
b05701c5 PR |
211 | INSTALL = install |
212 | RPMBUILD = rpmbuild | |
5f5dbd71 | 213 | TCL_PATH = tclsh |
81b63c70 | 214 | TCLTK_PATH = wish |
e83c5163 | 215 | |
5f5dbd71 SP |
216 | export TCL_PATH TCLTK_PATH |
217 | ||
44c9e859 LT |
218 | # sparse is architecture-neutral, which means that we need to tell it |
219 | # explicitly what architecture to check for. Fix this up for yours.. | |
b05701c5 | 220 | SPARSE_FLAGS = -D__BIG_ENDIAN__ -D__powerpc__ |
44c9e859 | 221 | |
28818ffa PB |
222 | |
223 | ||
224 | ### --- END CONFIGURATION SECTION --- | |
225 | ||
8d7f586f | 226 | # Those must not be GNU-specific; they are shared with perl/ which may |
18b0fc1c PB |
227 | # be built by a different compiler. (Note that this is an artifact now |
228 | # but it still might be nice to keep that distinction.) | |
229 | BASIC_CFLAGS = | |
230 | BASIC_LDFLAGS = | |
8d7f586f | 231 | |
215a7ad1 | 232 | SCRIPT_SH = \ |
782c2d65 | 233 | git-bisect.sh \ |
31cbb5d9 | 234 | git-clone.sh \ |
c4b4a5af | 235 | git-merge-one-file.sh git-mergetool.sh git-parse-remote.sh \ |
1b1dce4b | 236 | git-pull.sh git-rebase.sh git-rebase--interactive.sh \ |
0e5a7faa | 237 | git-repack.sh git-request-pull.sh \ |
9509af68 | 238 | git-sh-setup.sh \ |
59c8e2cb | 239 | git-am.sh \ |
2276aa6c | 240 | git-merge.sh git-merge-stupid.sh git-merge-octopus.sh \ |
a00a42ae | 241 | git-merge-resolve.sh \ |
6f6826c5 | 242 | git-lost-found.sh git-quiltimport.sh git-submodule.sh \ |
f2c66ed1 | 243 | git-filter-branch.sh \ |
5d6491c7 | 244 | git-stash.sh \ |
5884f1fe | 245 | git-web--browse.sh |
215a7ad1 JH |
246 | |
247 | SCRIPT_PERL = \ | |
5cde71d6 | 248 | git-add--interactive.perl \ |
215a7ad1 | 249 | git-archimport.perl git-cvsimport.perl git-relink.perl \ |
211c8968 | 250 | git-cvsserver.perl git-cvsexportcommit.perl \ |
60d02ccc | 251 | git-send-email.perl git-svn.perl |
60036a41 | 252 | |
d6ebd259 AE |
253 | SCRIPTS = $(patsubst %.sh,%,$(SCRIPT_SH)) \ |
254 | $(patsubst %.perl,%,$(SCRIPT_PERL)) \ | |
e475fe16 | 255 | git-instaweb |
d6ebd259 | 256 | |
b42934d6 | 257 | # ... and all the rest that could be moved out of bindir to gitexecdir |
215a7ad1 | 258 | PROGRAMS = \ |
2ecb5ea2 | 259 | git-fetch-pack$X \ |
fbdeef94 | 260 | git-hash-object$X git-index-pack$X \ |
db5e523f | 261 | git-fast-import$X \ |
af8ffbed | 262 | git-daemon$X \ |
5d4a6003 | 263 | git-merge-index$X git-mktag$X git-mktree$X git-patch-id$X \ |
18f7c51c | 264 | git-receive-pack$X \ |
51ce34b9 | 265 | git-send-pack$X git-shell$X \ |
fbdeef94 DB |
266 | git-show-index$X \ |
267 | git-unpack-file$X \ | |
64413630 | 268 | git-update-server-info$X \ |
59d10247 | 269 | git-upload-pack$X \ |
d6b64ed0 | 270 | git-pack-redundant$X git-var$X \ |
9a0eaf83 | 271 | git-merge-tree$X git-imap-send$X \ |
42f77406 JH |
272 | $(EXTRA_PROGRAMS) |
273 | ||
274 | # Empty... | |
275 | EXTRA_PROGRAMS = | |
d6ebd259 | 276 | |
1736855c JH |
277 | # List built-in command $C whose implementation cmd_$C() is not in |
278 | # builtin-$C.o but is linked in as part of some other command. | |
e414156a | 279 | BUILT_INS = \ |
e827633a | 280 | git-format-patch$X git-show$X git-whatchanged$X git-cherry$X \ |
e0d10e1c | 281 | git-get-tar-commit-id$X git-init$X git-repo-config$X \ |
31cbb5d9 | 282 | git-fsck-objects$X git-cherry-pick$X git-peek-remote$X git-status$X \ |
1736855c | 283 | git-merge-subtree$X \ |
f754fa9c | 284 | $(patsubst builtin-%.o,git-%$X,$(BUILTIN_OBJS)) |
91730800 | 285 | |
b42934d6 | 286 | # what 'all' will build and 'install' will install, in gitexecdir |
6506e156 | 287 | ALL_PROGRAMS = $(PROGRAMS) $(SCRIPTS) |
e83c5163 | 288 | |
3cfaf11b ER |
289 | # what 'all' will build but not install in gitexecdir |
290 | OTHER_PROGRAMS = git$X gitweb/gitweb.cgi | |
3cfaf11b | 291 | |
3d32051f RA |
292 | # Set paths to tools early so that they can be used for version tests. |
293 | ifndef SHELL_PATH | |
294 | SHELL_PATH = /bin/sh | |
295 | endif | |
296 | ifndef PERL_PATH | |
297 | PERL_PATH = /usr/bin/perl | |
298 | endif | |
720d150c | 299 | |
3a793478 LT |
300 | export PERL_PATH |
301 | ||
0a02ce72 | 302 | LIB_FILE=libgit.a |
3443546f | 303 | XDIFF_LIB=xdiff/lib.a |
8f3f9b09 | 304 | |
215a7ad1 | 305 | LIB_H = \ |
6b1b40d9 | 306 | archive.h blob.h cache.h cache-tree.h commit.h csum-file.h delta.h grep.h \ |
4405fb77 | 307 | diff.h object.h pack.h pkt-line.h quote.h refs.h list-objects.h sideband.h \ |
1b0c7174 | 308 | run-command.h strbuf.h tag.h tree.h git-compat-util.h revision.h \ |
9e832665 | 309 | tree-walk.h log-tree.h dir.h path-list.h unpack-trees.h builtin.h \ |
5751f490 | 310 | utf8.h reflog-walk.h patch-ids.h attr.h decorate.h progress.h \ |
5d921e29 | 311 | mailmap.h remote.h parse-options.h transport.h diffcore.h hash.h ll-merge.h fsck.h \ |
3449f8c4 | 312 | pack-revindex.h |
b1bf95bb | 313 | |
215a7ad1 | 314 | DIFF_OBJS = \ |
6973dcae | 315 | diff.o diff-lib.o diffcore-break.o diffcore-order.o \ |
65416758 | 316 | diffcore-pickaxe.o diffcore-rename.o tree-diff.o combine-diff.o \ |
5f1c3f07 | 317 | diffcore-delta.o log-tree.o |
d1df5743 | 318 | |
215a7ad1 | 319 | LIB_OBJS = \ |
283c8eef | 320 | blob.o commit.o connect.o csum-file.o cache-tree.o base85.o \ |
49ba83fb | 321 | date.o diff-delta.o entry.o exec_cmd.o ident.o \ |
93fc05eb | 322 | pretty.o interpolate.o hash.o \ |
49ba83fb | 323 | lockfile.o \ |
5d23e133 | 324 | patch-ids.o \ |
8b0eca7c DH |
325 | object.o pack-check.o pack-write.o patch-delta.o path.o pkt-line.o \ |
326 | sideband.o reachable.o reflog-walk.o \ | |
7914053b | 327 | quote.o read-cache.o refs.o run-command.o dir.o \ |
215a7ad1 | 328 | server-info.o setup.o sha1_file.o sha1_name.o strbuf.o \ |
f3123c4a | 329 | tag.o tree.o usage.o config.o environment.o ctype.o copy.o \ |
da093d37 | 330 | revision.o pager.o tree-walk.o xdiff-interface.o \ |
68faf689 | 331 | write_or_die.o trace.o list-objects.o grep.o match-trees.o \ |
7c92fe0e | 332 | alloc.o merge-file.o path-list.o help.o unpack-trees.o $(DIFF_OBJS) \ |
6c510bee | 333 | color.o wt-status.o archive-zip.o archive-tar.o shallow.o utf8.o \ |
9b288516 | 334 | convert.o attr.o decorate.o progress.o mailmap.o symlinks.o remote.o \ |
5a4d707a | 335 | transport.o bundle.o walker.o parse-options.o ws.o archive.o branch.o \ |
5d921e29 | 336 | ll-merge.o alias.o fsck.o pack-revindex.o |
d19938ab | 337 | |
70827b15 | 338 | BUILTIN_OBJS = \ |
f754fa9c | 339 | builtin-add.o \ |
f789e347 | 340 | builtin-annotate.o \ |
f754fa9c | 341 | builtin-apply.o \ |
4df096a5 | 342 | builtin-archive.o \ |
acca687f | 343 | builtin-blame.o \ |
c31820c2 | 344 | builtin-branch.o \ |
2e0afafe | 345 | builtin-bundle.o \ |
f754fa9c | 346 | builtin-cat-file.o \ |
d0bfd026 | 347 | builtin-check-attr.o \ |
782c2d65 | 348 | builtin-checkout.o \ |
e414156a | 349 | builtin-checkout-index.o \ |
f754fa9c | 350 | builtin-check-ref-format.o \ |
113f10f2 | 351 | builtin-clean.o \ |
f5bbc322 | 352 | builtin-commit.o \ |
f754fa9c JH |
353 | builtin-commit-tree.o \ |
354 | builtin-count-objects.o \ | |
9a0eaf83 | 355 | builtin-describe.o \ |
f754fa9c JH |
356 | builtin-diff.o \ |
357 | builtin-diff-files.o \ | |
358 | builtin-diff-index.o \ | |
f754fa9c | 359 | builtin-diff-tree.o \ |
f2dc849e | 360 | builtin-fast-export.o \ |
b888d61c | 361 | builtin-fetch.o \ |
2d4177c0 | 362 | builtin-fetch-pack.o \ |
d4289fff | 363 | builtin-fetch--tool.o \ |
f754fa9c | 364 | builtin-fmt-merge-msg.o \ |
9f613ddd | 365 | builtin-for-each-ref.o \ |
b4dfefe0 | 366 | builtin-fsck.o \ |
6757ada4 | 367 | builtin-gc.o \ |
f754fa9c JH |
368 | builtin-grep.o \ |
369 | builtin-init-db.o \ | |
370 | builtin-log.o \ | |
371 | builtin-ls-files.o \ | |
372 | builtin-ls-tree.o \ | |
8951d7c1 | 373 | builtin-ls-remote.o \ |
f754fa9c JH |
374 | builtin-mailinfo.o \ |
375 | builtin-mailsplit.o \ | |
71dfbf22 | 376 | builtin-merge-base.o \ |
ba1f5f35 | 377 | builtin-merge-file.o \ |
a00a42ae | 378 | builtin-merge-ours.o \ |
e1b3a2ca | 379 | builtin-merge-recursive.o \ |
f754fa9c JH |
380 | builtin-mv.o \ |
381 | builtin-name-rev.o \ | |
382 | builtin-pack-objects.o \ | |
383 | builtin-prune.o \ | |
384 | builtin-prune-packed.o \ | |
385 | builtin-push.o \ | |
386 | builtin-read-tree.o \ | |
4264dc15 | 387 | builtin-reflog.o \ |
211c8968 | 388 | builtin-remote.o \ |
96249c04 | 389 | builtin-send-pack.o \ |
e0d10e1c | 390 | builtin-config.o \ |
658f3650 | 391 | builtin-rerere.o \ |
0e5a7faa | 392 | builtin-reset.o \ |
f754fa9c JH |
393 | builtin-rev-list.o \ |
394 | builtin-rev-parse.o \ | |
9509af68 | 395 | builtin-revert.o \ |
f754fa9c | 396 | builtin-rm.o \ |
b8ec5923 | 397 | builtin-shortlog.o \ |
f754fa9c JH |
398 | builtin-show-branch.o \ |
399 | builtin-stripspace.o \ | |
400 | builtin-symbolic-ref.o \ | |
62e09ce9 | 401 | builtin-tag.o \ |
f754fa9c JH |
402 | builtin-tar-tree.o \ |
403 | builtin-unpack-objects.o \ | |
404 | builtin-update-index.o \ | |
405 | builtin-update-ref.o \ | |
39345a21 | 406 | builtin-upload-archive.o \ |
2e3ed670 | 407 | builtin-verify-pack.o \ |
2ae68fcb | 408 | builtin-verify-tag.o \ |
e4fbbfe9 | 409 | builtin-write-tree.o \ |
eaf12a8c | 410 | builtin-show-ref.o \ |
e1e22e37 | 411 | builtin-pack-refs.o |
70827b15 | 412 | |
54c261f9 | 413 | GITLIBS = $(LIB_FILE) $(XDIFF_LIB) |
bef19da9 | 414 | EXTLIBS = |
cef661fc | 415 | |
229a7ed7 JH |
416 | # |
417 | # Platform specific tweaks | |
418 | # | |
f7c15343 JH |
419 | |
420 | # We choose to avoid "if .. else if .. else .. endif endif" | |
421 | # because maintaining the nesting to match is a pain. If | |
422 | # we had "elif" things would have been much nicer... | |
f7c15343 | 423 | |
817151e6 PE |
424 | ifeq ($(uname_S),Linux) |
425 | NO_STRLCPY = YesPlease | |
426 | endif | |
ca7a7416 GP |
427 | ifeq ($(uname_S),GNU/kFreeBSD) |
428 | NO_STRLCPY = YesPlease | |
429 | endif | |
f7c15343 | 430 | ifeq ($(uname_S),Darwin) |
597c9cc5 JH |
431 | NEEDS_SSL_WITH_CRYPTO = YesPlease |
432 | NEEDS_LIBICONV = YesPlease | |
fe4aafba WC |
433 | ifneq ($(shell expr "$(uname_R)" : '9\.'),2) |
434 | OLD_ICONV = UnfortunatelyYes | |
435 | endif | |
817151e6 | 436 | NO_STRLCPY = YesPlease |
3d59405c | 437 | NO_MEMMEM = YesPlease |
597c9cc5 | 438 | endif |
f7c15343 | 439 | ifeq ($(uname_S),SunOS) |
f0ebff0d | 440 | NEEDS_SOCKET = YesPlease |
5a90d4ac | 441 | NEEDS_NSL = YesPlease |
229a7ed7 JH |
442 | SHELL_PATH = /bin/bash |
443 | NO_STRCASESTR = YesPlease | |
b21b9f1d | 444 | NO_MEMMEM = YesPlease |
fa0c87c3 | 445 | NO_HSTRERROR = YesPlease |
4e0da763 | 446 | NO_MKDTEMP = YesPlease |
e40b61fb | 447 | ifeq ($(uname_R),5.8) |
e15f5451 | 448 | NEEDS_LIBICONV = YesPlease |
731043fd | 449 | NO_UNSETENV = YesPlease |
e40b61fb | 450 | NO_SETENV = YesPlease |
66c4509b | 451 | NO_C99_FORMAT = YesPlease |
bc6b4f52 | 452 | NO_STRTOUMAX = YesPlease |
e40b61fb | 453 | endif |
40d88d4f DS |
454 | ifeq ($(uname_R),5.9) |
455 | NO_UNSETENV = YesPlease | |
456 | NO_SETENV = YesPlease | |
66c4509b | 457 | NO_C99_FORMAT = YesPlease |
bc6b4f52 | 458 | NO_STRTOUMAX = YesPlease |
40d88d4f | 459 | endif |
229a7ed7 JH |
460 | INSTALL = ginstall |
461 | TAR = gtar | |
8d7f586f | 462 | BASIC_CFLAGS += -D__EXTENSIONS__ |
f0ebff0d | 463 | endif |
f7c15343 | 464 | ifeq ($(uname_O),Cygwin) |
63be37b0 | 465 | NO_D_TYPE_IN_DIRENT = YesPlease |
35a730f0 | 466 | NO_D_INO_IN_DIRENT = YesPlease |
17754517 | 467 | NO_STRCASESTR = YesPlease |
b21b9f1d | 468 | NO_MEMMEM = YesPlease |
9f0bb90d | 469 | NO_SYMLINK_HEAD = YesPlease |
17754517 | 470 | NEEDS_LIBICONV = YesPlease |
1510fea7 | 471 | NO_FAST_WORKING_DIRECTORY = UnfortunatelyYes |
c869753e | 472 | NO_TRUSTABLE_FILEMODE = UnfortunatelyYes |
7a4a2e1f | 473 | OLD_ICONV = UnfortunatelyYes |
2e67a5f4 JH |
474 | # There are conflicting reports about this. |
475 | # On some boxes NO_MMAP is needed, and not so elsewhere. | |
87ac1390 JH |
476 | # Try commenting this out if you suspect MMAP is more efficient |
477 | NO_MMAP = YesPlease | |
49744d63 | 478 | NO_IPV6 = YesPlease |
a23cd8ec | 479 | X = .exe |
7c6ef2f2 | 480 | endif |
b3bf974c AK |
481 | ifeq ($(uname_S),FreeBSD) |
482 | NEEDS_LIBICONV = YesPlease | |
a2f22dbf | 483 | NO_MEMMEM = YesPlease |
8d7f586f PB |
484 | BASIC_CFLAGS += -I/usr/local/include |
485 | BASIC_LDFLAGS += -L/usr/local/lib | |
81a24b52 | 486 | DIR_HAS_BSD_GROUP_SEMANTICS = YesPlease |
b3bf974c | 487 | endif |
f7c15343 | 488 | ifeq ($(uname_S),OpenBSD) |
5fb41e8a | 489 | NO_STRCASESTR = YesPlease |
b21b9f1d | 490 | NO_MEMMEM = YesPlease |
18c5a525 | 491 | NEEDS_LIBICONV = YesPlease |
8d7f586f PB |
492 | BASIC_CFLAGS += -I/usr/local/include |
493 | BASIC_LDFLAGS += -L/usr/local/lib | |
94d23317 JH |
494 | endif |
495 | ifeq ($(uname_S),NetBSD) | |
e88856b4 DS |
496 | ifeq ($(shell expr "$(uname_R)" : '[01]\.'),2) |
497 | NEEDS_LIBICONV = YesPlease | |
498 | endif | |
8d7f586f PB |
499 | BASIC_CFLAGS += -I/usr/pkg/include |
500 | BASIC_LDFLAGS += -L/usr/pkg/lib | |
501 | ALL_LDFLAGS += -Wl,-rpath,/usr/pkg/lib | |
18c5a525 | 502 | endif |
a6da9395 JR |
503 | ifeq ($(uname_S),AIX) |
504 | NO_STRCASESTR=YesPlease | |
b21b9f1d | 505 | NO_MEMMEM = YesPlease |
817151e6 | 506 | NO_STRLCPY = YesPlease |
a6da9395 JR |
507 | NEEDS_LIBICONV=YesPlease |
508 | endif | |
c29ba0c3 TS |
509 | ifeq ($(uname_S),GNU) |
510 | # GNU/Hurd | |
511 | NO_STRLCPY=YesPlease | |
512 | endif | |
289c4b36 JS |
513 | ifeq ($(uname_S),IRIX64) |
514 | NO_IPV6=YesPlease | |
515 | NO_SETENV=YesPlease | |
516 | NO_STRCASESTR=YesPlease | |
b21b9f1d | 517 | NO_MEMMEM = YesPlease |
817151e6 | 518 | NO_STRLCPY = YesPlease |
289c4b36 JS |
519 | NO_SOCKADDR_STORAGE=YesPlease |
520 | SHELL_PATH=/usr/gnu/bin/bash | |
8d7f586f | 521 | BASIC_CFLAGS += -DPATH_MAX=1024 |
289c4b36 | 522 | # for now, build 32-bit version |
8d7f586f | 523 | BASIC_LDFLAGS += -L/usr/lib32 |
289c4b36 | 524 | endif |
81cc66a5 RS |
525 | ifeq ($(uname_S),HP-UX) |
526 | NO_IPV6=YesPlease | |
527 | NO_SETENV=YesPlease | |
528 | NO_STRCASESTR=YesPlease | |
529 | NO_MEMMEM = YesPlease | |
530 | NO_STRLCPY = YesPlease | |
531 | NO_MKDTEMP = YesPlease | |
532 | NO_UNSETENV = YesPlease | |
533 | NO_HSTRERROR = YesPlease | |
534 | NO_SYS_SELECT_H = YesPlease | |
535 | endif | |
f7c15343 JH |
536 | ifneq (,$(findstring arm,$(uname_M))) |
537 | ARM_SHA1 = YesPlease | |
538 | endif | |
597c9cc5 | 539 | |
55667714 | 540 | -include config.mak.autogen |
f2d6a256 | 541 | -include config.mak |
597c9cc5 | 542 | |
59f86740 BG |
543 | ifeq ($(uname_S),Darwin) |
544 | ifndef NO_FINK | |
545 | ifeq ($(shell test -d /sw/lib && echo y),y) | |
546 | BASIC_CFLAGS += -I/sw/include | |
547 | BASIC_LDFLAGS += -L/sw/lib | |
548 | endif | |
549 | endif | |
550 | ifndef NO_DARWIN_PORTS | |
551 | ifeq ($(shell test -d /opt/local/lib && echo y),y) | |
552 | BASIC_CFLAGS += -I/opt/local/include | |
553 | BASIC_LDFLAGS += -L/opt/local/lib | |
554 | endif | |
555 | endif | |
556 | endif | |
557 | ||
bbfc63dd JH |
558 | ifdef NO_R_TO_GCC_LINKER |
559 | # Some gcc does not accept and pass -R to the linker to specify | |
560 | # the runtime dynamic library path. | |
561 | CC_LD_DYNPATH = -Wl,-rpath= | |
562 | else | |
563 | CC_LD_DYNPATH = -R | |
564 | endif | |
565 | ||
30ae764b DB |
566 | ifdef NO_CURL |
567 | BASIC_CFLAGS += -DNO_CURL | |
568 | else | |
229a7ed7 | 569 | ifdef CURLDIR |
10861bea | 570 | # Try "-Wl,-rpath=$(CURLDIR)/$(lib)" in such a case. |
8d7f586f | 571 | BASIC_CFLAGS += -I$(CURLDIR)/include |
10861bea | 572 | CURL_LIBCURL = -L$(CURLDIR)/$(lib) $(CC_LD_DYNPATH)$(CURLDIR)/$(lib) -lcurl |
229a7ed7 JH |
573 | else |
574 | CURL_LIBCURL = -lcurl | |
575 | endif | |
30ae764b DB |
576 | BUILTIN_OBJS += builtin-http-fetch.o |
577 | EXTLIBS += $(CURL_LIBCURL) | |
ccfc02a3 | 578 | LIB_OBJS += http.o http-walker.o |
08900987 NH |
579 | curl_check := $(shell (echo 070908; curl-config --vernum) | sort -r | sed -ne 2p) |
580 | ifeq "$(curl_check)" "070908" | |
581 | ifndef NO_EXPAT | |
08900987 NH |
582 | PROGRAMS += git-http-push$X |
583 | endif | |
58e60dd2 | 584 | endif |
459a21bd JS |
585 | ifndef NO_EXPAT |
586 | EXPAT_LIBEXPAT = -lexpat | |
587 | endif | |
229a7ed7 JH |
588 | endif |
589 | ||
bef19da9 RS |
590 | ifdef ZLIB_PATH |
591 | BASIC_CFLAGS += -I$(ZLIB_PATH)/include | |
10861bea | 592 | EXTLIBS += -L$(ZLIB_PATH)/$(lib) $(CC_LD_DYNPATH)$(ZLIB_PATH)/$(lib) |
bef19da9 RS |
593 | endif |
594 | EXTLIBS += -lz | |
595 | ||
dd53c7ab | 596 | ifndef NO_OPENSSL |
215a7ad1 | 597 | OPENSSL_LIBSSL = -lssl |
455a7f32 | 598 | ifdef OPENSSLDIR |
8d7f586f | 599 | BASIC_CFLAGS += -I$(OPENSSLDIR)/include |
10861bea | 600 | OPENSSL_LINK = -L$(OPENSSLDIR)/$(lib) $(CC_LD_DYNPATH)$(OPENSSLDIR)/$(lib) |
455a7f32 JH |
601 | else |
602 | OPENSSL_LINK = | |
603 | endif | |
dd53c7ab | 604 | else |
8d7f586f | 605 | BASIC_CFLAGS += -DNO_OPENSSL |
215a7ad1 JH |
606 | MOZILLA_SHA1 = 1 |
607 | OPENSSL_LIBSSL = | |
dd53c7ab | 608 | endif |
597c9cc5 | 609 | ifdef NEEDS_SSL_WITH_CRYPTO |
455a7f32 | 610 | LIB_4_CRYPTO = $(OPENSSL_LINK) -lcrypto -lssl |
597c9cc5 | 611 | else |
455a7f32 | 612 | LIB_4_CRYPTO = $(OPENSSL_LINK) -lcrypto |
597c9cc5 JH |
613 | endif |
614 | ifdef NEEDS_LIBICONV | |
455a7f32 | 615 | ifdef ICONVDIR |
8d7f586f | 616 | BASIC_CFLAGS += -I$(ICONVDIR)/include |
10861bea | 617 | ICONV_LINK = -L$(ICONVDIR)/$(lib) $(CC_LD_DYNPATH)$(ICONVDIR)/$(lib) |
455a7f32 JH |
618 | else |
619 | ICONV_LINK = | |
620 | endif | |
d595a473 | 621 | EXTLIBS += $(ICONV_LINK) -liconv |
597c9cc5 | 622 | endif |
f0ebff0d | 623 | ifdef NEEDS_SOCKET |
d595a473 | 624 | EXTLIBS += -lsocket |
f0ebff0d | 625 | endif |
5a90d4ac | 626 | ifdef NEEDS_NSL |
d595a473 | 627 | EXTLIBS += -lnsl |
5a90d4ac | 628 | endif |
63be37b0 | 629 | ifdef NO_D_TYPE_IN_DIRENT |
8d7f586f | 630 | BASIC_CFLAGS += -DNO_D_TYPE_IN_DIRENT |
63be37b0 | 631 | endif |
35a730f0 | 632 | ifdef NO_D_INO_IN_DIRENT |
8d7f586f | 633 | BASIC_CFLAGS += -DNO_D_INO_IN_DIRENT |
35a730f0 | 634 | endif |
579d1fbf | 635 | ifdef NO_C99_FORMAT |
8188e73b | 636 | BASIC_CFLAGS += -DNO_C99_FORMAT |
579d1fbf | 637 | endif |
c4582f93 MR |
638 | ifdef SNPRINTF_RETURNS_BOGUS |
639 | COMPAT_CFLAGS += -DSNPRINTF_RETURNS_BOGUS | |
640 | COMPAT_OBJS += compat/snprintf.o | |
641 | endif | |
cba22528 BC |
642 | ifdef FREAD_READS_DIRECTORIES |
643 | COMPAT_CFLAGS += -DFREAD_READS_DIRECTORIES | |
644 | COMPAT_OBJS += compat/fopen.o | |
645 | endif | |
9f0bb90d | 646 | ifdef NO_SYMLINK_HEAD |
8d7f586f | 647 | BASIC_CFLAGS += -DNO_SYMLINK_HEAD |
9f0bb90d | 648 | endif |
ef34af24 | 649 | ifdef NO_STRCASESTR |
4050c0df | 650 | COMPAT_CFLAGS += -DNO_STRCASESTR |
e40b61fb JR |
651 | COMPAT_OBJS += compat/strcasestr.o |
652 | endif | |
817151e6 PE |
653 | ifdef NO_STRLCPY |
654 | COMPAT_CFLAGS += -DNO_STRLCPY | |
655 | COMPAT_OBJS += compat/strlcpy.o | |
656 | endif | |
bc6b4f52 JR |
657 | ifdef NO_STRTOUMAX |
658 | COMPAT_CFLAGS += -DNO_STRTOUMAX | |
659 | COMPAT_OBJS += compat/strtoumax.o | |
660 | endif | |
661 | ifdef NO_STRTOULL | |
662 | COMPAT_CFLAGS += -DNO_STRTOULL | |
663 | endif | |
e40b61fb | 664 | ifdef NO_SETENV |
4050c0df | 665 | COMPAT_CFLAGS += -DNO_SETENV |
e40b61fb | 666 | COMPAT_OBJS += compat/setenv.o |
ef34af24 | 667 | endif |
ca5bb5d5 SP |
668 | ifdef NO_MKDTEMP |
669 | COMPAT_CFLAGS += -DNO_MKDTEMP | |
670 | COMPAT_OBJS += compat/mkdtemp.o | |
671 | endif | |
104ff34a | 672 | ifdef NO_UNSETENV |
731043fd JR |
673 | COMPAT_CFLAGS += -DNO_UNSETENV |
674 | COMPAT_OBJS += compat/unsetenv.o | |
675 | endif | |
2600973f RS |
676 | ifdef NO_SYS_SELECT_H |
677 | BASIC_CFLAGS += -DNO_SYS_SELECT_H | |
678 | endif | |
730d48a2 | 679 | ifdef NO_MMAP |
4050c0df | 680 | COMPAT_CFLAGS += -DNO_MMAP |
e40b61fb | 681 | COMPAT_OBJS += compat/mmap.o |
730d48a2 | 682 | endif |
6900679c SH |
683 | ifdef NO_PREAD |
684 | COMPAT_CFLAGS += -DNO_PREAD | |
685 | COMPAT_OBJS += compat/pread.o | |
686 | endif | |
1510fea7 SP |
687 | ifdef NO_FAST_WORKING_DIRECTORY |
688 | BASIC_CFLAGS += -DNO_FAST_WORKING_DIRECTORY | |
689 | endif | |
c869753e SP |
690 | ifdef NO_TRUSTABLE_FILEMODE |
691 | BASIC_CFLAGS += -DNO_TRUSTABLE_FILEMODE | |
692 | endif | |
49744d63 | 693 | ifdef NO_IPV6 |
8d7f586f | 694 | BASIC_CFLAGS += -DNO_IPV6 |
bdc37f5a JH |
695 | endif |
696 | ifdef NO_SOCKADDR_STORAGE | |
697 | ifdef NO_IPV6 | |
8d7f586f | 698 | BASIC_CFLAGS += -Dsockaddr_storage=sockaddr_in |
bdc37f5a | 699 | else |
8d7f586f | 700 | BASIC_CFLAGS += -Dsockaddr_storage=sockaddr_in6 |
bdc37f5a | 701 | endif |
49744d63 | 702 | endif |
6ba68ab2 YL |
703 | ifdef NO_INET_NTOP |
704 | LIB_OBJS += compat/inet_ntop.o | |
705 | endif | |
dd467629 JL |
706 | ifdef NO_INET_PTON |
707 | LIB_OBJS += compat/inet_pton.o | |
708 | endif | |
cef661fc | 709 | |
b6e56eca | 710 | ifdef NO_ICONV |
8d7f586f | 711 | BASIC_CFLAGS += -DNO_ICONV |
b6e56eca FP |
712 | endif |
713 | ||
fd547a97 RJ |
714 | ifdef OLD_ICONV |
715 | BASIC_CFLAGS += -DOLD_ICONV | |
716 | endif | |
717 | ||
609a2289 DS |
718 | ifdef NO_DEFLATE_BOUND |
719 | BASIC_CFLAGS += -DNO_DEFLATE_BOUND | |
720 | endif | |
721 | ||
7c6ef2f2 NP |
722 | ifdef PPC_SHA1 |
723 | SHA1_HEADER = "ppc/sha1.h" | |
724 | LIB_OBJS += ppc/sha1.o ppc/sha1ppc.o | |
725 | else | |
726 | ifdef ARM_SHA1 | |
727 | SHA1_HEADER = "arm/sha1.h" | |
728 | LIB_OBJS += arm/sha1.o arm/sha1_arm.o | |
729 | else | |
730 | ifdef MOZILLA_SHA1 | |
731 | SHA1_HEADER = "mozilla-sha1/sha1.h" | |
732 | LIB_OBJS += mozilla-sha1/sha1.o | |
733 | else | |
734 | SHA1_HEADER = <openssl/sha.h> | |
d595a473 | 735 | EXTLIBS += $(LIB_4_CRYPTO) |
7c6ef2f2 NP |
736 | endif |
737 | endif | |
738 | endif | |
f848718a AR |
739 | ifdef NO_PERL_MAKEMAKER |
740 | export NO_PERL_MAKEMAKER | |
741 | endif | |
fa0c87c3 AR |
742 | ifdef NO_HSTRERROR |
743 | COMPAT_CFLAGS += -DNO_HSTRERROR | |
744 | COMPAT_OBJS += compat/hstrerror.o | |
745 | endif | |
b21b9f1d RS |
746 | ifdef NO_MEMMEM |
747 | COMPAT_CFLAGS += -DNO_MEMMEM | |
748 | COMPAT_OBJS += compat/memmem.o | |
749 | endif | |
43fe901b BD |
750 | ifdef INTERNAL_QSORT |
751 | COMPAT_CFLAGS += -DINTERNAL_QSORT | |
752 | COMPAT_OBJS += compat/qsort.o | |
753 | endif | |
b7774343 | 754 | |
8ecce684 NP |
755 | ifdef THREADED_DELTA_SEARCH |
756 | BASIC_CFLAGS += -DTHREADED_DELTA_SEARCH | |
757 | EXTLIBS += -lpthread | |
833e3df1 | 758 | LIB_OBJS += thread-utils.o |
8ecce684 | 759 | endif |
81a24b52 AR |
760 | ifdef DIR_HAS_BSD_GROUP_SEMANTICS |
761 | COMPAT_CFLAGS += -DDIR_HAS_BSD_GROUP_SEMANTICS | |
762 | endif | |
8ecce684 | 763 | |
81b63c70 ER |
764 | ifeq ($(TCLTK_PATH),) |
765 | NO_TCLTK=NoThanks | |
766 | endif | |
767 | ||
3b486cd2 | 768 | QUIET_SUBDIR0 = +$(MAKE) -C # space to separate -C and subdir |
b7774343 AR |
769 | QUIET_SUBDIR1 = |
770 | ||
a6f37099 AR |
771 | ifneq ($(findstring $(MAKEFLAGS),w),w) |
772 | PRINT_DIR = --no-print-directory | |
773 | else # "make -w" | |
774 | NO_SUBDIR = : | |
775 | endif | |
776 | ||
b7774343 | 777 | ifneq ($(findstring $(MAKEFLAGS),s),s) |
2314c947 | 778 | ifndef V |
31d0399c | 779 | QUIET_CC = @echo ' ' CC $@; |
74f2b2a8 SP |
780 | QUIET_AR = @echo ' ' AR $@; |
781 | QUIET_LINK = @echo ' ' LINK $@; | |
782 | QUIET_BUILT_IN = @echo ' ' BUILTIN $@; | |
783 | QUIET_GEN = @echo ' ' GEN $@; | |
3b486cd2 | 784 | QUIET_SUBDIR0 = +@subdir= |
a6f37099 AR |
785 | QUIET_SUBDIR1 = ;$(NO_SUBDIR) echo ' ' SUBDIR $$subdir; \ |
786 | $(MAKE) $(PRINT_DIR) -C $$subdir | |
2314c947 | 787 | export V |
31d0399c | 788 | export QUIET_GEN |
b7774343 AR |
789 | export QUIET_BUILT_IN |
790 | endif | |
74f2b2a8 | 791 | endif |
7c6ef2f2 | 792 | |
4c7100a9 JH |
793 | ifdef ASCIIDOC8 |
794 | export ASCIIDOC8 | |
795 | endif | |
796 | ||
addf88e4 | 797 | # Shell quote (do not use $(call) to accommodate ancient setups); |
39c015c5 JS |
798 | |
799 | SHA1_HEADER_SQ = $(subst ','\'',$(SHA1_HEADER)) | |
32043c9f | 800 | ETC_GITCONFIG_SQ = $(subst ','\'',$(ETC_GITCONFIG)) |
39c015c5 JS |
801 | |
802 | DESTDIR_SQ = $(subst ','\'',$(DESTDIR)) | |
803 | bindir_SQ = $(subst ','\'',$(bindir)) | |
8e566f24 | 804 | mandir_SQ = $(subst ','\'',$(mandir)) |
a149a1a4 | 805 | infodir_SQ = $(subst ','\'',$(infodir)) |
39c015c5 JS |
806 | gitexecdir_SQ = $(subst ','\'',$(gitexecdir)) |
807 | template_dir_SQ = $(subst ','\'',$(template_dir)) | |
5d6491c7 | 808 | htmldir_SQ = $(subst ','\'',$(htmldir)) |
ca3bcabf | 809 | prefix_SQ = $(subst ','\'',$(prefix)) |
39c015c5 JS |
810 | |
811 | SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH)) | |
812 | PERL_PATH_SQ = $(subst ','\'',$(PERL_PATH)) | |
81b63c70 | 813 | TCLTK_PATH_SQ = $(subst ','\'',$(TCLTK_PATH)) |
39c015c5 | 814 | |
d595a473 PB |
815 | LIBS = $(GITLIBS) $(EXTLIBS) |
816 | ||
32043c9f | 817 | BASIC_CFLAGS += -DSHA1_HEADER='$(SHA1_HEADER_SQ)' \ |
506b17b1 | 818 | $(COMPAT_CFLAGS) |
e40b61fb | 819 | LIB_OBJS += $(COMPAT_OBJS) |
8d7f586f PB |
820 | |
821 | ALL_CFLAGS += $(BASIC_CFLAGS) | |
822 | ALL_LDFLAGS += $(BASIC_LDFLAGS) | |
823 | ||
a42cbacc | 824 | export TAR INSTALL DESTDIR SHELL_PATH |
d595a473 PB |
825 | |
826 | ||
28818ffa PB |
827 | ### Build rules |
828 | ||
7cf7f54a | 829 | all:: $(ALL_PROGRAMS) $(BUILT_INS) $(OTHER_PROGRAMS) GIT-BUILD-OPTIONS |
6fc301bb | 830 | ifneq (,$X) |
4cb08df5 | 831 | $(foreach p,$(patsubst %$X,%,$(filter %$X,$(ALL_PROGRAMS) $(BUILT_INS) git$X)), $(RM) '$p';) |
6fc301bb | 832 | endif |
89967023 | 833 | |
6fc301bb | 834 | all:: |
3cfaf11b | 835 | ifndef NO_TCLTK |
5f5dbd71 | 836 | $(QUIET_SUBDIR0)git-gui $(QUIET_SUBDIR1) all |
62ba5143 | 837 | $(QUIET_SUBDIR0)gitk-git $(QUIET_SUBDIR1) all |
3cfaf11b | 838 | endif |
74f2b2a8 SP |
839 | $(QUIET_SUBDIR0)perl $(QUIET_SUBDIR1) PERL_PATH='$(PERL_PATH_SQ)' prefix='$(prefix_SQ)' all |
840 | $(QUIET_SUBDIR0)templates $(QUIET_SUBDIR1) | |
b05701c5 | 841 | |
4dc00021 JH |
842 | strip: $(PROGRAMS) git$X |
843 | $(STRIP) $(STRIP_OPTS) $(PROGRAMS) git$X | |
844 | ||
334d28ae JH |
845 | git.o: git.c common-cmds.h GIT-CFLAGS |
846 | $(QUIET_CC)$(CC) -DGIT_VERSION='"$(GIT_VERSION)"' \ | |
847 | $(ALL_CFLAGS) -c $(filter %.c,$^) | |
848 | ||
849 | git$X: git.o $(BUILTIN_OBJS) $(GITLIBS) | |
54dadbdb | 850 | $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ git.o \ |
70827b15 | 851 | $(BUILTIN_OBJS) $(ALL_LDFLAGS) $(LIBS) |
6a2e50f9 | 852 | |
8e566f24 | 853 | help.o: help.c common-cmds.h GIT-CFLAGS |
a149a1a4 | 854 | $(QUIET_CC)$(CC) -o $*.o -c $(ALL_CFLAGS) \ |
482cce82 | 855 | '-DGIT_HTML_PATH="$(htmldir_SQ)"' \ |
a149a1a4 JH |
856 | '-DGIT_MAN_PATH="$(mandir_SQ)"' \ |
857 | '-DGIT_INFO_PATH="$(infodir_SQ)"' $< | |
08df6171 | 858 | |
91730800 | 859 | $(BUILT_INS): git$X |
4cb08df5 | 860 | $(QUIET_BUILT_IN)$(RM) $@ && ln git$X $@ |
91730800 | 861 | |
79d30668 | 862 | common-cmds.h: ./generate-cmdlist.sh command-list.txt |
48dd1da8 | 863 | |
766b084f | 864 | common-cmds.h: $(wildcard Documentation/git-*.txt) |
74f2b2a8 | 865 | $(QUIET_GEN)./generate-cmdlist.sh > $@+ && mv $@+ $@ |
a87cd02c | 866 | |
d6ebd259 | 867 | $(patsubst %.sh,%,$(SCRIPT_SH)) : % : %.sh |
4cb08df5 | 868 | $(QUIET_GEN)$(RM) $@ $@+ && \ |
39c015c5 | 869 | sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \ |
d9bffc08 | 870 | -e 's|@@PERL@@|$(PERL_PATH_SQ)|g' \ |
3ff8cbed | 871 | -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \ |
6c5c62f3 | 872 | -e 's/@@NO_CURL@@/$(NO_CURL)/g' \ |
74f2b2a8 SP |
873 | $@.sh >$@+ && \ |
874 | chmod +x $@+ && \ | |
fc36f6a6 | 875 | mv $@+ $@ |
bc6146d2 | 876 | |
f848718a AR |
877 | $(patsubst %.perl,%,$(SCRIPT_PERL)): perl/perl.mak |
878 | ||
d1a20575 | 879 | perl/perl.mak: GIT-CFLAGS perl/Makefile perl/Makefile.PL |
31d0399c | 880 | $(QUIET_SUBDIR0)perl $(QUIET_SUBDIR1) PERL_PATH='$(PERL_PATH_SQ)' prefix='$(prefix_SQ)' $(@F) |
f848718a | 881 | |
f6276fe1 | 882 | $(patsubst %.perl,%,$(SCRIPT_PERL)): % : %.perl |
4cb08df5 | 883 | $(QUIET_GEN)$(RM) $@ $@+ && \ |
e883932f | 884 | INSTLIBDIR=`MAKEFLAGS= $(MAKE) -C perl -s --no-print-directory instlibdir` && \ |
998c4daa JH |
885 | sed -e '1{' \ |
886 | -e ' s|#!.*perl|#!$(PERL_PATH_SQ)|' \ | |
887 | -e ' h' \ | |
888 | -e ' s=.*=use lib (split(/:/, $$ENV{GITPERLLIB} || "@@INSTLIBDIR@@"));=' \ | |
889 | -e ' H' \ | |
890 | -e ' x' \ | |
891 | -e '}' \ | |
f6276fe1 | 892 | -e 's|@@INSTLIBDIR@@|'"$$INSTLIBDIR"'|g' \ |
3ff8cbed | 893 | -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \ |
74f2b2a8 SP |
894 | $@.perl >$@+ && \ |
895 | chmod +x $@+ && \ | |
fc36f6a6 | 896 | mv $@+ $@ |
bc6146d2 | 897 | |
5d043a3d | 898 | gitweb/gitweb.cgi: gitweb/gitweb.perl |
4cb08df5 | 899 | $(QUIET_GEN)$(RM) $@ $@+ && \ |
5d043a3d | 900 | sed -e '1s|#!.*perl|#!$(PERL_PATH_SQ)|' \ |
06c084d2 JH |
901 | -e 's|++GIT_VERSION++|$(GIT_VERSION)|g' \ |
902 | -e 's|++GIT_BINDIR++|$(bindir)|g' \ | |
903 | -e 's|++GITWEB_CONFIG++|$(GITWEB_CONFIG)|g' \ | |
2de21fac | 904 | -e 's|++GITWEB_HOME_LINK_STR++|$(GITWEB_HOME_LINK_STR)|g' \ |
06c084d2 JH |
905 | -e 's|++GITWEB_SITENAME++|$(GITWEB_SITENAME)|g' \ |
906 | -e 's|++GITWEB_PROJECTROOT++|$(GITWEB_PROJECTROOT)|g' \ | |
ca5e9495 | 907 | -e 's|"++GITWEB_PROJECT_MAXDEPTH++"|$(GITWEB_PROJECT_MAXDEPTH)|g' \ |
32f4aacc ML |
908 | -e 's|++GITWEB_EXPORT_OK++|$(GITWEB_EXPORT_OK)|g' \ |
909 | -e 's|++GITWEB_STRICT_EXPORT++|$(GITWEB_STRICT_EXPORT)|g' \ | |
19a8721e | 910 | -e 's|++GITWEB_BASE_URL++|$(GITWEB_BASE_URL)|g' \ |
06c084d2 JH |
911 | -e 's|++GITWEB_LIST++|$(GITWEB_LIST)|g' \ |
912 | -e 's|++GITWEB_HOMETEXT++|$(GITWEB_HOMETEXT)|g' \ | |
913 | -e 's|++GITWEB_CSS++|$(GITWEB_CSS)|g' \ | |
914 | -e 's|++GITWEB_LOGO++|$(GITWEB_LOGO)|g' \ | |
0b5deba1 | 915 | -e 's|++GITWEB_FAVICON++|$(GITWEB_FAVICON)|g' \ |
b2d3476e AC |
916 | -e 's|++GITWEB_SITE_HEADER++|$(GITWEB_SITE_HEADER)|g' \ |
917 | -e 's|++GITWEB_SITE_FOOTER++|$(GITWEB_SITE_FOOTER)|g' \ | |
74f2b2a8 SP |
918 | $< >$@+ && \ |
919 | chmod +x $@+ && \ | |
5d043a3d MW |
920 | mv $@+ $@ |
921 | ||
a51d37c1 | 922 | git-instaweb: git-instaweb.sh gitweb/gitweb.cgi gitweb/gitweb.css |
4cb08df5 | 923 | $(QUIET_GEN)$(RM) $@ $@+ && \ |
a51d37c1 EW |
924 | sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \ |
925 | -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \ | |
926 | -e 's/@@NO_CURL@@/$(NO_CURL)/g' \ | |
6e959ab0 | 927 | -e '/@@GITWEB_CGI@@/r gitweb/gitweb.cgi' \ |
07002287 | 928 | -e '/@@GITWEB_CGI@@/d' \ |
6e959ab0 | 929 | -e '/@@GITWEB_CSS@@/r gitweb/gitweb.css' \ |
07002287 | 930 | -e '/@@GITWEB_CSS@@/d' \ |
c5699693 | 931 | -e 's|@@PERL@@|$(PERL_PATH_SQ)|g' \ |
74f2b2a8 SP |
932 | $@.sh > $@+ && \ |
933 | chmod +x $@+ && \ | |
a51d37c1 EW |
934 | mv $@+ $@ |
935 | ||
3900145e | 936 | configure: configure.ac |
4cb08df5 | 937 | $(QUIET_GEN)$(RM) $@ $<+ && \ |
3900145e | 938 | sed -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \ |
74f2b2a8 SP |
939 | $< > $<+ && \ |
940 | autoconf -o $@ $<+ && \ | |
4cb08df5 | 941 | $(RM) $<+ |
3900145e | 942 | |
9b88fcef | 943 | # These can record GIT_VERSION |
54dadbdb | 944 | git.o git.spec \ |
9b88fcef JH |
945 | $(patsubst %.sh,%,$(SCRIPT_SH)) \ |
946 | $(patsubst %.perl,%,$(SCRIPT_PERL)) \ | |
9b88fcef | 947 | : GIT-VERSION-FILE |
e99fcf96 | 948 | |
ca3bcabf | 949 | %.o: %.c GIT-CFLAGS |
74f2b2a8 | 950 | $(QUIET_CC)$(CC) -o $*.o -c $(ALL_CFLAGS) $< |
e36cb1c1 LT |
951 | %.s: %.c GIT-CFLAGS |
952 | $(QUIET_CC)$(CC) -S $(ALL_CFLAGS) $< | |
b05701c5 | 953 | %.o: %.S |
74f2b2a8 | 954 | $(QUIET_CC)$(CC) -o $*.o -c $(ALL_CFLAGS) $< |
a310d434 | 955 | |
ca3bcabf | 956 | exec_cmd.o: exec_cmd.c GIT-CFLAGS |
74f2b2a8 | 957 | $(QUIET_CC)$(CC) -o $*.o -c $(ALL_CFLAGS) '-DGIT_EXEC_PATH="$(gitexecdir_SQ)"' $< |
c1f8064b | 958 | builtin-init-db.o: builtin-init-db.c GIT-CFLAGS |
74f2b2a8 | 959 | $(QUIET_CC)$(CC) -o $*.o -c $(ALL_CFLAGS) -DDEFAULT_GIT_TEMPLATE_DIR='"$(template_dir_SQ)"' $< |
77cb17e9 | 960 | |
506b17b1 JS |
961 | config.o: config.c GIT-CFLAGS |
962 | $(QUIET_CC)$(CC) -o $*.o -c $(ALL_CFLAGS) -DETC_GITCONFIG='"$(ETC_GITCONFIG_SQ)"' $< | |
963 | ||
ca3bcabf | 964 | http.o: http.c GIT-CFLAGS |
74f2b2a8 | 965 | $(QUIET_CC)$(CC) -o $*.o -c $(ALL_CFLAGS) -DGIT_USER_AGENT='"git/$(GIT_VERSION)"' $< |
20fc9bc5 | 966 | |
8d9fbe57 | 967 | ifdef NO_EXPAT |
30ae764b | 968 | http-walker.o: http-walker.c http.h GIT-CFLAGS |
74f2b2a8 | 969 | $(QUIET_CC)$(CC) -o $*.o -c $(ALL_CFLAGS) -DNO_EXPAT $< |
8d9fbe57 NH |
970 | endif |
971 | ||
8eef8e09 | 972 | git-%$X: %.o $(GITLIBS) |
74f2b2a8 | 973 | $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS) |
623c8a14 | 974 | |
f2561fda MM |
975 | git-imap-send$X: imap-send.o $(LIB_FILE) |
976 | ||
923e3ec8 | 977 | http.o http-walker.o http-push.o transport.o: http.h |
39c015c5 | 978 | |
8fced61c | 979 | git-http-push$X: revision.o http.o http-push.o $(GITLIBS) |
74f2b2a8 | 980 | $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \ |
39c015c5 JS |
981 | $(LIBS) $(CURL_LIBCURL) $(EXPAT_LIBEXPAT) |
982 | ||
ccfc02a3 | 983 | $(LIB_OBJS) $(BUILTIN_OBJS): $(LIB_H) |
1f330269 | 984 | $(patsubst git-%$X,%.o,$(PROGRAMS)): $(LIB_H) $(wildcard */*.h) |
fa470160 | 985 | builtin-revert.o wt-status.o: wt-status.h |
e83c5163 | 986 | |
28818ffa | 987 | $(LIB_FILE): $(LIB_OBJS) |
4cb08df5 | 988 | $(QUIET_AR)$(RM) $@ && $(AR) rcs $@ $(LIB_OBJS) |
28818ffa | 989 | |
857b933e JS |
990 | XDIFF_OBJS=xdiff/xdiffi.o xdiff/xprepare.o xdiff/xutils.o xdiff/xemit.o \ |
991 | xdiff/xmerge.o | |
17b96be2 AW |
992 | $(XDIFF_OBJS): xdiff/xinclude.h xdiff/xmacros.h xdiff/xdiff.h xdiff/xtypes.h \ |
993 | xdiff/xutils.h xdiff/xprepare.h xdiff/xdiffi.h xdiff/xemit.h | |
3443546f LT |
994 | |
995 | $(XDIFF_LIB): $(XDIFF_OBJS) | |
4cb08df5 | 996 | $(QUIET_AR)$(RM) $@ && $(AR) rcs $@ $(XDIFF_OBJS) |
3443546f LT |
997 | |
998 | ||
28818ffa PB |
999 | doc: |
1000 | $(MAKE) -C Documentation all | |
1001 | ||
4739809c DK |
1002 | info: |
1003 | $(MAKE) -C Documentation info | |
1004 | ||
f81e7c62 | 1005 | TAGS: |
4cb08df5 | 1006 | $(RM) TAGS |
89b2f19c | 1007 | $(FIND) . -name '*.[hcS]' -print | xargs etags -a |
f81e7c62 FK |
1008 | |
1009 | tags: | |
4cb08df5 | 1010 | $(RM) tags |
89b2f19c | 1011 | $(FIND) . -name '*.[hcS]' -print | xargs ctags -a |
28818ffa | 1012 | |
a2a9150b KP |
1013 | cscope: |
1014 | $(RM) cscope* | |
1015 | $(FIND) . -name '*.[hcS]' -print | xargs cscope -b | |
1016 | ||
ca3bcabf | 1017 | ### Detect prefix changes |
7cdbff14 | 1018 | TRACK_CFLAGS = $(subst ','\'',$(ALL_CFLAGS)):\ |
ca3bcabf YL |
1019 | $(bindir_SQ):$(gitexecdir_SQ):$(template_dir_SQ):$(prefix_SQ) |
1020 | ||
1021 | GIT-CFLAGS: .FORCE-GIT-CFLAGS | |
1022 | @FLAGS='$(TRACK_CFLAGS)'; \ | |
1023 | if test x"$$FLAGS" != x"`cat GIT-CFLAGS 2>/dev/null`" ; then \ | |
1024 | echo 1>&2 " * new build flags or prefix"; \ | |
1025 | echo "$$FLAGS" >GIT-CFLAGS; \ | |
1026 | fi | |
1027 | ||
7cf7f54a JK |
1028 | GIT-BUILD-OPTIONS: .FORCE-GIT-BUILD-OPTIONS |
1029 | @echo SHELL_PATH=\''$(SHELL_PATH_SQ)'\' >$@ | |
1030 | ||
6bdb18a9 ER |
1031 | ### Detect Tck/Tk interpreter path changes |
1032 | ifndef NO_TCLTK | |
1033 | TRACK_VARS = $(subst ','\'',-DTCLTK_PATH='$(TCLTK_PATH_SQ)') | |
1034 | ||
1035 | GIT-GUI-VARS: .FORCE-GIT-GUI-VARS | |
1036 | @VARS='$(TRACK_VARS)'; \ | |
1037 | if test x"$$VARS" != x"`cat $@ 2>/dev/null`" ; then \ | |
1038 | echo 1>&2 " * new Tcl/Tk interpreter location"; \ | |
1039 | echo "$$VARS" >$@; \ | |
1040 | fi | |
1041 | ||
1042 | .PHONY: .FORCE-GIT-GUI-VARS | |
1043 | endif | |
1044 | ||
28818ffa PB |
1045 | ### Testing rules |
1046 | ||
beb47437 | 1047 | TEST_PROGRAMS = test-chmtime$X test-genrandom$X test-date$X test-delta$X test-sha1$X test-match-trees$X test-absolute-path$X test-parse-options$X |
96651ef5 JH |
1048 | |
1049 | all:: $(TEST_PROGRAMS) | |
1050 | ||
abb7c7b3 JS |
1051 | # GNU make supports exporting all variables by "export" without parameters. |
1052 | # However, the environment gets quite big, and some programs have problems | |
1053 | # with that. | |
1054 | ||
140245b3 | 1055 | export NO_SVN_TESTS |
abb7c7b3 | 1056 | |
96651ef5 | 1057 | test: all |
28818ffa PB |
1058 | $(MAKE) -C t/ all |
1059 | ||
5c5ba73b | 1060 | test-date$X: date.o ctype.o |
28818ffa | 1061 | |
5c5ba73b | 1062 | test-delta$X: diff-delta.o patch-delta.o |
28818ffa | 1063 | |
481424e1 AR |
1064 | test-parse-options$X: parse-options.o |
1065 | ||
fa8fe28c JH |
1066 | .PRECIOUS: $(patsubst test-%$X,test-%.o,$(TEST_PROGRAMS)) |
1067 | ||
5c5ba73b JP |
1068 | test-%$X: test-%.o $(GITLIBS) |
1069 | $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS) | |
2dca1af4 | 1070 | |
b65bc21e JH |
1071 | check-sha1:: test-sha1$X |
1072 | ./test-sha1.sh | |
1073 | ||
7c4c9f4c | 1074 | check: common-cmds.h |
773b6339 | 1075 | for i in *.c; do sparse $(ALL_CFLAGS) $(SPARSE_FLAGS) $$i || exit; done |
28818ffa | 1076 | |
36e5e70e LT |
1077 | remove-dashes: |
1078 | ./fixup-builtins $(BUILT_INS) | |
28818ffa PB |
1079 | |
1080 | ### Installation rules | |
1081 | ||
d6ebd259 | 1082 | install: all |
41650765 RS |
1083 | $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(bindir_SQ)' |
1084 | $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(gitexecdir_SQ)' | |
39c015c5 | 1085 | $(INSTALL) $(ALL_PROGRAMS) '$(DESTDIR_SQ)$(gitexecdir_SQ)' |
3cfaf11b | 1086 | $(INSTALL) git$X '$(DESTDIR_SQ)$(bindir_SQ)' |
7ffe7098 | 1087 | $(MAKE) -C templates DESTDIR='$(DESTDIR_SQ)' install |
28072a5d | 1088 | $(MAKE) -C perl prefix='$(prefix_SQ)' DESTDIR='$(DESTDIR_SQ)' install |
3cfaf11b | 1089 | ifndef NO_TCLTK |
62ba5143 | 1090 | $(MAKE) -C gitk-git install |
d647c2ea | 1091 | $(MAKE) -C git-gui install |
3cfaf11b | 1092 | endif |
7f7e6eac SE |
1093 | if test 'z$(bindir_SQ)' != 'z$(gitexecdir_SQ)'; \ |
1094 | then \ | |
1095 | ln -f '$(DESTDIR_SQ)$(bindir_SQ)/git$X' \ | |
1096 | '$(DESTDIR_SQ)$(gitexecdir_SQ)/git$X' || \ | |
1097 | cp '$(DESTDIR_SQ)$(bindir_SQ)/git$X' \ | |
1098 | '$(DESTDIR_SQ)$(gitexecdir_SQ)/git$X'; \ | |
1099 | fi | |
4cb08df5 | 1100 | $(foreach p,$(BUILT_INS), $(RM) '$(DESTDIR_SQ)$(gitexecdir_SQ)/$p' && ln '$(DESTDIR_SQ)$(gitexecdir_SQ)/git$X' '$(DESTDIR_SQ)$(gitexecdir_SQ)/$p' ;) |
6fc301bb | 1101 | ifneq (,$X) |
4cb08df5 | 1102 | $(foreach p,$(patsubst %$X,%,$(filter %$X,$(ALL_PROGRAMS) $(BUILT_INS) git$X)), $(RM) '$(DESTDIR_SQ)$(gitexecdir_SQ)/$p';) |
6fc301bb | 1103 | endif |
28818ffa PB |
1104 | |
1105 | install-doc: | |
1106 | $(MAKE) -C Documentation install | |
1107 | ||
4739809c DK |
1108 | install-info: |
1109 | $(MAKE) -C Documentation install-info | |
1110 | ||
6538d1ef EW |
1111 | quick-install-doc: |
1112 | $(MAKE) -C Documentation quick-install | |
28818ffa PB |
1113 | |
1114 | ||
1115 | ||
1116 | ### Maintainer's dist rules | |
1117 | ||
9b88fcef | 1118 | git.spec: git.spec.in |
fc36f6a6 JM |
1119 | sed -e 's/@@VERSION@@/$(GIT_VERSION)/g' < $< > $@+ |
1120 | mv $@+ $@ | |
a9db2974 | 1121 | |
27dedf0c | 1122 | GIT_TARNAME=git-$(GIT_VERSION) |
6c0f8694 | 1123 | dist: git.spec git-archive$(X) configure |
9ccb64c8 JH |
1124 | ./git-archive --format=tar \ |
1125 | --prefix=$(GIT_TARNAME)/ HEAD^{tree} > $(GIT_TARNAME).tar | |
a9db2974 | 1126 | @mkdir -p $(GIT_TARNAME) |
f58494bf | 1127 | @cp git.spec configure $(GIT_TARNAME) |
181129d2 | 1128 | @echo $(GIT_VERSION) > $(GIT_TARNAME)/version |
d647c2ea | 1129 | @$(MAKE) -C git-gui TARDIR=../$(GIT_TARNAME)/git-gui dist-version |
181129d2 | 1130 | $(TAR) rf $(GIT_TARNAME).tar \ |
d647c2ea | 1131 | $(GIT_TARNAME)/git.spec \ |
f58494bf | 1132 | $(GIT_TARNAME)/configure \ |
d647c2ea | 1133 | $(GIT_TARNAME)/version \ |
115f0fe4 | 1134 | $(GIT_TARNAME)/git-gui/version |
4cb08df5 | 1135 | @$(RM) -r $(GIT_TARNAME) |
9dce3c06 | 1136 | gzip -f -9 $(GIT_TARNAME).tar |
a9db2974 CW |
1137 | |
1138 | rpm: dist | |
27dedf0c | 1139 | $(RPMBUILD) -ta $(GIT_TARNAME).tar.gz |
a9db2974 | 1140 | |
52db0495 TS |
1141 | htmldocs = git-htmldocs-$(GIT_VERSION) |
1142 | manpages = git-manpages-$(GIT_VERSION) | |
1143 | dist-doc: | |
4cb08df5 | 1144 | $(RM) -r .doc-tmp-dir |
52db0495 TS |
1145 | mkdir .doc-tmp-dir |
1146 | $(MAKE) -C Documentation WEBDOC_DEST=../.doc-tmp-dir install-webdoc | |
1147 | cd .doc-tmp-dir && $(TAR) cf ../$(htmldocs).tar . | |
1148 | gzip -n -9 -f $(htmldocs).tar | |
1149 | : | |
4cb08df5 | 1150 | $(RM) -r .doc-tmp-dir |
4392da4d | 1151 | mkdir -p .doc-tmp-dir/man1 .doc-tmp-dir/man5 .doc-tmp-dir/man7 |
c5360324 | 1152 | $(MAKE) -C Documentation DESTDIR=./ \ |
7b8cf0cf | 1153 | man1dir=../.doc-tmp-dir/man1 \ |
4392da4d | 1154 | man5dir=../.doc-tmp-dir/man5 \ |
7b8cf0cf | 1155 | man7dir=../.doc-tmp-dir/man7 \ |
52db0495 TS |
1156 | install |
1157 | cd .doc-tmp-dir && $(TAR) cf ../$(manpages).tar . | |
1158 | gzip -n -9 -f $(manpages).tar | |
4cb08df5 | 1159 | $(RM) -r .doc-tmp-dir |
52db0495 | 1160 | |
28818ffa | 1161 | ### Cleaning rules |
87a81c83 | 1162 | |
922aa807 MM |
1163 | distclean: clean |
1164 | $(RM) configure | |
1165 | ||
e83c5163 | 1166 | clean: |
4cb08df5 | 1167 | $(RM) *.o mozilla-sha1/*.o arm/*.o ppc/*.o compat/*.o xdiff/*.o \ |
d0f51a8b | 1168 | $(LIB_FILE) $(XDIFF_LIB) |
4cb08df5 EM |
1169 | $(RM) $(ALL_PROGRAMS) $(BUILT_INS) git$X |
1170 | $(RM) $(TEST_PROGRAMS) | |
a2a9150b | 1171 | $(RM) *.spec *.pyc *.pyo */*.pyc */*.pyo common-cmds.h TAGS tags cscope* |
4cb08df5 | 1172 | $(RM) -r autom4te.cache |
922aa807 | 1173 | $(RM) config.log config.mak.autogen config.mak.append config.status config.cache |
4cb08df5 EM |
1174 | $(RM) -r $(GIT_TARNAME) .doc-tmp-dir |
1175 | $(RM) $(GIT_TARNAME).tar.gz git-core_$(GIT_VERSION)-*.tar.gz | |
1176 | $(RM) $(htmldocs).tar.gz $(manpages).tar.gz | |
1177 | $(RM) gitweb/gitweb.cgi | |
ca67f002 | 1178 | $(MAKE) -C Documentation/ clean |
f848718a | 1179 | $(MAKE) -C perl clean |
b1edc53d | 1180 | $(MAKE) -C templates/ clean |
4b7581f0 | 1181 | $(MAKE) -C t/ clean |
3cfaf11b | 1182 | ifndef NO_TCLTK |
62ba5143 | 1183 | $(MAKE) -C gitk-git clean |
3cfaf11b ER |
1184 | $(MAKE) -C git-gui clean |
1185 | endif | |
7cf7f54a | 1186 | $(RM) GIT-VERSION-FILE GIT-CFLAGS GIT-GUI-VARS GIT-BUILD-OPTIONS |
9b88fcef | 1187 | |
4dc00021 | 1188 | .PHONY: all install clean strip |
a2a9150b | 1189 | .PHONY: .FORCE-GIT-VERSION-FILE TAGS tags cscope .FORCE-GIT-CFLAGS |
7cf7f54a | 1190 | .PHONY: .FORCE-GIT-BUILD-OPTIONS |
d89056c2 | 1191 | |
8c989ec5 JH |
1192 | ### Check documentation |
1193 | # | |
1194 | check-docs:: | |
3f7ce648 | 1195 | @(for v in $(ALL_PROGRAMS) $(BUILT_INS) git gitk; \ |
8c989ec5 JH |
1196 | do \ |
1197 | case "$$v" in \ | |
8c989ec5 | 1198 | git-merge-octopus | git-merge-ours | git-merge-recursive | \ |
3f7ce648 | 1199 | git-merge-resolve | git-merge-stupid | git-merge-subtree | \ |
5c66d0d4 | 1200 | git-fsck-objects | git-init-db | \ |
5b4617c7 | 1201 | git-?*--?* ) continue ;; \ |
8c989ec5 JH |
1202 | esac ; \ |
1203 | test -f "Documentation/$$v.txt" || \ | |
1204 | echo "no doc: $$v"; \ | |
79d30668 | 1205 | sed -e '/^#/d' command-list.txt | \ |
4b02c529 | 1206 | grep -q "^$$v[ ]" || \ |
8c989ec5 JH |
1207 | case "$$v" in \ |
1208 | git) ;; \ | |
1209 | *) echo "no link: $$v";; \ | |
1210 | esac ; \ | |
3f7ce648 JH |
1211 | done; \ |
1212 | ( \ | |
79d30668 | 1213 | sed -e '/^#/d' \ |
3f7ce648 | 1214 | -e 's/[ ].*//' \ |
79d30668 | 1215 | -e 's/^/listed /' command-list.txt; \ |
3f7ce648 JH |
1216 | ls -1 Documentation/git*txt | \ |
1217 | sed -e 's|Documentation/|documented |' \ | |
1218 | -e 's/\.txt//'; \ | |
1219 | ) | while read how cmd; \ | |
1220 | do \ | |
1221 | case "$$how,$$cmd" in \ | |
1222 | *,git-citool | \ | |
1223 | *,git-gui | \ | |
0f6f195b | 1224 | *,git-help | \ |
3f7ce648 JH |
1225 | documented,gitattributes | \ |
1226 | documented,gitignore | \ | |
1227 | documented,gitmodules | \ | |
2f7ee089 | 1228 | documented,gitcli | \ |
3f7ce648 JH |
1229 | documented,git-tools | \ |
1230 | sentinel,not,matching,is,ok ) continue ;; \ | |
1231 | esac; \ | |
1232 | case " $(ALL_PROGRAMS) $(BUILT_INS) git gitk " in \ | |
1233 | *" $$cmd "*) ;; \ | |
1234 | *) echo "removed but $$how: $$cmd" ;; \ | |
1235 | esac; \ | |
1236 | done ) | sort | |
c74390e4 JH |
1237 | |
1238 | ### Make sure built-ins do not have dups and listed in git.c | |
1239 | # | |
1240 | check-builtins:: | |
1241 | ./check-builtins.sh | |
11c57e6a | 1242 |