summaryrefslogtreecommitdiffabout
authorTodd Zullinger <tmz@pobox.com>2010-09-06 13:31:24 (UTC)
committer Lars Hjemli <hjemli@gmail.com>2010-09-19 17:11:45 (UTC)
commit6d10c130585eccae07eb17b3aff86eeb02cf4fb8 (patch) (unidiff)
tree555a06c36abf87c9940bce7c0fab6f41befe7c2f
parent0c3130de9677ddb0a3e257dba8de4e066ac0db6b (diff)
downloadcgit-6d10c130585eccae07eb17b3aff86eeb02cf4fb8.zip
cgit-6d10c130585eccae07eb17b3aff86eeb02cf4fb8.tar.gz
cgit-6d10c130585eccae07eb17b3aff86eeb02cf4fb8.tar.bz2
Install filter scripts
The syntax-highlighting.sh script is quite useful without any changes. Installing it by default makes it easier to use and package. Signed-off-by: Todd Zullinger <tmz@pobox.com> Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--Makefile4
1 files changed, 4 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 3004e88..ebf8f03 100644
--- a/Makefile
+++ b/Makefile
@@ -1,237 +1,241 @@
1CGIT_VERSION = v0.8.3.3 1CGIT_VERSION = v0.8.3.3
2CGIT_SCRIPT_NAME = cgit.cgi 2CGIT_SCRIPT_NAME = cgit.cgi
3CGIT_SCRIPT_PATH = /var/www/htdocs/cgit 3CGIT_SCRIPT_PATH = /var/www/htdocs/cgit
4CGIT_DATA_PATH = $(CGIT_SCRIPT_PATH) 4CGIT_DATA_PATH = $(CGIT_SCRIPT_PATH)
5CGIT_CONFIG = /etc/cgitrc 5CGIT_CONFIG = /etc/cgitrc
6CACHE_ROOT = /var/cache/cgit 6CACHE_ROOT = /var/cache/cgit
7prefix = /usr 7prefix = /usr
8libdir = $(prefix)/lib
9filterdir = $(libdir)/cgit/filters
8docdir = $(prefix)/share/doc/cgit 10docdir = $(prefix)/share/doc/cgit
9htmldir = $(docdir) 11htmldir = $(docdir)
10pdfdir = $(docdir) 12pdfdir = $(docdir)
11mandir = $(prefix)/share/man 13mandir = $(prefix)/share/man
12SHA1_HEADER = <openssl/sha.h> 14SHA1_HEADER = <openssl/sha.h>
13GIT_VER = 1.7.3 15GIT_VER = 1.7.3
14GIT_URL = http://www.kernel.org/pub/software/scm/git/git-$(GIT_VER).tar.bz2 16GIT_URL = http://www.kernel.org/pub/software/scm/git/git-$(GIT_VER).tar.bz2
15INSTALL = install 17INSTALL = install
16MAN5_TXT = $(wildcard *.5.txt) 18MAN5_TXT = $(wildcard *.5.txt)
17MAN_TXT = $(MAN5_TXT) 19MAN_TXT = $(MAN5_TXT)
18DOC_MAN5 = $(patsubst %.txt,%,$(MAN5_TXT)) 20DOC_MAN5 = $(patsubst %.txt,%,$(MAN5_TXT))
19DOC_HTML = $(patsubst %.txt,%.html,$(MAN_TXT)) 21DOC_HTML = $(patsubst %.txt,%.html,$(MAN_TXT))
20DOC_PDF = $(patsubst %.txt,%.pdf,$(MAN_TXT)) 22DOC_PDF = $(patsubst %.txt,%.pdf,$(MAN_TXT))
21 23
22# Define NO_STRCASESTR if you don't have strcasestr. 24# Define NO_STRCASESTR if you don't have strcasestr.
23# 25#
24# Define NO_OPENSSL to disable linking with OpenSSL and use bundled SHA1 26# Define NO_OPENSSL to disable linking with OpenSSL and use bundled SHA1
25# implementation (slower). 27# implementation (slower).
26# 28#
27# Define NEEDS_LIBICONV if linking with libc is not enough (eg. Darwin). 29# Define NEEDS_LIBICONV if linking with libc is not enough (eg. Darwin).
28# 30#
29# Define NO_C99_FORMAT if your formatted IO functions (printf/scanf et.al.) 31# Define NO_C99_FORMAT if your formatted IO functions (printf/scanf et.al.)
30# do not support the 'size specifiers' introduced by C99, namely ll, hh, 32# do not support the 'size specifiers' introduced by C99, namely ll, hh,
31# j, z, t. (representing long long int, char, intmax_t, size_t, ptrdiff_t). 33# j, z, t. (representing long long int, char, intmax_t, size_t, ptrdiff_t).
32# some C compilers supported these specifiers prior to C99 as an extension. 34# some C compilers supported these specifiers prior to C99 as an extension.
33# 35#
34 36
35#-include config.mak 37#-include config.mak
36 38
37# 39#
38# Platform specific tweaks 40# Platform specific tweaks
39# 41#
40 42
41uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not') 43uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not')
42uname_O := $(shell sh -c 'uname -o 2>/dev/null || echo not') 44uname_O := $(shell sh -c 'uname -o 2>/dev/null || echo not')
43uname_R := $(shell sh -c 'uname -r 2>/dev/null || echo not') 45uname_R := $(shell sh -c 'uname -r 2>/dev/null || echo not')
44 46
45ifeq ($(uname_O),Cygwin) 47ifeq ($(uname_O),Cygwin)
46 NO_STRCASESTR = YesPlease 48 NO_STRCASESTR = YesPlease
47 NEEDS_LIBICONV = YesPlease 49 NEEDS_LIBICONV = YesPlease
48endif 50endif
49 51
50# 52#
51# Let the user override the above settings. 53# Let the user override the above settings.
52# 54#
53-include cgit.conf 55-include cgit.conf
54 56
55# 57#
56# Define a way to invoke make in subdirs quietly, shamelessly ripped 58# Define a way to invoke make in subdirs quietly, shamelessly ripped
57# from git.git 59# from git.git
58# 60#
59QUIET_SUBDIR0 = +$(MAKE) -C # space to separate -C and subdir 61QUIET_SUBDIR0 = +$(MAKE) -C # space to separate -C and subdir
60QUIET_SUBDIR1 = 62QUIET_SUBDIR1 =
61 63
62ifneq ($(findstring $(MAKEFLAGS),w),w) 64ifneq ($(findstring $(MAKEFLAGS),w),w)
63PRINT_DIR = --no-print-directory 65PRINT_DIR = --no-print-directory
64else # "make -w" 66else # "make -w"
65NO_SUBDIR = : 67NO_SUBDIR = :
66endif 68endif
67 69
68ifndef V 70ifndef V
69 QUIET_CC = @echo ' ' CC $@; 71 QUIET_CC = @echo ' ' CC $@;
70 QUIET_MM = @echo ' ' MM $@; 72 QUIET_MM = @echo ' ' MM $@;
71 QUIET_SUBDIR0 = +@subdir= 73 QUIET_SUBDIR0 = +@subdir=
72 QUIET_SUBDIR1 = ;$(NO_SUBDIR) echo ' ' SUBDIR $$subdir; \ 74 QUIET_SUBDIR1 = ;$(NO_SUBDIR) echo ' ' SUBDIR $$subdir; \
73 $(MAKE) $(PRINT_DIR) -C $$subdir 75 $(MAKE) $(PRINT_DIR) -C $$subdir
74endif 76endif
75 77
76# 78#
77# Define a pattern rule for automatic dependency building 79# Define a pattern rule for automatic dependency building
78# 80#
79%.d: %.c 81%.d: %.c
80 $(QUIET_MM)$(CC) $(CFLAGS) -MM $< | sed -e 's/\($*\)\.o:/\1.o $@:/g' >$@ 82 $(QUIET_MM)$(CC) $(CFLAGS) -MM $< | sed -e 's/\($*\)\.o:/\1.o $@:/g' >$@
81 83
82# 84#
83# Define a pattern rule for silent object building 85# Define a pattern rule for silent object building
84# 86#
85%.o: %.c 87%.o: %.c
86 $(QUIET_CC)$(CC) -o $*.o -c $(CFLAGS) $< 88 $(QUIET_CC)$(CC) -o $*.o -c $(CFLAGS) $<
87 89
88 90
89EXTLIBS = git/libgit.a git/xdiff/lib.a -lz -lpthread 91EXTLIBS = git/libgit.a git/xdiff/lib.a -lz -lpthread
90OBJECTS = 92OBJECTS =
91OBJECTS += cache.o 93OBJECTS += cache.o
92OBJECTS += cgit.o 94OBJECTS += cgit.o
93OBJECTS += cmd.o 95OBJECTS += cmd.o
94OBJECTS += configfile.o 96OBJECTS += configfile.o
95OBJECTS += html.o 97OBJECTS += html.o
96OBJECTS += parsing.o 98OBJECTS += parsing.o
97OBJECTS += scan-tree.o 99OBJECTS += scan-tree.o
98OBJECTS += shared.o 100OBJECTS += shared.o
99OBJECTS += ui-atom.o 101OBJECTS += ui-atom.o
100OBJECTS += ui-blob.o 102OBJECTS += ui-blob.o
101OBJECTS += ui-clone.o 103OBJECTS += ui-clone.o
102OBJECTS += ui-commit.o 104OBJECTS += ui-commit.o
103OBJECTS += ui-diff.o 105OBJECTS += ui-diff.o
104OBJECTS += ui-log.o 106OBJECTS += ui-log.o
105OBJECTS += ui-patch.o 107OBJECTS += ui-patch.o
106OBJECTS += ui-plain.o 108OBJECTS += ui-plain.o
107OBJECTS += ui-refs.o 109OBJECTS += ui-refs.o
108OBJECTS += ui-repolist.o 110OBJECTS += ui-repolist.o
109OBJECTS += ui-shared.o 111OBJECTS += ui-shared.o
110OBJECTS += ui-snapshot.o 112OBJECTS += ui-snapshot.o
111OBJECTS += ui-ssdiff.o 113OBJECTS += ui-ssdiff.o
112OBJECTS += ui-stats.o 114OBJECTS += ui-stats.o
113OBJECTS += ui-summary.o 115OBJECTS += ui-summary.o
114OBJECTS += ui-tag.o 116OBJECTS += ui-tag.o
115OBJECTS += ui-tree.o 117OBJECTS += ui-tree.o
116 118
117ifdef NEEDS_LIBICONV 119ifdef NEEDS_LIBICONV
118 EXTLIBS += -liconv 120 EXTLIBS += -liconv
119endif 121endif
120 122
121 123
122.PHONY: all libgit test install uninstall clean force-version get-git \ 124.PHONY: all libgit test install uninstall clean force-version get-git \
123 doc clean-doc install-doc install-man install-html install-pdf \ 125 doc clean-doc install-doc install-man install-html install-pdf \
124 uninstall-doc uninstall-man uninstall-html uninstall-pdf 126 uninstall-doc uninstall-man uninstall-html uninstall-pdf
125 127
126all: cgit 128all: cgit
127 129
128VERSION: force-version 130VERSION: force-version
129 @./gen-version.sh "$(CGIT_VERSION)" 131 @./gen-version.sh "$(CGIT_VERSION)"
130-include VERSION 132-include VERSION
131 133
132 134
133CFLAGS += -g -Wall -Igit 135CFLAGS += -g -Wall -Igit
134CFLAGS += -DSHA1_HEADER='$(SHA1_HEADER)' 136CFLAGS += -DSHA1_HEADER='$(SHA1_HEADER)'
135CFLAGS += -DCGIT_VERSION='"$(CGIT_VERSION)"' 137CFLAGS += -DCGIT_VERSION='"$(CGIT_VERSION)"'
136CFLAGS += -DCGIT_CONFIG='"$(CGIT_CONFIG)"' 138CFLAGS += -DCGIT_CONFIG='"$(CGIT_CONFIG)"'
137CFLAGS += -DCGIT_SCRIPT_NAME='"$(CGIT_SCRIPT_NAME)"' 139CFLAGS += -DCGIT_SCRIPT_NAME='"$(CGIT_SCRIPT_NAME)"'
138CFLAGS += -DCGIT_CACHE_ROOT='"$(CACHE_ROOT)"' 140CFLAGS += -DCGIT_CACHE_ROOT='"$(CACHE_ROOT)"'
139 141
140ifdef NO_ICONV 142ifdef NO_ICONV
141 CFLAGS += -DNO_ICONV 143 CFLAGS += -DNO_ICONV
142endif 144endif
143ifdef NO_STRCASESTR 145ifdef NO_STRCASESTR
144 CFLAGS += -DNO_STRCASESTR 146 CFLAGS += -DNO_STRCASESTR
145endif 147endif
146ifdef NO_C99_FORMAT 148ifdef NO_C99_FORMAT
147 CFLAGS += -DNO_C99_FORMAT 149 CFLAGS += -DNO_C99_FORMAT
148endif 150endif
149ifdef NO_OPENSSL 151ifdef NO_OPENSSL
150 CFLAGS += -DNO_OPENSSL 152 CFLAGS += -DNO_OPENSSL
151 GIT_OPTIONS += NO_OPENSSL=1 153 GIT_OPTIONS += NO_OPENSSL=1
152else 154else
153 EXTLIBS += -lcrypto 155 EXTLIBS += -lcrypto
154endif 156endif
155 157
156cgit: $(OBJECTS) libgit 158cgit: $(OBJECTS) libgit
157 $(QUIET_CC)$(CC) $(CFLAGS) $(LDFLAGS) -o cgit $(OBJECTS) $(EXTLIBS) 159 $(QUIET_CC)$(CC) $(CFLAGS) $(LDFLAGS) -o cgit $(OBJECTS) $(EXTLIBS)
158 160
159cgit.o: VERSION 161cgit.o: VERSION
160 162
161ifneq "$(MAKECMDGOALS)" "clean" 163ifneq "$(MAKECMDGOALS)" "clean"
162 -include $(OBJECTS:.o=.d) 164 -include $(OBJECTS:.o=.d)
163endif 165endif
164 166
165libgit: 167libgit:
166 $(QUIET_SUBDIR0)git $(QUIET_SUBDIR1) NO_CURL=1 $(GIT_OPTIONS) libgit.a 168 $(QUIET_SUBDIR0)git $(QUIET_SUBDIR1) NO_CURL=1 $(GIT_OPTIONS) libgit.a
167 $(QUIET_SUBDIR0)git $(QUIET_SUBDIR1) NO_CURL=1 $(GIT_OPTIONS) xdiff/lib.a 169 $(QUIET_SUBDIR0)git $(QUIET_SUBDIR1) NO_CURL=1 $(GIT_OPTIONS) xdiff/lib.a
168 170
169test: all 171test: all
170 $(QUIET_SUBDIR0)tests $(QUIET_SUBDIR1) all 172 $(QUIET_SUBDIR0)tests $(QUIET_SUBDIR1) all
171 173
172install: all 174install: all
173 $(INSTALL) -m 0755 -d $(DESTDIR)$(CGIT_SCRIPT_PATH) 175 $(INSTALL) -m 0755 -d $(DESTDIR)$(CGIT_SCRIPT_PATH)
174 $(INSTALL) -m 0755 cgit $(DESTDIR)$(CGIT_SCRIPT_PATH)/$(CGIT_SCRIPT_NAME) 176 $(INSTALL) -m 0755 cgit $(DESTDIR)$(CGIT_SCRIPT_PATH)/$(CGIT_SCRIPT_NAME)
175 $(INSTALL) -m 0755 -d $(DESTDIR)$(CGIT_DATA_PATH) 177 $(INSTALL) -m 0755 -d $(DESTDIR)$(CGIT_DATA_PATH)
176 $(INSTALL) -m 0644 cgit.css $(DESTDIR)$(CGIT_DATA_PATH)/cgit.css 178 $(INSTALL) -m 0644 cgit.css $(DESTDIR)$(CGIT_DATA_PATH)/cgit.css
177 $(INSTALL) -m 0644 cgit.png $(DESTDIR)$(CGIT_DATA_PATH)/cgit.png 179 $(INSTALL) -m 0644 cgit.png $(DESTDIR)$(CGIT_DATA_PATH)/cgit.png
180 $(INSTALL) -m 0755 -d $(DESTDIR)$(filterdir)
181 $(INSTALL) -m 0755 filters/* $(DESTDIR)$(filterdir)
178 182
179install-doc: install-man install-html install-pdf 183install-doc: install-man install-html install-pdf
180 184
181install-man: doc-man 185install-man: doc-man
182 $(INSTALL) -m 0755 -d $(DESTDIR)$(mandir)/man5 186 $(INSTALL) -m 0755 -d $(DESTDIR)$(mandir)/man5
183 $(INSTALL) -m 0644 $(DOC_MAN5) $(DESTDIR)$(mandir)/man5 187 $(INSTALL) -m 0644 $(DOC_MAN5) $(DESTDIR)$(mandir)/man5
184 188
185install-html: doc-html 189install-html: doc-html
186 $(INSTALL) -m 0755 -d $(DESTDIR)$(htmldir) 190 $(INSTALL) -m 0755 -d $(DESTDIR)$(htmldir)
187 $(INSTALL) -m 0644 $(DOC_HTML) $(DESTDIR)$(htmldir) 191 $(INSTALL) -m 0644 $(DOC_HTML) $(DESTDIR)$(htmldir)
188 192
189install-pdf: doc-pdf 193install-pdf: doc-pdf
190 $(INSTALL) -m 0755 -d $(DESTDIR)$(pdfdir) 194 $(INSTALL) -m 0755 -d $(DESTDIR)$(pdfdir)
191 $(INSTALL) -m 0644 $(DOC_PDF) $(DESTDIR)$(pdfdir) 195 $(INSTALL) -m 0644 $(DOC_PDF) $(DESTDIR)$(pdfdir)
192 196
193uninstall: 197uninstall:
194 rm -f $(CGIT_SCRIPT_PATH)/$(CGIT_SCRIPT_NAME) 198 rm -f $(CGIT_SCRIPT_PATH)/$(CGIT_SCRIPT_NAME)
195 rm -f $(CGIT_DATA_PATH)/cgit.css 199 rm -f $(CGIT_DATA_PATH)/cgit.css
196 rm -f $(CGIT_DATA_PATH)/cgit.png 200 rm -f $(CGIT_DATA_PATH)/cgit.png
197 201
198uninstall-doc: uninstall-man uninstall-html uninstall-pdf 202uninstall-doc: uninstall-man uninstall-html uninstall-pdf
199 203
200uninstall-man: 204uninstall-man:
201 @for i in $(DOC_MAN5); do \ 205 @for i in $(DOC_MAN5); do \
202 rm -fv $(DESTDIR)$(mandir)/man5/$$i; \ 206 rm -fv $(DESTDIR)$(mandir)/man5/$$i; \
203 done 207 done
204 208
205uninstall-html: 209uninstall-html:
206 @for i in $(DOC_HTML); do \ 210 @for i in $(DOC_HTML); do \
207 rm -fv $(DESTDIR)$(htmldir)/$$i; \ 211 rm -fv $(DESTDIR)$(htmldir)/$$i; \
208 done 212 done
209 213
210uninstall-pdf: 214uninstall-pdf:
211 @for i in $(DOC_PDF); do \ 215 @for i in $(DOC_PDF); do \
212 rm -fv $(DESTDIR)$(pdfdir)/$$i; \ 216 rm -fv $(DESTDIR)$(pdfdir)/$$i; \
213 done 217 done
214 218
215doc: doc-man doc-html doc-pdf 219doc: doc-man doc-html doc-pdf
216doc-man: doc-man5 220doc-man: doc-man5
217doc-man5: $(DOC_MAN5) 221doc-man5: $(DOC_MAN5)
218doc-html: $(DOC_HTML) 222doc-html: $(DOC_HTML)
219doc-pdf: $(DOC_PDF) 223doc-pdf: $(DOC_PDF)
220 224
221%.5 : %.5.txt 225%.5 : %.5.txt
222 a2x -f manpage $< 226 a2x -f manpage $<
223 227
224$(DOC_HTML): %.html : %.txt 228$(DOC_HTML): %.html : %.txt
225 a2x -f xhtml --stylesheet=cgit-doc.css $< 229 a2x -f xhtml --stylesheet=cgit-doc.css $<
226 230
227$(DOC_PDF): %.pdf : %.txt 231$(DOC_PDF): %.pdf : %.txt
228 a2x -f pdf cgitrc.5.txt 232 a2x -f pdf cgitrc.5.txt
229 233
230clean: clean-doc 234clean: clean-doc
231 rm -f cgit VERSION *.o *.d 235 rm -f cgit VERSION *.o *.d
232 236
233clean-doc: 237clean-doc:
234 rm -f cgitrc.5 cgitrc.5.html cgitrc.5.pdf cgitrc.5.xml cgitrc.5.fo 238 rm -f cgitrc.5 cgitrc.5.html cgitrc.5.pdf cgitrc.5.xml cgitrc.5.fo
235 239
236get-git: 240get-git:
237 curl $(GIT_URL) | tar -xj && rm -rf git && mv git-$(GIT_VER) git 241 curl $(GIT_URL) | tar -xj && rm -rf git && mv git-$(GIT_VER) git