]> git.cameronkatri.com Git - cgit.git/blob - Makefile
cgit v0.2
[cgit.git] / Makefile
1 CGIT_VERSION = 0.2
2
3 prefix = /var/www/htdocs/cgit
4 gitsrc = ../git
5
6 CACHE_ROOT = /var/cache/cgit
7 EXTLIBS = $(gitsrc)/libgit.a $(gitsrc)/xdiff/lib.a -lz -lcrypto
8 OBJECTS = shared.o cache.o parsing.o html.o ui-shared.o ui-repolist.o \
9 ui-summary.o ui-log.o ui-view.c ui-tree.c ui-commit.c ui-diff.o
10
11 CFLAGS += -Wall
12
13 ifdef DEBUG
14 CFLAGS += -g
15 endif
16
17 all: cgit
18
19 install: all clean-cache
20 mkdir -p $(prefix)
21 install cgit $(prefix)/cgit.cgi
22 install cgit.css $(prefix)/cgit.css
23
24 cgit: cgit.c cgit.h git.h $(OBJECTS) $(gitsrc)/libgit.a
25 $(CC) $(CFLAGS) -DCGIT_VERSION='"$(CGIT_VERSION)"' cgit.c -o cgit \
26 $(OBJECTS) $(EXTLIBS)
27
28 $(OBJECTS): cgit.h git.h
29
30 ui-diff.o: xdiff.h
31
32 $(gitsrc)/libgit.a:
33 $(MAKE) -C $(gitsrc)
34
35
36 .PHONY: clean
37 clean:
38 rm -f cgit *.o
39
40 clean-cache:
41 rm -rf $(CACHE_ROOT)/*