Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Rada <marada@uwaterloo.ca>2010-04-03 04:35:05 +0400
committerJunio C Hamano <gitster@pobox.com>2010-04-03 08:23:35 +0400
commit0e6ce21361c5d8e35cd15327539eec1f627aa0e3 (patch)
treed79ad77f86de6c7dc920b1edf7fede40ccedf828 /gitweb/Makefile
parent8830bf4bc5b2d03027eff8a4dc6a0cb823ec3c3b (diff)
Gitweb: add support for minifying gitweb.css
The build system added support minifying gitweb.js through a JavaScript minifier, but most minifiers come with support for minifying CSS files as well, so we should use it if we can. This patch will add the same facilities to gitweb.css that gitweb.js has for minification. That does not mean that they will use the same minifier though, as it is not safe to assume that all JavaScript minifiers will also minify CSS files. This patch also adds the GITWEB_PROGRAMS variable to the Makefile to keep a list of potential gitweb dependencies separate from OTHER_PROGRAMS when we need to know just the gitweb dependencies. Though the bandwidth savings will not be as dramatic as with the JavaScript minifier, every byte saved is important. Signed-off-by: Mark Rada <marada@uwaterloo.ca> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'gitweb/Makefile')
-rw-r--r--gitweb/Makefile28
1 files changed, 21 insertions, 7 deletions
diff --git a/gitweb/Makefile b/gitweb/Makefile
index c9eb1ee667..fffe700760 100644
--- a/gitweb/Makefile
+++ b/gitweb/Makefile
@@ -6,13 +6,17 @@ all::
# Define JSMIN to point to JavaScript minifier that functions as
# a filter to have gitweb.js minified.
#
+# Define CSSMIN to point to a CSS minifier in order to generate a minified
+# version of gitweb.css
+#
prefix ?= $(HOME)
bindir ?= $(prefix)/bin
RM ?= rm -f
-# JavaScript minifier invocation that can function as filter
+# JavaScript/CSS minifier invocation that can function as filter
JSMIN ?=
+CSSMIN ?=
# default configuration for gitweb
GITWEB_CONFIG = gitweb_config.perl
@@ -26,7 +30,11 @@ GITWEB_STRICT_EXPORT =
GITWEB_BASE_URL =
GITWEB_LIST =
GITWEB_HOMETEXT = indextext.html
+ifdef CSSMIN
+GITWEB_CSS = gitweb.min.css
+else
GITWEB_CSS = gitweb.css
+endif
GITWEB_LOGO = git-logo.png
GITWEB_FAVICON = git-favicon.png
ifdef JSMIN
@@ -84,13 +92,14 @@ endif
all:: gitweb.cgi
+FILES = gitweb.cgi
ifdef JSMIN
-FILES=gitweb.cgi gitweb.min.js
-gitweb.cgi: gitweb.perl gitweb.min.js
-else # !JSMIN
-FILES=gitweb.cgi
-gitweb.cgi: gitweb.perl
-endif # JSMIN
+FILES += gitweb.min.js
+endif
+ifdef CSSMIN
+FILES += gitweb.min.css
+endif
+gitweb.cgi: gitweb.perl $(GITWEB_JS) $(GITWEB_CSS)
gitweb.cgi:
$(QUIET_GEN)$(RM) $@ $@+ && \
@@ -123,6 +132,11 @@ gitweb.min.js: gitweb.js
$(QUIET_GEN)$(JSMIN) <$< >$@
endif # JSMIN
+ifdef CSSMIN
+gitweb.min.css: gitweb.css
+ $(QUIET_GEN)$(CSSMIN) <$ >$@
+endif
+
clean:
$(RM) $(FILES)