blob: 9573a1189d7855a839dc3acad713b1cc0fb19fde [file] [log] [blame]
Petr Baudis5c2a7fb2005-04-13 02:14:06 -07001# -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.
Petr Baudisbdd4da52005-04-13 02:20:38 -07004#
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).
Linus Torvalds2dee0602005-04-20 13:00:08 -070010CFLAGS=-g -O2 -Wall
Petr Baudis5c2a7fb2005-04-13 02:14:06 -070011
Linus Torvaldse83c5162005-04-07 15:13:13 -070012CC=gcc
Linus Torvalds0a02ce72005-04-18 12:49:39 -070013AR=ar
Linus Torvaldse83c5162005-04-07 15:13:13 -070014
Petr Baudisbdd4da52005-04-13 02:20:38 -070015
Petr Baudis7912c072005-04-13 02:02:34 -070016PROG= update-cache show-diff init-db write-tree read-tree commit-tree \
Linus Torvalds74b46e32005-04-12 00:23:14 -070017 cat-file fsck-cache checkout-cache diff-tree rev-tree show-files \
Linus Torvaldse74f8f62005-04-19 21:00:09 -070018 check-files ls-tree merge-base merge-cache unpack-file git-export \
Linus Torvaldsd98b46f2005-04-20 01:10:46 -070019 diff-cache convert-cache
Linus Torvaldse83c5162005-04-07 15:13:13 -070020
21all: $(PROG)
22
23install: $(PROG)
24 install $(PROG) $(HOME)/bin/
25
Linus Torvalds0fcfd162005-04-18 13:04:43 -070026LIB_OBJS=read-cache.o sha1_file.o usage.o object.o commit.o tree.o blob.o
Linus Torvalds0a02ce72005-04-18 12:49:39 -070027LIB_FILE=libgit.a
Linus Torvaldse590d692005-04-18 13:12:21 -070028LIB_H=cache.h object.h
Linus Torvalds0a02ce72005-04-18 12:49:39 -070029
Linus Torvaldscc1ad5c2005-04-21 12:14:46 -070030LIBS = $(LIB_FILE)
31LIBS += -lz
Linus Torvaldscef661f2005-04-21 12:33:22 -070032
33ifdef MOZILLA_SHA1
34 SHA1_HEADER="mozilla-sha1/sha1.h"
35 LIB_OBJS += mozilla-sha1/sha1.o
36else
37 SHA1_HEADER=<openssl/sha.h>
38 LIBS += -lssl
39endif
40
41CFLAGS += '-DSHA1_HEADER=$(SHA1_HEADER)'
Linus Torvaldscc1ad5c2005-04-21 12:14:46 -070042
Linus Torvalds0a02ce72005-04-18 12:49:39 -070043$(LIB_FILE): $(LIB_OBJS)
44 $(AR) rcs $@ $(LIB_OBJS)
45
Linus Torvaldse83c5162005-04-07 15:13:13 -070046init-db: init-db.o
47
Andre Noll6ca25ed2005-04-20 13:10:13 -070048%: %.o $(LIB_FILE)
49 $(CC) $(CFLAGS) -o $@ $< $(LIBS)
Linus Torvaldsd98b46f2005-04-20 01:10:46 -070050
Linus Torvaldse590d692005-04-18 13:12:21 -070051blob.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)
Linus Torvaldsd98b46f2005-04-20 01:10:46 -070057convert-cache.o: $(LIB_H)
Linus Torvaldse74f8f62005-04-19 21:00:09 -070058diff-cache.o: $(LIB_H)
Linus Torvaldse590d692005-04-18 13:12:21 -070059diff-tree.o: $(LIB_H)
60fsck-cache.o: $(LIB_H)
Linus Torvaldse74f8f62005-04-19 21:00:09 -070061git-export.o: $(LIB_H)
Linus Torvaldse590d692005-04-18 13:12:21 -070062init-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)
Linus Torvalds3407bb42005-04-18 14:11:01 -070076unpack-file.o: $(LIB_H)
Linus Torvaldse590d692005-04-18 13:12:21 -070077write-tree.o: $(LIB_H)
Linus Torvaldse83c5162005-04-07 15:13:13 -070078
79clean:
Linus Torvaldscef661f2005-04-21 12:33:22 -070080 rm -f *.o mozilla-sha1/*.o $(PROG) $(LIB_FILE)
Linus Torvaldse83c5162005-04-07 15:13:13 -070081
82backup: clean
83 cd .. ; tar czvf dircache.tar.gz dir-cache