Kirill Simonov avatar Kirill Simonov committed a7852a0

Build improvements:
- added prerequisites check;
- use upper-case for the package name;
- generate `build/htraf` to make `build/doc` immediately usable.

Comments (0)

Files changed (1)

-.PHONY: build dist doc clean
+.PHONY: prerequisites build dist doc clean
 
 HTRAF_VER=2.0.0b1
 
 
 JSMIN=python -c 'import sys, jsmin; sys.stdout.write(jsmin.jsmin(sys.stdin.read()))'
 
-BUILD=build/htraf-${HTRAF_VER}
+BUILD=build/HTRAF-${HTRAF_VER}
 
 dist: build
-	cd build; zip -rq htraf-${HTRAF_VER}.zip htraf-${HTRAF_VER}
+	cd build; zip -rq HTRAF-${HTRAF_VER}.zip HTRAF-${HTRAF_VER}
 
-build:
+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:
 	tar -xz -C build/jqplot -f build/jquery.jqplot.${JQPLOT_VER}.tar.gz
 	rm build/jquery.jqplot.${JQPLOT_VER}.tar.gz
 
-${BUILD}: build/json-js build/jquery build/jquery-ui build/blockui build/jqplot doc
-	mkdir -p ${BUILD}/htraf
+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
+	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}
-	cp src/*.js src/*.css src/*.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
+	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.