Add example "git-tag-script" to show how to create signed tag objects.
[git/git.git] / Makefile
CommitLineData
5c2a7fbc
PB
1# -DCOLLISION_CHECK if you believe that SHA1's
2# 1461501637330902918203684832716283019655932542976 hashes do not give you
3# enough guarantees about no collisions between objects ever hapenning.
bdd4da59
PB
4#
5# -DNSEC if you want git to care about sub-second file mtimes and ctimes.
6# Note that you need some new glibc (at least >2.2.4) for this, and it will
7# BREAK YOUR LOCAL DIFFS! show-diff and anything using it will likely randomly
8# break unless your underlying filesystem supports those sub-second times
9# (my ext3 doesn't).
2dee0609 10CFLAGS=-g -O2 -Wall
5c2a7fbc 11
e83c5163 12CC=gcc
0a02ce72 13AR=ar
e83c5163 14
bdd4da59 15
7912c070 16PROG= update-cache show-diff init-db write-tree read-tree commit-tree \
74b46e32 17 cat-file fsck-cache checkout-cache diff-tree rev-tree show-files \
e74f8f6a 18 check-files ls-tree merge-base merge-cache unpack-file git-export \
ec4465ad 19 diff-cache convert-cache http-pull rpush rpull rev-list git-mktag
e83c5163
LT
20
21all: $(PROG)
22
23install: $(PROG)
24 install $(PROG) $(HOME)/bin/
25
0fcfd160 26LIB_OBJS=read-cache.o sha1_file.o usage.o object.o commit.o tree.o blob.o
0a02ce72 27LIB_FILE=libgit.a
e590d694 28LIB_H=cache.h object.h
0a02ce72 29
cc1ad5c8
LT
30LIBS = $(LIB_FILE)
31LIBS += -lz
cef661fc
LT
32
33ifdef MOZILLA_SHA1
34 SHA1_HEADER="mozilla-sha1/sha1.h"
35 LIB_OBJS += mozilla-sha1/sha1.o
a6ef3518
PM
36else
37ifdef PPC_SHA1
38 SHA1_HEADER="ppc/sha1.h"
39 LIB_OBJS += ppc/sha1.o ppc/sha1ppc.o
cef661fc
LT
40else
41 SHA1_HEADER=<openssl/sha.h>
42 LIBS += -lssl
43endif
a6ef3518 44endif
cef661fc
LT
45
46CFLAGS += '-DSHA1_HEADER=$(SHA1_HEADER)'
cc1ad5c8 47
0a02ce72
LT
48$(LIB_FILE): $(LIB_OBJS)
49 $(AR) rcs $@ $(LIB_OBJS)
50
e83c5163
LT
51init-db: init-db.o
52
90ffd095 53%: %.c $(LIB_FILE)
6eb7ed54
DB
54 $(CC) $(CFLAGS) -o $@ $(filter %.c,$^) $(LIBS)
55
56rpush: rsh.c
57
58rpull: rsh.c
59
60http-pull: LIBS += -lcurl
d98b46f8 61
e590d694
LT
62blob.o: $(LIB_H)
63cat-file.o: $(LIB_H)
64check-files.o: $(LIB_H)
65checkout-cache.o: $(LIB_H)
66commit.o: $(LIB_H)
67commit-tree.o: $(LIB_H)
d98b46f8 68convert-cache.o: $(LIB_H)
e74f8f6a 69diff-cache.o: $(LIB_H)
e590d694
LT
70diff-tree.o: $(LIB_H)
71fsck-cache.o: $(LIB_H)
e74f8f6a 72git-export.o: $(LIB_H)
e590d694
LT
73init-db.o: $(LIB_H)
74ls-tree.o: $(LIB_H)
75merge-base.o: $(LIB_H)
76merge-cache.o: $(LIB_H)
77object.o: $(LIB_H)
78read-cache.o: $(LIB_H)
79read-tree.o: $(LIB_H)
80rev-tree.o: $(LIB_H)
81sha1_file.o: $(LIB_H)
82show-diff.o: $(LIB_H)
83show-files.o: $(LIB_H)
84tree.o: $(LIB_H)
85update-cache.o: $(LIB_H)
86usage.o: $(LIB_H)
3407bb49 87unpack-file.o: $(LIB_H)
e590d694 88write-tree.o: $(LIB_H)
6eb7ed54
DB
89http-pull.o: $(LIB_H)
90rpull.o: $(LIB_H)
91rpush.o: $(LIB_H)
e83c5163
LT
92
93clean:
a6ef3518 94 rm -f *.o mozilla-sha1/*.o ppc/*.o $(PROG) $(LIB_FILE)
e83c5163
LT
95
96backup: clean
97 cd .. ; tar czvf dircache.tar.gz dir-cache