1 HANDLEBARS_FILE = handlebars-v1.1.2.js
2 JQUERY_FILE = jquery-1.10.0.min.js
3 JQUERY_JSON_FILE = jquery.json-2.4.js
6 HANDLEBARS_URL = http://builds.handlebarsjs.com.s3.amazonaws.com/${HANDLEBARS_FILE}
7 JQUERY_URL = http://code.jquery.com/${JQUERY_FILE}
8 JQUERY_JSON_URL = https://jquery-json.googlecode.com/files/${JQUERY_JSON_FILE}
9 PP2_URL = http://git.indexdata.com/?p=pazpar2.git;a=blob_plain;f=js/${PP2_FILE};hb=HEAD
11 JQUERY_UI_URL = http://code.jquery.com/ui/1.10.3/jquery-ui.js
12 VERSION = $(shell tr -d '\012' < VERSION)
14 COMPONENTS = mkws-handlebars.js \
15 mkws-core.js mkws-team.js mkws-filter.js \
16 mkws-widgets.js mkws-widget-termlists.js \
17 mkws-widget-authname.js mkws-widget-categories.js mkws-widget-log.js \
18 mkws-widget-record.js mkws-widget-builder.js
20 GENERATED = ${HANDLEBARS_FILE} ${JQUERY_FILE} ${JQUERY_JSON_FILE} ${PP2_FILE} \
21 mkws.js mkws.min.js mkws-complete.js mkws-complete.min.js
23 INSTALLABLE = mkws-jquery.js VERSION NEWS $(GENERATED)
25 INSTALLED = $(INSTALLABLE:%=../tools/htdocs/%)
27 **make-default**: ../tools/htdocs/mkws.js
35 rm -f $@ && cp -p $? $@ && chmod 444 $@
37 all: mkws.min.js mkws-complete.min.js
39 mkws-js mkws-complete.js: Makefile mkws.js mkws-jquery.js ${HANDLEBARS_FILE} ${JQUERY_FILE} ${JQUERY_JSON_FILE} ${PP2_FILE}
41 echo "/*! Copyright (c) 2013-2014 IndexData ApS. http://indexdata.com"; \
42 echo " Licence: GPL, http://www.indexdata.com/licences/gpl"; \
43 echo " created at: $$(date)"; \
44 echo " mkws.js GIT id: $$(git log mkws.js | head -n 1 | perl -npe 's,\S+\s+,,')"; \
45 echo " pz2.js GIT id: $$(curl -sSf 'http://git.indexdata.com/?p=pazpar2.git;a=rss' | egrep '<guid' | head -1 | perl -ne 'print "$$1\n" if m,.*=([0-9a-f]+)</guid>,')"; \
48 cat ${JQUERY_JSON_FILE}; \
49 cat ${HANDLEBARS_FILE}; \
53 ) > mkws-complete.js.new
54 mv -f mkws-complete.js.new mkws-complete.js
57 yui-compressor $? > $@.new
61 yui-compressor mkws.js >/dev/null
64 curl -sSf ${HANDLEBARS_URL} -o $@.tmp
68 curl -sSf ${JQUERY_URL} -o $@.new
69 perl -npe 's,sourceMappingURL=jquery.*map,,' $@.new > $@
73 curl -sSf ${JQUERY_JSON_URL} -o $@.tmp
77 curl -sSf "${PP2_URL}" -o $@.tmp
80 release: mkws.js mkws-complete.js mkws.min.js mkws-complete.min.js
81 @if [ -f releases/mkws-$(VERSION).js ]; then \
82 echo "*** There is already a release $(VERSION)"; \
84 cp -p mkws.js releases/mkws-$(VERSION).js; \
85 cp -p mkws.min.js releases/mkws-$(VERSION).min.js; \
86 cp -p mkws-complete.js releases/mkws-complete-$(VERSION).js; \
87 cp -p mkws-complete.min.js releases/mkws-complete-$(VERSION).min.js; \
88 echo "Made release $(VERSION)"; \
91 mkws.js: $(COMPONENTS) Makefile
93 cat $(COMPONENTS) > $@
97 rm -f *.orig *.bak *.rej