summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-21 19:33:22 (GMT)
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-21 19:33:22 (GMT)
commitcef661fc799a3a13ffdea4a3f69f1acd295de53d (patch)
tree690494557d393ca78f69a8569880ed4a3aeda276 /Makefile
parentcc1ad5c8309fbace11e3a68e3ec8ffcbded442a6 (diff)
downloadgit-cef661fc799a3a13ffdea4a3f69f1acd295de53d.zip
git-cef661fc799a3a13ffdea4a3f69f1acd295de53d.tar.gz
git-cef661fc799a3a13ffdea4a3f69f1acd295de53d.tar.bz2
Add support for alternate SHA1 library implementations.
This one includes the Mozilla SHA1 implementation sent in by Edgar Toernig. It's dual-licenced under MPL-1.1 or GPL, so in the context of git, we obviously use the GPL version. Side note: the Mozilla SHA1 implementation is about twice as fast as the default openssl one on my G5, but the default openssl one has optimized x86 assembly language on x86. So choose wisely.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile22
1 files changed, 11 insertions, 11 deletions
diff --git a/Makefile b/Makefile
index 562338a..9573a11 100644
--- a/Makefile
+++ b/Makefile
@@ -29,22 +29,22 @@ LIB_H=cache.h object.h
LIBS = $(LIB_FILE)
LIBS += -lz
-LIBS += -lssl
+
+ifdef MOZILLA_SHA1
+ SHA1_HEADER="mozilla-sha1/sha1.h"
+ LIB_OBJS += mozilla-sha1/sha1.o
+else
+ SHA1_HEADER=<openssl/sha.h>
+ LIBS += -lssl
+endif
+
+CFLAGS += '-DSHA1_HEADER=$(SHA1_HEADER)'
$(LIB_FILE): $(LIB_OBJS)
$(AR) rcs $@ $(LIB_OBJS)
init-db: init-db.o
-fsck-cache: fsck-cache.o $(LIB_FILE) object.o commit.o tree.o blob.o
- $(CC) $(CFLAGS) -o fsck-cache fsck-cache.o $(LIBS)
-
-rev-tree: rev-tree.o $(LIB_FILE) object.o commit.o tree.o blob.o
- $(CC) $(CFLAGS) -o rev-tree rev-tree.o $(LIBS)
-
-merge-base: merge-base.o $(LIB_FILE) object.o commit.o tree.o blob.o
- $(CC) $(CFLAGS) -o merge-base merge-base.o $(LIBS)
-
%: %.o $(LIB_FILE)
$(CC) $(CFLAGS) -o $@ $< $(LIBS)
@@ -77,7 +77,7 @@ unpack-file.o: $(LIB_H)
write-tree.o: $(LIB_H)
clean:
- rm -f *.o $(PROG) $(LIB_FILE)
+ rm -f *.o mozilla-sha1/*.o $(PROG) $(LIB_FILE)
backup: clean
cd .. ; tar czvf dircache.tar.gz dir-cache