Petr Baudis | 5c2a7fb | 2005-04-13 02:14:06 -0700 | [diff] [blame] | 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. |
Petr Baudis | bdd4da5 | 2005-04-13 02:20:38 -0700 | [diff] [blame] | 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). |
Linus Torvalds | 2dee060 | 2005-04-20 13:00:08 -0700 | [diff] [blame] | 10 | CFLAGS=-g -O2 -Wall |
Petr Baudis | 5c2a7fb | 2005-04-13 02:14:06 -0700 | [diff] [blame] | 11 | |
Linus Torvalds | e83c516 | 2005-04-07 15:13:13 -0700 | [diff] [blame] | 12 | CC=gcc |
Linus Torvalds | 0a02ce7 | 2005-04-18 12:49:39 -0700 | [diff] [blame] | 13 | AR=ar |
Linus Torvalds | e83c516 | 2005-04-07 15:13:13 -0700 | [diff] [blame] | 14 | |
Petr Baudis | bdd4da5 | 2005-04-13 02:20:38 -0700 | [diff] [blame] | 15 | |
Petr Baudis | 7912c07 | 2005-04-13 02:02:34 -0700 | [diff] [blame] | 16 | PROG= update-cache show-diff init-db write-tree read-tree commit-tree \ |
Linus Torvalds | 74b46e3 | 2005-04-12 00:23:14 -0700 | [diff] [blame] | 17 | cat-file fsck-cache checkout-cache diff-tree rev-tree show-files \ |
Linus Torvalds | e74f8f6 | 2005-04-19 21:00:09 -0700 | [diff] [blame] | 18 | check-files ls-tree merge-base merge-cache unpack-file git-export \ |
Linus Torvalds | d98b46f | 2005-04-20 01:10:46 -0700 | [diff] [blame] | 19 | diff-cache convert-cache |
Linus Torvalds | e83c516 | 2005-04-07 15:13:13 -0700 | [diff] [blame] | 20 | |
| 21 | all: $(PROG) |
| 22 | |
| 23 | install: $(PROG) |
| 24 | install $(PROG) $(HOME)/bin/ |
| 25 | |
Linus Torvalds | 0fcfd16 | 2005-04-18 13:04:43 -0700 | [diff] [blame] | 26 | LIB_OBJS=read-cache.o sha1_file.o usage.o object.o commit.o tree.o blob.o |
Linus Torvalds | 0a02ce7 | 2005-04-18 12:49:39 -0700 | [diff] [blame] | 27 | LIB_FILE=libgit.a |
Linus Torvalds | e590d69 | 2005-04-18 13:12:21 -0700 | [diff] [blame] | 28 | LIB_H=cache.h object.h |
Linus Torvalds | 0a02ce7 | 2005-04-18 12:49:39 -0700 | [diff] [blame] | 29 | |
Linus Torvalds | cc1ad5c | 2005-04-21 12:14:46 -0700 | [diff] [blame] | 30 | LIBS = $(LIB_FILE) |
| 31 | LIBS += -lz |
Linus Torvalds | cef661f | 2005-04-21 12:33:22 -0700 | [diff] [blame^] | 32 | |
| 33 | ifdef MOZILLA_SHA1 |
| 34 | SHA1_HEADER="mozilla-sha1/sha1.h" |
| 35 | LIB_OBJS += mozilla-sha1/sha1.o |
| 36 | else |
| 37 | SHA1_HEADER=<openssl/sha.h> |
| 38 | LIBS += -lssl |
| 39 | endif |
| 40 | |
| 41 | CFLAGS += '-DSHA1_HEADER=$(SHA1_HEADER)' |
Linus Torvalds | cc1ad5c | 2005-04-21 12:14:46 -0700 | [diff] [blame] | 42 | |
Linus Torvalds | 0a02ce7 | 2005-04-18 12:49:39 -0700 | [diff] [blame] | 43 | $(LIB_FILE): $(LIB_OBJS) |
| 44 | $(AR) rcs $@ $(LIB_OBJS) |
| 45 | |
Linus Torvalds | e83c516 | 2005-04-07 15:13:13 -0700 | [diff] [blame] | 46 | init-db: init-db.o |
| 47 | |
Andre Noll | 6ca25ed | 2005-04-20 13:10:13 -0700 | [diff] [blame] | 48 | %: %.o $(LIB_FILE) |
| 49 | $(CC) $(CFLAGS) -o $@ $< $(LIBS) |
Linus Torvalds | d98b46f | 2005-04-20 01:10:46 -0700 | [diff] [blame] | 50 | |
Linus Torvalds | e590d69 | 2005-04-18 13:12:21 -0700 | [diff] [blame] | 51 | blob.o: $(LIB_H) |
| 52 | cat-file.o: $(LIB_H) |
| 53 | check-files.o: $(LIB_H) |
| 54 | checkout-cache.o: $(LIB_H) |
| 55 | commit.o: $(LIB_H) |
| 56 | commit-tree.o: $(LIB_H) |
Linus Torvalds | d98b46f | 2005-04-20 01:10:46 -0700 | [diff] [blame] | 57 | convert-cache.o: $(LIB_H) |
Linus Torvalds | e74f8f6 | 2005-04-19 21:00:09 -0700 | [diff] [blame] | 58 | diff-cache.o: $(LIB_H) |
Linus Torvalds | e590d69 | 2005-04-18 13:12:21 -0700 | [diff] [blame] | 59 | diff-tree.o: $(LIB_H) |
| 60 | fsck-cache.o: $(LIB_H) |
Linus Torvalds | e74f8f6 | 2005-04-19 21:00:09 -0700 | [diff] [blame] | 61 | git-export.o: $(LIB_H) |
Linus Torvalds | e590d69 | 2005-04-18 13:12:21 -0700 | [diff] [blame] | 62 | init-db.o: $(LIB_H) |
| 63 | ls-tree.o: $(LIB_H) |
| 64 | merge-base.o: $(LIB_H) |
| 65 | merge-cache.o: $(LIB_H) |
| 66 | object.o: $(LIB_H) |
| 67 | read-cache.o: $(LIB_H) |
| 68 | read-tree.o: $(LIB_H) |
| 69 | rev-tree.o: $(LIB_H) |
| 70 | sha1_file.o: $(LIB_H) |
| 71 | show-diff.o: $(LIB_H) |
| 72 | show-files.o: $(LIB_H) |
| 73 | tree.o: $(LIB_H) |
| 74 | update-cache.o: $(LIB_H) |
| 75 | usage.o: $(LIB_H) |
Linus Torvalds | 3407bb4 | 2005-04-18 14:11:01 -0700 | [diff] [blame] | 76 | unpack-file.o: $(LIB_H) |
Linus Torvalds | e590d69 | 2005-04-18 13:12:21 -0700 | [diff] [blame] | 77 | write-tree.o: $(LIB_H) |
Linus Torvalds | e83c516 | 2005-04-07 15:13:13 -0700 | [diff] [blame] | 78 | |
| 79 | clean: |
Linus Torvalds | cef661f | 2005-04-21 12:33:22 -0700 | [diff] [blame^] | 80 | rm -f *.o mozilla-sha1/*.o $(PROG) $(LIB_FILE) |
Linus Torvalds | e83c516 | 2005-04-07 15:13:13 -0700 | [diff] [blame] | 81 | |
| 82 | backup: clean |
| 83 | cd .. ; tar czvf dircache.tar.gz dir-cache |