1 # Define MOZILLA_SHA1 environment variable when running make to make use of
2 # a bundled SHA1 routine coming from Mozilla. It is GPL'd and should be fast
3 # on non-x86 architectures (e.g. PowerPC), while the OpenSSL version (default
4 # choice) has very fast version optimized for i586.
6 # Define NO_OPENSSL environment variable if you do not have OpenSSL. You will
7 # miss out git-rev-list --merge-order. This also implies MOZILLA_SHA1.
9 # Define NO_CURL if you do not have curl installed. git-http-pull is not
10 # built, and you cannot use http:// and https:// transports.
12 # Define PPC_SHA1 environment variable when running make to make use of
13 # a bundled SHA1 routine optimized for PowerPC.
15 # Define NEEDS_SSL_WITH_CRYPTO if you need -lcrypto with -lssl (Darwin).
17 # Define NEEDS_LIBICONV if linking with libc is not enough (Darwin).
19 # Define NEEDS_SOCKET if linking with libc is not enough (SunOS,
22 # Define NO_GETDOMAINNAME if your library lack it (SunOS, Patrick Mauritz).
24 # Define COLLISION_CHECK below if you believe that SHA1's
25 # 1461501637330902918203684832716283019655932542976 hashes do not give you
26 # sufficient guarantee that no collisions between objects will ever happen.
28 # DEFINES += -DCOLLISION_CHECK
30 # Define USE_NSEC below if you want git to care about sub-second file mtimes
31 # and ctimes. Note that you need recent glibc (at least 2.2.4) for this, and
32 # it will BREAK YOUR LOCAL DIFFS! show-diff and anything using it will likely
33 # randomly break unless your underlying filesystem supports those sub-second
34 # times (my ext3 doesn't).
36 # DEFINES += -DUSE_NSEC
38 # Define USE_STDEV below if you want git to care about the underlying device
39 # change being considered an inode change from the update-cache perspective.
41 # DEFINES += -DUSE_STDEV
46 ALL_CFLAGS
= $(CFLAGS
) $(PLATFORM_DEFINES
) $(DEFINES
)
49 bindir = $(prefix)/bin
50 template_dir
= $(prefix)/share
/git-core
/templates
/
51 GIT_PYTHON_DIR
= $(prefix)/share
/git-core
/python
59 # sparse is architecture-neutral, which means that we need to tell it
60 # explicitly what architecture to check for. Fix this up for yours..
61 SPARSE_FLAGS
= -D__BIG_ENDIAN__
-D__powerpc__
65 ### --- END CONFIGURATION SECTION ---
68 git-add.sh git-bisect.sh git-branch.sh git-checkout.sh \
69 git-cherry.sh git-clone.sh git-commit.sh \
70 git-count-objects.sh git-diff.sh git-fetch.sh \
71 git-format-patch.sh git-log.sh git-ls-remote.sh \
72 git-merge-one-file.sh git-octopus.sh git-parse-remote.sh \
73 git-prune.sh git-pull.sh git-push.sh git-rebase.sh \
74 git-repack.sh git-request-pull.sh git-reset.sh \
75 git-resolve.sh git-revert.sh git-sh-setup.sh git-status.sh \
76 git-tag.sh git-verify-tag.sh git-whatchanged.sh git.sh \
77 git-applymbox.sh git-applypatch.sh \
78 git-merge.sh git-merge-stupid.sh git-merge-octopus.sh \
79 git-merge-resolve.sh git-grep.sh
82 git-archimport.perl git-cvsimport.perl git-relink.perl \
83 git-rename.perl git-shortlog.perl
86 git-merge-recursive.py
88 # The ones that do not have to link with lcrypto nor lz.
90 git-get-tar-commit-id git-mailinfo git-mailsplit git-stripspace \
93 # ... and all the rest
95 git-apply git-build-rev-cache git-cat-file \
96 git-checkout-index git-clone-pack git-commit-tree \
97 git-convert-objects git-diff-files \
98 git-diff-helper git-diff-index git-diff-stages \
99 git-diff-tree git-export git-fetch-pack git-fsck-objects \
100 git-hash-object git-init-db \
101 git-local-fetch git-ls-files git-ls-tree git-merge-base \
102 git-merge-index git-mktag git-pack-objects git-patch-id \
103 git-peek-remote git-prune-packed git-read-tree \
104 git-receive-pack git-rev-list git-rev-parse \
105 git-rev-tree git-send-pack git-show-branch \
106 git-show-index git-show-rev-cache git-ssh-fetch \
107 git-ssh-upload git-tar-tree git-unpack-file \
108 git-unpack-objects git-update-index git-update-server-info \
109 git-upload-pack git-verify-pack git-write-tree \
115 ifdef WITH_SEND_EMAIL
116 SCRIPT_PERL
+= git-send-email.perl
120 PROGRAMS
+= git-http-fetch
126 blob.h cache.h commit.h count-delta.h csum-file.h delta.h \
127 diff.h epoch.h object.h pack.h pkt-line.h quote.h refs.h \
128 rev-cache.h run-command.h strbuf.h tag.h tree.h
131 diff.o diffcore-break.o diffcore-order.o diffcore-pathspec.o \
132 diffcore-pickaxe.o diffcore-rename.o
135 blob.o commit.o connect.o count-delta.o csum-file.o \
136 date.o diff-delta.o entry.o ident.o index.o \
137 object.o pack-check.o patch-delta.o path.o pkt-line.o \
138 quote.o read-cache.o refs.o rev-cache.o run-command.o \
139 server-info.o setup.o sha1_file.o sha1_name.o strbuf.o \
140 tag.o tree.o usage.o
$(DIFF_OBJS
)
145 ifeq ($(shell uname
-s
),Darwin
)
146 NEEDS_SSL_WITH_CRYPTO
= YesPlease
147 NEEDS_LIBICONV
= YesPlease
149 ifeq ($(shell uname
-s
),SunOS
)
150 NEEDS_SOCKET
= YesPlease
151 PLATFORM_DEFINES
+= -DNO_GETDOMAINNAME
=1
158 PERL_PATH
= /usr
/bin
/perl
161 PYTHON_PATH
= /usr
/bin
/python
166 OPENSSL_LIBSSL
= -lssl
168 DEFINES
+= '-DNO_OPENSSL'
172 ifdef NEEDS_SSL_WITH_CRYPTO
173 LIB_4_CRYPTO
= -lcrypto
-lssl
175 LIB_4_CRYPTO
= -lcrypto
178 LIB_4_ICONV
= -liconv
183 SHA1_HEADER
= "mozilla-sha1/sha1.h"
184 LIB_OBJS
+= mozilla-sha1
/sha1.o
187 SHA1_HEADER
= "ppc/sha1.h"
188 LIB_OBJS
+= ppc
/sha1.o ppc
/sha1ppc.o
190 SHA1_HEADER
= <openssl
/sha.h
>
191 LIBS
+= $(LIB_4_CRYPTO
)
196 SIMPLE_LIB
+= -lsocket
199 DEFINES
+= '-DSHA1_HEADER=$(SHA1_HEADER)'
201 SCRIPTS
= $(patsubst %.sh
,%,$(SCRIPT_SH
)) \
202 $(patsubst %.perl
,%,$(SCRIPT_PERL
)) \
203 $(patsubst %.py
,%,$(SCRIPT_PYTHON
)) \
208 all: $(PROGRAMS
) $(SCRIPTS
)
215 sed
-e
's/@@GIT_VERSION@@/$(GIT_VERSION)/g' <$@.sh
>$@
+
219 $(filter-out git
,$(patsubst %.sh
,%,$(SCRIPT_SH
))) : % : %.sh
221 sed
-e
'1s|#!.*/sh|#!$(SHELL_PATH)|' $@.sh
>$@
224 $(patsubst %.perl
,%,$(SCRIPT_PERL
)) : % : %.perl
226 sed
-e
'1s|#!.*perl|#!$(PERL_PATH)|' $@.perl
>$@
229 $(patsubst %.py
,%,$(SCRIPT_PYTHON
)) : % : %.py
231 sed
-e
'1s|#!.*python|#!$(PYTHON_PATH)|' \
232 -e
's|@@GIT_PYTHON_PATH@@|$(GIT_PYTHON_DIR)|g' \
237 $(CC
) -o
$*.o
-c
$(ALL_CFLAGS
) $<
239 $(CC
) -o
$*.o
-c
$(ALL_CFLAGS
) $<
241 git-
%: %.o
$(LIB_FILE
)
242 $(CC
) $(ALL_CFLAGS
) -o
$@
$(filter %.o
,$^
) $(LIBS
)
244 git-mailinfo
: SIMPLE_LIB
+= $(LIB_4_ICONV
)
245 $(SIMPLE_PROGRAMS
) : $(LIB_FILE
)
246 $(SIMPLE_PROGRAMS
) : git-
% : %.o
247 $(CC
) $(ALL_CFLAGS
) -o
$@
$(filter %.o
,$^
) $(LIB_FILE
) $(SIMPLE_LIB
)
249 git-http-fetch
: fetch.o
250 git-local-fetch
: fetch.o
251 git-ssh-fetch
: rsh.o fetch.o
252 git-ssh-upload
: rsh.o
254 git-http-fetch
: LIBS
+= -lcurl
255 git-rev-list
: LIBS
+= $(OPENSSL_LIBSSL
)
258 $(CC
) -c
$(ALL_CFLAGS
) \
259 -DDEFAULT_GIT_TEMPLATE_DIR
='"$(template_dir)"' $*.c
261 $(LIB_OBJS
): $(LIB_H
)
262 $(patsubst git-
%,%.o
,$(PROGRAMS
)): $(LIB_H
)
263 $(DIFF_OBJS
): diffcore.h
265 $(LIB_FILE
): $(LIB_OBJS
)
266 $(AR
) rcs
$@
$(LIB_OBJS
)
269 $(MAKE
) -C Documentation
all
277 test-date
: test-date.c date.o
278 $(CC
) $(ALL_CFLAGS
) -o
$@ test-date.c date.o
280 test-delta
: test-delta.c diff-delta.o patch-delta.o
281 $(CC
) $(ALL_CFLAGS
) -o
$@
$^
284 for i in
*.c
; do sparse
$(ALL_CFLAGS
) $(SPARSE_FLAGS
) $$i; done
288 ### Installation rules
290 install: $(PROGRAMS
) $(SCRIPTS
)
291 $(INSTALL
) -m755
-d
$(DESTDIR
)$(bindir)
292 $(INSTALL
) $(PROGRAMS
) $(SCRIPTS
) $(DESTDIR
)$(bindir)
293 $(INSTALL
) git-revert
$(DESTDIR
)$(bindir)/git-cherry-pick
294 sh .
/cmd-rename.sh
$(DESTDIR
)$(bindir)
295 $(MAKE
) -C templates
install
296 $(INSTALL
) -m755
-d
$(DESTDIR
)$(GIT_PYTHON_DIR
)
297 $(INSTALL
) $(PYMODULES
) $(DESTDIR
)$(GIT_PYTHON_DIR
)
300 $(MAKE
) -C Documentation
install
305 ### Maintainer's dist rules
307 git-core.spec
: git-core.spec.in Makefile
308 sed
-e
's/@@VERSION@@/$(GIT_VERSION)/g' < $< > $@
310 GIT_TARNAME
=git-core-
$(GIT_VERSION
)
311 dist: git-core.spec git-tar-tree
312 .
/git-tar-tree HEAD
$(GIT_TARNAME
) > $(GIT_TARNAME
).
tar
313 @mkdir
-p
$(GIT_TARNAME
)
314 @cp git-core.spec
$(GIT_TARNAME
)
315 tar rf
$(GIT_TARNAME
).
tar $(GIT_TARNAME
)/git-core.spec
316 @
rm -rf
$(GIT_TARNAME
)
317 gzip
-f
-9 $(GIT_TARNAME
).
tar
320 $(RPMBUILD
) -ta git-core-
$(GIT_VERSION
).
tar.gz
323 rm -rf
$(GIT_TARNAME
)
324 tar zxf
$(GIT_TARNAME
).
tar.gz
325 dpkg-source
-b
$(GIT_TARNAME
)
326 cd
$(GIT_TARNAME
) && fakeroot debian
/rules binary
331 rm -f
*.o mozilla-sha1
/*.o ppc
/*.o
$(PROGRAMS
) $(LIB_FILE
)
332 rm -f
$(filter-out gitk
,$(SCRIPTS
))
334 rm -rf
$(GIT_TARNAME
)
335 rm -f
$(GIT_TARNAME
).
tar.gz git-core_
$(GIT_VERSION
)-*.
tar.gz
336 rm -f git-core_
$(GIT_VERSION
)-*.deb git-core_
$(GIT_VERSION
)-*.dsc
337 rm -f git-tk_
$(GIT_VERSION
)-*.deb
338 $(MAKE
) -C Documentation
/ clean
339 $(MAKE
) -C templates
/ clean