diff options
author | Mark Rada <marada@uwaterloo.ca> | 2010-04-02 20:35:05 -0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-04-02 21:23:35 -0700 |
commit | 0e6ce21361c5d8e35cd15327539eec1f627aa0e3 (patch) | |
tree | d79ad77f86de6c7dc920b1edf7fede40ccedf828 /Makefile | |
parent | 8830bf4bc5b2d03027eff8a4dc6a0cb823ec3c3b (diff) | |
download | git-0e6ce21361c5d8e35cd15327539eec1f627aa0e3.tar.gz git-0e6ce21361c5d8e35cd15327539eec1f627aa0e3.tar.xz |
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 'Makefile')
-rw-r--r-- | Makefile | 21 |
1 files changed, 15 insertions, 6 deletions
@@ -203,6 +203,9 @@ 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 +# # Define DEFAULT_PAGER to a sensible pager command (defaults to "less") if # you want to use something different. The value will be interpreted by the # shell at runtime when it is used. @@ -279,8 +282,9 @@ lib = lib # DESTDIR= pathsep = : -# JavaScript minifier invocation that can function as filter +# JavaScript/CSS minifier invocation that can function as filter JSMIN = +CSSMIN = export prefix bindir sharedir sysconfdir @@ -1560,18 +1564,23 @@ gitweb: $(QUIET_SUBDIR0)gitweb $(QUIET_SUBDIR1) all ifdef JSMIN -OTHER_PROGRAMS += gitweb/gitweb.cgi gitweb/gitweb.min.js -gitweb/gitweb.cgi: gitweb/gitweb.perl gitweb/gitweb.min.js -else -OTHER_PROGRAMS += gitweb/gitweb.cgi -gitweb/gitweb.cgi: gitweb/gitweb.perl +GITWEB_PROGRAMS += gitweb/gitweb.min.js endif +ifdef CSSMIN +GITWEB_PROGRAMS += gitweb/gitweb.min.css +endif +OTHER_PROGRAMS += gitweb/gitweb.cgi $(GITWEB_PROGRAMS) +gitweb/gitweb.cgi: gitweb/gitweb.perl $(GITWEB_PROGRAMS) $(QUIET_SUBDIR0)gitweb $(QUIET_SUBDIR1) $(patsubst gitweb/%,%,$@) ifdef JSMIN gitweb/gitweb.min.js: gitweb/gitweb.js $(QUIET_SUBDIR0)gitweb $(QUIET_SUBDIR1) $(patsubst gitweb/%,%,$@) endif # JSMIN +ifdef CSSMIN +gitweb/gitweb.min.css: gitweb/gitweb.css + $(QUIET_SUBDIR0)gitweb $(QUIET_SUBDIR1) $(patsubst gitweb/%,%,$@) +endif # CSSMIN git-instaweb: git-instaweb.sh gitweb/gitweb.cgi gitweb/gitweb.css gitweb/gitweb.js |