1CFLAGS=-g -O3 -Wall
2CC=gcc
34
PROG= update-cache show-diff init-db write-tree read-tree commit-tree \
5cat-file fsck-cache checkout-cache diff-tree rev-tree
67
all: $(PROG)
89
install: $(PROG)
10install $(PROG) $(HOME)/bin/
1112
LIBS= -lssl -lz
1314
init-db: init-db.o
1516
update-cache: update-cache.o read-cache.o
17$(CC) $(CFLAGS) -o update-cache update-cache.o read-cache.o $(LIBS)
1819
show-diff: show-diff.o read-cache.o
20$(CC) $(CFLAGS) -o show-diff show-diff.o read-cache.o $(LIBS)
2122
write-tree: write-tree.o read-cache.o
23$(CC) $(CFLAGS) -o write-tree write-tree.o read-cache.o $(LIBS)
2425
read-tree: read-tree.o read-cache.o
26$(CC) $(CFLAGS) -o read-tree read-tree.o read-cache.o $(LIBS)
2728
commit-tree: commit-tree.o read-cache.o
29$(CC) $(CFLAGS) -o commit-tree commit-tree.o read-cache.o $(LIBS)
3031
cat-file: cat-file.o read-cache.o
32$(CC) $(CFLAGS) -o cat-file cat-file.o read-cache.o $(LIBS)
3334
fsck-cache: fsck-cache.o read-cache.o
35$(CC) $(CFLAGS) -o fsck-cache fsck-cache.o read-cache.o $(LIBS)
3637
checkout-cache: checkout-cache.o read-cache.o
38$(CC) $(CFLAGS) -o checkout-cache checkout-cache.o read-cache.o $(LIBS)
3940
diff-tree: diff-tree.o read-cache.o
41$(CC) $(CFLAGS) -o diff-tree diff-tree.o read-cache.o $(LIBS)
4243
rev-tree: rev-tree.o read-cache.o
44$(CC) $(CFLAGS) -o rev-tree rev-tree.o read-cache.o $(LIBS)
4546
read-cache.o: cache.h
47show-diff.o: cache.h
4849
clean:
50rm -f *.o $(PROG) temp_git_file_*
5152
backup: clean
53cd .. ; tar czvf dircache.tar.gz dir-cache