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 -O2 -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 unpack-file git-export \
19 diff-cache convert-cache
20
21all: $(PROG)
22
23install: $(PROG)
24 install $(PROG) $(HOME)/bin/
25
26LIB_OBJS=read-cache.o sha1_file.o usage.o object.o commit.o tree.o blob.o
27LIB_FILE=libgit.a
28LIB_H=cache.h object.h
29
30$(LIB_FILE): $(LIB_OBJS)
31 $(AR) rcs $@ $(LIB_OBJS)
32
33LIBS= $(LIB_FILE) -lssl -lz
34
35init-db: init-db.o
36
37fsck-cache: fsck-cache.o $(LIB_FILE) object.o commit.o tree.o blob.o
38 $(CC) $(CFLAGS) -o fsck-cache fsck-cache.o $(LIBS)
39
40rev-tree: rev-tree.o $(LIB_FILE) object.o commit.o tree.o blob.o
41 $(CC) $(CFLAGS) -o rev-tree rev-tree.o $(LIBS)
42
43merge-base: merge-base.o $(LIB_FILE) object.o commit.o tree.o blob.o
44 $(CC) $(CFLAGS) -o merge-base merge-base.o $(LIBS)
45
46%: %.o $(LIB_FILE)
47 $(CC) $(CFLAGS) -o $@ $< $(LIBS)
48
49blob.o: $(LIB_H)
50cat-file.o: $(LIB_H)
51check-files.o: $(LIB_H)
52checkout-cache.o: $(LIB_H)
53commit.o: $(LIB_H)
54commit-tree.o: $(LIB_H)
55convert-cache.o: $(LIB_H)
56diff-cache.o: $(LIB_H)
57diff-tree.o: $(LIB_H)
58fsck-cache.o: $(LIB_H)
59git-export.o: $(LIB_H)
60init-db.o: $(LIB_H)
61ls-tree.o: $(LIB_H)
62merge-base.o: $(LIB_H)
63merge-cache.o: $(LIB_H)
64object.o: $(LIB_H)
65read-cache.o: $(LIB_H)
66read-tree.o: $(LIB_H)
67rev-tree.o: $(LIB_H)
68sha1_file.o: $(LIB_H)
69show-diff.o: $(LIB_H)
70show-files.o: $(LIB_H)
71tree.o: $(LIB_H)
72update-cache.o: $(LIB_H)
73usage.o: $(LIB_H)
74unpack-file.o: $(LIB_H)
75write-tree.o: $(LIB_H)
76
77clean:
78 rm -f *.o $(PROG) $(LIB_FILE)
79
80backup: clean
81 cd .. ; tar czvf dircache.tar.gz dir-cache