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