|
diff --git a/Makefile b/Makefile index d9ff7d8..d1950cb 100644 --- a/ Makefile+++ b/ Makefile |
|
@@ -1,83 +1,98 @@ |
1 | CGIT_VERSION = v0.7.2 |
1 | CGIT_VERSION = v0.7.2 |
2 | CGIT_SCRIPT_NAME = cgit.cgi |
2 | CGIT_SCRIPT_NAME = cgit.cgi |
3 | CGIT_SCRIPT_PATH = /var/www/htdocs/cgit |
3 | CGIT_SCRIPT_PATH = /var/www/htdocs/cgit |
4 | CGIT_CONFIG = /etc/cgitrc |
4 | CGIT_CONFIG = /etc/cgitrc |
5 | CACHE_ROOT = /var/cache/cgit |
5 | CACHE_ROOT = /var/cache/cgit |
6 | SHA1_HEADER = <openssl/sha.h> |
6 | SHA1_HEADER = <openssl/sha.h> |
7 | GIT_VER = 1.5.4.1 |
7 | GIT_VER = 1.5.4.1 |
8 | GIT_URL = http://www.kernel.org/pub/software/scm/git/git-$(GIT_VER).tar.bz2 |
8 | GIT_URL = http://www.kernel.org/pub/software/scm/git/git-$(GIT_VER).tar.bz2 |
9 | |
9 | |
10 | # |
10 | # |
11 | # Let the user override the above settings. |
11 | # Let the user override the above settings. |
12 | # |
12 | # |
13 | -include cgit.conf |
13 | -include cgit.conf |
14 | |
14 | |
15 | |
15 | |
16 | EXTLIBS = git/libgit.a git/xdiff/lib.a -lz -lcrypto |
16 | EXTLIBS = git/libgit.a git/xdiff/lib.a -lz -lcrypto |
17 | OBJECTS = shared.o cache.o parsing.o html.o ui-shared.o ui-repolist.o \ |
17 | OBJECTS = |
18 | ui-summary.o ui-log.o ui-tree.o ui-commit.o ui-diff.o \ |
18 | OBJECTS += cache.o |
19 | ui-snapshot.o ui-blob.o ui-tag.o ui-refs.o ui-patch.o cmd.o |
19 | OBJECTS += cgit.o |
20 | |
20 | OBJECTS += cmd.o |
| |
21 | OBJECTS += html.o |
| |
22 | OBJECTS += parsing.o |
| |
23 | OBJECTS += shared.o |
| |
24 | OBJECTS += ui-blob.o |
| |
25 | OBJECTS += ui-commit.o |
| |
26 | OBJECTS += ui-diff.o |
| |
27 | OBJECTS += ui-log.o |
| |
28 | OBJECTS += ui-patch.o |
| |
29 | OBJECTS += ui-refs.o |
| |
30 | OBJECTS += ui-repolist.o |
| |
31 | OBJECTS += ui-shared.o |
| |
32 | OBJECTS += ui-snapshot.o |
| |
33 | OBJECTS += ui-summary.o |
| |
34 | OBJECTS += ui-tag.o |
| |
35 | OBJECTS += ui-tree.o |
21 | |
36 | |
22 | ifdef NEEDS_LIBICONV |
37 | ifdef NEEDS_LIBICONV |
23 | EXTLIBS += -liconv |
38 | EXTLIBS += -liconv |
24 | endif |
39 | endif |
25 | |
40 | |
26 | |
41 | |
27 | .PHONY: all git test install clean distclean emptycache force-version get-git |
42 | .PHONY: all git test install clean distclean emptycache force-version get-git |
28 | |
43 | |
29 | all: cgit git |
44 | all: cgit git |
30 | |
45 | |
31 | VERSION: force-version |
46 | VERSION: force-version |
32 | @./gen-version.sh "$(CGIT_VERSION)" |
47 | @./gen-version.sh "$(CGIT_VERSION)" |
33 | -include VERSION |
48 | -include VERSION |
34 | |
49 | |
35 | |
50 | |
36 | CFLAGS += -g -Wall -Igit |
51 | CFLAGS += -g -Wall -Igit |
37 | CFLAGS += -DSHA1_HEADER='$(SHA1_HEADER)' |
52 | CFLAGS += -DSHA1_HEADER='$(SHA1_HEADER)' |
38 | CFLAGS += -DCGIT_VERSION='"$(CGIT_VERSION)"' |
53 | CFLAGS += -DCGIT_VERSION='"$(CGIT_VERSION)"' |
39 | CFLAGS += -DCGIT_CONFIG='"$(CGIT_CONFIG)"' |
54 | CFLAGS += -DCGIT_CONFIG='"$(CGIT_CONFIG)"' |
40 | CFLAGS += -DCGIT_SCRIPT_NAME='"$(CGIT_SCRIPT_NAME)"' |
55 | CFLAGS += -DCGIT_SCRIPT_NAME='"$(CGIT_SCRIPT_NAME)"' |
41 | CFLAGS += -DCGIT_CACHE_ROOT='"$(CACHE_ROOT)"' |
56 | CFLAGS += -DCGIT_CACHE_ROOT='"$(CACHE_ROOT)"' |
42 | |
57 | |
43 | |
58 | |
44 | cgit: cgit.c $(OBJECTS) |
59 | cgit: $(OBJECTS) |
45 | $(CC) $(CFLAGS) cgit.c -o cgit $(OBJECTS) $(EXTLIBS) |
60 | $(CC) $(CFLAGS) -o cgit $(OBJECTS) $(EXTLIBS) |
46 | |
61 | |
47 | $(OBJECTS): cgit.h git/xdiff/lib.a git/libgit.a VERSION |
62 | $(OBJECTS): git/xdiff/lib.a git/libgit.a VERSION |
48 | |
63 | |
49 | git/xdiff/lib.a: | git |
64 | git/xdiff/lib.a: | git |
50 | |
65 | |
51 | git/libgit.a: | git |
66 | git/libgit.a: | git |
52 | |
67 | |
53 | git: |
68 | git: |
54 | cd git && $(MAKE) xdiff/lib.a |
69 | cd git && $(MAKE) xdiff/lib.a |
55 | cd git && $(MAKE) libgit.a |
70 | cd git && $(MAKE) libgit.a |
56 | |
71 | |
57 | test: all |
72 | test: all |
58 | $(MAKE) -C tests |
73 | $(MAKE) -C tests |
59 | |
74 | |
60 | install: all |
75 | install: all |
61 | mkdir -p $(DESTDIR)$(CGIT_SCRIPT_PATH) |
76 | mkdir -p $(DESTDIR)$(CGIT_SCRIPT_PATH) |
62 | install cgit $(DESTDIR)$(CGIT_SCRIPT_PATH)/$(CGIT_SCRIPT_NAME) |
77 | install cgit $(DESTDIR)$(CGIT_SCRIPT_PATH)/$(CGIT_SCRIPT_NAME) |
63 | install cgit.css $(DESTDIR)$(CGIT_SCRIPT_PATH)/cgit.css |
78 | install cgit.css $(DESTDIR)$(CGIT_SCRIPT_PATH)/cgit.css |
64 | install cgit.png $(DESTDIR)$(CGIT_SCRIPT_PATH)/cgit.png |
79 | install cgit.png $(DESTDIR)$(CGIT_SCRIPT_PATH)/cgit.png |
65 | |
80 | |
66 | uninstall: |
81 | uninstall: |
67 | rm -f $(CGIT_SCRIPT_PATH)/$(CGIT_SCRIPT_NAME) |
82 | rm -f $(CGIT_SCRIPT_PATH)/$(CGIT_SCRIPT_NAME) |
68 | rm -f $(CGIT_SCRIPT_PATH)/cgit.css |
83 | rm -f $(CGIT_SCRIPT_PATH)/cgit.css |
69 | rm -f $(CGIT_SCRIPT_PATH)/cgit.png |
84 | rm -f $(CGIT_SCRIPT_PATH)/cgit.png |
70 | |
85 | |
71 | clean: |
86 | clean: |
72 | rm -f cgit VERSION *.o |
87 | rm -f cgit VERSION *.o |
73 | cd git && $(MAKE) clean |
88 | cd git && $(MAKE) clean |
74 | |
89 | |
75 | distclean: clean |
90 | distclean: clean |
76 | git clean -d -x |
91 | git clean -d -x |
77 | cd git && git clean -d -x |
92 | cd git && git clean -d -x |
78 | |
93 | |
79 | emptycache: |
94 | emptycache: |
80 | rm -rf $(DESTDIR)$(CACHE_ROOT)/* |
95 | rm -rf $(DESTDIR)$(CACHE_ROOT)/* |
81 | |
96 | |
82 | get-git: |
97 | get-git: |
83 | curl $(GIT_URL) | tar -xj && rm -rf git && mv git-$(GIT_VER) git |
98 | curl $(GIT_URL) | tar -xj && rm -rf git && mv git-$(GIT_VER) git |
|