diff options
Diffstat (limited to 'Build/source/utils/asymptote/build-scripts/build-asygl')
-rwxr-xr-x | Build/source/utils/asymptote/build-scripts/build-asygl | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/Build/source/utils/asymptote/build-scripts/build-asygl b/Build/source/utils/asymptote/build-scripts/build-asygl index 46e0cfd082b..f1d75a6f803 100755 --- a/Build/source/utils/asymptote/build-scripts/build-asygl +++ b/Build/source/utils/asymptote/build-scripts/build-asygl @@ -1,5 +1,16 @@ #!/bin/sh -if [ ! $# = 0 ]; then echo Usage: "$0"; exit 1; fi +if [ $# -gt 1 -o \( $# = 1 -a "$1" != "debug" \) ]; then \ + echo Usage: "$0 [debug]"; exit 1; \ +fi + +if [ $# -eq 1 ]; then \ +UGLIFY=cat; \ +UGLIFYOPT=""; \ +else \ +UGLIFY=uglifyjs; \ +UGLIFYOPTIONS="-m -c --comments"; \ +fi + GL_MATRIX_VERSION=2.4.0 GL_MATRIX_DIR=gl-matrix-$GL_MATRIX_VERSION GL_MATRIX_DIR_PRUNED=$GL_MATRIX_DIR-pruned @@ -18,4 +29,12 @@ echo "/*@license for gl-matrix mat3 and mat4 functions:" > LICENSE.js echo "*/"| cat LICENSE.md - >> LICENSE.js cd .. fi -cat $GL_MATRIX_DIR_PRUNED/dist/gl-matrix.js webgl/gl.js $GL_MATRIX_DIR_PRUNED/LICENSE.js | uglifyjs -m -c -o base/webgl/asygl.js --comments +SHADERS=`mktemp` +echo "let vertex=\`" > $SHADERS +echo "\`;" | cat webgl/vertex.glsl - >> $SHADERS +echo "let fragment=\`" >> $SHADERS +echo "\`;" | cat webgl/fragment.glsl - >> $SHADERS +cat webgl/license $GL_MATRIX_DIR_PRUNED/LICENSE.js \ + $SHADERS $GL_MATRIX_DIR_PRUNED/dist/gl-matrix.js webgl/gl.js | \ + $UGLIFY $UGLIFYOPTIONS > base/webgl/asygl.js +rm $SHADERS |