author | Lars Hjemli <hjemli@gmail.com> | 2007-05-15 16:38:31 (UTC) |
---|---|---|
committer | Lars Hjemli <hjemli@gmail.com> | 2007-05-15 16:41:31 (UTC) |
commit | ad3b39d3b8443e142a6bfee34d527c99cd5f280d (patch) (unidiff) | |
tree | ac90d617f9468840472a45d33b892ecb90203013 | |
parent | c94afaacf4f996e3c983bcc150a2bacde2b00f20 (diff) | |
download | cgit-ad3b39d3b8443e142a6bfee34d527c99cd5f280d.zip cgit-ad3b39d3b8443e142a6bfee34d527c99cd5f280d.tar.gz cgit-ad3b39d3b8443e142a6bfee34d527c99cd5f280d.tar.bz2 |
Include cgit.conf in Makefile
This allows persistent overrides of Makefile settings without touching
the Makefile.
Suggested in a patch by Kristian Høgsberg <krh@bitplanet.net>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
-rw-r--r-- | Makefile | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -1,84 +1,89 @@ | |||
1 | CGIT_VERSION = 0.4 | 1 | CGIT_VERSION = 0.4 |
2 | 2 | ||
3 | prefix = /var/www/htdocs/cgit | 3 | prefix = /var/www/htdocs/cgit |
4 | 4 | ||
5 | SHA1_HEADER = <openssl/sha.h> | 5 | SHA1_HEADER = <openssl/sha.h> |
6 | CACHE_ROOT = /var/cache/cgit | 6 | CACHE_ROOT = /var/cache/cgit |
7 | CGIT_CONFIG = /etc/cgitrc | 7 | CGIT_CONFIG = /etc/cgitrc |
8 | CGIT_SCRIPT_NAME = cgit.cgi | 8 | CGIT_SCRIPT_NAME = cgit.cgi |
9 | 9 | ||
10 | # | ||
11 | # Let the user override the above settings. | ||
12 | # | ||
13 | -include cgit.conf | ||
14 | |||
10 | EXTLIBS = git/libgit.a git/xdiff/lib.a -lz -lcrypto | 15 | EXTLIBS = git/libgit.a git/xdiff/lib.a -lz -lcrypto |
11 | OBJECTS = shared.o cache.o parsing.o html.o ui-shared.o ui-repolist.o \ | 16 | OBJECTS = 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 | ||
15 | CFLAGS += -Wall | 20 | CFLAGS += -Wall |
16 | 21 | ||
17 | ifdef DEBUG | 22 | ifdef DEBUG |
18 | CFLAGS += -g | 23 | CFLAGS += -g |
19 | endif | 24 | endif |
20 | 25 | ||
21 | CFLAGS += -Igit | 26 | CFLAGS += -Igit |
22 | CFLAGS += -DSHA1_HEADER='$(SHA1_HEADER)' | 27 | CFLAGS += -DSHA1_HEADER='$(SHA1_HEADER)' |
23 | CFLAGS += -DCGIT_VERSION='"$(CGIT_VERSION)"' | 28 | CFLAGS += -DCGIT_VERSION='"$(CGIT_VERSION)"' |
24 | CFLAGS += -DCGIT_CONFIG='"$(CGIT_CONFIG)"' | 29 | CFLAGS += -DCGIT_CONFIG='"$(CGIT_CONFIG)"' |
25 | CFLAGS += -DCGIT_SCRIPT_NAME='"$(CGIT_SCRIPT_NAME)"' | 30 | CFLAGS += -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 | # |
33 | GITVER = $(shell git version 2>/dev/null || echo nogit) | 38 | GITVER = $(shell git version 2>/dev/null || echo nogit) |
34 | ifeq ($(GITVER),nogit) | 39 | ifeq ($(GITVER),nogit) |
35 | GITURL = http://hjemli.net/git/git/snapshot/?id=v1.5.2-rc2 | 40 | GITURL = http://hjemli.net/git/git/snapshot/?id=v1.5.2-rc2 |
36 | INITGIT = test -e git/git.c || (curl "$(GITURL)" > tmp.zip && unzip tmp.zip) | 41 | INITGIT = test -e git/git.c || (curl "$(GITURL)" > tmp.zip && unzip tmp.zip) |
37 | else | 42 | else |
38 | INITGIT = ./submodules.sh -i | 43 | INITGIT = ./submodules.sh -i |
39 | endif | 44 | endif |
40 | 45 | ||
41 | 46 | ||
42 | # | 47 | # |
43 | # basic build rules | 48 | # basic build rules |
44 | # | 49 | # |
45 | all: cgit | 50 | all: cgit |
46 | 51 | ||
47 | cgit: cgit.c cgit.h $(OBJECTS) | 52 | cgit: 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 | ||
52 | git/libgit.a: | 57 | git/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 | # |
59 | install: all clean-cache | 64 | install: 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 | ||
64 | clean-cgit: | 69 | clean-cgit: |
65 | rm -f cgit *.o | 70 | rm -f cgit *.o |
66 | 71 | ||
67 | distclean-cgit: clean-cgit | 72 | distclean-cgit: clean-cgit |
68 | git clean -d -x | 73 | git clean -d -x |
69 | 74 | ||
70 | clean-sub: | 75 | clean-sub: |
71 | $(MAKE) -C git clean | 76 | $(MAKE) -C git clean |
72 | 77 | ||
73 | distclean-sub: clean-sub | 78 | distclean-sub: clean-sub |
74 | $(shell cd git && git clean -d -x) | 79 | $(shell cd git && git clean -d -x) |
75 | 80 | ||
76 | clean-cache: | 81 | clean-cache: |
77 | rm -rf $(CACHE_ROOT)/* | 82 | rm -rf $(CACHE_ROOT)/* |
78 | 83 | ||
79 | clean: clean-cgit clean-sub | 84 | clean: clean-cgit clean-sub |
80 | 85 | ||
81 | distclean: distclean-cgit distclean-sub | 86 | distclean: 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 |