2007-02-04 23:21:06 +00:00
|
|
|
CGIT_VERSION = 0.2
|
2006-12-09 14:18:17 +00:00
|
|
|
|
2007-02-04 22:57:34 +00:00
|
|
|
prefix = /var/www/htdocs/cgit
|
|
|
|
gitsrc = ../git
|
2006-12-09 14:18:17 +00:00
|
|
|
|
2007-05-08 20:40:59 +00:00
|
|
|
SHA1_HEADER = <openssl/sha.h>
|
|
|
|
|
2007-02-04 22:57:34 +00:00
|
|
|
CACHE_ROOT = /var/cache/cgit
|
|
|
|
EXTLIBS = $(gitsrc)/libgit.a $(gitsrc)/xdiff/lib.a -lz -lcrypto
|
2006-12-11 16:25:41 +00:00
|
|
|
OBJECTS = shared.o cache.o parsing.o html.o ui-shared.o ui-repolist.o \
|
2007-05-08 20:40:59 +00:00
|
|
|
ui-summary.o ui-log.o ui-view.o ui-tree.o ui-commit.o ui-diff.o \
|
2007-02-08 12:53:13 +00:00
|
|
|
ui-snapshot.o
|
2006-12-10 21:31:36 +00:00
|
|
|
|
|
|
|
CFLAGS += -Wall
|
2006-12-09 14:18:17 +00:00
|
|
|
|
2007-01-17 00:13:05 +00:00
|
|
|
ifdef DEBUG
|
|
|
|
CFLAGS += -g
|
|
|
|
endif
|
|
|
|
|
2007-05-08 20:40:59 +00:00
|
|
|
CFLAGS += -I$(gitsrc) -DSHA1_HEADER='$(SHA1_HEADER)'
|
|
|
|
|
2006-12-09 14:18:17 +00:00
|
|
|
all: cgit
|
|
|
|
|
2006-12-13 13:39:41 +00:00
|
|
|
install: all clean-cache
|
2007-02-04 22:57:34 +00:00
|
|
|
mkdir -p $(prefix)
|
|
|
|
install cgit $(prefix)/cgit.cgi
|
|
|
|
install cgit.css $(prefix)/cgit.css
|
2006-12-09 14:18:17 +00:00
|
|
|
|
2007-05-08 20:40:59 +00:00
|
|
|
cgit: cgit.c cgit.h $(OBJECTS) $(gitsrc)/libgit.a
|
2006-12-11 15:11:40 +00:00
|
|
|
$(CC) $(CFLAGS) -DCGIT_VERSION='"$(CGIT_VERSION)"' cgit.c -o cgit \
|
|
|
|
$(OBJECTS) $(EXTLIBS)
|
2006-12-09 14:18:17 +00:00
|
|
|
|
2007-05-08 20:40:59 +00:00
|
|
|
$(OBJECTS): cgit.h
|
2006-12-20 23:47:05 +00:00
|
|
|
|
2007-02-04 22:57:34 +00:00
|
|
|
$(gitsrc)/libgit.a:
|
|
|
|
$(MAKE) -C $(gitsrc)
|
|
|
|
|
|
|
|
|
2006-12-10 22:50:16 +00:00
|
|
|
.PHONY: clean
|
|
|
|
clean:
|
|
|
|
rm -f cgit *.o
|
2006-12-13 13:39:41 +00:00
|
|
|
|
|
|
|
clean-cache:
|
|
|
|
rm -rf $(CACHE_ROOT)/*
|