[PATCH] Various transport programs
[git/git.git] / Makefile
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).
10 CFLAGS=-g -O2 -Wall
11
12 CC=gcc
13 AR=ar
14
15
16 PROG= 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 http-pull rpush rpull
20
21 all: $(PROG)
22
23 install: $(PROG)
24 install $(PROG) $(HOME)/bin/
25
26 LIB_OBJS=read-cache.o sha1_file.o usage.o object.o commit.o tree.o blob.o
27 LIB_FILE=libgit.a
28 LIB_H=cache.h object.h
29
30 LIBS = $(LIB_FILE)
31 LIBS += -lz
32
33 ifdef MOZILLA_SHA1
34 SHA1_HEADER="mozilla-sha1/sha1.h"
35 LIB_OBJS += mozilla-sha1/sha1.o
36 else
37 ifdef PPC_SHA1
38 SHA1_HEADER="ppc/sha1.h"
39 LIB_OBJS += ppc/sha1.o ppc/sha1ppc.o
40 else
41 SHA1_HEADER=<openssl/sha.h>
42 LIBS += -lssl
43 endif
44 endif
45
46 CFLAGS += '-DSHA1_HEADER=$(SHA1_HEADER)'
47
48 $(LIB_FILE): $(LIB_OBJS)
49 $(AR) rcs $@ $(LIB_OBJS)
50
51 init-db: init-db.o
52
53 %: %.c $(LIB_FILE)
54 $(CC) $(CFLAGS) -o $@ $(filter %.c,$^) $(LIBS)
55
56 rpush: rsh.c
57
58 rpull: rsh.c
59
60 http-pull: LIBS += -lcurl
61
62 blob.o: $(LIB_H)
63 cat-file.o: $(LIB_H)
64 check-files.o: $(LIB_H)
65 checkout-cache.o: $(LIB_H)
66 commit.o: $(LIB_H)
67 commit-tree.o: $(LIB_H)
68 convert-cache.o: $(LIB_H)
69 diff-cache.o: $(LIB_H)
70 diff-tree.o: $(LIB_H)
71 fsck-cache.o: $(LIB_H)
72 git-export.o: $(LIB_H)
73 init-db.o: $(LIB_H)
74 ls-tree.o: $(LIB_H)
75 merge-base.o: $(LIB_H)
76 merge-cache.o: $(LIB_H)
77 object.o: $(LIB_H)
78 read-cache.o: $(LIB_H)
79 read-tree.o: $(LIB_H)
80 rev-tree.o: $(LIB_H)
81 sha1_file.o: $(LIB_H)
82 show-diff.o: $(LIB_H)
83 show-files.o: $(LIB_H)
84 tree.o: $(LIB_H)
85 update-cache.o: $(LIB_H)
86 usage.o: $(LIB_H)
87 unpack-file.o: $(LIB_H)
88 write-tree.o: $(LIB_H)
89 http-pull.o: $(LIB_H)
90 rpull.o: $(LIB_H)
91 rpush.o: $(LIB_H)
92
93 clean:
94 rm -f *.o mozilla-sha1/*.o ppc/*.o $(PROG) $(LIB_FILE)
95
96 backup: clean
97 cd .. ; tar czvf dircache.tar.gz dir-cache