Source

htraf-packaging / Makefile

.PHONY: build dist doc clean

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/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 doc
	mkdir -p build/htraf
	cp src/htraf.js build/htraf
	cp src/jquery.htraf.js build/htraf
	cp src/htraf.plugins.js build/htraf
	cp src/htraf.css build/htraf
	cp src/htraf-load.gif build/htraf
	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

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

build:
	${MAKE} clean build/htraf

dist: build
	cd build; zip -rq htraf-bundle.zip htraf

clean:
	rm -rf build