]> git.cameronkatri.com Git - cgit.git/blob - Makefile
Tag release v0.3
[cgit.git] / Makefile
1 CGIT_VERSION = 0.3
2
3 prefix = /var/www/htdocs/cgit
4
5 SHA1_HEADER = <openssl/sha.h>
6
7 CACHE_ROOT = /var/cache/cgit
8 EXTLIBS = git/libgit.a git/xdiff/lib.a -lz -lcrypto
9 OBJECTS = shared.o cache.o parsing.o html.o ui-shared.o ui-repolist.o \
10 ui-summary.o ui-log.o ui-view.o ui-tree.o ui-commit.o ui-diff.o \
11 ui-snapshot.o ui-blob.o
12
13 CFLAGS += -Wall
14
15 ifdef DEBUG
16 CFLAGS += -g
17 endif
18
19 CFLAGS += -Igit -DSHA1_HEADER='$(SHA1_HEADER)'
20
21
22
23
24 #
25 # basic build rules
26 #
27 all: cgit
28
29 cgit: cgit.c cgit.h $(OBJECTS)
30 $(CC) $(CFLAGS) -DCGIT_VERSION='"$(CGIT_VERSION)"' cgit.c -o cgit \
31 $(OBJECTS) $(EXTLIBS)
32
33 $(OBJECTS): cgit.h git/libgit.a
34
35 git/libgit.a:
36 ./submodules.sh -i
37 $(MAKE) -C git
38
39 #
40 # phony targets
41 #
42 install: all clean-cache
43 mkdir -p $(prefix)
44 install cgit $(prefix)/cgit.cgi
45 install cgit.css $(prefix)/cgit.css
46
47 clean-cgit:
48 rm -f cgit *.o
49
50 distclean-cgit: clean-cgit
51 git clean -d -x
52
53 clean-sub:
54 $(MAKE) -C git clean
55
56 distclean-sub: clean-sub
57 $(shell cd git && git clean -d -x)
58
59 clean-cache:
60 rm -rf $(CACHE_ROOT)/*
61
62 clean: clean-cgit clean-sub
63
64 distclean: distclean-cgit distclean-sub
65
66 .PHONY: all install clean clean-cgit clean-sub clean-cache \
67 distclean distclean-cgit distclean-sub