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
14 JQUERY_UI_URL= http://code.jquery.com/ui/1.10.3/jquery-ui.js
15 #JQUERY_UI_URL= http://code.jquery.com/ui/1.8.0/jquery-ui.min.js
16 JQUERY_JSON_URL= https://jquery-json.googlecode.com/files/jquery.json-2.4.js
17 HANDLEBARS_URL= http://builds.handlebarsjs.com.s3.amazonaws.com/handlebars-v1.1.2.js -o $@
18 PP2_URL= http://git.indexdata.com/?p=pazpar2.git;a=blob_plain;f=js/pz2.js;hb=HEAD
19 VERSION = $(shell tr -d '\012' < VERSION)
21 MKWS_JS= mkws-complete.js
23 JQUERY_FILE := $(shell basename ${JQUERY_URL})
24 JQUERY_JSON_FILE := $(shell basename ${JQUERY_JSON_URL})
25 HANDLEBARS_FILE := $(shell basename ${HANDLEBARS_URL})
27 ##############################
29 DOCS = README.html README.odt README.pdf \
30 whitepaper.html whitepaper.odt whitepaper.pdf
32 # Default rule when "make" is invoked without a target
33 **default**: ${MKWS_JS} mkws-js-min README.html whitepaper.html
35 all: ${MKWS_JS} mkws-js-min $(DOCS)
39 mkws-js ${MKWS_JS}: Makefile mkws.js ${JQUERY_FILE} ${JQUERY_JSON_FILE} ${HANDLEBARS_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 mv -f ${MKWS_JS}.new ${MKWS_JS}
55 mkws-js-min: mkws.min.js mkws-complete.min.js
58 yui-compressor $? > $@.new
62 yui-compressor mkws.js >/dev/null
64 mkws-complete-syntax-check: mkws-js-min
67 curl -sSf ${JQUERY_URL} -o $@.new
68 perl -npe 's,sourceMappingURL=jquery.*map,,' $@.new > $@
72 curl -sSf ${JQUERY_JSON_URL} -o $@
75 curl -sSf ${HANDLEBARS_URL} -o $@
78 curl -sSf "${PP2_URL}" -o $@.tmp
81 release: mkws.js mkws-complete.js mkws.min.js mkws-complete.min.js
82 @if [ -f releases/mkws-$(VERSION).js ]; then \
83 echo "*** There is already a release $(VERSION)"; \
85 cp -p mkws.js releases/mkws-$(VERSION).js; \
86 cp -p mkws.min.js releases/mkws-$(VERSION).min.js; \
87 cp -p mkws-complete.js releases/mkws-complete-$(VERSION).js; \
88 cp -p mkws-complete.min.js releases/mkws-complete-$(VERSION).min.js; \
89 echo "Made release $(VERSION)"; \
92 # For a description of pandoc's markdown format, see:
93 # http://johnmacfarlane.net/pandoc/demo/example9/pandocs-markdown.html -->
95 # for older pandoc (<1.9) run first:
96 # perl -i.bak -npe 's/"(Authors|Subjects)": "(.*?)"/"$1": "test"/' tools/htdocs/whitepaper.markdown
100 pandoc --standalone --toc -c mkws-doc.css $< | sed '/^<col width="[0-9]*%" \/>$//d' > $@
105 pandoc --standalone $< -o $@
108 # ### In order to compile the whitepaper, which has tables, to PDF,
109 # you will need to install the Debian package
110 # texlive-latex-recommended
113 pandoc --standalone $< -o $@
116 ##############################
120 rm -f *.orig *.bak *.rej
123 rm -f ${JQUERY_FILE} ${JQUERY_JSON_FILE} ${HANDLEBARS_FILE} ${PP2_FILE}
124 rm -f mkws.min.js ${MKWS_JS} mkws-complete.min.js
128 @echo "make [ help | docs | clean ]"
129 @echo " [ mkws-js | mkws-js-min ]"
130 @echo " [ mkws-syntax-check | mkws-complete-syntax-check ]"
132 @echo "make JQUERY_URL=http://code.jquery.com/jquery-2.0.3.min.js clean mkws-js"
134 @echo "Please check ./README file too!"