ident: add NO_GECOS_IN_PWENT for systems without pw_gecos in struct passwd
[git/git.git] / Makefile
1 # The default target of this Makefile is...
2 all::
3
4 # Define V=1 to have a more verbose compile.
5 #
6 # Define SHELL_PATH to a POSIX shell if your /bin/sh is broken.
7 #
8 # Define SANE_TOOL_PATH to a colon-separated list of paths to prepend
9 # to PATH if your tools in /usr/bin are broken.
10 #
11 # Define SNPRINTF_RETURNS_BOGUS if your are on a system which snprintf()
12 # or vsnprintf() return -1 instead of number of characters which would
13 # have been written to the final string if enough space had been available.
14 #
15 # Define FREAD_READS_DIRECTORIES if your are on a system which succeeds
16 # when attempting to read from an fopen'ed directory.
17 #
18 # Define NO_OPENSSL environment variable if you do not have OpenSSL.
19 # This also implies BLK_SHA1.
20 #
21 # Define NO_CURL if you do not have libcurl installed. git-http-pull and
22 # git-http-push are not built, and you cannot use http:// and https://
23 # transports.
24 #
25 # Define CURLDIR=/foo/bar if your curl header and library files are in
26 # /foo/bar/include and /foo/bar/lib directories.
27 #
28 # Define NO_EXPAT if you do not have expat installed. git-http-push is
29 # not built, and you cannot push using http:// and https:// transports.
30 #
31 # Define EXPATDIR=/foo/bar if your expat header and library files are in
32 # /foo/bar/include and /foo/bar/lib directories.
33 #
34 # Define NO_D_INO_IN_DIRENT if you don't have d_ino in your struct dirent.
35 #
36 # Define NO_D_TYPE_IN_DIRENT if your platform defines DT_UNKNOWN but lacks
37 # d_type in struct dirent (latest Cygwin -- will be fixed soonish).
38 #
39 # Define NO_C99_FORMAT if your formatted IO functions (printf/scanf et.al.)
40 # do not support the 'size specifiers' introduced by C99, namely ll, hh,
41 # j, z, t. (representing long long int, char, intmax_t, size_t, ptrdiff_t).
42 # some C compilers supported these specifiers prior to C99 as an extension.
43 #
44 # Define NO_STRCASESTR if you don't have strcasestr.
45 #
46 # Define NO_MEMMEM if you don't have memmem.
47 #
48 # Define NO_STRLCPY if you don't have strlcpy.
49 #
50 # Define NO_STRTOUMAX if you don't have strtoumax in the C library.
51 # If your compiler also does not support long long or does not have
52 # strtoull, define NO_STRTOULL.
53 #
54 # Define NO_SETENV if you don't have setenv in the C library.
55 #
56 # Define NO_UNSETENV if you don't have unsetenv in the C library.
57 #
58 # Define NO_MKDTEMP if you don't have mkdtemp in the C library.
59 #
60 # Define NO_MKSTEMPS if you don't have mkstemps in the C library.
61 #
62 # Define NO_GECOS_IN_PWENT if you don't have pw_gecos in struct passwd
63 # in the C library.
64 #
65 # Define NO_LIBGEN_H if you don't have libgen.h.
66 #
67 # Define NEEDS_LIBGEN if your libgen needs -lgen when linking
68 #
69 # Define NO_SYS_SELECT_H if you don't have sys/select.h.
70 #
71 # Define NO_SYMLINK_HEAD if you never want .git/HEAD to be a symbolic link.
72 # Enable it on Windows. By default, symrefs are still used.
73 #
74 # Define NO_SVN_TESTS if you want to skip time-consuming SVN interoperability
75 # tests. These tests take up a significant amount of the total test time
76 # but are not needed unless you plan to talk to SVN repos.
77 #
78 # Define NO_FINK if you are building on Darwin/Mac OS X, have Fink
79 # installed in /sw, but don't want GIT to link against any libraries
80 # installed there. If defined you may specify your own (or Fink's)
81 # include directories and library directories by defining CFLAGS
82 # and LDFLAGS appropriately.
83 #
84 # Define NO_DARWIN_PORTS if you are building on Darwin/Mac OS X,
85 # have DarwinPorts installed in /opt/local, but don't want GIT to
86 # link against any libraries installed there. If defined you may
87 # specify your own (or DarwinPort's) include directories and
88 # library directories by defining CFLAGS and LDFLAGS appropriately.
89 #
90 # Define BLK_SHA1 environment variable if you want the C version
91 # of the SHA1 that assumes you can do unaligned 32-bit loads and
92 # have a fast htonl() function.
93 #
94 # Define PPC_SHA1 environment variable when running make to make use of
95 # a bundled SHA1 routine optimized for PowerPC.
96 #
97 # Define NEEDS_CRYPTO_WITH_SSL if you need -lcrypto when using -lssl (Darwin).
98 #
99 # Define NEEDS_SSL_WITH_CRYPTO if you need -lssl when using -lcrypto (Darwin).
100 #
101 # Define NEEDS_LIBICONV if linking with libc is not enough (Darwin).
102 #
103 # Define NEEDS_SOCKET if linking with libc is not enough (SunOS,
104 # Patrick Mauritz).
105 #
106 # Define NEEDS_RESOLV if linking with -lnsl and/or -lsocket is not enough.
107 # Notably on Solaris hstrerror resides in libresolv and on Solaris 7
108 # inet_ntop and inet_pton additionally reside there.
109 #
110 # Define NO_MMAP if you want to avoid mmap.
111 #
112 # Define NO_PTHREADS if you do not have or do not want to use Pthreads.
113 #
114 # Define NO_PREAD if you have a problem with pread() system call (e.g.
115 # cygwin.dll before v1.5.22).
116 #
117 # Define NO_FAST_WORKING_DIRECTORY if accessing objects in pack files is
118 # generally faster on your platform than accessing the working directory.
119 #
120 # Define NO_TRUSTABLE_FILEMODE if your filesystem may claim to support
121 # the executable mode bit, but doesn't really do so.
122 #
123 # Define NO_IPV6 if you lack IPv6 support and getaddrinfo().
124 #
125 # Define NO_SOCKADDR_STORAGE if your platform does not have struct
126 # sockaddr_storage.
127 #
128 # Define NO_ICONV if your libc does not properly support iconv.
129 #
130 # Define OLD_ICONV if your library has an old iconv(), where the second
131 # (input buffer pointer) parameter is declared with type (const char **).
132 #
133 # Define NO_DEFLATE_BOUND if your zlib does not have deflateBound.
134 #
135 # Define NO_R_TO_GCC_LINKER if your gcc does not like "-R/path/lib"
136 # that tells runtime paths to dynamic libraries;
137 # "-Wl,-rpath=/path/lib" is used instead.
138 #
139 # Define USE_NSEC below if you want git to care about sub-second file mtimes
140 # and ctimes. Note that you need recent glibc (at least 2.2.4) for this, and
141 # it will BREAK YOUR LOCAL DIFFS! show-diff and anything using it will likely
142 # randomly break unless your underlying filesystem supports those sub-second
143 # times (my ext3 doesn't).
144 #
145 # Define USE_ST_TIMESPEC if your "struct stat" uses "st_ctimespec" instead of
146 # "st_ctim"
147 #
148 # Define NO_NSEC if your "struct stat" does not have "st_ctim.tv_nsec"
149 # available. This automatically turns USE_NSEC off.
150 #
151 # Define USE_STDEV below if you want git to care about the underlying device
152 # change being considered an inode change from the update-index perspective.
153 #
154 # Define NO_ST_BLOCKS_IN_STRUCT_STAT if your platform does not have st_blocks
155 # field that counts the on-disk footprint in 512-byte blocks.
156 #
157 # Define ASCIIDOC8 if you want to format documentation with AsciiDoc 8
158 #
159 # Define DOCBOOK_XSL_172 if you want to format man pages with DocBook XSL v1.72
160 # (not v1.73 or v1.71).
161 #
162 # Define ASCIIDOC_NO_ROFF if your DocBook XSL escapes raw roff directives
163 # (versions 1.72 and later and 1.68.1 and earlier).
164 #
165 # Define GNU_ROFF if your target system uses GNU groff. This forces
166 # apostrophes to be ASCII so that cut&pasting examples to the shell
167 # will work.
168 #
169 # Define NO_PERL_MAKEMAKER if you cannot use Makefiles generated by perl's
170 # MakeMaker (e.g. using ActiveState under Cygwin).
171 #
172 # Define NO_PERL if you do not want Perl scripts or libraries at all.
173 #
174 # Define NO_PYTHON if you do not want Python scripts or libraries at all.
175 #
176 # Define NO_TCLTK if you do not want Tcl/Tk GUI.
177 #
178 # The TCL_PATH variable governs the location of the Tcl interpreter
179 # used to optimize git-gui for your system. Only used if NO_TCLTK
180 # is not set. Defaults to the bare 'tclsh'.
181 #
182 # The TCLTK_PATH variable governs the location of the Tcl/Tk interpreter.
183 # If not set it defaults to the bare 'wish'. If it is set to the empty
184 # string then NO_TCLTK will be forced (this is used by configure script).
185 #
186 # Define INTERNAL_QSORT to use Git's implementation of qsort(), which
187 # is a simplified version of the merge sort used in glibc. This is
188 # recommended if Git triggers O(n^2) behavior in your platform's qsort().
189 #
190 # Define UNRELIABLE_FSTAT if your system's fstat does not return the same
191 # information on a not yet closed file that lstat would return for the same
192 # file after it was closed.
193 #
194 # Define OBJECT_CREATION_USES_RENAMES if your operating systems has problems
195 # when hardlinking a file to another name and unlinking the original file right
196 # away (some NTFS drivers seem to zero the contents in that scenario).
197 #
198 # Define NO_CROSS_DIRECTORY_HARDLINKS if you plan to distribute the installed
199 # programs as a tar, where bin/ and libexec/ might be on different file systems.
200 #
201 # Define USE_NED_ALLOCATOR if you want to replace the platforms default
202 # memory allocators with the nedmalloc allocator written by Niall Douglas.
203 #
204 # Define NO_REGEX if you have no or inferior regex support in your C library.
205 #
206 # Define JSMIN to point to JavaScript minifier that functions as
207 # a filter to have gitweb.js minified.
208 #
209 # Define DEFAULT_PAGER to a sensible pager command (defaults to "less") if
210 # you want to use something different. The value will be interpreted by the
211 # shell at runtime when it is used.
212 #
213 # Define DEFAULT_EDITOR to a sensible editor command (defaults to "vi") if you
214 # want to use something different. The value will be interpreted by the shell
215 # if necessary when it is used. Examples:
216 #
217 # DEFAULT_EDITOR='~/bin/vi',
218 # DEFAULT_EDITOR='$GIT_FALLBACK_EDITOR',
219 # DEFAULT_EDITOR='"C:\Program Files\Vim\gvim.exe" --nofork'
220
221 GIT-VERSION-FILE: FORCE
222 @$(SHELL_PATH) ./GIT-VERSION-GEN
223 -include GIT-VERSION-FILE
224
225 uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not')
226 uname_M := $(shell sh -c 'uname -m 2>/dev/null || echo not')
227 uname_O := $(shell sh -c 'uname -o 2>/dev/null || echo not')
228 uname_R := $(shell sh -c 'uname -r 2>/dev/null || echo not')
229 uname_P := $(shell sh -c 'uname -p 2>/dev/null || echo not')
230 uname_V := $(shell sh -c 'uname -v 2>/dev/null || echo not')
231
232 ifdef MSVC
233 # avoid the MingW and Cygwin configuration sections
234 uname_S := Windows
235 uname_O := Windows
236 endif
237
238 # CFLAGS and LDFLAGS are for the users to override from the command line.
239
240 CFLAGS = -g -O2 -Wall
241 LDFLAGS =
242 ALL_CFLAGS = $(CFLAGS)
243 ALL_LDFLAGS = $(LDFLAGS)
244 STRIP ?= strip
245
246 # Among the variables below, these:
247 # gitexecdir
248 # template_dir
249 # mandir
250 # infodir
251 # htmldir
252 # ETC_GITCONFIG (but not sysconfdir)
253 # can be specified as a relative path some/where/else;
254 # this is interpreted as relative to $(prefix) and "git" at
255 # runtime figures out where they are based on the path to the executable.
256 # This can help installing the suite in a relocatable way.
257
258 prefix = $(HOME)
259 bindir_relative = bin
260 bindir = $(prefix)/$(bindir_relative)
261 mandir = share/man
262 infodir = share/info
263 gitexecdir = libexec/git-core
264 sharedir = $(prefix)/share
265 template_dir = share/git-core/templates
266 htmldir = share/doc/git-doc
267 ifeq ($(prefix),/usr)
268 sysconfdir = /etc
269 ETC_GITCONFIG = $(sysconfdir)/gitconfig
270 else
271 sysconfdir = $(prefix)/etc
272 ETC_GITCONFIG = etc/gitconfig
273 endif
274 lib = lib
275 # DESTDIR=
276 pathsep = :
277
278 # JavaScript minifier invocation that can function as filter
279 JSMIN =
280
281 export prefix bindir sharedir sysconfdir
282
283 CC = gcc
284 AR = ar
285 RM = rm -f
286 TAR = tar
287 FIND = find
288 INSTALL = install
289 RPMBUILD = rpmbuild
290 TCL_PATH = tclsh
291 TCLTK_PATH = wish
292 PTHREAD_LIBS = -lpthread
293
294 export TCL_PATH TCLTK_PATH
295
296 # sparse is architecture-neutral, which means that we need to tell it
297 # explicitly what architecture to check for. Fix this up for yours..
298 SPARSE_FLAGS = -D__BIG_ENDIAN__ -D__powerpc__
299
300
301
302 ### --- END CONFIGURATION SECTION ---
303
304 # Those must not be GNU-specific; they are shared with perl/ which may
305 # be built by a different compiler. (Note that this is an artifact now
306 # but it still might be nice to keep that distinction.)
307 BASIC_CFLAGS =
308 BASIC_LDFLAGS =
309
310 # Guard against environment variables
311 BUILTIN_OBJS =
312 BUILT_INS =
313 COMPAT_CFLAGS =
314 COMPAT_OBJS =
315 LIB_H =
316 LIB_OBJS =
317 PROGRAMS =
318 SCRIPT_PERL =
319 SCRIPT_PYTHON =
320 SCRIPT_SH =
321 TEST_PROGRAMS =
322
323 # Having this variable in your environment would break pipelines because
324 # you cause "cd" to echo its destination to stdout. It can also take
325 # scripts to unexpected places. If you like CDPATH, define it for your
326 # interactive shell sessions without exporting it.
327 unexport CDPATH
328
329 SCRIPT_SH += git-am.sh
330 SCRIPT_SH += git-bisect.sh
331 SCRIPT_SH += git-difftool--helper.sh
332 SCRIPT_SH += git-filter-branch.sh
333 SCRIPT_SH += git-lost-found.sh
334 SCRIPT_SH += git-merge-octopus.sh
335 SCRIPT_SH += git-merge-one-file.sh
336 SCRIPT_SH += git-merge-resolve.sh
337 SCRIPT_SH += git-mergetool.sh
338 SCRIPT_SH += git-mergetool--lib.sh
339 SCRIPT_SH += git-notes.sh
340 SCRIPT_SH += git-parse-remote.sh
341 SCRIPT_SH += git-pull.sh
342 SCRIPT_SH += git-quiltimport.sh
343 SCRIPT_SH += git-rebase--interactive.sh
344 SCRIPT_SH += git-rebase.sh
345 SCRIPT_SH += git-repack.sh
346 SCRIPT_SH += git-request-pull.sh
347 SCRIPT_SH += git-sh-setup.sh
348 SCRIPT_SH += git-stash.sh
349 SCRIPT_SH += git-submodule.sh
350 SCRIPT_SH += git-web--browse.sh
351
352 SCRIPT_PERL += git-add--interactive.perl
353 SCRIPT_PERL += git-difftool.perl
354 SCRIPT_PERL += git-archimport.perl
355 SCRIPT_PERL += git-cvsexportcommit.perl
356 SCRIPT_PERL += git-cvsimport.perl
357 SCRIPT_PERL += git-cvsserver.perl
358 SCRIPT_PERL += git-relink.perl
359 SCRIPT_PERL += git-send-email.perl
360 SCRIPT_PERL += git-svn.perl
361
362 SCRIPTS = $(patsubst %.sh,%,$(SCRIPT_SH)) \
363 $(patsubst %.perl,%,$(SCRIPT_PERL)) \
364 $(patsubst %.py,%,$(SCRIPT_PYTHON)) \
365 git-instaweb
366
367 # Empty...
368 EXTRA_PROGRAMS =
369
370 # ... and all the rest that could be moved out of bindir to gitexecdir
371 PROGRAMS += $(EXTRA_PROGRAMS)
372 PROGRAMS += git-fast-import$X
373 PROGRAMS += git-imap-send$X
374 PROGRAMS += git-shell$X
375 PROGRAMS += git-show-index$X
376 PROGRAMS += git-upload-pack$X
377 PROGRAMS += git-http-backend$X
378
379 # List built-in command $C whose implementation cmd_$C() is not in
380 # builtin-$C.o but is linked in as part of some other command.
381 BUILT_INS += $(patsubst builtin-%.o,git-%$X,$(BUILTIN_OBJS))
382
383 BUILT_INS += git-cherry$X
384 BUILT_INS += git-cherry-pick$X
385 BUILT_INS += git-format-patch$X
386 BUILT_INS += git-fsck-objects$X
387 BUILT_INS += git-get-tar-commit-id$X
388 BUILT_INS += git-init$X
389 BUILT_INS += git-merge-subtree$X
390 BUILT_INS += git-peek-remote$X
391 BUILT_INS += git-repo-config$X
392 BUILT_INS += git-show$X
393 BUILT_INS += git-stage$X
394 BUILT_INS += git-status$X
395 BUILT_INS += git-whatchanged$X
396
397 # what 'all' will build and 'install' will install in gitexecdir,
398 # excluding programs for built-in commands
399 ALL_PROGRAMS = $(PROGRAMS) $(SCRIPTS)
400
401 # what 'all' will build but not install in gitexecdir
402 OTHER_PROGRAMS = git$X
403
404 # what test wrappers are needed and 'install' will install, in bindir
405 BINDIR_PROGRAMS_NEED_X += git
406 BINDIR_PROGRAMS_NEED_X += git-upload-pack
407 BINDIR_PROGRAMS_NEED_X += git-receive-pack
408 BINDIR_PROGRAMS_NEED_X += git-upload-archive
409 BINDIR_PROGRAMS_NEED_X += git-shell
410
411 BINDIR_PROGRAMS_NO_X += git-cvsserver
412
413 # Set paths to tools early so that they can be used for version tests.
414 ifndef SHELL_PATH
415 SHELL_PATH = /bin/sh
416 endif
417 ifndef PERL_PATH
418 PERL_PATH = /usr/bin/perl
419 endif
420 ifndef PYTHON_PATH
421 PYTHON_PATH = /usr/bin/python
422 endif
423
424 export PERL_PATH
425 export PYTHON_PATH
426
427 LIB_FILE=libgit.a
428 XDIFF_LIB=xdiff/lib.a
429
430 LIB_H += advice.h
431 LIB_H += archive.h
432 LIB_H += attr.h
433 LIB_H += blob.h
434 LIB_H += builtin.h
435 LIB_H += cache.h
436 LIB_H += cache-tree.h
437 LIB_H += commit.h
438 LIB_H += compat/bswap.h
439 LIB_H += compat/cygwin.h
440 LIB_H += compat/mingw.h
441 LIB_H += compat/win32/pthread.h
442 LIB_H += csum-file.h
443 LIB_H += decorate.h
444 LIB_H += delta.h
445 LIB_H += diffcore.h
446 LIB_H += diff.h
447 LIB_H += dir.h
448 LIB_H += fsck.h
449 LIB_H += git-compat-util.h
450 LIB_H += graph.h
451 LIB_H += grep.h
452 LIB_H += hash.h
453 LIB_H += help.h
454 LIB_H += levenshtein.h
455 LIB_H += list-objects.h
456 LIB_H += ll-merge.h
457 LIB_H += log-tree.h
458 LIB_H += mailmap.h
459 LIB_H += merge-recursive.h
460 LIB_H += notes.h
461 LIB_H += object.h
462 LIB_H += pack.h
463 LIB_H += pack-refs.h
464 LIB_H += pack-revindex.h
465 LIB_H += parse-options.h
466 LIB_H += patch-ids.h
467 LIB_H += pkt-line.h
468 LIB_H += progress.h
469 LIB_H += quote.h
470 LIB_H += reflog-walk.h
471 LIB_H += refs.h
472 LIB_H += remote.h
473 LIB_H += rerere.h
474 LIB_H += resolve-undo.h
475 LIB_H += revision.h
476 LIB_H += run-command.h
477 LIB_H += sha1-lookup.h
478 LIB_H += sideband.h
479 LIB_H += sigchain.h
480 LIB_H += strbuf.h
481 LIB_H += string-list.h
482 LIB_H += submodule.h
483 LIB_H += tag.h
484 LIB_H += transport.h
485 LIB_H += tree.h
486 LIB_H += tree-walk.h
487 LIB_H += unpack-trees.h
488 LIB_H += userdiff.h
489 LIB_H += utf8.h
490 LIB_H += wt-status.h
491
492 LIB_OBJS += abspath.o
493 LIB_OBJS += advice.o
494 LIB_OBJS += alias.o
495 LIB_OBJS += alloc.o
496 LIB_OBJS += archive.o
497 LIB_OBJS += archive-tar.o
498 LIB_OBJS += archive-zip.o
499 LIB_OBJS += attr.o
500 LIB_OBJS += base85.o
501 LIB_OBJS += bisect.o
502 LIB_OBJS += blob.o
503 LIB_OBJS += branch.o
504 LIB_OBJS += bundle.o
505 LIB_OBJS += cache-tree.o
506 LIB_OBJS += color.o
507 LIB_OBJS += combine-diff.o
508 LIB_OBJS += commit.o
509 LIB_OBJS += config.o
510 LIB_OBJS += connect.o
511 LIB_OBJS += convert.o
512 LIB_OBJS += copy.o
513 LIB_OBJS += csum-file.o
514 LIB_OBJS += ctype.o
515 LIB_OBJS += date.o
516 LIB_OBJS += decorate.o
517 LIB_OBJS += diffcore-break.o
518 LIB_OBJS += diffcore-delta.o
519 LIB_OBJS += diffcore-order.o
520 LIB_OBJS += diffcore-pickaxe.o
521 LIB_OBJS += diffcore-rename.o
522 LIB_OBJS += diff-delta.o
523 LIB_OBJS += diff-lib.o
524 LIB_OBJS += diff-no-index.o
525 LIB_OBJS += diff.o
526 LIB_OBJS += dir.o
527 LIB_OBJS += editor.o
528 LIB_OBJS += entry.o
529 LIB_OBJS += environment.o
530 LIB_OBJS += exec_cmd.o
531 LIB_OBJS += fsck.o
532 LIB_OBJS += graph.o
533 LIB_OBJS += grep.o
534 LIB_OBJS += hash.o
535 LIB_OBJS += help.o
536 LIB_OBJS += hex.o
537 LIB_OBJS += ident.o
538 LIB_OBJS += levenshtein.o
539 LIB_OBJS += list-objects.o
540 LIB_OBJS += ll-merge.o
541 LIB_OBJS += lockfile.o
542 LIB_OBJS += log-tree.o
543 LIB_OBJS += mailmap.o
544 LIB_OBJS += match-trees.o
545 LIB_OBJS += merge-file.o
546 LIB_OBJS += merge-recursive.o
547 LIB_OBJS += name-hash.o
548 LIB_OBJS += notes.o
549 LIB_OBJS += object.o
550 LIB_OBJS += pack-check.o
551 LIB_OBJS += pack-refs.o
552 LIB_OBJS += pack-revindex.o
553 LIB_OBJS += pack-write.o
554 LIB_OBJS += pager.o
555 LIB_OBJS += parse-options.o
556 LIB_OBJS += patch-delta.o
557 LIB_OBJS += patch-ids.o
558 LIB_OBJS += path.o
559 LIB_OBJS += pkt-line.o
560 LIB_OBJS += preload-index.o
561 LIB_OBJS += pretty.o
562 LIB_OBJS += progress.o
563 LIB_OBJS += quote.o
564 LIB_OBJS += reachable.o
565 LIB_OBJS += read-cache.o
566 LIB_OBJS += reflog-walk.o
567 LIB_OBJS += refs.o
568 LIB_OBJS += remote.o
569 LIB_OBJS += replace_object.o
570 LIB_OBJS += rerere.o
571 LIB_OBJS += resolve-undo.o
572 LIB_OBJS += revision.o
573 LIB_OBJS += run-command.o
574 LIB_OBJS += server-info.o
575 LIB_OBJS += setup.o
576 LIB_OBJS += sha1-lookup.o
577 LIB_OBJS += sha1_file.o
578 LIB_OBJS += sha1_name.o
579 LIB_OBJS += shallow.o
580 LIB_OBJS += sideband.o
581 LIB_OBJS += sigchain.o
582 LIB_OBJS += strbuf.o
583 LIB_OBJS += string-list.o
584 LIB_OBJS += submodule.o
585 LIB_OBJS += symlinks.o
586 LIB_OBJS += tag.o
587 LIB_OBJS += trace.o
588 LIB_OBJS += transport.o
589 LIB_OBJS += transport-helper.o
590 LIB_OBJS += tree-diff.o
591 LIB_OBJS += tree.o
592 LIB_OBJS += tree-walk.o
593 LIB_OBJS += unpack-trees.o
594 LIB_OBJS += usage.o
595 LIB_OBJS += userdiff.o
596 LIB_OBJS += utf8.o
597 LIB_OBJS += walker.o
598 LIB_OBJS += wrapper.o
599 LIB_OBJS += write_or_die.o
600 LIB_OBJS += ws.o
601 LIB_OBJS += wt-status.o
602 LIB_OBJS += xdiff-interface.o
603
604 BUILTIN_OBJS += builtin-add.o
605 BUILTIN_OBJS += builtin-annotate.o
606 BUILTIN_OBJS += builtin-apply.o
607 BUILTIN_OBJS += builtin-archive.o
608 BUILTIN_OBJS += builtin-bisect--helper.o
609 BUILTIN_OBJS += builtin-blame.o
610 BUILTIN_OBJS += builtin-branch.o
611 BUILTIN_OBJS += builtin-bundle.o
612 BUILTIN_OBJS += builtin-cat-file.o
613 BUILTIN_OBJS += builtin-check-attr.o
614 BUILTIN_OBJS += builtin-check-ref-format.o
615 BUILTIN_OBJS += builtin-checkout-index.o
616 BUILTIN_OBJS += builtin-checkout.o
617 BUILTIN_OBJS += builtin-clean.o
618 BUILTIN_OBJS += builtin-clone.o
619 BUILTIN_OBJS += builtin-commit-tree.o
620 BUILTIN_OBJS += builtin-commit.o
621 BUILTIN_OBJS += builtin-config.o
622 BUILTIN_OBJS += builtin-count-objects.o
623 BUILTIN_OBJS += builtin-describe.o
624 BUILTIN_OBJS += builtin-diff-files.o
625 BUILTIN_OBJS += builtin-diff-index.o
626 BUILTIN_OBJS += builtin-diff-tree.o
627 BUILTIN_OBJS += builtin-diff.o
628 BUILTIN_OBJS += builtin-fast-export.o
629 BUILTIN_OBJS += builtin-fetch-pack.o
630 BUILTIN_OBJS += builtin-fetch.o
631 BUILTIN_OBJS += builtin-fmt-merge-msg.o
632 BUILTIN_OBJS += builtin-for-each-ref.o
633 BUILTIN_OBJS += builtin-fsck.o
634 BUILTIN_OBJS += builtin-gc.o
635 BUILTIN_OBJS += builtin-grep.o
636 BUILTIN_OBJS += builtin-hash-object.o
637 BUILTIN_OBJS += builtin-help.o
638 BUILTIN_OBJS += builtin-index-pack.o
639 BUILTIN_OBJS += builtin-init-db.o
640 BUILTIN_OBJS += builtin-log.o
641 BUILTIN_OBJS += builtin-ls-files.o
642 BUILTIN_OBJS += builtin-ls-remote.o
643 BUILTIN_OBJS += builtin-ls-tree.o
644 BUILTIN_OBJS += builtin-mailinfo.o
645 BUILTIN_OBJS += builtin-mailsplit.o
646 BUILTIN_OBJS += builtin-merge.o
647 BUILTIN_OBJS += builtin-merge-base.o
648 BUILTIN_OBJS += builtin-merge-file.o
649 BUILTIN_OBJS += builtin-merge-index.o
650 BUILTIN_OBJS += builtin-merge-ours.o
651 BUILTIN_OBJS += builtin-merge-recursive.o
652 BUILTIN_OBJS += builtin-merge-tree.o
653 BUILTIN_OBJS += builtin-mktag.o
654 BUILTIN_OBJS += builtin-mktree.o
655 BUILTIN_OBJS += builtin-mv.o
656 BUILTIN_OBJS += builtin-name-rev.o
657 BUILTIN_OBJS += builtin-pack-objects.o
658 BUILTIN_OBJS += builtin-pack-redundant.o
659 BUILTIN_OBJS += builtin-pack-refs.o
660 BUILTIN_OBJS += builtin-patch-id.o
661 BUILTIN_OBJS += builtin-prune-packed.o
662 BUILTIN_OBJS += builtin-prune.o
663 BUILTIN_OBJS += builtin-push.o
664 BUILTIN_OBJS += builtin-read-tree.o
665 BUILTIN_OBJS += builtin-receive-pack.o
666 BUILTIN_OBJS += builtin-reflog.o
667 BUILTIN_OBJS += builtin-remote.o
668 BUILTIN_OBJS += builtin-replace.o
669 BUILTIN_OBJS += builtin-rerere.o
670 BUILTIN_OBJS += builtin-reset.o
671 BUILTIN_OBJS += builtin-rev-list.o
672 BUILTIN_OBJS += builtin-rev-parse.o
673 BUILTIN_OBJS += builtin-revert.o
674 BUILTIN_OBJS += builtin-rm.o
675 BUILTIN_OBJS += builtin-send-pack.o
676 BUILTIN_OBJS += builtin-shortlog.o
677 BUILTIN_OBJS += builtin-show-branch.o
678 BUILTIN_OBJS += builtin-show-ref.o
679 BUILTIN_OBJS += builtin-stripspace.o
680 BUILTIN_OBJS += builtin-symbolic-ref.o
681 BUILTIN_OBJS += builtin-tag.o
682 BUILTIN_OBJS += builtin-tar-tree.o
683 BUILTIN_OBJS += builtin-unpack-file.o
684 BUILTIN_OBJS += builtin-unpack-objects.o
685 BUILTIN_OBJS += builtin-update-index.o
686 BUILTIN_OBJS += builtin-update-ref.o
687 BUILTIN_OBJS += builtin-update-server-info.o
688 BUILTIN_OBJS += builtin-upload-archive.o
689 BUILTIN_OBJS += builtin-var.o
690 BUILTIN_OBJS += builtin-verify-pack.o
691 BUILTIN_OBJS += builtin-verify-tag.o
692 BUILTIN_OBJS += builtin-write-tree.o
693
694 GITLIBS = $(LIB_FILE) $(XDIFF_LIB)
695 EXTLIBS =
696
697 #
698 # Platform specific tweaks
699 #
700
701 # We choose to avoid "if .. else if .. else .. endif endif"
702 # because maintaining the nesting to match is a pain. If
703 # we had "elif" things would have been much nicer...
704
705 ifeq ($(uname_S),Linux)
706 NO_STRLCPY = YesPlease
707 NO_MKSTEMPS = YesPlease
708 endif
709 ifeq ($(uname_S),GNU/kFreeBSD)
710 NO_STRLCPY = YesPlease
711 NO_MKSTEMPS = YesPlease
712 endif
713 ifeq ($(uname_S),UnixWare)
714 CC = cc
715 NEEDS_SOCKET = YesPlease
716 NEEDS_NSL = YesPlease
717 NEEDS_SSL_WITH_CRYPTO = YesPlease
718 NEEDS_LIBICONV = YesPlease
719 SHELL_PATH = /usr/local/bin/bash
720 NO_IPV6 = YesPlease
721 NO_HSTRERROR = YesPlease
722 NO_MKSTEMPS = YesPlease
723 BASIC_CFLAGS += -Kthread
724 BASIC_CFLAGS += -I/usr/local/include
725 BASIC_LDFLAGS += -L/usr/local/lib
726 INSTALL = ginstall
727 TAR = gtar
728 NO_STRCASESTR = YesPlease
729 NO_MEMMEM = YesPlease
730 endif
731 ifeq ($(uname_S),SCO_SV)
732 ifeq ($(uname_R),3.2)
733 CFLAGS = -O2
734 endif
735 ifeq ($(uname_R),5)
736 CC = cc
737 BASIC_CFLAGS += -Kthread
738 endif
739 NEEDS_SOCKET = YesPlease
740 NEEDS_NSL = YesPlease
741 NEEDS_SSL_WITH_CRYPTO = YesPlease
742 NEEDS_LIBICONV = YesPlease
743 SHELL_PATH = /usr/bin/bash
744 NO_IPV6 = YesPlease
745 NO_HSTRERROR = YesPlease
746 NO_MKSTEMPS = YesPlease
747 BASIC_CFLAGS += -I/usr/local/include
748 BASIC_LDFLAGS += -L/usr/local/lib
749 NO_STRCASESTR = YesPlease
750 NO_MEMMEM = YesPlease
751 INSTALL = ginstall
752 TAR = gtar
753 endif
754 ifeq ($(uname_S),Darwin)
755 NEEDS_CRYPTO_WITH_SSL = YesPlease
756 NEEDS_SSL_WITH_CRYPTO = YesPlease
757 NEEDS_LIBICONV = YesPlease
758 ifeq ($(shell expr "$(uname_R)" : '[15678]\.'),2)
759 OLD_ICONV = UnfortunatelyYes
760 endif
761 ifeq ($(shell expr "$(uname_R)" : '[15]\.'),2)
762 NO_STRLCPY = YesPlease
763 endif
764 NO_MEMMEM = YesPlease
765 USE_ST_TIMESPEC = YesPlease
766 endif
767 ifeq ($(uname_S),SunOS)
768 NEEDS_SOCKET = YesPlease
769 NEEDS_NSL = YesPlease
770 SHELL_PATH = /bin/bash
771 SANE_TOOL_PATH = /usr/xpg6/bin:/usr/xpg4/bin
772 NO_STRCASESTR = YesPlease
773 NO_MEMMEM = YesPlease
774 NO_MKDTEMP = YesPlease
775 NO_MKSTEMPS = YesPlease
776 NO_REGEX = YesPlease
777 ifeq ($(uname_R),5.7)
778 NEEDS_RESOLV = YesPlease
779 NO_IPV6 = YesPlease
780 NO_SOCKADDR_STORAGE = YesPlease
781 NO_UNSETENV = YesPlease
782 NO_SETENV = YesPlease
783 NO_STRLCPY = YesPlease
784 NO_C99_FORMAT = YesPlease
785 NO_STRTOUMAX = YesPlease
786 endif
787 ifeq ($(uname_R),5.8)
788 NO_UNSETENV = YesPlease
789 NO_SETENV = YesPlease
790 NO_C99_FORMAT = YesPlease
791 NO_STRTOUMAX = YesPlease
792 endif
793 ifeq ($(uname_R),5.9)
794 NO_UNSETENV = YesPlease
795 NO_SETENV = YesPlease
796 NO_C99_FORMAT = YesPlease
797 NO_STRTOUMAX = YesPlease
798 endif
799 INSTALL = /usr/ucb/install
800 TAR = gtar
801 BASIC_CFLAGS += -D__EXTENSIONS__ -D__sun__ -DHAVE_ALLOCA_H
802 endif
803 ifeq ($(uname_O),Cygwin)
804 NO_D_TYPE_IN_DIRENT = YesPlease
805 NO_D_INO_IN_DIRENT = YesPlease
806 NO_STRCASESTR = YesPlease
807 NO_MEMMEM = YesPlease
808 NO_MKSTEMPS = YesPlease
809 NO_SYMLINK_HEAD = YesPlease
810 NEEDS_LIBICONV = YesPlease
811 NO_FAST_WORKING_DIRECTORY = UnfortunatelyYes
812 NO_TRUSTABLE_FILEMODE = UnfortunatelyYes
813 OLD_ICONV = UnfortunatelyYes
814 NO_ST_BLOCKS_IN_STRUCT_STAT = YesPlease
815 # There are conflicting reports about this.
816 # On some boxes NO_MMAP is needed, and not so elsewhere.
817 # Try commenting this out if you suspect MMAP is more efficient
818 NO_MMAP = YesPlease
819 NO_IPV6 = YesPlease
820 X = .exe
821 COMPAT_OBJS += compat/cygwin.o
822 UNRELIABLE_FSTAT = UnfortunatelyYes
823 endif
824 ifeq ($(uname_S),FreeBSD)
825 NEEDS_LIBICONV = YesPlease
826 OLD_ICONV = YesPlease
827 NO_MEMMEM = YesPlease
828 BASIC_CFLAGS += -I/usr/local/include
829 BASIC_LDFLAGS += -L/usr/local/lib
830 DIR_HAS_BSD_GROUP_SEMANTICS = YesPlease
831 USE_ST_TIMESPEC = YesPlease
832 ifeq ($(shell expr "$(uname_R)" : '4\.'),2)
833 PTHREAD_LIBS = -pthread
834 NO_UINTMAX_T = YesPlease
835 NO_STRTOUMAX = YesPlease
836 endif
837 PYTHON_PATH = /usr/local/bin/python
838 endif
839 ifeq ($(uname_S),OpenBSD)
840 NO_STRCASESTR = YesPlease
841 NO_MEMMEM = YesPlease
842 USE_ST_TIMESPEC = YesPlease
843 NEEDS_LIBICONV = YesPlease
844 BASIC_CFLAGS += -I/usr/local/include
845 BASIC_LDFLAGS += -L/usr/local/lib
846 endif
847 ifeq ($(uname_S),NetBSD)
848 ifeq ($(shell expr "$(uname_R)" : '[01]\.'),2)
849 NEEDS_LIBICONV = YesPlease
850 endif
851 BASIC_CFLAGS += -I/usr/pkg/include
852 BASIC_LDFLAGS += -L/usr/pkg/lib $(CC_LD_DYNPATH)/usr/pkg/lib
853 USE_ST_TIMESPEC = YesPlease
854 NO_MKSTEMPS = YesPlease
855 endif
856 ifeq ($(uname_S),AIX)
857 NO_STRCASESTR=YesPlease
858 NO_MEMMEM = YesPlease
859 NO_MKDTEMP = YesPlease
860 NO_MKSTEMPS = YesPlease
861 NO_STRLCPY = YesPlease
862 NO_NSEC = YesPlease
863 FREAD_READS_DIRECTORIES = UnfortunatelyYes
864 INTERNAL_QSORT = UnfortunatelyYes
865 NEEDS_LIBICONV=YesPlease
866 BASIC_CFLAGS += -D_LARGE_FILES
867 ifeq ($(shell expr "$(uname_V)" : '[1234]'),1)
868 NO_PTHREADS = YesPlease
869 endif
870 endif
871 ifeq ($(uname_S),GNU)
872 # GNU/Hurd
873 NO_STRLCPY=YesPlease
874 NO_MKSTEMPS = YesPlease
875 endif
876 ifeq ($(uname_S),IRIX)
877 NO_SETENV = YesPlease
878 NO_UNSETENV = YesPlease
879 NO_STRCASESTR = YesPlease
880 NO_MEMMEM = YesPlease
881 NO_MKSTEMPS = YesPlease
882 NO_MKDTEMP = YesPlease
883 # When compiled with the MIPSpro 7.4.4m compiler, and without pthreads
884 # (i.e. NO_PTHREADS is set), and _with_ MMAP (i.e. NO_MMAP is not set),
885 # git dies with a segmentation fault when trying to access the first
886 # entry of a reflog. The conservative choice is made to always set
887 # NO_MMAP. If you suspect that your compiler is not affected by this
888 # issue, comment out the NO_MMAP statement.
889 NO_MMAP = YesPlease
890 SNPRINTF_RETURNS_BOGUS = YesPlease
891 SHELL_PATH = /usr/gnu/bin/bash
892 NEEDS_LIBGEN = YesPlease
893 NEEDS_LIBICONV = YesPlease
894 endif
895 ifeq ($(uname_S),IRIX64)
896 NO_SETENV=YesPlease
897 NO_UNSETENV = YesPlease
898 NO_STRCASESTR=YesPlease
899 NO_MEMMEM = YesPlease
900 NO_MKSTEMPS = YesPlease
901 NO_MKDTEMP = YesPlease
902 # When compiled with the MIPSpro 7.4.4m compiler, and without pthreads
903 # (i.e. NO_PTHREADS is set), and _with_ MMAP (i.e. NO_MMAP is not set),
904 # git dies with a segmentation fault when trying to access the first
905 # entry of a reflog. The conservative choice is made to always set
906 # NO_MMAP. If you suspect that your compiler is not affected by this
907 # issue, comment out the NO_MMAP statement.
908 NO_MMAP = YesPlease
909 SNPRINTF_RETURNS_BOGUS = YesPlease
910 SHELL_PATH=/usr/gnu/bin/bash
911 NEEDS_LIBGEN = YesPlease
912 NEEDS_LIBICONV = YesPlease
913 endif
914 ifeq ($(uname_S),HP-UX)
915 NO_IPV6=YesPlease
916 NO_SETENV=YesPlease
917 NO_STRCASESTR=YesPlease
918 NO_MEMMEM = YesPlease
919 NO_MKSTEMPS = YesPlease
920 NO_STRLCPY = YesPlease
921 NO_MKDTEMP = YesPlease
922 NO_UNSETENV = YesPlease
923 NO_HSTRERROR = YesPlease
924 NO_SYS_SELECT_H = YesPlease
925 SNPRINTF_RETURNS_BOGUS = YesPlease
926 endif
927 ifeq ($(uname_S),Windows)
928 GIT_VERSION := $(GIT_VERSION).MSVC
929 pathsep = ;
930 NO_PREAD = YesPlease
931 NEEDS_CRYPTO_WITH_SSL = YesPlease
932 NO_LIBGEN_H = YesPlease
933 NO_SYMLINK_HEAD = YesPlease
934 NO_IPV6 = YesPlease
935 NO_SETENV = YesPlease
936 NO_UNSETENV = YesPlease
937 NO_STRCASESTR = YesPlease
938 NO_STRLCPY = YesPlease
939 NO_MEMMEM = YesPlease
940 # NEEDS_LIBICONV = YesPlease
941 NO_ICONV = YesPlease
942 NO_C99_FORMAT = YesPlease
943 NO_STRTOUMAX = YesPlease
944 NO_STRTOULL = YesPlease
945 NO_MKDTEMP = YesPlease
946 NO_MKSTEMPS = YesPlease
947 SNPRINTF_RETURNS_BOGUS = YesPlease
948 NO_SVN_TESTS = YesPlease
949 NO_PERL_MAKEMAKER = YesPlease
950 RUNTIME_PREFIX = YesPlease
951 NO_POSIX_ONLY_PROGRAMS = YesPlease
952 NO_ST_BLOCKS_IN_STRUCT_STAT = YesPlease
953 NO_NSEC = YesPlease
954 USE_WIN32_MMAP = YesPlease
955 # USE_NED_ALLOCATOR = YesPlease
956 UNRELIABLE_FSTAT = UnfortunatelyYes
957 OBJECT_CREATION_USES_RENAMES = UnfortunatelyNeedsTo
958 NO_REGEX = YesPlease
959 NO_CURL = YesPlease
960 NO_PYTHON = YesPlease
961 BLK_SHA1 = YesPlease
962
963 CC = compat/vcbuild/scripts/clink.pl
964 AR = compat/vcbuild/scripts/lib.pl
965 CFLAGS =
966 BASIC_CFLAGS = -nologo -I. -I../zlib -Icompat/vcbuild -Icompat/vcbuild/include -DWIN32 -D_CONSOLE -DHAVE_STRING_H -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE
967 COMPAT_OBJS = compat/msvc.o compat/fnmatch/fnmatch.o compat/winansi.o compat/win32/pthread.o
968 COMPAT_CFLAGS = -D__USE_MINGW_ACCESS -DNOGDI -DHAVE_STRING_H -DHAVE_ALLOCA_H -Icompat -Icompat/fnmatch -Icompat/regex -Icompat/fnmatch -Icompat/win32 -DSTRIP_EXTENSION=\".exe\"
969 BASIC_LDFLAGS = -IGNORE:4217 -IGNORE:4049 -NOLOGO -SUBSYSTEM:CONSOLE -NODEFAULTLIB:MSVCRT.lib
970 EXTLIBS = advapi32.lib shell32.lib wininet.lib ws2_32.lib
971 PTHREAD_LIBS =
972 lib =
973 ifndef DEBUG
974 BASIC_CFLAGS += -GL -Os -MT
975 BASIC_LDFLAGS += -LTCG
976 AR += -LTCG
977 else
978 BASIC_CFLAGS += -Zi -MTd
979 endif
980 X = .exe
981 endif
982 ifneq (,$(findstring MINGW,$(uname_S)))
983 pathsep = ;
984 NO_PREAD = YesPlease
985 NEEDS_CRYPTO_WITH_SSL = YesPlease
986 NO_LIBGEN_H = YesPlease
987 NO_SYMLINK_HEAD = YesPlease
988 NO_SETENV = YesPlease
989 NO_UNSETENV = YesPlease
990 NO_STRCASESTR = YesPlease
991 NO_STRLCPY = YesPlease
992 NO_MEMMEM = YesPlease
993 NEEDS_LIBICONV = YesPlease
994 OLD_ICONV = YesPlease
995 NO_C99_FORMAT = YesPlease
996 NO_STRTOUMAX = YesPlease
997 NO_MKDTEMP = YesPlease
998 NO_MKSTEMPS = YesPlease
999 SNPRINTF_RETURNS_BOGUS = YesPlease
1000 NO_SVN_TESTS = YesPlease
1001 NO_PERL_MAKEMAKER = YesPlease
1002 RUNTIME_PREFIX = YesPlease
1003 NO_POSIX_ONLY_PROGRAMS = YesPlease
1004 NO_ST_BLOCKS_IN_STRUCT_STAT = YesPlease
1005 NO_NSEC = YesPlease
1006 USE_WIN32_MMAP = YesPlease
1007 USE_NED_ALLOCATOR = YesPlease
1008 UNRELIABLE_FSTAT = UnfortunatelyYes
1009 OBJECT_CREATION_USES_RENAMES = UnfortunatelyNeedsTo
1010 NO_REGEX = YesPlease
1011 NO_PYTHON = YesPlease
1012 BLK_SHA1 = YesPlease
1013 COMPAT_CFLAGS += -D__USE_MINGW_ACCESS -DNOGDI -Icompat -Icompat/fnmatch -Icompat/win32
1014 COMPAT_CFLAGS += -DSTRIP_EXTENSION=\".exe\"
1015 COMPAT_OBJS += compat/mingw.o compat/fnmatch/fnmatch.o compat/winansi.o \
1016 compat/win32/pthread.o
1017 EXTLIBS += -lws2_32
1018 PTHREAD_LIBS =
1019 X = .exe
1020 ifneq (,$(wildcard ../THIS_IS_MSYSGIT))
1021 htmldir=doc/git/html/
1022 prefix =
1023 INSTALL = /bin/install
1024 EXTLIBS += /mingw/lib/libz.a
1025 NO_R_TO_GCC_LINKER = YesPlease
1026 INTERNAL_QSORT = YesPlease
1027 else
1028 NO_CURL = YesPlease
1029 endif
1030 endif
1031
1032 -include config.mak.autogen
1033 -include config.mak
1034
1035 ifdef SANE_TOOL_PATH
1036 SANE_TOOL_PATH_SQ = $(subst ','\'',$(SANE_TOOL_PATH))
1037 BROKEN_PATH_FIX = 's|^\# @@BROKEN_PATH_FIX@@$$|git_broken_path_fix $(SANE_TOOL_PATH_SQ)|'
1038 PATH := $(SANE_TOOL_PATH):${PATH}
1039 else
1040 BROKEN_PATH_FIX = '/^\# @@BROKEN_PATH_FIX@@$$/d'
1041 endif
1042
1043 ifeq ($(uname_S),Darwin)
1044 ifndef NO_FINK
1045 ifeq ($(shell test -d /sw/lib && echo y),y)
1046 BASIC_CFLAGS += -I/sw/include
1047 BASIC_LDFLAGS += -L/sw/lib
1048 endif
1049 endif
1050 ifndef NO_DARWIN_PORTS
1051 ifeq ($(shell test -d /opt/local/lib && echo y),y)
1052 BASIC_CFLAGS += -I/opt/local/include
1053 BASIC_LDFLAGS += -L/opt/local/lib
1054 endif
1055 endif
1056 PTHREAD_LIBS =
1057 endif
1058
1059 ifndef CC_LD_DYNPATH
1060 ifdef NO_R_TO_GCC_LINKER
1061 # Some gcc does not accept and pass -R to the linker to specify
1062 # the runtime dynamic library path.
1063 CC_LD_DYNPATH = -Wl,-rpath,
1064 else
1065 CC_LD_DYNPATH = -R
1066 endif
1067 endif
1068
1069 ifdef NO_LIBGEN_H
1070 COMPAT_CFLAGS += -DNO_LIBGEN_H
1071 COMPAT_OBJS += compat/basename.o
1072 endif
1073
1074 ifdef NO_CURL
1075 BASIC_CFLAGS += -DNO_CURL
1076 REMOTE_CURL_PRIMARY =
1077 REMOTE_CURL_ALIASES =
1078 REMOTE_CURL_NAMES =
1079 else
1080 ifdef CURLDIR
1081 # Try "-Wl,-rpath=$(CURLDIR)/$(lib)" in such a case.
1082 BASIC_CFLAGS += -I$(CURLDIR)/include
1083 CURL_LIBCURL = -L$(CURLDIR)/$(lib) $(CC_LD_DYNPATH)$(CURLDIR)/$(lib) -lcurl
1084 else
1085 CURL_LIBCURL = -lcurl
1086 endif
1087 REMOTE_CURL_PRIMARY = git-remote-http$X
1088 REMOTE_CURL_ALIASES = git-remote-https$X git-remote-ftp$X git-remote-ftps$X
1089 REMOTE_CURL_NAMES = $(REMOTE_CURL_PRIMARY) $(REMOTE_CURL_ALIASES)
1090 PROGRAMS += $(REMOTE_CURL_NAMES) git-http-fetch$X
1091 curl_check := $(shell (echo 070908; curl-config --vernum) | sort -r | sed -ne 2p)
1092 ifeq "$(curl_check)" "070908"
1093 ifndef NO_EXPAT
1094 PROGRAMS += git-http-push$X
1095 endif
1096 endif
1097 ifndef NO_EXPAT
1098 ifdef EXPATDIR
1099 BASIC_CFLAGS += -I$(EXPATDIR)/include
1100 EXPAT_LIBEXPAT = -L$(EXPATDIR)/$(lib) $(CC_LD_DYNPATH)$(EXPATDIR)/$(lib) -lexpat
1101 else
1102 EXPAT_LIBEXPAT = -lexpat
1103 endif
1104 endif
1105 endif
1106
1107 ifdef ZLIB_PATH
1108 BASIC_CFLAGS += -I$(ZLIB_PATH)/include
1109 EXTLIBS += -L$(ZLIB_PATH)/$(lib) $(CC_LD_DYNPATH)$(ZLIB_PATH)/$(lib)
1110 endif
1111 EXTLIBS += -lz
1112
1113 ifndef NO_POSIX_ONLY_PROGRAMS
1114 PROGRAMS += git-daemon$X
1115 endif
1116 ifndef NO_OPENSSL
1117 OPENSSL_LIBSSL = -lssl
1118 ifdef OPENSSLDIR
1119 BASIC_CFLAGS += -I$(OPENSSLDIR)/include
1120 OPENSSL_LINK = -L$(OPENSSLDIR)/$(lib) $(CC_LD_DYNPATH)$(OPENSSLDIR)/$(lib)
1121 else
1122 OPENSSL_LINK =
1123 endif
1124 ifdef NEEDS_CRYPTO_WITH_SSL
1125 OPENSSL_LINK += -lcrypto
1126 endif
1127 else
1128 BASIC_CFLAGS += -DNO_OPENSSL
1129 BLK_SHA1 = 1
1130 OPENSSL_LIBSSL =
1131 endif
1132 ifdef NEEDS_SSL_WITH_CRYPTO
1133 LIB_4_CRYPTO = $(OPENSSL_LINK) -lcrypto -lssl
1134 else
1135 LIB_4_CRYPTO = $(OPENSSL_LINK) -lcrypto
1136 endif
1137 ifdef NEEDS_LIBICONV
1138 ifdef ICONVDIR
1139 BASIC_CFLAGS += -I$(ICONVDIR)/include
1140 ICONV_LINK = -L$(ICONVDIR)/$(lib) $(CC_LD_DYNPATH)$(ICONVDIR)/$(lib)
1141 else
1142 ICONV_LINK =
1143 endif
1144 EXTLIBS += $(ICONV_LINK) -liconv
1145 endif
1146 ifdef NEEDS_LIBGEN
1147 EXTLIBS += -lgen
1148 endif
1149 ifdef NEEDS_SOCKET
1150 EXTLIBS += -lsocket
1151 endif
1152 ifdef NEEDS_NSL
1153 EXTLIBS += -lnsl
1154 endif
1155 ifdef NEEDS_RESOLV
1156 EXTLIBS += -lresolv
1157 endif
1158 ifdef NO_D_TYPE_IN_DIRENT
1159 BASIC_CFLAGS += -DNO_D_TYPE_IN_DIRENT
1160 endif
1161 ifdef NO_D_INO_IN_DIRENT
1162 BASIC_CFLAGS += -DNO_D_INO_IN_DIRENT
1163 endif
1164 ifdef NO_ST_BLOCKS_IN_STRUCT_STAT
1165 BASIC_CFLAGS += -DNO_ST_BLOCKS_IN_STRUCT_STAT
1166 endif
1167 ifdef USE_NSEC
1168 BASIC_CFLAGS += -DUSE_NSEC
1169 endif
1170 ifdef USE_ST_TIMESPEC
1171 BASIC_CFLAGS += -DUSE_ST_TIMESPEC
1172 endif
1173 ifdef NO_NSEC
1174 BASIC_CFLAGS += -DNO_NSEC
1175 endif
1176 ifdef NO_C99_FORMAT
1177 BASIC_CFLAGS += -DNO_C99_FORMAT
1178 endif
1179 ifdef SNPRINTF_RETURNS_BOGUS
1180 COMPAT_CFLAGS += -DSNPRINTF_RETURNS_BOGUS
1181 COMPAT_OBJS += compat/snprintf.o
1182 endif
1183 ifdef FREAD_READS_DIRECTORIES
1184 COMPAT_CFLAGS += -DFREAD_READS_DIRECTORIES
1185 COMPAT_OBJS += compat/fopen.o
1186 endif
1187 ifdef NO_SYMLINK_HEAD
1188 BASIC_CFLAGS += -DNO_SYMLINK_HEAD
1189 endif
1190 ifdef NO_STRCASESTR
1191 COMPAT_CFLAGS += -DNO_STRCASESTR
1192 COMPAT_OBJS += compat/strcasestr.o
1193 endif
1194 ifdef NO_STRLCPY
1195 COMPAT_CFLAGS += -DNO_STRLCPY
1196 COMPAT_OBJS += compat/strlcpy.o
1197 endif
1198 ifdef NO_STRTOUMAX
1199 COMPAT_CFLAGS += -DNO_STRTOUMAX
1200 COMPAT_OBJS += compat/strtoumax.o
1201 endif
1202 ifdef NO_STRTOULL
1203 COMPAT_CFLAGS += -DNO_STRTOULL
1204 endif
1205 ifdef NO_SETENV
1206 COMPAT_CFLAGS += -DNO_SETENV
1207 COMPAT_OBJS += compat/setenv.o
1208 endif
1209 ifdef NO_MKDTEMP
1210 COMPAT_CFLAGS += -DNO_MKDTEMP
1211 COMPAT_OBJS += compat/mkdtemp.o
1212 endif
1213 ifdef NO_MKSTEMPS
1214 COMPAT_CFLAGS += -DNO_MKSTEMPS
1215 endif
1216 ifdef NO_UNSETENV
1217 COMPAT_CFLAGS += -DNO_UNSETENV
1218 COMPAT_OBJS += compat/unsetenv.o
1219 endif
1220 ifdef NO_SYS_SELECT_H
1221 BASIC_CFLAGS += -DNO_SYS_SELECT_H
1222 endif
1223 ifdef NO_MMAP
1224 COMPAT_CFLAGS += -DNO_MMAP
1225 COMPAT_OBJS += compat/mmap.o
1226 else
1227 ifdef USE_WIN32_MMAP
1228 COMPAT_CFLAGS += -DUSE_WIN32_MMAP
1229 COMPAT_OBJS += compat/win32mmap.o
1230 endif
1231 endif
1232 ifdef OBJECT_CREATION_USES_RENAMES
1233 COMPAT_CFLAGS += -DOBJECT_CREATION_MODE=1
1234 endif
1235 ifdef NO_PREAD
1236 COMPAT_CFLAGS += -DNO_PREAD
1237 COMPAT_OBJS += compat/pread.o
1238 endif
1239 ifdef NO_FAST_WORKING_DIRECTORY
1240 BASIC_CFLAGS += -DNO_FAST_WORKING_DIRECTORY
1241 endif
1242 ifdef NO_TRUSTABLE_FILEMODE
1243 BASIC_CFLAGS += -DNO_TRUSTABLE_FILEMODE
1244 endif
1245 ifdef NO_IPV6
1246 BASIC_CFLAGS += -DNO_IPV6
1247 endif
1248 ifdef NO_UINTMAX_T
1249 BASIC_CFLAGS += -Duintmax_t=uint32_t
1250 endif
1251 ifdef NO_SOCKADDR_STORAGE
1252 ifdef NO_IPV6
1253 BASIC_CFLAGS += -Dsockaddr_storage=sockaddr_in
1254 else
1255 BASIC_CFLAGS += -Dsockaddr_storage=sockaddr_in6
1256 endif
1257 endif
1258 ifdef NO_INET_NTOP
1259 LIB_OBJS += compat/inet_ntop.o
1260 endif
1261 ifdef NO_INET_PTON
1262 LIB_OBJS += compat/inet_pton.o
1263 endif
1264
1265 ifdef NO_ICONV
1266 BASIC_CFLAGS += -DNO_ICONV
1267 endif
1268
1269 ifdef OLD_ICONV
1270 BASIC_CFLAGS += -DOLD_ICONV
1271 endif
1272
1273 ifdef NO_DEFLATE_BOUND
1274 BASIC_CFLAGS += -DNO_DEFLATE_BOUND
1275 endif
1276
1277 ifdef BLK_SHA1
1278 SHA1_HEADER = "block-sha1/sha1.h"
1279 LIB_OBJS += block-sha1/sha1.o
1280 else
1281 ifdef PPC_SHA1
1282 SHA1_HEADER = "ppc/sha1.h"
1283 LIB_OBJS += ppc/sha1.o ppc/sha1ppc.o
1284 else
1285 SHA1_HEADER = <openssl/sha.h>
1286 EXTLIBS += $(LIB_4_CRYPTO)
1287 endif
1288 endif
1289 ifdef NO_PERL_MAKEMAKER
1290 export NO_PERL_MAKEMAKER
1291 endif
1292 ifdef NO_HSTRERROR
1293 COMPAT_CFLAGS += -DNO_HSTRERROR
1294 COMPAT_OBJS += compat/hstrerror.o
1295 endif
1296 ifdef NO_MEMMEM
1297 COMPAT_CFLAGS += -DNO_MEMMEM
1298 COMPAT_OBJS += compat/memmem.o
1299 endif
1300 ifdef INTERNAL_QSORT
1301 COMPAT_CFLAGS += -DINTERNAL_QSORT
1302 COMPAT_OBJS += compat/qsort.o
1303 endif
1304 ifdef RUNTIME_PREFIX
1305 COMPAT_CFLAGS += -DRUNTIME_PREFIX
1306 endif
1307
1308 ifdef NO_PTHREADS
1309 BASIC_CFLAGS += -DNO_PTHREADS
1310 else
1311 EXTLIBS += $(PTHREAD_LIBS)
1312 LIB_OBJS += thread-utils.o
1313 endif
1314
1315 ifdef DIR_HAS_BSD_GROUP_SEMANTICS
1316 COMPAT_CFLAGS += -DDIR_HAS_BSD_GROUP_SEMANTICS
1317 endif
1318 ifdef UNRELIABLE_FSTAT
1319 BASIC_CFLAGS += -DUNRELIABLE_FSTAT
1320 endif
1321 ifdef NO_REGEX
1322 COMPAT_CFLAGS += -Icompat/regex
1323 COMPAT_OBJS += compat/regex/regex.o
1324 endif
1325
1326 ifdef USE_NED_ALLOCATOR
1327 COMPAT_CFLAGS += -DUSE_NED_ALLOCATOR -DOVERRIDE_STRDUP -DNDEBUG -DREPLACE_SYSTEM_ALLOCATOR -Icompat/nedmalloc
1328 COMPAT_OBJS += compat/nedmalloc/nedmalloc.o
1329 endif
1330
1331 ifeq ($(TCLTK_PATH),)
1332 NO_TCLTK=NoThanks
1333 endif
1334
1335 ifeq ($(PERL_PATH),)
1336 NO_PERL=NoThanks
1337 endif
1338
1339 ifeq ($(PYTHON_PATH),)
1340 NO_PYTHON=NoThanks
1341 endif
1342
1343 QUIET_SUBDIR0 = +$(MAKE) -C # space to separate -C and subdir
1344 QUIET_SUBDIR1 =
1345
1346 ifneq ($(findstring $(MAKEFLAGS),w),w)
1347 PRINT_DIR = --no-print-directory
1348 else # "make -w"
1349 NO_SUBDIR = :
1350 endif
1351
1352 ifneq ($(findstring $(MAKEFLAGS),s),s)
1353 ifndef V
1354 QUIET_CC = @echo ' ' CC $@;
1355 QUIET_AR = @echo ' ' AR $@;
1356 QUIET_LINK = @echo ' ' LINK $@;
1357 QUIET_BUILT_IN = @echo ' ' BUILTIN $@;
1358 QUIET_GEN = @echo ' ' GEN $@;
1359 QUIET_LNCP = @echo ' ' LN/CP $@;
1360 QUIET_SUBDIR0 = +@subdir=
1361 QUIET_SUBDIR1 = ;$(NO_SUBDIR) echo ' ' SUBDIR $$subdir; \
1362 $(MAKE) $(PRINT_DIR) -C $$subdir
1363 export V
1364 export QUIET_GEN
1365 export QUIET_BUILT_IN
1366 endif
1367 endif
1368
1369 ifdef ASCIIDOC8
1370 export ASCIIDOC8
1371 endif
1372
1373 # Shell quote (do not use $(call) to accommodate ancient setups);
1374
1375 SHA1_HEADER_SQ = $(subst ','\'',$(SHA1_HEADER))
1376 ETC_GITCONFIG_SQ = $(subst ','\'',$(ETC_GITCONFIG))
1377
1378 DESTDIR_SQ = $(subst ','\'',$(DESTDIR))
1379 bindir_SQ = $(subst ','\'',$(bindir))
1380 bindir_relative_SQ = $(subst ','\'',$(bindir_relative))
1381 mandir_SQ = $(subst ','\'',$(mandir))
1382 infodir_SQ = $(subst ','\'',$(infodir))
1383 gitexecdir_SQ = $(subst ','\'',$(gitexecdir))
1384 template_dir_SQ = $(subst ','\'',$(template_dir))
1385 htmldir_SQ = $(subst ','\'',$(htmldir))
1386 prefix_SQ = $(subst ','\'',$(prefix))
1387
1388 SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH))
1389 PERL_PATH_SQ = $(subst ','\'',$(PERL_PATH))
1390 PYTHON_PATH_SQ = $(subst ','\'',$(PYTHON_PATH))
1391 TCLTK_PATH_SQ = $(subst ','\'',$(TCLTK_PATH))
1392
1393 LIBS = $(GITLIBS) $(EXTLIBS)
1394
1395 BASIC_CFLAGS += -DSHA1_HEADER='$(SHA1_HEADER_SQ)' \
1396 $(COMPAT_CFLAGS)
1397 LIB_OBJS += $(COMPAT_OBJS)
1398
1399 # Quote for C
1400
1401 ifdef DEFAULT_EDITOR
1402 DEFAULT_EDITOR_CQ = "$(subst ",\",$(subst \,\\,$(DEFAULT_EDITOR)))"
1403 DEFAULT_EDITOR_CQ_SQ = $(subst ','\'',$(DEFAULT_EDITOR_CQ))
1404
1405 BASIC_CFLAGS += -DDEFAULT_EDITOR='$(DEFAULT_EDITOR_CQ_SQ)'
1406 endif
1407
1408 ifdef DEFAULT_PAGER
1409 DEFAULT_PAGER_CQ = "$(subst ",\",$(subst \,\\,$(DEFAULT_PAGER)))"
1410 DEFAULT_PAGER_CQ_SQ = $(subst ','\'',$(DEFAULT_PAGER_CQ))
1411
1412 BASIC_CFLAGS += -DDEFAULT_PAGER='$(DEFAULT_PAGER_CQ_SQ)'
1413 endif
1414
1415 ALL_CFLAGS += $(BASIC_CFLAGS)
1416 ALL_LDFLAGS += $(BASIC_LDFLAGS)
1417
1418 export TAR INSTALL DESTDIR SHELL_PATH
1419
1420
1421 ### Build rules
1422
1423 SHELL = $(SHELL_PATH)
1424
1425 all:: shell_compatibility_test $(ALL_PROGRAMS) $(BUILT_INS) $(OTHER_PROGRAMS) GIT-BUILD-OPTIONS
1426 ifneq (,$X)
1427 $(QUIET_BUILT_IN)$(foreach p,$(patsubst %$X,%,$(filter %$X,$(ALL_PROGRAMS) $(BUILT_INS) git$X)), test -d '$p' -o '$p' -ef '$p$X' || $(RM) '$p';)
1428 endif
1429
1430 all::
1431 ifndef NO_TCLTK
1432 $(QUIET_SUBDIR0)git-gui $(QUIET_SUBDIR1) gitexecdir='$(gitexec_instdir_SQ)' all
1433 $(QUIET_SUBDIR0)gitk-git $(QUIET_SUBDIR1) all
1434 endif
1435 ifndef NO_PERL
1436 $(QUIET_SUBDIR0)perl $(QUIET_SUBDIR1) PERL_PATH='$(PERL_PATH_SQ)' prefix='$(prefix_SQ)' all
1437 endif
1438 ifndef NO_PYTHON
1439 $(QUIET_SUBDIR0)git_remote_helpers $(QUIET_SUBDIR1) PYTHON_PATH='$(PYTHON_PATH_SQ)' prefix='$(prefix_SQ)' all
1440 endif
1441 $(QUIET_SUBDIR0)templates $(QUIET_SUBDIR1)
1442
1443 please_set_SHELL_PATH_to_a_more_modern_shell:
1444 @$$(:)
1445
1446 shell_compatibility_test: please_set_SHELL_PATH_to_a_more_modern_shell
1447
1448 strip: $(PROGRAMS) git$X
1449 $(STRIP) $(STRIP_OPTS) $(PROGRAMS) git$X
1450
1451 git.o: common-cmds.h
1452 git.s git.o: ALL_CFLAGS += -DGIT_VERSION='"$(GIT_VERSION)"' \
1453 '-DGIT_HTML_PATH="$(htmldir_SQ)"'
1454
1455 git$X: git.o $(BUILTIN_OBJS) $(GITLIBS)
1456 $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ git.o \
1457 $(BUILTIN_OBJS) $(ALL_LDFLAGS) $(LIBS)
1458
1459 builtin-help.o: common-cmds.h
1460 builtin-help.s builtin-help.o: ALL_CFLAGS += \
1461 '-DGIT_HTML_PATH="$(htmldir_SQ)"' \
1462 '-DGIT_MAN_PATH="$(mandir_SQ)"' \
1463 '-DGIT_INFO_PATH="$(infodir_SQ)"'
1464
1465 $(BUILT_INS): git$X
1466 $(QUIET_BUILT_IN)$(RM) $@ && \
1467 ln git$X $@ 2>/dev/null || \
1468 ln -s git$X $@ 2>/dev/null || \
1469 cp git$X $@
1470
1471 common-cmds.h: ./generate-cmdlist.sh command-list.txt
1472
1473 common-cmds.h: $(wildcard Documentation/git-*.txt)
1474 $(QUIET_GEN)./generate-cmdlist.sh > $@+ && mv $@+ $@
1475
1476 $(patsubst %.sh,%,$(SCRIPT_SH)) : % : %.sh
1477 $(QUIET_GEN)$(RM) $@ $@+ && \
1478 sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \
1479 -e 's|@SHELL_PATH@|$(SHELL_PATH_SQ)|' \
1480 -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \
1481 -e 's/@@NO_CURL@@/$(NO_CURL)/g' \
1482 -e $(BROKEN_PATH_FIX) \
1483 $@.sh >$@+ && \
1484 chmod +x $@+ && \
1485 mv $@+ $@
1486
1487 ifndef NO_PERL
1488 $(patsubst %.perl,%,$(SCRIPT_PERL)): perl/perl.mak
1489
1490 perl/perl.mak: GIT-CFLAGS perl/Makefile perl/Makefile.PL
1491 $(QUIET_SUBDIR0)perl $(QUIET_SUBDIR1) PERL_PATH='$(PERL_PATH_SQ)' prefix='$(prefix_SQ)' $(@F)
1492
1493 $(patsubst %.perl,%,$(SCRIPT_PERL)): % : %.perl
1494 $(QUIET_GEN)$(RM) $@ $@+ && \
1495 INSTLIBDIR=`MAKEFLAGS= $(MAKE) -C perl -s --no-print-directory instlibdir` && \
1496 sed -e '1{' \
1497 -e ' s|#!.*perl|#!$(PERL_PATH_SQ)|' \
1498 -e ' h' \
1499 -e ' s=.*=use lib (split(/$(pathsep)/, $$ENV{GITPERLLIB} || "@@INSTLIBDIR@@"));=' \
1500 -e ' H' \
1501 -e ' x' \
1502 -e '}' \
1503 -e 's|@@INSTLIBDIR@@|'"$$INSTLIBDIR"'|g' \
1504 -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \
1505 $@.perl >$@+ && \
1506 chmod +x $@+ && \
1507 mv $@+ $@
1508
1509
1510 .PHONY: gitweb
1511 gitweb:
1512 $(QUIET_SUBDIR0)gitweb $(QUIET_SUBDIR1) all
1513
1514 ifdef JSMIN
1515 OTHER_PROGRAMS += gitweb/gitweb.cgi gitweb/gitweb.min.js
1516 gitweb/gitweb.cgi: gitweb/gitweb.perl gitweb/gitweb.min.js
1517 else
1518 OTHER_PROGRAMS += gitweb/gitweb.cgi
1519 gitweb/gitweb.cgi: gitweb/gitweb.perl
1520 endif
1521 $(QUIET_SUBDIR0)gitweb $(QUIET_SUBDIR1) $(patsubst gitweb/%,%,$@)
1522
1523 ifdef JSMIN
1524 gitweb/gitweb.min.js: gitweb/gitweb.js
1525 $(QUIET_SUBDIR0)gitweb $(QUIET_SUBDIR1) $(patsubst gitweb/%,%,$@)
1526 endif # JSMIN
1527
1528
1529 git-instaweb: git-instaweb.sh gitweb/gitweb.cgi gitweb/gitweb.css gitweb/gitweb.js
1530 $(QUIET_GEN)$(RM) $@ $@+ && \
1531 sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \
1532 -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \
1533 -e 's/@@NO_CURL@@/$(NO_CURL)/g' \
1534 -e '/@@GITWEB_CGI@@/r gitweb/gitweb.cgi' \
1535 -e '/@@GITWEB_CGI@@/d' \
1536 -e '/@@GITWEB_CSS@@/r gitweb/gitweb.css' \
1537 -e '/@@GITWEB_CSS@@/d' \
1538 -e '/@@GITWEB_JS@@/r gitweb/gitweb.js' \
1539 -e '/@@GITWEB_JS@@/d' \
1540 -e 's|@@PERL@@|$(PERL_PATH_SQ)|g' \
1541 $@.sh > $@+ && \
1542 chmod +x $@+ && \
1543 mv $@+ $@
1544 else # NO_PERL
1545 $(patsubst %.perl,%,$(SCRIPT_PERL)) git-instaweb: % : unimplemented.sh
1546 $(QUIET_GEN)$(RM) $@ $@+ && \
1547 sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \
1548 -e 's|@@REASON@@|NO_PERL=$(NO_PERL)|g' \
1549 unimplemented.sh >$@+ && \
1550 chmod +x $@+ && \
1551 mv $@+ $@
1552 endif # NO_PERL
1553
1554 ifndef NO_PYTHON
1555 $(patsubst %.py,%,$(SCRIPT_PYTHON)): GIT-CFLAGS
1556 $(patsubst %.py,%,$(SCRIPT_PYTHON)): % : %.py
1557 $(QUIET_GEN)$(RM) $@ $@+ && \
1558 INSTLIBDIR=`MAKEFLAGS= $(MAKE) -C git_remote_helpers -s \
1559 --no-print-directory prefix='$(prefix_SQ)' DESTDIR='$(DESTDIR_SQ)' \
1560 instlibdir` && \
1561 sed -e '1{' \
1562 -e ' s|#!.*python|#!$(PYTHON_PATH_SQ)|' \
1563 -e '}' \
1564 -e 's|^import sys.*|&; \\\
1565 import os; \\\
1566 sys.path.insert(0, os.getenv("GITPYTHONLIB",\
1567 "@@INSTLIBDIR@@"));|' \
1568 -e 's|@@INSTLIBDIR@@|'"$$INSTLIBDIR"'|g' \
1569 $@.py >$@+ && \
1570 chmod +x $@+ && \
1571 mv $@+ $@
1572 else # NO_PYTHON
1573 $(patsubst %.py,%,$(SCRIPT_PYTHON)): % : unimplemented.sh
1574 $(QUIET_GEN)$(RM) $@ $@+ && \
1575 sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \
1576 -e 's|@@REASON@@|NO_PYTHON=$(NO_PYTHON)|g' \
1577 unimplemented.sh >$@+ && \
1578 chmod +x $@+ && \
1579 mv $@+ $@
1580 endif # NO_PYTHON
1581
1582 configure: configure.ac
1583 $(QUIET_GEN)$(RM) $@ $<+ && \
1584 sed -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \
1585 $< > $<+ && \
1586 autoconf -o $@ $<+ && \
1587 $(RM) $<+
1588
1589 # These can record GIT_VERSION
1590 git.o git.spec \
1591 $(patsubst %.sh,%,$(SCRIPT_SH)) \
1592 $(patsubst %.perl,%,$(SCRIPT_PERL)) \
1593 : GIT-VERSION-FILE
1594
1595 %.o: %.c GIT-CFLAGS
1596 $(QUIET_CC)$(CC) -o $*.o -c $(ALL_CFLAGS) $<
1597 %.s: %.c GIT-CFLAGS FORCE
1598 $(QUIET_CC)$(CC) -S $(ALL_CFLAGS) $<
1599 %.o: %.S GIT-CFLAGS
1600 $(QUIET_CC)$(CC) -o $*.o -c $(ALL_CFLAGS) $<
1601
1602 exec_cmd.s exec_cmd.o: ALL_CFLAGS += \
1603 '-DGIT_EXEC_PATH="$(gitexecdir_SQ)"' \
1604 '-DBINDIR="$(bindir_relative_SQ)"' \
1605 '-DPREFIX="$(prefix_SQ)"'
1606
1607 builtin-init-db.s builtin-init-db.o: ALL_CFLAGS += \
1608 -DDEFAULT_GIT_TEMPLATE_DIR='"$(template_dir_SQ)"'
1609
1610 config.s config.o: ALL_CFLAGS += -DETC_GITCONFIG='"$(ETC_GITCONFIG_SQ)"'
1611
1612 http.s http.o: ALL_CFLAGS += -DGIT_USER_AGENT='"git/$(GIT_VERSION)"'
1613
1614 ifdef NO_EXPAT
1615 http-walker.o: http.h
1616 http-walker.s http-walker.o: ALL_CFLAGS += -DNO_EXPAT
1617 endif
1618
1619 git-%$X: %.o $(GITLIBS)
1620 $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS)
1621
1622 git-imap-send$X: imap-send.o $(GITLIBS)
1623 $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
1624 $(LIBS) $(OPENSSL_LINK) $(OPENSSL_LIBSSL)
1625
1626 http.o http-walker.o http-push.o: http.h
1627
1628 http.o http-walker.o: $(LIB_H)
1629
1630 git-http-fetch$X: revision.o http.o http-walker.o http-fetch.o $(GITLIBS)
1631 $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
1632 $(LIBS) $(CURL_LIBCURL)
1633 git-http-push$X: revision.o http.o http-push.o $(GITLIBS)
1634 $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
1635 $(LIBS) $(CURL_LIBCURL) $(EXPAT_LIBEXPAT)
1636
1637 $(REMOTE_CURL_ALIASES): $(REMOTE_CURL_PRIMARY)
1638 $(QUIET_LNCP)$(RM) $@ && \
1639 ln $< $@ 2>/dev/null || \
1640 ln -s $< $@ 2>/dev/null || \
1641 cp $< $@
1642
1643 $(REMOTE_CURL_PRIMARY): remote-curl.o http.o http-walker.o $(GITLIBS)
1644 $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
1645 $(LIBS) $(CURL_LIBCURL) $(EXPAT_LIBEXPAT)
1646
1647 $(LIB_OBJS) $(BUILTIN_OBJS): $(LIB_H)
1648 $(patsubst git-%$X,%.o,$(PROGRAMS)) git.o: $(LIB_H) $(wildcard */*.h)
1649 builtin-revert.o wt-status.o: wt-status.h
1650
1651 $(LIB_FILE): $(LIB_OBJS)
1652 $(QUIET_AR)$(RM) $@ && $(AR) rcs $@ $(LIB_OBJS)
1653
1654 XDIFF_OBJS=xdiff/xdiffi.o xdiff/xprepare.o xdiff/xutils.o xdiff/xemit.o \
1655 xdiff/xmerge.o xdiff/xpatience.o
1656 $(XDIFF_OBJS): xdiff/xinclude.h xdiff/xmacros.h xdiff/xdiff.h xdiff/xtypes.h \
1657 xdiff/xutils.h xdiff/xprepare.h xdiff/xdiffi.h xdiff/xemit.h
1658
1659 $(XDIFF_LIB): $(XDIFF_OBJS)
1660 $(QUIET_AR)$(RM) $@ && $(AR) rcs $@ $(XDIFF_OBJS)
1661
1662
1663 doc:
1664 $(MAKE) -C Documentation all
1665
1666 man:
1667 $(MAKE) -C Documentation man
1668
1669 html:
1670 $(MAKE) -C Documentation html
1671
1672 info:
1673 $(MAKE) -C Documentation info
1674
1675 pdf:
1676 $(MAKE) -C Documentation pdf
1677
1678 TAGS:
1679 $(RM) TAGS
1680 $(FIND) . -name '*.[hcS]' -print | xargs etags -a
1681
1682 tags:
1683 $(RM) tags
1684 $(FIND) . -name '*.[hcS]' -print | xargs ctags -a
1685
1686 cscope:
1687 $(RM) cscope*
1688 $(FIND) . -name '*.[hcS]' -print | xargs cscope -b
1689
1690 ### Detect prefix changes
1691 TRACK_CFLAGS = $(subst ','\'',$(ALL_CFLAGS)):\
1692 $(bindir_SQ):$(gitexecdir_SQ):$(template_dir_SQ):$(prefix_SQ)
1693
1694 GIT-CFLAGS: FORCE
1695 @FLAGS='$(TRACK_CFLAGS)'; \
1696 if test x"$$FLAGS" != x"`cat GIT-CFLAGS 2>/dev/null`" ; then \
1697 echo 1>&2 " * new build flags or prefix"; \
1698 echo "$$FLAGS" >GIT-CFLAGS; \
1699 fi
1700
1701 # We need to apply sq twice, once to protect from the shell
1702 # that runs GIT-BUILD-OPTIONS, and then again to protect it
1703 # and the first level quoting from the shell that runs "echo".
1704 GIT-BUILD-OPTIONS: FORCE
1705 @echo SHELL_PATH=\''$(subst ','\'',$(SHELL_PATH_SQ))'\' >$@
1706 @echo PERL_PATH=\''$(subst ','\'',$(PERL_PATH_SQ))'\' >>$@
1707 @echo TAR=\''$(subst ','\'',$(subst ','\'',$(TAR)))'\' >>$@
1708 @echo NO_CURL=\''$(subst ','\'',$(subst ','\'',$(NO_CURL)))'\' >>$@
1709 @echo NO_PERL=\''$(subst ','\'',$(subst ','\'',$(NO_PERL)))'\' >>$@
1710 @echo NO_PYTHON=\''$(subst ','\'',$(subst ','\'',$(NO_PYTHON)))'\' >>$@
1711
1712 ### Detect Tck/Tk interpreter path changes
1713 ifndef NO_TCLTK
1714 TRACK_VARS = $(subst ','\'',-DTCLTK_PATH='$(TCLTK_PATH_SQ)')
1715
1716 GIT-GUI-VARS: FORCE
1717 @VARS='$(TRACK_VARS)'; \
1718 if test x"$$VARS" != x"`cat $@ 2>/dev/null`" ; then \
1719 echo 1>&2 " * new Tcl/Tk interpreter location"; \
1720 echo "$$VARS" >$@; \
1721 fi
1722 endif
1723
1724 ### Testing rules
1725
1726 TEST_PROGRAMS_NEED_X += test-chmtime
1727 TEST_PROGRAMS_NEED_X += test-ctype
1728 TEST_PROGRAMS_NEED_X += test-date
1729 TEST_PROGRAMS_NEED_X += test-delta
1730 TEST_PROGRAMS_NEED_X += test-dump-cache-tree
1731 TEST_PROGRAMS_NEED_X += test-genrandom
1732 TEST_PROGRAMS_NEED_X += test-match-trees
1733 TEST_PROGRAMS_NEED_X += test-parse-options
1734 TEST_PROGRAMS_NEED_X += test-path-utils
1735 TEST_PROGRAMS_NEED_X += test-run-command
1736 TEST_PROGRAMS_NEED_X += test-sha1
1737 TEST_PROGRAMS_NEED_X += test-sigchain
1738 TEST_PROGRAMS_NEED_X += test-index-version
1739
1740 TEST_PROGRAMS = $(patsubst %,%$X,$(TEST_PROGRAMS_NEED_X))
1741
1742 test_bindir_programs := $(patsubst %,bin-wrappers/%,$(BINDIR_PROGRAMS_NEED_X) $(BINDIR_PROGRAMS_NO_X) $(TEST_PROGRAMS_NEED_X))
1743
1744 all:: $(TEST_PROGRAMS) $(test_bindir_programs)
1745
1746 bin-wrappers/%: wrap-for-bin.sh
1747 @mkdir -p bin-wrappers
1748 $(QUIET_GEN)sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \
1749 -e 's|@@BUILD_DIR@@|$(shell pwd)|' \
1750 -e 's|@@PROG@@|$(@F)|' < $< > $@ && \
1751 chmod +x $@
1752
1753 # GNU make supports exporting all variables by "export" without parameters.
1754 # However, the environment gets quite big, and some programs have problems
1755 # with that.
1756
1757 export NO_SVN_TESTS
1758
1759 test: all
1760 $(MAKE) -C t/ all
1761
1762 test-ctype$X: ctype.o
1763
1764 test-date$X: date.o ctype.o
1765
1766 test-delta$X: diff-delta.o patch-delta.o
1767
1768 test-parse-options$X: parse-options.o
1769
1770 test-parse-options.o: parse-options.h
1771
1772 .PRECIOUS: $(patsubst test-%$X,test-%.o,$(TEST_PROGRAMS))
1773
1774 test-%$X: test-%.o $(GITLIBS)
1775 $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS)
1776
1777 check-sha1:: test-sha1$X
1778 ./test-sha1.sh
1779
1780 check: common-cmds.h
1781 if sparse; \
1782 then \
1783 for i in *.c; \
1784 do \
1785 sparse $(ALL_CFLAGS) $(SPARSE_FLAGS) $$i || exit; \
1786 done; \
1787 else \
1788 echo 2>&1 "Did you mean 'make test'?"; \
1789 exit 1; \
1790 fi
1791
1792 remove-dashes:
1793 ./fixup-builtins $(BUILT_INS) $(PROGRAMS) $(SCRIPTS)
1794
1795 ### Installation rules
1796
1797 ifneq ($(filter /%,$(firstword $(template_dir))),)
1798 template_instdir = $(template_dir)
1799 else
1800 template_instdir = $(prefix)/$(template_dir)
1801 endif
1802 export template_instdir
1803
1804 ifneq ($(filter /%,$(firstword $(gitexecdir))),)
1805 gitexec_instdir = $(gitexecdir)
1806 else
1807 gitexec_instdir = $(prefix)/$(gitexecdir)
1808 endif
1809 gitexec_instdir_SQ = $(subst ','\'',$(gitexec_instdir))
1810 export gitexec_instdir
1811
1812 install_bindir_programs := $(patsubst %,%$X,$(BINDIR_PROGRAMS_NEED_X)) $(BINDIR_PROGRAMS_NO_X)
1813
1814 install: all
1815 $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(bindir_SQ)'
1816 $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(gitexec_instdir_SQ)'
1817 $(INSTALL) $(ALL_PROGRAMS) '$(DESTDIR_SQ)$(gitexec_instdir_SQ)'
1818 $(INSTALL) $(install_bindir_programs) '$(DESTDIR_SQ)$(bindir_SQ)'
1819 $(MAKE) -C templates DESTDIR='$(DESTDIR_SQ)' install
1820 ifndef NO_PERL
1821 $(MAKE) -C perl prefix='$(prefix_SQ)' DESTDIR='$(DESTDIR_SQ)' install
1822 endif
1823 ifndef NO_PYTHON
1824 $(MAKE) -C git_remote_helpers prefix='$(prefix_SQ)' DESTDIR='$(DESTDIR_SQ)' install
1825 endif
1826 ifndef NO_TCLTK
1827 $(MAKE) -C gitk-git install
1828 $(MAKE) -C git-gui gitexecdir='$(gitexec_instdir_SQ)' install
1829 endif
1830 ifneq (,$X)
1831 $(foreach p,$(patsubst %$X,%,$(filter %$X,$(ALL_PROGRAMS) $(BUILT_INS) git$X)), test '$(DESTDIR_SQ)$(gitexec_instdir_SQ)/$p' -ef '$(DESTDIR_SQ)$(gitexec_instdir_SQ)/$p$X' || $(RM) '$(DESTDIR_SQ)$(gitexec_instdir_SQ)/$p';)
1832 endif
1833
1834 bindir=$$(cd '$(DESTDIR_SQ)$(bindir_SQ)' && pwd) && \
1835 execdir=$$(cd '$(DESTDIR_SQ)$(gitexec_instdir_SQ)' && pwd) && \
1836 { test "$$bindir/" = "$$execdir/" || \
1837 { $(RM) "$$execdir/git$X" && \
1838 test -z "$(NO_CROSS_DIRECTORY_HARDLINKS)" && \
1839 ln "$$bindir/git$X" "$$execdir/git$X" 2>/dev/null || \
1840 cp "$$bindir/git$X" "$$execdir/git$X"; } ; } && \
1841 { for p in $(BUILT_INS); do \
1842 $(RM) "$$execdir/$$p" && \
1843 ln "$$execdir/git$X" "$$execdir/$$p" 2>/dev/null || \
1844 ln -s "git$X" "$$execdir/$$p" 2>/dev/null || \
1845 cp "$$execdir/git$X" "$$execdir/$$p" || exit; \
1846 done; } && \
1847 { test x"$(REMOTE_CURL_ALIASES)" = x || \
1848 { for p in $(REMOTE_CURL_ALIASES); do \
1849 $(RM) "$$execdir/$$p" && \
1850 ln "$$execdir/git-remote-http$X" "$$execdir/$$p" 2>/dev/null || \
1851 ln -s "git-remote-http$X" "$$execdir/$$p" 2>/dev/null || \
1852 cp "$$execdir/git-remote-http$X" "$$execdir/$$p" || exit; \
1853 done; } ; } && \
1854 ./check_bindir "z$$bindir" "z$$execdir" "$$bindir/git-add$X"
1855
1856 install-doc:
1857 $(MAKE) -C Documentation install
1858
1859 install-man:
1860 $(MAKE) -C Documentation install-man
1861
1862 install-html:
1863 $(MAKE) -C Documentation install-html
1864
1865 install-info:
1866 $(MAKE) -C Documentation install-info
1867
1868 install-pdf:
1869 $(MAKE) -C Documentation install-pdf
1870
1871 quick-install-doc:
1872 $(MAKE) -C Documentation quick-install
1873
1874 quick-install-man:
1875 $(MAKE) -C Documentation quick-install-man
1876
1877 quick-install-html:
1878 $(MAKE) -C Documentation quick-install-html
1879
1880
1881
1882 ### Maintainer's dist rules
1883
1884 git.spec: git.spec.in
1885 sed -e 's/@@VERSION@@/$(GIT_VERSION)/g' < $< > $@+
1886 mv $@+ $@
1887
1888 GIT_TARNAME=git-$(GIT_VERSION)
1889 dist: git.spec git-archive$(X) configure
1890 ./git-archive --format=tar \
1891 --prefix=$(GIT_TARNAME)/ HEAD^{tree} > $(GIT_TARNAME).tar
1892 @mkdir -p $(GIT_TARNAME)
1893 @cp git.spec configure $(GIT_TARNAME)
1894 @echo $(GIT_VERSION) > $(GIT_TARNAME)/version
1895 @$(MAKE) -C git-gui TARDIR=../$(GIT_TARNAME)/git-gui dist-version
1896 $(TAR) rf $(GIT_TARNAME).tar \
1897 $(GIT_TARNAME)/git.spec \
1898 $(GIT_TARNAME)/configure \
1899 $(GIT_TARNAME)/version \
1900 $(GIT_TARNAME)/git-gui/version
1901 @$(RM) -r $(GIT_TARNAME)
1902 gzip -f -9 $(GIT_TARNAME).tar
1903
1904 rpm: dist
1905 $(RPMBUILD) \
1906 --define "_source_filedigest_algorithm md5" \
1907 --define "_binary_filedigest_algorithm md5" \
1908 -ta $(GIT_TARNAME).tar.gz
1909
1910 htmldocs = git-htmldocs-$(GIT_VERSION)
1911 manpages = git-manpages-$(GIT_VERSION)
1912 dist-doc:
1913 $(RM) -r .doc-tmp-dir
1914 mkdir .doc-tmp-dir
1915 $(MAKE) -C Documentation WEBDOC_DEST=../.doc-tmp-dir install-webdoc
1916 cd .doc-tmp-dir && $(TAR) cf ../$(htmldocs).tar .
1917 gzip -n -9 -f $(htmldocs).tar
1918 :
1919 $(RM) -r .doc-tmp-dir
1920 mkdir -p .doc-tmp-dir/man1 .doc-tmp-dir/man5 .doc-tmp-dir/man7
1921 $(MAKE) -C Documentation DESTDIR=./ \
1922 man1dir=../.doc-tmp-dir/man1 \
1923 man5dir=../.doc-tmp-dir/man5 \
1924 man7dir=../.doc-tmp-dir/man7 \
1925 install
1926 cd .doc-tmp-dir && $(TAR) cf ../$(manpages).tar .
1927 gzip -n -9 -f $(manpages).tar
1928 $(RM) -r .doc-tmp-dir
1929
1930 ### Cleaning rules
1931
1932 distclean: clean
1933 $(RM) configure
1934
1935 clean:
1936 $(RM) *.o block-sha1/*.o ppc/*.o compat/*.o compat/*/*.o xdiff/*.o \
1937 $(LIB_FILE) $(XDIFF_LIB)
1938 $(RM) $(ALL_PROGRAMS) $(BUILT_INS) git$X
1939 $(RM) $(TEST_PROGRAMS)
1940 $(RM) -r bin-wrappers
1941 $(RM) *.spec *.pyc *.pyo */*.pyc */*.pyo common-cmds.h TAGS tags cscope*
1942 $(RM) -r autom4te.cache
1943 $(RM) config.log config.mak.autogen config.mak.append config.status config.cache
1944 $(RM) -r $(GIT_TARNAME) .doc-tmp-dir
1945 $(RM) $(GIT_TARNAME).tar.gz git-core_$(GIT_VERSION)-*.tar.gz
1946 $(RM) $(htmldocs).tar.gz $(manpages).tar.gz
1947 $(MAKE) -C Documentation/ clean
1948 ifndef NO_PERL
1949 $(RM) gitweb/gitweb.cgi
1950 $(MAKE) -C perl clean
1951 endif
1952 ifndef NO_PYTHON
1953 $(MAKE) -C git_remote_helpers clean
1954 endif
1955 $(MAKE) -C templates/ clean
1956 $(MAKE) -C t/ clean
1957 ifndef NO_TCLTK
1958 $(MAKE) -C gitk-git clean
1959 $(MAKE) -C git-gui clean
1960 endif
1961 $(RM) GIT-VERSION-FILE GIT-CFLAGS GIT-GUI-VARS GIT-BUILD-OPTIONS
1962
1963 .PHONY: all install clean strip
1964 .PHONY: shell_compatibility_test please_set_SHELL_PATH_to_a_more_modern_shell
1965 .PHONY: FORCE TAGS tags cscope
1966
1967 ### Check documentation
1968 #
1969 check-docs::
1970 @(for v in $(ALL_PROGRAMS) $(BUILT_INS) git gitk; \
1971 do \
1972 case "$$v" in \
1973 git-merge-octopus | git-merge-ours | git-merge-recursive | \
1974 git-merge-resolve | git-merge-subtree | \
1975 git-fsck-objects | git-init-db | \
1976 git-?*--?* ) continue ;; \
1977 esac ; \
1978 test -f "Documentation/$$v.txt" || \
1979 echo "no doc: $$v"; \
1980 sed -e '/^#/d' command-list.txt | \
1981 grep -q "^$$v[ ]" || \
1982 case "$$v" in \
1983 git) ;; \
1984 *) echo "no link: $$v";; \
1985 esac ; \
1986 done; \
1987 ( \
1988 sed -e '/^#/d' \
1989 -e 's/[ ].*//' \
1990 -e 's/^/listed /' command-list.txt; \
1991 ls -1 Documentation/git*txt | \
1992 sed -e 's|Documentation/|documented |' \
1993 -e 's/\.txt//'; \
1994 ) | while read how cmd; \
1995 do \
1996 case "$$how,$$cmd" in \
1997 *,git-citool | \
1998 *,git-gui | \
1999 *,git-help | \
2000 documented,gitattributes | \
2001 documented,gitignore | \
2002 documented,gitmodules | \
2003 documented,gitcli | \
2004 documented,git-tools | \
2005 documented,gitcore-tutorial | \
2006 documented,gitcvs-migration | \
2007 documented,gitdiffcore | \
2008 documented,gitglossary | \
2009 documented,githooks | \
2010 documented,gitrepository-layout | \
2011 documented,gittutorial | \
2012 documented,gittutorial-2 | \
2013 sentinel,not,matching,is,ok ) continue ;; \
2014 esac; \
2015 case " $(ALL_PROGRAMS) $(BUILT_INS) git gitk " in \
2016 *" $$cmd "*) ;; \
2017 *) echo "removed but $$how: $$cmd" ;; \
2018 esac; \
2019 done ) | sort
2020
2021 ### Make sure built-ins do not have dups and listed in git.c
2022 #
2023 check-builtins::
2024 ./check-builtins.sh
2025
2026 ### Test suite coverage testing
2027 #
2028 .PHONY: coverage coverage-clean coverage-build coverage-report
2029
2030 coverage:
2031 $(MAKE) coverage-build
2032 $(MAKE) coverage-report
2033
2034 coverage-clean:
2035 rm -f *.gcda *.gcno
2036
2037 COVERAGE_CFLAGS = $(CFLAGS) -O0 -ftest-coverage -fprofile-arcs
2038 COVERAGE_LDFLAGS = $(CFLAGS) -O0 -lgcov
2039
2040 coverage-build: coverage-clean
2041 $(MAKE) CFLAGS="$(COVERAGE_CFLAGS)" LDFLAGS="$(COVERAGE_LDFLAGS)" all
2042 $(MAKE) CFLAGS="$(COVERAGE_CFLAGS)" LDFLAGS="$(COVERAGE_LDFLAGS)" \
2043 -j1 test
2044
2045 coverage-report:
2046 gcov -b *.c
2047 grep '^function.*called 0 ' *.c.gcov \
2048 | sed -e 's/\([^:]*\)\.gcov: *function \([^ ]*\) called.*/\1: \2/' \
2049 | tee coverage-untested-functions