Makefileon commit [PATCH] init-db.c: normalize env var handling. (addb315)
   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 -O3 -Wall
  11
  12CC=gcc
  13AR=ar
  14
  15
  16PROG=   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
  20
  21all: $(PROG)
  22
  23install: $(PROG)
  24        install $(PROG) $(HOME)/bin/
  25
  26LIB_OBJS=read-cache.o sha1_file.o usage.o object.o commit.o tree.o blob.o
  27LIB_FILE=libgit.a
  28LIB_H=cache.h object.h
  29
  30$(LIB_FILE): $(LIB_OBJS)
  31        $(AR) rcs $@ $(LIB_OBJS)
  32
  33LIBS= $(LIB_FILE) -lssl -lz
  34
  35init-db: init-db.o
  36
  37update-cache: update-cache.o $(LIB_FILE)
  38        $(CC) $(CFLAGS) -o update-cache update-cache.o $(LIBS)
  39
  40show-diff: show-diff.o $(LIB_FILE)
  41        $(CC) $(CFLAGS) -o show-diff show-diff.o $(LIBS)
  42
  43write-tree: write-tree.o $(LIB_FILE)
  44        $(CC) $(CFLAGS) -o write-tree write-tree.o $(LIBS)
  45
  46read-tree: read-tree.o $(LIB_FILE)
  47        $(CC) $(CFLAGS) -o read-tree read-tree.o $(LIBS)
  48
  49commit-tree: commit-tree.o $(LIB_FILE)
  50        $(CC) $(CFLAGS) -o commit-tree commit-tree.o $(LIBS)
  51
  52cat-file: cat-file.o $(LIB_FILE)
  53        $(CC) $(CFLAGS) -o cat-file cat-file.o $(LIBS)
  54
  55fsck-cache: fsck-cache.o $(LIB_FILE) object.o commit.o tree.o blob.o
  56        $(CC) $(CFLAGS) -o fsck-cache fsck-cache.o $(LIBS)
  57
  58checkout-cache: checkout-cache.o $(LIB_FILE)
  59        $(CC) $(CFLAGS) -o checkout-cache checkout-cache.o $(LIBS)
  60
  61diff-tree: diff-tree.o $(LIB_FILE)
  62        $(CC) $(CFLAGS) -o diff-tree diff-tree.o $(LIBS)
  63
  64rev-tree: rev-tree.o $(LIB_FILE) object.o commit.o tree.o blob.o
  65        $(CC) $(CFLAGS) -o rev-tree rev-tree.o $(LIBS)
  66
  67show-files: show-files.o $(LIB_FILE)
  68        $(CC) $(CFLAGS) -o show-files show-files.o $(LIBS)
  69
  70check-files: check-files.o $(LIB_FILE)
  71        $(CC) $(CFLAGS) -o check-files check-files.o $(LIBS)
  72
  73ls-tree: ls-tree.o $(LIB_FILE)
  74        $(CC) $(CFLAGS) -o ls-tree ls-tree.o $(LIBS)
  75
  76merge-base: merge-base.o $(LIB_FILE) object.o commit.o tree.o blob.o
  77        $(CC) $(CFLAGS) -o merge-base merge-base.o $(LIBS)
  78
  79merge-cache: merge-cache.o $(LIB_FILE)
  80        $(CC) $(CFLAGS) -o merge-cache merge-cache.o $(LIBS)
  81
  82unpack-file: unpack-file.o $(LIB_FILE)
  83        $(CC) $(CFLAGS) -o unpack-file unpack-file.o $(LIBS)
  84
  85git-export: git-export.o $(LIB_FILE)
  86        $(CC) $(CFLAGS) -o git-export git-export.o $(LIBS)
  87
  88diff-cache: diff-cache.o $(LIB_FILE)
  89        $(CC) $(CFLAGS) -o diff-cache diff-cache.o $(LIBS)
  90
  91blob.o: $(LIB_H)
  92cat-file.o: $(LIB_H)
  93check-files.o: $(LIB_H)
  94checkout-cache.o: $(LIB_H)
  95commit.o: $(LIB_H)
  96commit-tree.o: $(LIB_H)
  97diff-cache.o: $(LIB_H)
  98diff-tree.o: $(LIB_H)
  99fsck-cache.o: $(LIB_H)
 100git-export.o: $(LIB_H)
 101init-db.o: $(LIB_H)
 102ls-tree.o: $(LIB_H)
 103merge-base.o: $(LIB_H)
 104merge-cache.o: $(LIB_H)
 105object.o: $(LIB_H)
 106read-cache.o: $(LIB_H)
 107read-tree.o: $(LIB_H)
 108rev-tree.o: $(LIB_H)
 109sha1_file.o: $(LIB_H)
 110show-diff.o: $(LIB_H)
 111show-files.o: $(LIB_H)
 112tree.o: $(LIB_H)
 113update-cache.o: $(LIB_H)
 114usage.o: $(LIB_H)
 115unpack-file.o: $(LIB_H)
 116write-tree.o: $(LIB_H)
 117
 118clean:
 119        rm -f *.o $(PROG) $(LIB_FILE)
 120
 121backup: clean
 122        cd .. ; tar czvf dircache.tar.gz dir-cache