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).
16 # Define NEEDS_LIBICONV if linking with libc is not enough (Darwin).
18 # Define COLLISION_CHECK below if you believe that SHA1's
19 # 1461501637330902918203684832716283019655932542976 hashes do not give you
20 # sufficient guarantee that no collisions between objects will ever happen.
22 # DEFINES += -DCOLLISION_CHECK
24 # Define USE_NSEC below if you want git to care about sub-second file mtimes
25 # and ctimes. Note that you need recent glibc (at least 2.2.4) for this, and
26 # it will BREAK YOUR LOCAL DIFFS! show-diff and anything using it will likely
27 # randomly break unless your underlying filesystem supports those sub-second
28 # times (my ext3 doesn't).
30 # DEFINES += -DUSE_NSEC
32 # Define USE_STDEV below if you want git to care about the underlying device
33 # change being considered an inode change from the update-cache perspective.
35 # DEFINES += -DUSE_STDEV
40 ALL_CFLAGS
= $(CFLAGS
) $(DEFINES
)
43 bindir = $(prefix)/bin
44 template_dir
= $(prefix)/share
/git-core
/templates
/
52 # sparse is architecture-neutral, which means that we need to tell it
53 # explicitly what architecture to check for. Fix this up for yours..
54 SPARSE_FLAGS
= -D__BIG_ENDIAN__
-D__powerpc__
58 ### --- END CONFIGURATION SECTION ---
62 SCRIPTS
=git git-merge-one-file-script git-prune-script \
63 git-pull-script git-tag-script git-resolve-script git-whatchanged \
64 git-fetch-script git-status-script git-commit-script \
65 git-log-script git-shortlog git-cvsimport-script git-diff-script \
66 git-reset-script git-add-script git-checkout-script git-clone-script \
67 gitk git-cherry git-rebase-script git-relink-script git-repack-script \
68 git-format-patch-script git-sh-setup-script git-push-script \
69 git-branch-script git-parse-remote-script git-verify-tag-script \
70 git-ls-remote-script git-rename-script \
71 git-request-pull-script git-bisect-script \
72 git-applymbox git-applypatch
74 SCRIPTS
+= git-count-objects-script
75 SCRIPTS
+= git-revert-script
76 SCRIPTS
+= git-octopus-script
77 SCRIPTS
+= git-archimport-script
79 # The ones that do not have to link with lcrypto nor lz.
81 git-get-tar-commit-id git-mailinfo git-mailsplit git-stripspace \
84 # ... and all the rest
85 PROG
= git-update-cache git-diff-files git-init-db git-write-tree \
86 git-read-tree git-commit-tree git-cat-file git-fsck-cache \
87 git-checkout-cache git-diff-tree git-rev-tree git-ls-files \
88 git-ls-tree git-merge-base git-merge-cache \
89 git-unpack-file git-export git-diff-cache git-convert-cache \
90 git-ssh-push git-ssh-pull git-rev-list git-mktag \
91 git-diff-helper git-tar-tree git-local-pull git-hash-object \
93 git-diff-stages git-rev-parse git-patch-id git-pack-objects \
94 git-unpack-objects git-verify-pack git-receive-pack git-send-pack \
95 git-prune-packed git-fetch-pack git-upload-pack git-clone-pack \
96 git-show-index git-peek-remote git-show-branch \
97 git-update-server-info git-show-rev-cache git-build-rev-cache \
100 ifdef WITH_SEND_EMAIL
101 SCRIPTS
+= git-send-email-script
109 LIB_H
=cache.h object.h blob.h tree.h commit.h tag.h delta.h epoch.h csum-file.h \
110 pack.h pkt-line.h refs.h
111 LIB_OBJS
=read-cache.o sha1_file.o usage.o object.o commit.o tree.o blob.o \
112 tag.o date.o index.o diff-delta.o patch-delta.o entry.o path.o \
113 refs.o csum-file.o pack-check.o pkt-line.o connect.o ident.o \
117 LIB_OBJS
+= rev-cache.o
119 LIB_H
+= run-command.h
120 LIB_OBJS
+= run-command.o
128 LIB_H
+= diff.h count-delta.h
129 DIFF_OBJS
= diff.o diffcore-rename.o diffcore-pickaxe.o diffcore-pathspec.o \
130 diffcore-break.o diffcore-order.o
131 LIB_OBJS
+= $(DIFF_OBJS
) count-delta.o
134 LIB_OBJS
+= server-info.o
139 ifeq ($(shell uname
-s
),Darwin
)
140 NEEDS_SSL_WITH_CRYPTO
= YesPlease
141 NEEDS_LIBICONV
= YesPlease
148 DEFINES
+= '-DNO_OPENSSL'
152 ifdef NEEDS_SSL_WITH_CRYPTO
153 LIB_4_CRYPTO
= -lcrypto
-lssl
155 LIB_4_CRYPTO
= -lcrypto
158 LIB_4_ICONV
= -liconv
163 SHA1_HEADER
="mozilla-sha1/sha1.h"
164 LIB_OBJS
+= mozilla-sha1
/sha1.o
167 SHA1_HEADER
="ppc/sha1.h"
168 LIB_OBJS
+= ppc
/sha1.o ppc
/sha1ppc.o
170 SHA1_HEADER
=<openssl
/sha.h
>
171 LIBS
+= $(LIB_4_CRYPTO
)
175 DEFINES
+= '-DSHA1_HEADER=$(SHA1_HEADER)'
187 $(CC
) -o
$*.o
-c
$(ALL_CFLAGS
) $<
189 $(CC
) -o
$*.o
-c
$(ALL_CFLAGS
) $<
191 git-
%: %.o
$(LIB_FILE
)
192 $(CC
) $(ALL_CFLAGS
) -o
$@
$(filter %.o
,$^
) $(LIBS
)
194 git-mailinfo
: SIMPLE_LIB
+= $(LIB_4_ICONV
)
195 $(SIMPLE_PROGRAMS
) : $(LIB_FILE
)
196 $(SIMPLE_PROGRAMS
) : git-
% : %.o
197 $(CC
) $(ALL_CFLAGS
) -o
$@
$(filter %.o
,$^
) $(LIB_FILE
) $(SIMPLE_LIB
)
199 git-http-pull
: pull.o
200 git-local-pull
: pull.o
201 git-ssh-pull
: rsh.o pull.o
204 git-http-pull
: LIBS
+= -lcurl
205 git-rev-list
: LIBS
+= $(OPENSSL_LIBSSL
)
208 $(CC
) -c
$(ALL_CFLAGS
) \
209 -DDEFAULT_GIT_TEMPLATE_DIR
='"$(template_dir)"' $*.c
211 $(LIB_OBJS
): $(LIB_H
)
212 $(patsubst git-
%,%.o
,$(PROG
)): $(LIB_H
)
213 $(DIFF_OBJS
): diffcore.h
215 $(LIB_FILE
): $(LIB_OBJS
)
216 $(AR
) rcs
$@
$(LIB_OBJS
)
219 $(MAKE
) -C Documentation
all
228 test-date
: test-date.c date.o
229 $(CC
) $(ALL_CFLAGS
) -o
$@ test-date.c date.o
231 test-delta
: test-delta.c diff-delta.o patch-delta.o
232 $(CC
) $(ALL_CFLAGS
) -o
$@
$^
235 for i in
*.c
; do sparse
$(ALL_CFLAGS
) $(SPARSE_FLAGS
) $$i; done
239 ### Installation rules
241 install: $(PROG
) $(SCRIPTS
)
242 $(INSTALL
) -m755
-d
$(DESTDIR
)$(bindir)
243 $(INSTALL
) $(PROG
) $(SCRIPTS
) $(DESTDIR
)$(bindir)
244 $(INSTALL
) git-revert-script
$(DESTDIR
)$(bindir)/git-cherry-pick-script
245 $(MAKE
) -C templates
install
248 $(MAKE
) -C Documentation
install
253 ### Maintainer's dist rules
255 git-core.spec
: git-core.spec.in Makefile
256 sed
-e
's/@@VERSION@@/$(GIT_VERSION)/g' < $< > $@
258 GIT_TARNAME
=git-core-
$(GIT_VERSION
)
259 dist: git-core.spec git-tar-tree
260 .
/git-tar-tree HEAD
$(GIT_TARNAME
) > $(GIT_TARNAME
).
tar
261 @mkdir
-p
$(GIT_TARNAME
)
262 @cp git-core.spec
$(GIT_TARNAME
)
263 tar rf
$(GIT_TARNAME
).
tar $(GIT_TARNAME
)/git-core.spec
264 @
rm -rf
$(GIT_TARNAME
)
265 gzip
-f
-9 $(GIT_TARNAME
).
tar
268 $(RPMBUILD
) -ta git-core-
$(GIT_VERSION
).
tar.gz
271 rm -rf
$(GIT_TARNAME
)
272 tar zxf
$(GIT_TARNAME
).
tar.gz
273 dpkg-source
-b
$(GIT_TARNAME
)
274 cd
$(GIT_TARNAME
) && fakeroot debian
/rules binary
279 rm -f
*.o mozilla-sha1
/*.o ppc
/*.o
$(PROG
) $(LIB_FILE
)
281 rm -rf
$(GIT_TARNAME
)
282 rm -f
$(GIT_TARNAME
).
tar.gz git-core_
$(GIT_VERSION
)-*.
tar.gz
283 rm -f git-core_
$(GIT_VERSION
)-*.deb git-core_
$(GIT_VERSION
)-*.dsc
284 rm -f git-tk_
$(GIT_VERSION
)-*.deb
285 $(MAKE
) -C Documentation
/ clean
286 $(MAKE
) -C templates
/ clean