|
diff --git a/Makefile b/Makefile index aa7146d..914db1c 100644 --- a/ Makefile+++ b/ Makefile |
|
@@ -1,73 +1,78 @@ |
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 |
|