Fix init-db shared database case
[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).
19b2860c 10CFLAGS=-g -O3 -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 \
3407bb49 18 check-files ls-tree merge-base merge-cache unpack-file
e83c5163
LT
19
20all: $(PROG)
21
22install: $(PROG)
23 install $(PROG) $(HOME)/bin/
24
0fcfd160 25LIB_OBJS=read-cache.o sha1_file.o usage.o object.o commit.o tree.o blob.o
0a02ce72 26LIB_FILE=libgit.a
e590d694 27LIB_H=cache.h object.h
0a02ce72
LT
28
29$(LIB_FILE): $(LIB_OBJS)
30 $(AR) rcs $@ $(LIB_OBJS)
31
32LIBS= $(LIB_FILE) -lssl -lz
e83c5163
LT
33
34init-db: init-db.o
35
0a02ce72
LT
36update-cache: update-cache.o $(LIB_FILE)
37 $(CC) $(CFLAGS) -o update-cache update-cache.o $(LIBS)
e83c5163 38
0a02ce72
LT
39show-diff: show-diff.o $(LIB_FILE)
40 $(CC) $(CFLAGS) -o show-diff show-diff.o $(LIBS)
e83c5163 41
0a02ce72
LT
42write-tree: write-tree.o $(LIB_FILE)
43 $(CC) $(CFLAGS) -o write-tree write-tree.o $(LIBS)
e83c5163 44
0a02ce72
LT
45read-tree: read-tree.o $(LIB_FILE)
46 $(CC) $(CFLAGS) -o read-tree read-tree.o $(LIBS)
e83c5163 47
0a02ce72
LT
48commit-tree: commit-tree.o $(LIB_FILE)
49 $(CC) $(CFLAGS) -o commit-tree commit-tree.o $(LIBS)
e83c5163 50
0a02ce72
LT
51cat-file: cat-file.o $(LIB_FILE)
52 $(CC) $(CFLAGS) -o cat-file cat-file.o $(LIBS)
e83c5163 53
0a02ce72
LT
54fsck-cache: fsck-cache.o $(LIB_FILE) object.o commit.o tree.o blob.o
55 $(CC) $(CFLAGS) -o fsck-cache fsck-cache.o $(LIBS)
7660a188 56
0a02ce72
LT
57checkout-cache: checkout-cache.o $(LIB_FILE)
58 $(CC) $(CFLAGS) -o checkout-cache checkout-cache.o $(LIBS)
33db5f4d 59
0a02ce72
LT
60diff-tree: diff-tree.o $(LIB_FILE)
61 $(CC) $(CFLAGS) -o diff-tree diff-tree.o $(LIBS)
9174026c 62
0a02ce72
LT
63rev-tree: rev-tree.o $(LIB_FILE) object.o commit.o tree.o blob.o
64 $(CC) $(CFLAGS) -o rev-tree rev-tree.o $(LIBS)
84fe9720 65
0a02ce72
LT
66show-files: show-files.o $(LIB_FILE)
67 $(CC) $(CFLAGS) -o show-files show-files.o $(LIBS)
8695c8bf 68
0a02ce72
LT
69check-files: check-files.o $(LIB_FILE)
70 $(CC) $(CFLAGS) -o check-files check-files.o $(LIBS)
74b46e32 71
0a02ce72
LT
72ls-tree: ls-tree.o $(LIB_FILE)
73 $(CC) $(CFLAGS) -o ls-tree ls-tree.o $(LIBS)
7912c070 74
0a02ce72
LT
75merge-base: merge-base.o $(LIB_FILE) object.o commit.o tree.o blob.o
76 $(CC) $(CFLAGS) -o merge-base merge-base.o $(LIBS)
6683463e 77
0a02ce72
LT
78merge-cache: merge-cache.o $(LIB_FILE)
79 $(CC) $(CFLAGS) -o merge-cache merge-cache.o $(LIBS)
75118b13 80
3407bb49
LT
81unpack-file: unpack-file.o $(LIB_FILE)
82 $(CC) $(CFLAGS) -o unpack-file unpack-file.o $(LIBS)
83
e590d694
LT
84blob.o: $(LIB_H)
85cat-file.o: $(LIB_H)
86check-files.o: $(LIB_H)
87checkout-cache.o: $(LIB_H)
88commit.o: $(LIB_H)
89commit-tree.o: $(LIB_H)
90diff-tree.o: $(LIB_H)
91fsck-cache.o: $(LIB_H)
92init-db.o: $(LIB_H)
93ls-tree.o: $(LIB_H)
94merge-base.o: $(LIB_H)
95merge-cache.o: $(LIB_H)
96object.o: $(LIB_H)
97read-cache.o: $(LIB_H)
98read-tree.o: $(LIB_H)
99rev-tree.o: $(LIB_H)
100sha1_file.o: $(LIB_H)
101show-diff.o: $(LIB_H)
102show-files.o: $(LIB_H)
103tree.o: $(LIB_H)
104update-cache.o: $(LIB_H)
105usage.o: $(LIB_H)
3407bb49 106unpack-file.o: $(LIB_H)
e590d694 107write-tree.o: $(LIB_H)
e83c5163
LT
108
109clean:
0a02ce72 110 rm -f *.o $(PROG) $(LIB_FILE)
e83c5163
LT
111
112backup: clean
113 cd .. ; tar czvf dircache.tar.gz dir-cache