htraf / Makefile

.PHONY: prerequisites build dist doc clean

HTRAF_VER=2.0.0b2

JQUERY_VER=1.5.1
JQUERYUI_VER=1.8.13
JSONJS_VER=master
BLOCKUI_VER=master
JQPLOT_VER=0.9.7r629

JSMIN=python -c 'import sys, jsmin; sys.stdout.write(jsmin.jsmin(sys.stdin.read()))'

BUILD=build/HTRAF-${HTRAF_VER}

dist: build
	cd build; zip -rq HTRAF-${HTRAF_VER}.zip HTRAF-${HTRAF_VER}

prerequisites:
	@which wget >/dev/null || (echo "Wget is required"; exit 1)
	@which hg >/dev/null || (echo "Mercurial is required"; exit 1)
	@which git >/dev/null || (echo "Git is required"; exit 1)
	@which zip >/dev/null || (echo "Zip is required"; exit 1)
	@which python >/dev/null || (echo "Python is required"; exit 1)
	@python -c 'import htsql' || (echo "HTSQL package is required"; exit 1)
	@python -c 'import sphinx' || (echo "Sphinx package is required"; exit 1)
	@python -c 'import jsmin' || (echo "JSmin package is required"; exit 1)

build: prerequisites
	${MAKE} clean ${BUILD}

doc:
	mkdir -p build
	sphinx-build -b html doc build/doc

clean:
	rm -rf build

build/json-js:
	mkdir -p build/json-js
	git clone https://github.com/douglascrockford/JSON-js build/json-js
	cd build/json-js; git checkout ${JSONJS_VER}

build/jquery:
	mkdir -p build/jquery
	wget -q -O build/jquery/jquery.min.js http://code.jquery.com/jquery-${JQUERY_VER}.min.js

build/jquery-ui:
	wget -q -P build http://jquery-ui.googlecode.com/files/jquery-ui-${JQUERYUI_VER}.zip
	unzip -q build/jquery-ui-${JQUERYUI_VER} -d build
	rm build/jquery-ui-${JQUERYUI_VER}.zip
	mv build/jquery-ui-${JQUERYUI_VER} build/jquery-ui

build/blockui:
	mkdir -p build/blockui
	git clone https://github.com/malsup/blockui build/blockui
	cd build/blockui; git checkout ${BLOCKUI_VER}

build/jqplot:
	mkdir -p build/jqplot
	wget -P build -q --no-check-certificate \
		http://bitbucket.org/cleonello/jqplot/downloads/jquery.jqplot.${JQPLOT_VER}.tar.gz
	tar -xz -C build/jqplot -f build/jquery.jqplot.${JQPLOT_VER}.tar.gz
	rm build/jquery.jqplot.${JQPLOT_VER}.tar.gz

build/htraf: build/json-js build/jquery build/jquery-ui build/blockui build/jqplot
	mkdir -p build/htraf
	cp src/*.js src/*.css src/*.gif build/htraf
	sed 's/\$$HTRAF_VER/${HTRAF_VER}/' build/htraf/htraf.js >build/htraf/htraf.js.ver
	mv build/htraf/htraf.js.ver build/htraf/htraf.js
	mkdir -p build/htraf/lib
	cat build/json-js/json2.js | ${JSMIN} > build/htraf/lib/json2.min.js
	cp build/jquery/jquery.min.js build/htraf/lib/jquery.min.js
	cat build/jquery-ui/ui/minified/jquery.ui.core.min.js \
		build/jquery-ui/ui/minified/jquery.ui.position.min.js \
		build/jquery-ui/ui/minified/jquery.ui.widget.min.js \
		> build/htraf/lib/jquery-ui.custom.min.js
	cat build/blockui/jquery.blockUI.js | ${JSMIN} \
		> build/htraf/lib/jquery.blockUI.min.js
	cp build/jqplot/dist/excanvas.min.js build/htraf/lib
	cp build/jqplot/dist/jquery.jqplot.min.js build/htraf/lib
	cp build/jqplot/dist/plugins/*.min.js build/htraf/lib
	cp build/jqplot/dist/jquery.jqplot.min.css build/htraf/lib

${BUILD}: doc build/htraf
	mkdir -p ${BUILD}
	cp README LICENSE *-LICENSE ${BUILD}
	cp -r demo ${BUILD}
	cp -r build/doc ${BUILD}
	rm -rf ${BUILD}/doc/.doctrees
	cp -r build/htraf ${BUILD}
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.