X-Git-Url: http://sru.miketaylor.org.uk/?a=blobdiff_plain;ds=sidebyside;f=src%2FMakefile;h=cf60ea6fe41abdf06688a1ac54af6d10e9c38dab;hb=d761fb51adbacecb400a290635f2f72b46d6c0ca;hp=6b53072ec44a99443f202a6ffd509d1e289e9bda;hpb=188ad50d28801f40cc33967a779632b8215c3ca6;p=mkws-moved-to-github.git
diff --git a/src/Makefile b/src/Makefile
index 6b53072..cf60ea6 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -1,20 +1,22 @@
-# Copyright (c) 2013-2014 Index Data ApS. http://indexdata.com
+# Copyright (c) 2013-2015 Index Data ApS. http://indexdata.com
DEST = ../tools/htdocs
HANDLEBARS_FILE = handlebars-v2.0.0.js
JQUERY_FILE = jquery-1.10.0.min.js
JQUERY_JSON_FILE = jquery.json-2.4.js
+JSNLOG_FILE = jsnlog.min.js
PP2_FILE = pz2.js
HANDLEBARS_URL = http://builds.handlebarsjs.com.s3.amazonaws.com/${HANDLEBARS_FILE}
JQUERY_URL = http://code.jquery.com/${JQUERY_FILE}
JQUERY_JSON_URL = https://jquery-json.googlecode.com/files/${JQUERY_JSON_FILE}
+JSNLOG_URL = https://raw.githubusercontent.com/mperdeck/jsnlog.js/2.7.5/${JSNLOG_FILE}
PP2_URL = http://git.indexdata.com/?p=pazpar2.git;a=blob_plain;f=js/${PP2_FILE};hb=HEAD
VERSION = $(shell tr -d '\012' < VERSION)
HANDLEBARS = ../test/node_modules/.bin/handlebars
-YUI_COMPRESSOR = $(shell which yui-compressor ../test/bin/yui-compressor | head -1)
+UGLIFYJS = ../test/node_modules/.bin/uglifyjs
COMPONENTS = mkws-handlebars.js \
mkws-core.js \
@@ -27,12 +29,13 @@ COMPONENTS = mkws-handlebars.js \
mkws-widget-categories.js \
mkws-widget-log.js \
mkws-widget-record.js \
- mkws-widget-reference.js \
+ mkws-widget-wikipedia.js \
+ mkws-widget-ru.js \
mkws-widget-builder.js \
mkws-templates.js \
mkws-popup.js
-DOWNLOADABLE = ${HANDLEBARS_FILE} ${JQUERY_FILE} ${JQUERY_JSON_FILE} ${PP2_FILE}
+DOWNLOADABLE = ${HANDLEBARS_FILE} ${JQUERY_FILE} ${JQUERY_JSON_FILE} ${JSNLOG_FILE} ${PP2_FILE}
RELEASABLE = mkws.js mkws.min.js mkws-complete.js mkws-complete.min.js
AVAILABLE = $(DOWNLOADABLE) $(RELEASABLE) NEWS VERSION
INSTALLED_DOWNLOADABLE = $(DOWNLOADABLE:%=$(DEST)/%)
@@ -43,7 +46,7 @@ all: $(INSTALLED)
$(DEST)/mkws-complete.js: Makefile $(INSTALLED_DOWNLOADABLE) $(DEST)/mkws.js
( set -e; \
- echo "/*! Copyright (c) 2013-2014 Index Data ApS. http://indexdata.com"; \
+ echo "/*! Copyright (c) 2013-$$(date '+%Y') Index Data ApS. http://indexdata.com"; \
echo " Licence: LGPL, http://www.indexdata.com/licences/lgpl"; \
echo " created at: $$(date)"; \
echo " MKWS GIT id: $$(git show | head -n 1 | perl -npe 's,\S+\s+,,')"; \
@@ -51,6 +54,7 @@ $(DEST)/mkws-complete.js: Makefile $(INSTALLED_DOWNLOADABLE) $(DEST)/mkws.js
echo "*/"; \
cat $(DEST)/${JQUERY_FILE}; \
cat $(DEST)/${JQUERY_JSON_FILE}; \
+ cat $(DEST)/${JSNLOG_FILE}; \
echo 'mkws_jQuery = jQuery.noConflict(true);'; \
cat $(DEST)/${HANDLEBARS_FILE}; \
cat $(DEST)/${PP2_FILE}; \
@@ -59,7 +63,7 @@ $(DEST)/mkws-complete.js: Makefile $(INSTALLED_DOWNLOADABLE) $(DEST)/mkws.js
mv -f $@.tmp $@
%.min.js: %.js
- ${YUI_COMPRESSOR} $? > $@.tmp
+ ${UGLIFYJS} $? > $@.tmp
mv -f $@.tmp $@
$(DEST)/${HANDLEBARS_FILE}:
@@ -68,13 +72,17 @@ $(DEST)/${HANDLEBARS_FILE}:
$(DEST)/${JQUERY_FILE}:
curl -sSf ${JQUERY_URL} -o $@.tmp
- perl -npe 's,sourceMappingURL=jquery.*map,,' $@.tmp > $@
+ perl -npe 's,sourceMappingURL=jquery.*map,,' $@.tmp | sed 's@@@' > $@
rm -f $@.tmp
$(DEST)/${JQUERY_JSON_FILE}:
curl -sSf ${JQUERY_JSON_URL} -o $@.tmp
mv -f $@.tmp $@
+$(DEST)/${JSNLOG_FILE}:
+ curl -sSf ${JSNLOG_URL} -o $@.tmp
+ mv -f $@.tmp $@
+
$(DEST)/${PP2_FILE}:
curl -sSf "${PP2_URL}" -o $@.tmp
mv -f $@.tmp $@
@@ -90,9 +98,6 @@ $(DEST)/VERSION: VERSION
chmod 444 $@
release: $(INSTALLED_RELEASABLE)
- @if ! which yui-compressor >/dev/null; then \
- echo "*** please install the yui-compressor program"; exit 1; \
- fi
if [ -f ${DEST}/releases/mkws-$(VERSION).js ]; then \
echo "*** There is already a release $(VERSION)"; \
else \
@@ -115,7 +120,7 @@ mkws-templates.js: templates/*.handlebars
# Checks that the JavaScript can be parsed
syntax-check: $(DEST)/mkws.js
- ${YUI_COMPRESSOR} $(DEST)/mkws.js >/dev/null
+ ${UGLIFYJS} $(DEST)/mkws.js >/dev/null
# Emits a list of