2007-05-13 21:28:19 +00:00
|
|
|
CGIT_VERSION = 0.4
|
2006-12-09 14:18:17 +00:00
|
|
|
|
2007-02-04 22:57:34 +00:00
|
|
|
prefix = /var/www/htdocs/cgit
|
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
|
2007-05-14 21:09:49 +00:00
|
|
|
CGIT_CONFIG = /etc/cgitrc
|
2007-05-14 22:48:31 +00:00
|
|
|
CGIT_SCRIPT_NAME = cgit.cgi
|
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-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-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-05-08 22:48:09 +00:00
|
|
|
ui-snapshot.o ui-blob.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-14 21:09:49 +00:00
|
|
|
CFLAGS += -Igit
|
|
|
|
CFLAGS += -DSHA1_HEADER='$(SHA1_HEADER)'
|
|
|
|
CFLAGS += -DCGIT_VERSION='"$(CGIT_VERSION)"'
|
|
|
|
CFLAGS += -DCGIT_CONFIG='"$(CGIT_CONFIG)"'
|
2007-05-14 22:48:31 +00:00
|
|
|
CFLAGS += -DCGIT_SCRIPT_NAME='"$(CGIT_SCRIPT_NAME)"'
|
2007-05-08 20:40:59 +00:00
|
|
|
|
2007-05-10 09:25:12 +00:00
|
|
|
|
2007-05-11 18:41:14 +00:00
|
|
|
#
|
|
|
|
# If make is run on a nongit platform, we need to get the git sources as a tarball.
|
|
|
|
# But there is currently no recent enough tarball available on kernel.org, so download
|
|
|
|
# a zipfile from hjemli.net instead
|
|
|
|
#
|
|
|
|
GITVER = $(shell git version 2>/dev/null || echo nogit)
|
|
|
|
ifeq ($(GITVER),nogit)
|
|
|
|
GITURL = http://hjemli.net/git/git/snapshot/?id=v1.5.2-rc2
|
|
|
|
INITGIT = test -e git/git.c || (curl "$(GITURL)" > tmp.zip && unzip tmp.zip)
|
|
|
|
else
|
|
|
|
INITGIT = ./submodules.sh -i
|
|
|
|
endif
|
2007-05-10 09:25:12 +00:00
|
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
# basic build rules
|
|
|
|
#
|
2006-12-09 14:18:17 +00:00
|
|
|
all: cgit
|
|
|
|
|
2007-05-10 09:25:12 +00:00
|
|
|
cgit: cgit.c cgit.h $(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
|
|
|
|
|
|
|
$(OBJECTS): cgit.h git/libgit.a
|
|
|
|
|
|
|
|
git/libgit.a:
|
2007-05-11 18:41:14 +00:00
|
|
|
$(INITGIT)
|
2007-05-10 09:25:12 +00:00
|
|
|
$(MAKE) -C git
|
|
|
|
|
|
|
|
#
|
|
|
|
# phony targets
|
|
|
|
#
|
2006-12-13 13:39:41 +00:00
|
|
|
install: all clean-cache
|
2007-02-04 22:57:34 +00:00
|
|
|
mkdir -p $(prefix)
|
2007-05-14 22:48:31 +00:00
|
|
|
install cgit $(prefix)/$(CGIT_SCRIPT_NAME)
|
2007-02-04 22:57:34 +00:00
|
|
|
install cgit.css $(prefix)/cgit.css
|
2006-12-09 14:18:17 +00:00
|
|
|
|
2007-05-10 09:25:12 +00:00
|
|
|
clean-cgit:
|
|
|
|
rm -f cgit *.o
|
2006-12-20 23:47:05 +00:00
|
|
|
|
2007-05-10 09:25:12 +00:00
|
|
|
distclean-cgit: clean-cgit
|
|
|
|
git clean -d -x
|
2007-02-04 22:57:34 +00:00
|
|
|
|
2007-05-10 09:25:12 +00:00
|
|
|
clean-sub:
|
|
|
|
$(MAKE) -C git clean
|
2007-02-04 22:57:34 +00:00
|
|
|
|
2007-05-10 09:25:12 +00:00
|
|
|
distclean-sub: clean-sub
|
|
|
|
$(shell cd git && git clean -d -x)
|
2006-12-13 13:39:41 +00:00
|
|
|
|
|
|
|
clean-cache:
|
|
|
|
rm -rf $(CACHE_ROOT)/*
|
2007-05-10 09:25:12 +00:00
|
|
|
|
|
|
|
clean: clean-cgit clean-sub
|
|
|
|
|
|
|
|
distclean: distclean-cgit distclean-sub
|
|
|
|
|
|
|
|
.PHONY: all install clean clean-cgit clean-sub clean-cache \
|
|
|
|
distclean distclean-cgit distclean-sub
|