summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--Makefile5
1 files changed, 5 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index aa7146d..914db1c 100644
--- a/Makefile
+++ b/Makefile
@@ -1,84 +1,89 @@
1CGIT_VERSION = 0.4 1CGIT_VERSION = 0.4
2 2
3prefix = /var/www/htdocs/cgit 3prefix = /var/www/htdocs/cgit
4 4
5SHA1_HEADER = <openssl/sha.h> 5SHA1_HEADER = <openssl/sha.h>
6CACHE_ROOT = /var/cache/cgit 6CACHE_ROOT = /var/cache/cgit
7CGIT_CONFIG = /etc/cgitrc 7CGIT_CONFIG = /etc/cgitrc
8CGIT_SCRIPT_NAME = cgit.cgi 8CGIT_SCRIPT_NAME = cgit.cgi
9 9
10#
11# Let the user override the above settings.
12#
13-include cgit.conf
14
10EXTLIBS = git/libgit.a git/xdiff/lib.a -lz -lcrypto 15EXTLIBS = git/libgit.a git/xdiff/lib.a -lz -lcrypto
11OBJECTS = shared.o cache.o parsing.o html.o ui-shared.o ui-repolist.o \ 16OBJECTS = shared.o cache.o parsing.o html.o ui-shared.o ui-repolist.o \
12 ui-summary.o ui-log.o ui-view.o ui-tree.o ui-commit.o ui-diff.o \ 17 ui-summary.o ui-log.o ui-view.o ui-tree.o ui-commit.o ui-diff.o \
13 ui-snapshot.o ui-blob.o 18 ui-snapshot.o ui-blob.o
14 19
15CFLAGS += -Wall 20CFLAGS += -Wall
16 21
17ifdef DEBUG 22ifdef DEBUG
18 CFLAGS += -g 23 CFLAGS += -g
19endif 24endif
20 25
21CFLAGS += -Igit 26CFLAGS += -Igit
22CFLAGS += -DSHA1_HEADER='$(SHA1_HEADER)' 27CFLAGS += -DSHA1_HEADER='$(SHA1_HEADER)'
23CFLAGS += -DCGIT_VERSION='"$(CGIT_VERSION)"' 28CFLAGS += -DCGIT_VERSION='"$(CGIT_VERSION)"'
24CFLAGS += -DCGIT_CONFIG='"$(CGIT_CONFIG)"' 29CFLAGS += -DCGIT_CONFIG='"$(CGIT_CONFIG)"'
25CFLAGS += -DCGIT_SCRIPT_NAME='"$(CGIT_SCRIPT_NAME)"' 30CFLAGS += -DCGIT_SCRIPT_NAME='"$(CGIT_SCRIPT_NAME)"'
26 31
27 32
28# 33#
29# If make is run on a nongit platform, we need to get the git sources as a tarball. 34# If make is run on a nongit platform, we need to get the git sources as a tarball.
30# But there is currently no recent enough tarball available on kernel.org, so download 35# But there is currently no recent enough tarball available on kernel.org, so download
31# a zipfile from hjemli.net instead 36# a zipfile from hjemli.net instead
32# 37#
33GITVER = $(shell git version 2>/dev/null || echo nogit) 38GITVER = $(shell git version 2>/dev/null || echo nogit)
34ifeq ($(GITVER),nogit) 39ifeq ($(GITVER),nogit)
35GITURL = http://hjemli.net/git/git/snapshot/?id=v1.5.2-rc2 40GITURL = http://hjemli.net/git/git/snapshot/?id=v1.5.2-rc2
36INITGIT = test -e git/git.c || (curl "$(GITURL)" > tmp.zip && unzip tmp.zip) 41INITGIT = test -e git/git.c || (curl "$(GITURL)" > tmp.zip && unzip tmp.zip)
37else 42else
38INITGIT = ./submodules.sh -i 43INITGIT = ./submodules.sh -i
39endif 44endif
40 45
41 46
42# 47#
43# basic build rules 48# basic build rules
44# 49#
45all: cgit 50all: cgit
46 51
47cgit: cgit.c cgit.h $(OBJECTS) 52cgit: cgit.c cgit.h $(OBJECTS)
48 $(CC) $(CFLAGS) cgit.c -o cgit $(OBJECTS) $(EXTLIBS) 53 $(CC) $(CFLAGS) cgit.c -o cgit $(OBJECTS) $(EXTLIBS)
49 54
50$(OBJECTS): cgit.h git/libgit.a 55$(OBJECTS): cgit.h git/libgit.a
51 56
52git/libgit.a: 57git/libgit.a:
53 $(INITGIT) 58 $(INITGIT)
54 $(MAKE) -C git 59 $(MAKE) -C git
55 60
56# 61#
57# phony targets 62# phony targets
58# 63#
59install: all clean-cache 64install: all clean-cache
60 mkdir -p $(prefix) 65 mkdir -p $(prefix)
61 install cgit $(prefix)/$(CGIT_SCRIPT_NAME) 66 install cgit $(prefix)/$(CGIT_SCRIPT_NAME)
62 install cgit.css $(prefix)/cgit.css 67 install cgit.css $(prefix)/cgit.css
63 68
64clean-cgit: 69clean-cgit:
65 rm -f cgit *.o 70 rm -f cgit *.o
66 71
67distclean-cgit: clean-cgit 72distclean-cgit: clean-cgit
68 git clean -d -x 73 git clean -d -x
69 74
70clean-sub: 75clean-sub:
71 $(MAKE) -C git clean 76 $(MAKE) -C git clean
72 77
73distclean-sub: clean-sub 78distclean-sub: clean-sub
74 $(shell cd git && git clean -d -x) 79 $(shell cd git && git clean -d -x)
75 80
76clean-cache: 81clean-cache:
77 rm -rf $(CACHE_ROOT)/* 82 rm -rf $(CACHE_ROOT)/*
78 83
79clean: clean-cgit clean-sub 84clean: clean-cgit clean-sub
80 85
81distclean: distclean-cgit distclean-sub 86distclean: distclean-cgit distclean-sub
82 87
83.PHONY: all install clean clean-cgit clean-sub clean-cache \ 88.PHONY: all install clean clean-cgit clean-sub clean-cache \
84 distclean distclean-cgit distclean-sub 89 distclean distclean-cgit distclean-sub