Reinstate specific rules to copy VERSION and NEWS into $(DEST).
[mkws-moved-to-github.git] / src / Makefile
index 9995682..166db58 100644 (file)
@@ -14,7 +14,7 @@ PP2_URL = http://git.indexdata.com/?p=pazpar2.git;a=blob_plain;f=js/${PP2_FILE};
 
 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 \
@@ -22,7 +22,7 @@ COMPONENTS = mkws-handlebars.js \
        mkws-filter.js \
        mkws-widget.js \
        mkws-widget-main.js \
-       mkws-widget-termlists.js \
+       mkws-widget-facets.js \
        mkws-widget-authname.js \
        mkws-widget-categories.js \
        mkws-widget-log.js \
@@ -34,7 +34,7 @@ COMPONENTS = mkws-handlebars.js \
 
 DOWNLOADABLE = ${HANDLEBARS_FILE} ${JQUERY_FILE} ${JQUERY_JSON_FILE} ${PP2_FILE}
 RELEASABLE = mkws.js mkws.min.js mkws-complete.js mkws-complete.min.js
-AVAILABLE = $(DOWNLOADABLE) $(RELEASABLE) mkws-jquery.js
+AVAILABLE = $(DOWNLOADABLE) $(RELEASABLE) NEWS VERSION
 INSTALLED_DOWNLOADABLE = $(DOWNLOADABLE:%=$(DEST)/%)
 INSTALLED_RELEASABLE = $(RELEASABLE:%=$(DEST)/%)
 INSTALLED = $(AVAILABLE:%=$(DEST)/%)
@@ -44,7 +44,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 "   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>,')"; \
@@ -79,7 +79,12 @@ $(DEST)/${PP2_FILE}:
        curl -sSf "${PP2_URL}" -o $@.tmp
        mv -f $@.tmp $@
 
-$(DEST)/%: %
+$(DEST)/NEWS: NEWS
+       rm -f $@
+       cp $? $@
+       chmod 444 $@
+
+$(DEST)/VERSION: VERSION
        rm -f $@
        cp $? $@
        chmod 444 $@
@@ -100,8 +105,8 @@ $(DEST)/mkws.js: $(COMPONENTS) Makefile
        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
@@ -114,5 +119,10 @@ html-includes:
          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 ""