2007-05-11 12:15:44 +02:00
|
|
|
CGIT_VERSION = 0.3
|
2006-12-09 15:18:17 +01:00
|
|
|
|
2007-02-04 23:57:34 +01:00
|
|
|
prefix = /var/www/htdocs/cgit
|
2006-12-09 15:18:17 +01:00
|
|
|
|
2007-05-08 22:40:59 +02:00
|
|
|
SHA1_HEADER = <openssl/sha.h>
|
|
|
|
|
2007-02-04 23:57:34 +01:00
|
|
|
CACHE_ROOT = /var/cache/cgit
|
2007-05-10 11:25:12 +02:00
|
|
|
EXTLIBS = git/libgit.a git/xdiff/lib.a -lz -lcrypto
|
2006-12-11 17:25:41 +01:00
|
|
|
OBJECTS = shared.o cache.o parsing.o html.o ui-shared.o ui-repolist.o \
|
2007-05-08 22:40:59 +02:00
|
|
|
ui-summary.o ui-log.o ui-view.o ui-tree.o ui-commit.o ui-diff.o \
|
2007-05-09 00:48:09 +02:00
|
|
|
ui-snapshot.o ui-blob.o
|
2006-12-10 22:31:36 +01:00
|
|
|
|
|
|
|
CFLAGS += -Wall
|
2006-12-09 15:18:17 +01:00
|
|
|
|
2007-01-17 01:13:05 +01:00
|
|
|
ifdef DEBUG
|
|
|
|
CFLAGS += -g
|
|
|
|
endif
|
|
|
|
|
2007-05-10 11:25:12 +02:00
|
|
|
CFLAGS += -Igit -DSHA1_HEADER='$(SHA1_HEADER)'
|
2007-05-08 22:40:59 +02:00
|
|
|
|
2007-05-10 11:25:12 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
# basic build rules
|
|
|
|
#
|
2006-12-09 15:18:17 +01:00
|
|
|
all: cgit
|
|
|
|
|
2007-05-10 11:25:12 +02:00
|
|
|
cgit: cgit.c cgit.h $(OBJECTS)
|
|
|
|
$(CC) $(CFLAGS) -DCGIT_VERSION='"$(CGIT_VERSION)"' cgit.c -o cgit \
|
|
|
|
$(OBJECTS) $(EXTLIBS)
|
|
|
|
|
|
|
|
$(OBJECTS): cgit.h git/libgit.a
|
|
|
|
|
|
|
|
git/libgit.a:
|
|
|
|
./submodules.sh -i
|
|
|
|
$(MAKE) -C git
|
|
|
|
|
|
|
|
#
|
|
|
|
# phony targets
|
|
|
|
#
|
2006-12-13 14:39:41 +01:00
|
|
|
install: all clean-cache
|
2007-02-04 23:57:34 +01:00
|
|
|
mkdir -p $(prefix)
|
|
|
|
install cgit $(prefix)/cgit.cgi
|
|
|
|
install cgit.css $(prefix)/cgit.css
|
2006-12-09 15:18:17 +01:00
|
|
|
|
2007-05-10 11:25:12 +02:00
|
|
|
clean-cgit:
|
|
|
|
rm -f cgit *.o
|
2006-12-21 00:47:05 +01:00
|
|
|
|
2007-05-10 11:25:12 +02:00
|
|
|
distclean-cgit: clean-cgit
|
|
|
|
git clean -d -x
|
2007-02-04 23:57:34 +01:00
|
|
|
|
2007-05-10 11:25:12 +02:00
|
|
|
clean-sub:
|
|
|
|
$(MAKE) -C git clean
|
2007-02-04 23:57:34 +01:00
|
|
|
|
2007-05-10 11:25:12 +02:00
|
|
|
distclean-sub: clean-sub
|
|
|
|
$(shell cd git && git clean -d -x)
|
2006-12-13 14:39:41 +01:00
|
|
|
|
|
|
|
clean-cache:
|
|
|
|
rm -rf $(CACHE_ROOT)/*
|
2007-05-10 11:25:12 +02: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
|