2007-11-03 10:35:55 +00:00
|
|
|
CGIT_VERSION = v0.7
|
2007-05-14 22:48:31 +00:00
|
|
|
CGIT_SCRIPT_NAME = cgit.cgi
|
2007-09-03 19:52:14 +00:00
|
|
|
CGIT_SCRIPT_PATH = /var/www/htdocs/cgit
|
|
|
|
CGIT_CONFIG = /etc/cgitrc
|
|
|
|
CACHE_ROOT = /var/cache/cgit
|
|
|
|
SHA1_HEADER = <openssl/sha.h>
|
2007-11-03 10:33:54 +00:00
|
|
|
GIT_VER = 1.5.3.5
|
2007-09-03 20:42:54 +00:00
|
|
|
GIT_URL = http://www.kernel.org/pub/software/scm/git/git-$(GIT_VER).tar.bz2
|
2007-05-14 21:09:49 +00:00
|
|
|
|
2007-05-15 16:38:31 +00:00
|
|
|
#
|
|
|
|
# Let the user override the above settings.
|
|
|
|
#
|
|
|
|
-include cgit.conf
|
|
|
|
|
2007-06-18 07:42:10 +00:00
|
|
|
|
2007-05-10 09:25:12 +00:00
|
|
|
EXTLIBS = git/libgit.a git/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-06-16 18:20:42 +00:00
|
|
|
ui-summary.o ui-log.o ui-tree.o ui-commit.o ui-diff.o \
|
2007-10-27 08:36:53 +00:00
|
|
|
ui-snapshot.o ui-blob.o ui-tag.o ui-refs.o
|
2006-12-10 21:31:36 +00:00
|
|
|
|
2006-12-09 14:18:17 +00:00
|
|
|
|
2007-09-03 20:42:54 +00:00
|
|
|
.PHONY: all git install clean distclean force-version get-git
|
2007-09-03 19:52:14 +00:00
|
|
|
|
|
|
|
all: cgit git
|
|
|
|
|
|
|
|
VERSION: force-version
|
|
|
|
@./gen-version.sh "$(CGIT_VERSION)"
|
|
|
|
-include VERSION
|
|
|
|
|
2007-01-17 00:13:05 +00:00
|
|
|
|
2007-09-03 19:52:14 +00:00
|
|
|
CFLAGS += -g -Wall -Igit
|
2007-05-14 21:09:49 +00:00
|
|
|
CFLAGS += -DSHA1_HEADER='$(SHA1_HEADER)'
|
|
|
|
CFLAGS += -DCGIT_VERSION='"$(CGIT_VERSION)"'
|
2007-09-08 16:38:10 +00:00
|
|
|
CFLAGS += -DCGIT_CONFIG='"$(CGIT_CONFIG)"'
|
2007-05-14 22:48:31 +00:00
|
|
|
CFLAGS += -DCGIT_SCRIPT_NAME='"$(CGIT_SCRIPT_NAME)"'
|
2007-09-08 16:38:10 +00:00
|
|
|
CFLAGS += -DCGIT_CACHE_ROOT='"$(CACHE_ROOT)"'
|
2007-05-08 20:40:59 +00:00
|
|
|
|
2007-05-10 09:25:12 +00:00
|
|
|
|
2007-09-03 19:52:14 +00:00
|
|
|
cgit: cgit.c $(OBJECTS)
|
2007-05-14 21:09:49 +00:00
|
|
|
$(CC) $(CFLAGS) cgit.c -o cgit $(OBJECTS) $(EXTLIBS)
|
2007-05-10 09:25:12 +00:00
|
|
|
|
2007-09-03 19:52:14 +00:00
|
|
|
$(OBJECTS): cgit.h git/xdiff/lib.a git/libgit.a VERSION
|
2007-05-10 09:25:12 +00:00
|
|
|
|
2007-09-03 19:52:14 +00:00
|
|
|
git/xdiff/lib.a: | git
|
2007-05-10 09:25:12 +00:00
|
|
|
|
2007-09-03 19:52:14 +00:00
|
|
|
git/libgit.a: | git
|
2006-12-09 14:18:17 +00:00
|
|
|
|
2007-09-03 19:52:14 +00:00
|
|
|
git:
|
|
|
|
cd git && $(MAKE) xdiff/lib.a
|
|
|
|
cd git && $(MAKE) libgit.a
|
2006-12-20 23:47:05 +00:00
|
|
|
|
2007-09-03 19:52:14 +00:00
|
|
|
install: all
|
2007-09-08 09:34:11 +00:00
|
|
|
mkdir -p $(DESTDIR)$(CGIT_SCRIPT_PATH)
|
|
|
|
install cgit $(DESTDIR)$(CGIT_SCRIPT_PATH)/$(CGIT_SCRIPT_NAME)
|
|
|
|
install cgit.css $(DESTDIR)$(CGIT_SCRIPT_PATH)/cgit.css
|
|
|
|
rm -rf $(DESTDIR)$(CACHE_ROOT)/*
|
2007-05-10 09:25:12 +00:00
|
|
|
|
2007-09-03 19:52:14 +00:00
|
|
|
uninstall:
|
2007-09-08 16:42:55 +00:00
|
|
|
rm -f $(CGIT_SCRIPT_PATH)/$(CGIT_SCRIPT_NAME)
|
|
|
|
rm -f $(CGIT_SCRIPT_PATH)/cgit.css
|
|
|
|
rm -rf $(CACHE_ROOT)
|
2007-05-10 09:25:12 +00:00
|
|
|
|
2007-09-03 19:52:14 +00:00
|
|
|
clean:
|
|
|
|
rm -f cgit VERSION *.o
|
|
|
|
cd git && $(MAKE) clean
|
2007-06-18 07:42:10 +00:00
|
|
|
|
2007-09-03 19:52:14 +00:00
|
|
|
distclean: clean
|
|
|
|
git clean -d -x
|
|
|
|
cd git && git clean -d -x
|
2007-09-03 20:42:54 +00:00
|
|
|
|
|
|
|
get-git:
|
|
|
|
curl $(GIT_URL) | tar -xj && rm -rf git && mv git-$(GIT_VER) git
|