|
diff --git a/Makefile b/Makefile index 60d8c58..4e101d3 100644 --- a/ Makefile+++ b/ Makefile |
|
@@ -2,24 +2,27 @@ CGIT_VERSION = v0.8.3 |
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_DATA_PATH = $(CGIT_SCRIPT_PATH) |
4 | CGIT_DATA_PATH = $(CGIT_SCRIPT_PATH) |
5 | CGIT_CONFIG = /etc/cgitrc |
5 | CGIT_CONFIG = /etc/cgitrc |
6 | CACHE_ROOT = /var/cache/cgit |
6 | CACHE_ROOT = /var/cache/cgit |
7 | SHA1_HEADER = <openssl/sha.h> |
7 | SHA1_HEADER = <openssl/sha.h> |
8 | GIT_VER = 1.6.4.3 |
8 | GIT_VER = 1.6.4.3 |
9 | GIT_URL = http://www.kernel.org/pub/software/scm/git/git-$(GIT_VER).tar.bz2 |
9 | GIT_URL = http://www.kernel.org/pub/software/scm/git/git-$(GIT_VER).tar.bz2 |
10 | INSTALL = install |
10 | INSTALL = install |
11 | |
11 | |
12 | # Define NO_STRCASESTR if you don't have strcasestr. |
12 | # Define NO_STRCASESTR if you don't have strcasestr. |
13 | # |
13 | # |
| |
14 | # Define NO_OPENSSL to disable linking with OpenSSL and use bundled SHA1 |
| |
15 | # implementation (slower). |
| |
16 | # |
14 | # Define NEEDS_LIBICONV if linking with libc is not enough (eg. Darwin). |
17 | # Define NEEDS_LIBICONV if linking with libc is not enough (eg. Darwin). |
15 | # |
18 | # |
16 | |
19 | |
17 | #-include config.mak |
20 | #-include config.mak |
18 | |
21 | |
19 | # |
22 | # |
20 | # Platform specific tweaks |
23 | # Platform specific tweaks |
21 | # |
24 | # |
22 | |
25 | |
23 | uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not') |
26 | uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not') |
24 | uname_O := $(shell sh -c 'uname -o 2>/dev/null || echo not') |
27 | uname_O := $(shell sh -c 'uname -o 2>/dev/null || echo not') |
25 | uname_R := $(shell sh -c 'uname -r 2>/dev/null || echo not') |
28 | uname_R := $(shell sh -c 'uname -r 2>/dev/null || echo not') |
@@ -59,25 +62,25 @@ endif |
59 | # Define a pattern rule for automatic dependency building |
62 | # Define a pattern rule for automatic dependency building |
60 | # |
63 | # |
61 | %.d: %.c |
64 | %.d: %.c |
62 | $(QUIET_MM)$(CC) $(CFLAGS) -MM $< | sed -e 's/\($*\)\.o:/\1.o $@:/g' >$@ |
65 | $(QUIET_MM)$(CC) $(CFLAGS) -MM $< | sed -e 's/\($*\)\.o:/\1.o $@:/g' >$@ |
63 | |
66 | |
64 | # |
67 | # |
65 | # Define a pattern rule for silent object building |
68 | # Define a pattern rule for silent object building |
66 | # |
69 | # |
67 | %.o: %.c |
70 | %.o: %.c |
68 | $(QUIET_CC)$(CC) -o $*.o -c $(CFLAGS) $< |
71 | $(QUIET_CC)$(CC) -o $*.o -c $(CFLAGS) $< |
69 | |
72 | |
70 | |
73 | |
71 | EXTLIBS = git/libgit.a git/xdiff/lib.a -lz -lcrypto |
74 | EXTLIBS = git/libgit.a git/xdiff/lib.a -lz |
72 | OBJECTS = |
75 | OBJECTS = |
73 | OBJECTS += cache.o |
76 | OBJECTS += cache.o |
74 | OBJECTS += cgit.o |
77 | OBJECTS += cgit.o |
75 | OBJECTS += cmd.o |
78 | OBJECTS += cmd.o |
76 | OBJECTS += configfile.o |
79 | OBJECTS += configfile.o |
77 | OBJECTS += html.o |
80 | OBJECTS += html.o |
78 | OBJECTS += parsing.o |
81 | OBJECTS += parsing.o |
79 | OBJECTS += scan-tree.o |
82 | OBJECTS += scan-tree.o |
80 | OBJECTS += shared.o |
83 | OBJECTS += shared.o |
81 | OBJECTS += ui-atom.o |
84 | OBJECTS += ui-atom.o |
82 | OBJECTS += ui-blob.o |
85 | OBJECTS += ui-blob.o |
83 | OBJECTS += ui-clone.o |
86 | OBJECTS += ui-clone.o |
@@ -114,35 +117,41 @@ CFLAGS += -g -Wall -Igit |
114 | CFLAGS += -DSHA1_HEADER='$(SHA1_HEADER)' |
117 | CFLAGS += -DSHA1_HEADER='$(SHA1_HEADER)' |
115 | CFLAGS += -DCGIT_VERSION='"$(CGIT_VERSION)"' |
118 | CFLAGS += -DCGIT_VERSION='"$(CGIT_VERSION)"' |
116 | CFLAGS += -DCGIT_CONFIG='"$(CGIT_CONFIG)"' |
119 | CFLAGS += -DCGIT_CONFIG='"$(CGIT_CONFIG)"' |
117 | CFLAGS += -DCGIT_SCRIPT_NAME='"$(CGIT_SCRIPT_NAME)"' |
120 | CFLAGS += -DCGIT_SCRIPT_NAME='"$(CGIT_SCRIPT_NAME)"' |
118 | CFLAGS += -DCGIT_CACHE_ROOT='"$(CACHE_ROOT)"' |
121 | CFLAGS += -DCGIT_CACHE_ROOT='"$(CACHE_ROOT)"' |
119 | |
122 | |
120 | ifdef NO_ICONV |
123 | ifdef NO_ICONV |
121 | CFLAGS += -DNO_ICONV |
124 | CFLAGS += -DNO_ICONV |
122 | endif |
125 | endif |
123 | ifdef NO_STRCASESTR |
126 | ifdef NO_STRCASESTR |
124 | CFLAGS += -DNO_STRCASESTR |
127 | CFLAGS += -DNO_STRCASESTR |
125 | endif |
128 | endif |
| |
129 | ifdef NO_OPENSSL |
| |
130 | CFLAGS += -DNO_OPENSSL |
| |
131 | GIT_OPTIONS += NO_OPENSSL=1 |
| |
132 | else |
| |
133 | EXTLIBS += -lcrypto |
| |
134 | endif |
126 | |
135 | |
127 | cgit: $(OBJECTS) libgit |
136 | cgit: $(OBJECTS) libgit |
128 | $(QUIET_CC)$(CC) $(CFLAGS) $(LDFLAGS) -o cgit $(OBJECTS) $(EXTLIBS) |
137 | $(QUIET_CC)$(CC) $(CFLAGS) $(LDFLAGS) -o cgit $(OBJECTS) $(EXTLIBS) |
129 | |
138 | |
130 | cgit.o: VERSION |
139 | cgit.o: VERSION |
131 | |
140 | |
132 | -include $(OBJECTS:.o=.d) |
141 | -include $(OBJECTS:.o=.d) |
133 | |
142 | |
134 | libgit: |
143 | libgit: |
135 | $(QUIET_SUBDIR0)git $(QUIET_SUBDIR1) NO_CURL=1 libgit.a |
144 | $(QUIET_SUBDIR0)git $(QUIET_SUBDIR1) NO_CURL=1 $(GIT_OPTIONS) libgit.a |
136 | $(QUIET_SUBDIR0)git $(QUIET_SUBDIR1) NO_CURL=1 xdiff/lib.a |
145 | $(QUIET_SUBDIR0)git $(QUIET_SUBDIR1) NO_CURL=1 $(GIT_OPTIONS) xdiff/lib.a |
137 | |
146 | |
138 | test: all |
147 | test: all |
139 | $(QUIET_SUBDIR0)tests $(QUIET_SUBDIR1) all |
148 | $(QUIET_SUBDIR0)tests $(QUIET_SUBDIR1) all |
140 | |
149 | |
141 | install: all |
150 | install: all |
142 | $(INSTALL) -m 0755 -d $(DESTDIR)$(CGIT_SCRIPT_PATH) |
151 | $(INSTALL) -m 0755 -d $(DESTDIR)$(CGIT_SCRIPT_PATH) |
143 | $(INSTALL) -m 0755 cgit $(DESTDIR)$(CGIT_SCRIPT_PATH)/$(CGIT_SCRIPT_NAME) |
152 | $(INSTALL) -m 0755 cgit $(DESTDIR)$(CGIT_SCRIPT_PATH)/$(CGIT_SCRIPT_NAME) |
144 | $(INSTALL) -m 0755 -d $(DESTDIR)$(CGIT_DATA_PATH) |
153 | $(INSTALL) -m 0755 -d $(DESTDIR)$(CGIT_DATA_PATH) |
145 | $(INSTALL) -m 0644 cgit.css $(DESTDIR)$(CGIT_DATA_PATH)/cgit.css |
154 | $(INSTALL) -m 0644 cgit.css $(DESTDIR)$(CGIT_DATA_PATH)/cgit.css |
146 | $(INSTALL) -m 0644 cgit.png $(DESTDIR)$(CGIT_DATA_PATH)/cgit.png |
155 | $(INSTALL) -m 0644 cgit.png $(DESTDIR)$(CGIT_DATA_PATH)/cgit.png |
147 | |
156 | |
148 | uninstall: |
157 | uninstall: |
|