Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
gitweb: Minify gitweb.js if JSMIN is defined
author
Jakub Narebski
<jnareb@gmail.com>
Tue, 1 Sep 2009 11:39:20 +0000
(13:39 +0200)
committer
Junio C Hamano
<gitster@pobox.com>
Tue, 1 Sep 2009 15:34:25 +0000
(08:34 -0700)
It requires that $JSMIN command can function as a filter.
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Makefile
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
c4ccf61
)
diff --git
a/Makefile
b/Makefile
index 2ad3b1e40c007c17002fe2c17baa9b9ffa68d2f5..9b7dc036b6d6e3d3760e0c900a2aad600093d9d6 100644
(file)
--- a/
Makefile
+++ b/
Makefile
@@
-198,6
+198,9
@@
all::
# memory allocators with the nedmalloc allocator written by Niall Douglas.
#
# Define NO_REGEX if you have no or inferior regex support in your C library.
# memory allocators with the nedmalloc allocator written by Niall Douglas.
#
# Define NO_REGEX if you have no or inferior regex support in your C library.
+#
+# Define JSMIN to point to JavaScript minifier that functions as
+# a filter to have gitweb.js minified.
GIT-VERSION-FILE: .FORCE-GIT-VERSION-FILE
@$(SHELL_PATH) ./GIT-VERSION-GEN
GIT-VERSION-FILE: .FORCE-GIT-VERSION-FILE
@$(SHELL_PATH) ./GIT-VERSION-GEN
@@
-250,6
+253,9
@@
lib = lib
# DESTDIR=
pathsep = :
# DESTDIR=
pathsep = :
+# JavaScript minifier invocation that can function as filter
+JSMIN =
+
# default configuration for gitweb
GITWEB_CONFIG = gitweb_config.perl
GITWEB_CONFIG_SYSTEM = /etc/gitweb.conf
# default configuration for gitweb
GITWEB_CONFIG = gitweb_config.perl
GITWEB_CONFIG_SYSTEM = /etc/gitweb.conf
@@
-265,7
+271,11
@@
GITWEB_HOMETEXT = indextext.html
GITWEB_CSS = gitweb.css
GITWEB_LOGO = git-logo.png
GITWEB_FAVICON = git-favicon.png
GITWEB_CSS = gitweb.css
GITWEB_LOGO = git-logo.png
GITWEB_FAVICON = git-favicon.png
+ifdef JSMIN
+GITWEB_JS = gitweb.min.js
+else
GITWEB_JS = gitweb.js
GITWEB_JS = gitweb.js
+endif
GITWEB_SITE_HEADER =
GITWEB_SITE_FOOTER =
GITWEB_SITE_HEADER =
GITWEB_SITE_FOOTER =
@@
-1388,8
+1398,13
@@
$(patsubst %.perl,%,$(SCRIPT_PERL)): % : %.perl
chmod +x $@+ && \
mv $@+ $@
chmod +x $@+ && \
mv $@+ $@
+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
OTHER_PROGRAMS += gitweb/gitweb.cgi
gitweb/gitweb.cgi: gitweb/gitweb.perl
+endif
$(QUIET_GEN)$(RM) $@ $@+ && \
sed -e '1s|#!.*perl|#!$(PERL_PATH_SQ)|' \
-e 's|++GIT_VERSION++|$(GIT_VERSION)|g' \
$(QUIET_GEN)$(RM) $@ $@+ && \
sed -e '1s|#!.*perl|#!$(PERL_PATH_SQ)|' \
-e 's|++GIT_VERSION++|$(GIT_VERSION)|g' \
@@
-1440,6
+1455,11
@@
$(patsubst %.perl,%,$(SCRIPT_PERL)) git-instaweb: % : unimplemented.sh
mv $@+ $@
endif # NO_PERL
mv $@+ $@
endif # NO_PERL
+ifdef JSMIN
+gitweb/gitweb.min.js: gitweb/gitweb.js
+ $(QUIET_GEN)$(JSMIN) <$< >$@
+endif # JSMIN
+
configure: configure.ac
$(QUIET_GEN)$(RM) $@ $<+ && \
sed -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \
configure: configure.ac
$(QUIET_GEN)$(RM) $@ $<+ && \
sed -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \