e73a87a57e0bf5e5911ea612e442a455df56e02b
[mkws-moved-to-github.git] / tools / htdocs / Makefile
1 ######################################################################
2 # Copyright (c) 2013 IndexData ApS. http://indexdata.com
3 #
4
5 ##############################
6 # select a jquery version
7 #
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
15
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
19 MKWS_JS=        mkws-complete.js
20 PZ2API_JS=      ../../../libjs-pz2/pz2api.1.js
21 PZ2API_GIT=     ssh://git.indexdata.com:222/home/git/pub/libjs-pz2
22
23 DOCS = README.html README.odt README.pdf \
24        whitepaper.html whitepaper.odt whitepaper.pdf
25
26 **default**: ${MKWS_JS} README.html whitepaper.html
27
28 all: ${MKWS_JS} $(DOCS)
29
30 docs: $(DOCS)
31
32 pz2api-check: 
33         @if ! test -e ${PZ2API_JS}; then \
34             echo "The pazpar2 JS file ${PZ2API_JS} does not exists."; \
35             echo "Did you checked out the source from the git repo?"; \
36             echo "( cd $$(dirname $$(dirname ${PZ2API_JS})); git clone ${PZ2API_GIT} )"; \
37             exit 1; \
38         fi
39
40 mkws-js ${MKWS_JS}: pz2api-check ${PZ2API_JS} mkws.js
41         ( echo "/* created at: $$(date)"; \
42           echo "   mkws.js GIT id: $$(git log mkws.js | head -n 1 | perl -npe 's,\S+\s+,,') */"; \
43           curl -sSf ${JQUERY_URL}; \
44           cat ../../../libjs-pz2/pz2api.1.js mkws.js ) > ${MKWS_JS}.new 
45         mv -f ${MKWS_JS}.new ${MKWS_JS}
46
47 distclean: clean
48 clean:
49         rm -f ${MKWS_JS} $(DOCS)
50
51 help:
52         @echo "make [ help | mkws-js | docs | clean ]"
53         @echo ""
54         @echo "make JQUERY_URL=http://code.jquery.com/jquery-2.0.3.min.js clean mkws-js"
55         @echo ""
56         @echo "Please check ./README file too!"
57
58
59 # For a description of pandoc's markdown format, see:
60 # http://johnmacfarlane.net/pandoc/demo/example9/pandocs-markdown.html -->
61
62 %.html: %.markdown
63         rm -f $@
64         pandoc --standalone -c mkws-doc.css $< -o $@
65         chmod ugo-w $@
66
67 %.odt: %.markdown
68         rm -f $@
69         pandoc --standalone $< -o $@
70         chmod ugo-w $@
71
72 %.pdf: %.markdown
73         rm -f $@
74         pandoc --standalone $< -o $@
75         chmod ugo-w $@
76