1 ######################################################################
2 # Copyright (c) 2013-2014 IndexData ApS. http://indexdata.com
5 ##############################
6 # select a jquery version
8 #JQUERY_URL= http://code.jquery.com/jquery-2.0.3.min.js
9 JQUERY_URL= http://code.jquery.com/jquery-1.10.0.min.js
10 #JQUERY_URL= http://code.jquery.com/jquery-1.9.1.min.js
11 #JQUERY_URL= http://code.jquery.com/jquery-1.8.3.min.js
12 #JQUERY_URL= http://code.jquery.com/jquery-1.7.2.min.js
13 #JQUERY_URL= http://code.jquery.com/jquery-1.6.4.min.js
14 #JQUERY_URL= http://code.jquery.com/jquery-1.4.4.min.js
16 JQUERY_UI_URL= http://code.jquery.com/ui/1.10.3/jquery-ui.js
17 #JQUERY_UI_URL= http://code.jquery.com/ui/1.8.0/jquery-ui.min.js
18 JQUERY_JSON_URL= https://jquery-json.googlecode.com/files/jquery.json-2.4.js
19 HANDLEBARS_URL= http://builds.handlebarsjs.com.s3.amazonaws.com/handlebars-v1.1.2.js -o $@
20 PP2_URL= http://git.indexdata.com/?p=pazpar2.git;a=blob_plain;f=js/pz2.js;hb=HEAD
21 VERSION = $(shell tr -d '\012' < VERSION)
23 MKWS_JS= mkws-complete.js
25 JQUERY_FILE := $(shell basename ${JQUERY_URL})
26 JQUERY_JSON_FILE := $(shell basename ${JQUERY_JSON_URL})
27 HANDLEBARS_FILE := $(shell basename ${HANDLEBARS_URL})
29 ##############################
31 DOCS = README.html README.odt README.pdf \
32 whitepaper.html whitepaper.odt whitepaper.pdf
34 # Default rule when "make" is invoked without a target
35 **default**: ${MKWS_JS} mkws-js-min README.html whitepaper.html
37 all: ${MKWS_JS} mkws-js-min $(DOCS)
41 mkws-js ${MKWS_JS}: Makefile mkws.js ${JQUERY_FILE} ${JQUERY_JSON_FILE} ${HANDLEBARS_FILE} ${PP2_FILE}
43 echo "/*! Copyright (c) 2013-2014 IndexData ApS. http://indexdata.com"; \
44 echo " Licence: GPL, http://www.indexdata.com/licences/gpl"; \
45 echo " created at: $$(date)"; \
46 echo " mkws.js GIT id: $$(git log mkws.js | head -n 1 | perl -npe 's,\S+\s+,,')"; \
47 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>,')"; \
50 cat ${JQUERY_JSON_FILE}; \
51 cat ${HANDLEBARS_FILE}; \
55 mv -f ${MKWS_JS}.new ${MKWS_JS}
57 mkws-js-min: mkws.min.js mkws-complete.min.js
60 yui-compressor $? > $@.new
64 yui-compressor mkws.js >/dev/null
66 mkws-complete-syntax-check: mkws-js-min
69 curl -sSf ${JQUERY_URL} -o $@.new
70 perl -npe 's,sourceMappingURL=jquery.*map,,' $@.new > $@
74 curl -sSf ${JQUERY_JSON_URL} -o $@
77 curl -sSf ${HANDLEBARS_URL} -o $@
80 curl -sSf "${PP2_URL}" -o $@.tmp
83 release: mkws.js mkws-complete.js mkws.min.js mkws-complete.min.js
84 @if [ -f releases/mkws-$(VERSION).js ]; then \
85 echo "*** There is already a release $(VERSION)"; \
87 cp -p mkws.js releases/mkws-$(VERSION).js; \
88 cp -p mkws.min.js releases/mkws-$(VERSION).min.js; \
89 cp -p mkws-complete.js releases/mkws-complete-$(VERSION).js; \
90 cp -p mkws-complete.min.js releases/mkws-complete-$(VERSION).min.js; \
91 echo "Made release $(VERSION)"; \
94 # For a description of pandoc's markdown format, see:
95 # http://johnmacfarlane.net/pandoc/demo/example9/pandocs-markdown.html -->
97 # for older pandoc (<1.9) run first:
98 # perl -i.bak -npe 's/"(Authors|Subjects)": "(.*?)"/"$1": "test"/' tools/htdocs/whitepaper.markdown
102 pandoc --standalone --toc -c mkws-doc.css $< | sed '/^<col width="[0-9]*%" \/>$//d' > $@
107 pandoc --standalone $< -o $@
110 # ### In order to compile the whitepaper, which has tables, to PDF,
111 # you will need to install the Debian package
112 # texlive-latex-recommended
115 pandoc --standalone $< -o $@
118 ##############################
122 rm -f *.orig *.bak *.rej
125 rm -f ${JQUERY_FILE} ${JQUERY_JSON_FILE} ${HANDLEBARS_FILE} ${PP2_FILE}
126 rm -f mkws.min.js ${MKWS_JS} mkws-complete.min.js
130 @echo "make [ help | docs | clean ]"
131 @echo " [ mkws-js | mkws-js-min ]"
132 @echo " [ mkws-syntax-check | mkws-complete-syntax-check ]"
134 @echo "make JQUERY_URL=http://code.jquery.com/jquery-2.0.3.min.js clean mkws-js"
136 @echo "Please check ./README file too!"