VERSION = $(shell tr -d '\012' < VERSION)
HANDLEBARS = ../test/node_modules/.bin/handlebars
-YUI_COMPRESSOR = $(shell which yui-compressor ../../test/bin/yui-compressor | head -1)
+YUI_COMPRESSOR = $(shell which yui-compressor ../test/bin/yui-compressor | head -1)
COMPONENTS = mkws-handlebars.js \
mkws-core.js \
DOWNLOADABLE = ${HANDLEBARS_FILE} ${JQUERY_FILE} ${JQUERY_JSON_FILE} ${PP2_FILE}
RELEASABLE = mkws.js mkws.min.js mkws-complete.js mkws-complete.min.js
-GENERATED = $(DOWNLOADABLE) $(RELEASABLE)
+AVAILABLE = $(DOWNLOADABLE) $(RELEASABLE) NEWS VERSION
INSTALLED_DOWNLOADABLE = $(DOWNLOADABLE:%=$(DEST)/%)
INSTALLED_RELEASABLE = $(RELEASABLE:%=$(DEST)/%)
-INSTALLED = $(GENERATED:%=$(DEST)/%)
+INSTALLED = $(AVAILABLE:%=$(DEST)/%)
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 " Licence: GPL, http://www.indexdata.com/licences/gpl"; \
+ 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+,,')"; \
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>,')"; \
curl -sSf "${PP2_URL}" -o $@.tmp
mv -f $@.tmp $@
+$(DEST)/%: %
+ rm -f $@
+ cp $? $@
+ chmod 444 $@
+
release: $(RELEASABLE)
@if [ -f ${DEST}/releases/mkws-$(VERSION).js ]; then \
echo "*** There is already a release $(VERSION)"; \
mv -f $@.tmp $@
chmod 444 $@
-mkws-templates.js: *.templates/*.handlebars
- ${HANDLEBARS} -n mkws.defaultTemplates *.templates/*.handlebars -f $@.tmp
+mkws-templates.js: templates/*.handlebars
+ ${HANDLEBARS} -n mkws.defaultTemplates templates/*.handlebars -f $@.tmp
mv -f $@.tmp $@
# Checks that the JavaScript can be parsed
perl -n0e 'chomp(); print qq{ <script type="text/javascript" src="src/$$_"></script>\n}'
clean distclean:
- rm -f ${INSTALLED}
+ rm -f ${INSTALLED} mkws-templates.js
+help:
+ @echo "make [ all | clean | release ]"
+ @echo " [ syntax-check | html-includes ]"
+ @echo " [ mkws-templates.js | $(DEST)/mkws-complete.min.js ]"
+ @echo ""