aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2010-04-10 13:02:22 -0700
committerJunio C Hamano <gitster@pobox.com>2010-04-10 13:02:22 -0700
commitb92cbb62def240268c1af39f1a688fec8d34ac9b (patch)
tree40076d09750cf1cf357d21794f152f3e519da32e /Makefile
parent055e1e29696c0fb06582c1592ee6b58643dcc514 (diff)
parente3918594f6269b37ad7bd7e419df433b6d586428 (diff)
downloadgit-b92cbb62def240268c1af39f1a688fec8d34ac9b.tar.gz
git-b92cbb62def240268c1af39f1a688fec8d34ac9b.tar.xz
Merge branch 'mr/gitweb-jsmin'
* mr/gitweb-jsmin: gitweb: update INSTALL to use shorter make target gitweb: add documentation to INSTALL regarding gitweb.js instaweb: add minification awareness Gitweb: add autoconfigure support for minifiers Gitweb: add support for minifying gitweb.css Gitweb: add ignore and clean rules for minified files
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile33
1 files changed, 23 insertions, 10 deletions
diff --git a/Makefile b/Makefile
index 956e78162..910f4713e 100644
--- a/Makefile
+++ b/Makefile
@@ -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,9 +282,6 @@ lib = lib
# DESTDIR=
pathsep = :
-# JavaScript minifier invocation that can function as filter
-JSMIN =
-
export prefix bindir sharedir sysconfdir
CC = gcc
@@ -1561,18 +1561,29 @@ 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
+GITWEB_PROGRAMS += gitweb/gitweb.min.js
+GITWEB_JS = gitweb/gitweb.min.js
else
-OTHER_PROGRAMS += gitweb/gitweb.cgi
-gitweb/gitweb.cgi: gitweb/gitweb.perl
+GITWEB_JS = gitweb/gitweb.js
endif
+ifdef CSSMIN
+GITWEB_PROGRAMS += gitweb/gitweb.min.css
+GITWEB_CSS = gitweb/gitweb.min.css
+else
+GITWEB_CSS = gitweb/gitweb.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
@@ -1582,11 +1593,13 @@ git-instaweb: git-instaweb.sh gitweb/gitweb.cgi gitweb/gitweb.css gitweb/gitweb.
-e 's/@@NO_CURL@@/$(NO_CURL)/g' \
-e '/@@GITWEB_CGI@@/r gitweb/gitweb.cgi' \
-e '/@@GITWEB_CGI@@/d' \
- -e '/@@GITWEB_CSS@@/r gitweb/gitweb.css' \
+ -e '/@@GITWEB_CSS@@/r $(GITWEB_CSS)' \
-e '/@@GITWEB_CSS@@/d' \
- -e '/@@GITWEB_JS@@/r gitweb/gitweb.js' \
+ -e '/@@GITWEB_JS@@/r $(GITWEB_JS)' \
-e '/@@GITWEB_JS@@/d' \
-e 's|@@PERL@@|$(PERL_PATH_SQ)|g' \
+ -e 's|@@GITWEB_CSS_NAME@@|$(GITWEB_CSS)|' \
+ -e 's|@@GITWEB_JS_NAME@@|$(GITWEB_JS)|' \
$@.sh > $@+ && \
chmod +x $@+ && \
mv $@+ $@
@@ -2085,7 +2098,7 @@ clean:
$(RM) $(htmldocs).tar.gz $(manpages).tar.gz
$(MAKE) -C Documentation/ clean
ifndef NO_PERL
- $(RM) gitweb/gitweb.cgi
+ $(RM) gitweb/gitweb.cgi gitweb/gitweb.min.*
$(MAKE) -C perl clean
endif
ifndef NO_PYTHON