Split up Makefile library list handling with separate entries for
[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 \
d98b46f8 19 diff-cache convert-cache
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
32LIBS += -lssl
33
0a02ce72
LT
34$(LIB_FILE): $(LIB_OBJS)
35 $(AR) rcs $@ $(LIB_OBJS)
36
e83c5163
LT
37init-db: init-db.o
38
0a02ce72
LT
39fsck-cache: fsck-cache.o $(LIB_FILE) object.o commit.o tree.o blob.o
40 $(CC) $(CFLAGS) -o fsck-cache fsck-cache.o $(LIBS)
7660a188 41
0a02ce72
LT
42rev-tree: rev-tree.o $(LIB_FILE) object.o commit.o tree.o blob.o
43 $(CC) $(CFLAGS) -o rev-tree rev-tree.o $(LIBS)
84fe9720 44
0a02ce72
LT
45merge-base: merge-base.o $(LIB_FILE) object.o commit.o tree.o blob.o
46 $(CC) $(CFLAGS) -o merge-base merge-base.o $(LIBS)
6683463e 47
6ca25ed3
AN
48%: %.o $(LIB_FILE)
49 $(CC) $(CFLAGS) -o $@ $< $(LIBS)
d98b46f8 50
e590d694
LT
51blob.o: $(LIB_H)
52cat-file.o: $(LIB_H)
53check-files.o: $(LIB_H)
54checkout-cache.o: $(LIB_H)
55commit.o: $(LIB_H)
56commit-tree.o: $(LIB_H)
d98b46f8 57convert-cache.o: $(LIB_H)
e74f8f6a 58diff-cache.o: $(LIB_H)
e590d694
LT
59diff-tree.o: $(LIB_H)
60fsck-cache.o: $(LIB_H)
e74f8f6a 61git-export.o: $(LIB_H)
e590d694
LT
62init-db.o: $(LIB_H)
63ls-tree.o: $(LIB_H)
64merge-base.o: $(LIB_H)
65merge-cache.o: $(LIB_H)
66object.o: $(LIB_H)
67read-cache.o: $(LIB_H)
68read-tree.o: $(LIB_H)
69rev-tree.o: $(LIB_H)
70sha1_file.o: $(LIB_H)
71show-diff.o: $(LIB_H)
72show-files.o: $(LIB_H)
73tree.o: $(LIB_H)
74update-cache.o: $(LIB_H)
75usage.o: $(LIB_H)
3407bb49 76unpack-file.o: $(LIB_H)
e590d694 77write-tree.o: $(LIB_H)
e83c5163
LT
78
79clean:
0a02ce72 80 rm -f *.o $(PROG) $(LIB_FILE)
e83c5163
LT
81
82backup: clean
83 cd .. ; tar czvf dircache.tar.gz dir-cache