reformat warning for better readability
[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=      ../../../pazpar2/js/pz2.js
21 PZ2API_GIT=     ssh://git.indexdata.com:222/home/git/pub/pazpar2
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-git-checkout: 
33         @if ! test -e ${PZ2API_JS}; then \
34             ( cd ../../.. && git clone ${PZ2API_GIT} ); \
35         fi
36
37 mkws-js ${MKWS_JS}: mkws.js handlebars-v1.1.2.js
38         @if ! test -e ${PZ2API_JS}; then \
39             echo "The pazpar2 JS file ${PZ2API_JS} does not exists."; \
40             echo "Did you checked out the source from the git repo?"; \
41             echo ""; \
42             echo "Please run:"; \
43             echo "$$ make pz2api-git-checkout"; \
44             echo ""; \
45             exit 1; \
46         fi
47         ( echo "/* created at: $$(date)"; \
48           echo "   mkws.js GIT id: $$(git log mkws.js | head -n 1 | perl -npe 's,\S+\s+,,') */"; \
49           curl -sSf ${JQUERY_URL} | perl -npe 's,sourceMappingURL=jquery.*map,,'; \
50           cat handlebars-v1.1.2.js; \
51           cat ${PZ2API_JS} mkws.js ) > ${MKWS_JS}.new 
52         mv -f ${MKWS_JS}.new ${MKWS_JS}
53
54 handlebars-v1.1.2.js:
55         curl -sSf http://builds.handlebarsjs.com.s3.amazonaws.com/handlebars-v1.1.2.js -o $@
56
57 distclean: clean
58 clean:
59         rm -f ${MKWS_JS} $(DOCS)
60
61 help:
62         @echo "make [ help | mkws-js | docs | clean ]"
63         @echo ""
64         @echo "make JQUERY_URL=http://code.jquery.com/jquery-2.0.3.min.js clean mkws-js"
65         @echo ""
66         @echo "Please check ./README file too!"
67
68
69 # For a description of pandoc's markdown format, see:
70 # http://johnmacfarlane.net/pandoc/demo/example9/pandocs-markdown.html -->
71
72 # for older pandoc (<1.9) run first:
73 # perl -i.bak -npe 's/"(Authors|Subjects)": "(.*?)"/"$1": "test"/' tools/htdocs/whitepaper.markdown
74 #
75 %.html: %.markdown
76         rm -f $@
77         pandoc --standalone --toc -c mkws-doc.css $< | sed '/^<col width="[0-9]*%" \/>$//d' > $@
78         chmod ugo-w $@
79
80 %.odt: %.markdown
81         rm -f $@
82         pandoc --standalone $< -o $@
83         chmod ugo-w $@
84
85 # ### In order to compile the whitepaper, which has tables, to PDF,
86 # you will need to install the Debian package
87 #       texlive-latex-recommended
88 %.pdf: %.markdown
89         rm -f $@
90         pandoc --standalone $< -o $@
91         chmod ugo-w $@
92