[PATCH] Rename and extend read_tree_with_tree_or_commit_sha1
[git/spearce.git] / Makefile
blob0b330dc3fd05253b8fd20ca4f9e98e411074868f
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.
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).
10 CFLAGS=-g -O2 -Wall
12 CC=gcc
13 AR=ar
15 SCRIPTS=git-merge-one-file-script git-prune-script git-pull-script git-tag-script
17 PROG= update-cache show-diff init-db write-tree read-tree commit-tree \
18 cat-file fsck-cache checkout-cache diff-tree rev-tree show-files \
19 check-files ls-tree merge-base merge-cache unpack-file git-export \
20 diff-cache convert-cache http-pull rpush rpull rev-list git-mktag \
21 diff-tree-helper tar-tree
23 all: $(PROG)
25 install: $(PROG) $(SCRIPTS)
26 install $(PROG) $(SCRIPTS) $(HOME)/bin/
28 LIB_OBJS=read-cache.o sha1_file.o usage.o object.o commit.o tree.o blob.o tag.o
29 LIB_FILE=libgit.a
30 LIB_H=cache.h object.h blob.h tree.h commit.h tag.h
32 LIB_H += strbuf.h
33 LIB_OBJS += strbuf.o
35 LIB_H += diff.h
36 LIB_OBJS += diff.o
38 LIBS = $(LIB_FILE)
39 LIBS += -lz
41 ifdef MOZILLA_SHA1
42 SHA1_HEADER="mozilla-sha1/sha1.h"
43 LIB_OBJS += mozilla-sha1/sha1.o
44 else
45 ifdef PPC_SHA1
46 SHA1_HEADER="ppc/sha1.h"
47 LIB_OBJS += ppc/sha1.o ppc/sha1ppc.o
48 else
49 SHA1_HEADER=<openssl/sha.h>
50 LIBS += -lssl
51 endif
52 endif
54 CFLAGS += '-DSHA1_HEADER=$(SHA1_HEADER)'
56 $(LIB_FILE): $(LIB_OBJS)
57 $(AR) rcs $@ $(LIB_OBJS)
59 init-db: init-db.o
61 %: %.c $(LIB_FILE)
62 $(CC) $(CFLAGS) -o $@ $(filter %.c,$^) $(LIBS)
64 rpush: rsh.c
66 rpull: rsh.c
68 http-pull: LIBS += -lcurl
70 blob.o: $(LIB_H)
71 cat-file.o: $(LIB_H)
72 check-files.o: $(LIB_H)
73 checkout-cache.o: $(LIB_H)
74 commit.o: $(LIB_H)
75 commit-tree.o: $(LIB_H)
76 convert-cache.o: $(LIB_H)
77 diff.o: $(LIB_H)
78 diff-cache.o: $(LIB_H)
79 diff-tree.o: $(LIB_H)
80 fsck-cache.o: $(LIB_H)
81 git-export.o: $(LIB_H)
82 init-db.o: $(LIB_H)
83 ls-tree.o: $(LIB_H)
84 merge-base.o: $(LIB_H)
85 merge-cache.o: $(LIB_H)
86 object.o: $(LIB_H)
87 read-cache.o: $(LIB_H)
88 read-tree.o: $(LIB_H)
89 rev-tree.o: $(LIB_H)
90 sha1_file.o: $(LIB_H)
91 show-diff.o: $(LIB_H)
92 show-files.o: $(LIB_H)
93 tree.o: $(LIB_H)
94 update-cache.o: $(LIB_H)
95 usage.o: $(LIB_H)
96 unpack-file.o: $(LIB_H)
97 write-tree.o: $(LIB_H)
98 http-pull.o: $(LIB_H)
99 rpull.o: $(LIB_H)
100 rpush.o: $(LIB_H)
102 clean:
103 rm -f *.o mozilla-sha1/*.o ppc/*.o $(PROG) $(LIB_FILE)
105 backup: clean
106 cd .. ; tar czvf dircache.tar.gz dir-cache