3 prefix = /var/www/htdocs/cgit
5 SHA1_HEADER = <openssl/sha.h>
6 CACHE_ROOT = /var/cache/cgit
7 CGIT_CONFIG = /etc/cgitrc
9 EXTLIBS = git/libgit.a git/xdiff/lib.a -lz -lcrypto
10 OBJECTS = shared.o cache.o parsing.o html.o ui-shared.o ui-repolist.o \
11 ui-summary.o ui-log.o ui-view.o ui-tree.o ui-commit.o ui-diff.o \
12 ui-snapshot.o ui-blob.o
21 CFLAGS += -DSHA1_HEADER='$(SHA1_HEADER)'
22 CFLAGS += -DCGIT_VERSION='"$(CGIT_VERSION)"'
23 CFLAGS += -DCGIT_CONFIG='"$(CGIT_CONFIG)"'
27 # If make is run on a nongit platform, we need to get the git sources as a tarball.
28 # But there is currently no recent enough tarball available on kernel.org, so download
29 # a zipfile from hjemli.net instead
31 GITVER = $(shell git version 2>/dev/null || echo nogit)
32 ifeq ($(GITVER),nogit)
33 GITURL = http://hjemli.net/git/git/snapshot/?id=v1.5.2-rc2
34 INITGIT = test -e git/git.c || (curl "$(GITURL)" > tmp.zip && unzip tmp.zip)
36 INITGIT = ./submodules.sh -i
45 cgit: cgit.c cgit.h $(OBJECTS)
46 $(CC) $(CFLAGS) cgit.c -o cgit $(OBJECTS) $(EXTLIBS)
48 $(OBJECTS): cgit.h git/libgit.a
57 install: all clean-cache
59 install cgit $(prefix)/cgit.cgi
60 install cgit.css $(prefix)/cgit.css
61 install add.png del.png $(prefix)/
66 distclean-cgit: clean-cgit
72 distclean-sub: clean-sub
73 $(shell cd git && git clean -d -x)
76 rm -rf $(CACHE_ROOT)/*
78 clean: clean-cgit clean-sub
80 distclean: distclean-cgit distclean-sub
82 .PHONY: all install clean clean-cgit clean-sub clean-cache \
83 distclean distclean-cgit distclean-sub