85859b09a31e699f923979223e6232b103ccdee9
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.
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).
10CFLAGS=-g -O3 -Wall
11
12CC=gcc
13AR=ar
14
15
16PROG= update-cache show-diff init-db write-tree read-tree commit-tree \
17 cat-file fsck-cache checkout-cache diff-tree rev-tree show-files \
18 check-files ls-tree merge-base merge-cache
19
20all: $(PROG)
21
22install: $(PROG)
23 install $(PROG) $(HOME)/bin/
24
25LIB_OBJS=read-cache.o sha1_file.o usage.o object.o commit.o tree.o blob.o
26LIB_FILE=libgit.a
27LIB_H=cache.h object.h
28
29$(LIB_FILE): $(LIB_OBJS)
30 $(AR) rcs $@ $(LIB_OBJS)
31
32LIBS= $(LIB_FILE) -lssl -lz
33
34init-db: init-db.o
35
36update-cache: update-cache.o $(LIB_FILE)
37 $(CC) $(CFLAGS) -o update-cache update-cache.o $(LIBS)
38
39show-diff: show-diff.o $(LIB_FILE)
40 $(CC) $(CFLAGS) -o show-diff show-diff.o $(LIBS)
41
42write-tree: write-tree.o $(LIB_FILE)
43 $(CC) $(CFLAGS) -o write-tree write-tree.o $(LIBS)
44
45read-tree: read-tree.o $(LIB_FILE)
46 $(CC) $(CFLAGS) -o read-tree read-tree.o $(LIBS)
47
48commit-tree: commit-tree.o $(LIB_FILE)
49 $(CC) $(CFLAGS) -o commit-tree commit-tree.o $(LIBS)
50
51cat-file: cat-file.o $(LIB_FILE)
52 $(CC) $(CFLAGS) -o cat-file cat-file.o $(LIBS)
53
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)
56
57checkout-cache: checkout-cache.o $(LIB_FILE)
58 $(CC) $(CFLAGS) -o checkout-cache checkout-cache.o $(LIBS)
59
60diff-tree: diff-tree.o $(LIB_FILE)
61 $(CC) $(CFLAGS) -o diff-tree diff-tree.o $(LIBS)
62
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)
65
66show-files: show-files.o $(LIB_FILE)
67 $(CC) $(CFLAGS) -o show-files show-files.o $(LIBS)
68
69check-files: check-files.o $(LIB_FILE)
70 $(CC) $(CFLAGS) -o check-files check-files.o $(LIBS)
71
72ls-tree: ls-tree.o $(LIB_FILE)
73 $(CC) $(CFLAGS) -o ls-tree ls-tree.o $(LIBS)
74
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)
77
78merge-cache: merge-cache.o $(LIB_FILE)
79 $(CC) $(CFLAGS) -o merge-cache merge-cache.o $(LIBS)
80
81blob.o: $(LIB_H)
82cat-file.o: $(LIB_H)
83check-files.o: $(LIB_H)
84checkout-cache.o: $(LIB_H)
85commit.o: $(LIB_H)
86commit-tree.o: $(LIB_H)
87diff-tree.o: $(LIB_H)
88fsck-cache.o: $(LIB_H)
89init-db.o: $(LIB_H)
90ls-tree.o: $(LIB_H)
91merge-base.o: $(LIB_H)
92merge-cache.o: $(LIB_H)
93object.o: $(LIB_H)
94read-cache.o: $(LIB_H)
95read-tree.o: $(LIB_H)
96rev-tree.o: $(LIB_H)
97sha1_file.o: $(LIB_H)
98show-diff.o: $(LIB_H)
99show-files.o: $(LIB_H)
100tree.o: $(LIB_H)
101update-cache.o: $(LIB_H)
102usage.o: $(LIB_H)
103write-tree.o: $(LIB_H)
104
105clean:
106 rm -f *.o $(PROG) $(LIB_FILE)
107
108backup: clean
109 cd .. ; tar czvf dircache.tar.gz dir-cache