#!/bin/sh # Shave and a Haircut # (c) 2019 Epic Games # US Patent 6720962 log=$$.log checkFailure() { if [ $? -ne 0 ]; then cat $log rm -f $log echo "mkosx:error: Exiting due to errors building $1 for Maya $maya." exit 1 fi } maya= reuseLibexe=n while [ "$1" != "" ]; do if [ "$1" = "reuseLibexe" ]; then reuseLibexe=y else maya=$1 fi shift done if [ -d /Applications/Autodesk/maya${maya} ]; then export MAYA_LOCATION=/Applications/Autodesk/maya${maya} else export MAYA_LOCATION=/Applications/Alias/maya${maya} fi if [ ! -d $MAYA_LOCATION ]; then echo "mkosx:error: Maya version ${maya} does not appear to be installed." exit 2 fi source getosxvars.sh cd libexe # # If we're reusing libexe we still do the make, we just don't do the clean # beforehand. That way if it's all up-to-date then nothing will happen but # if anything is out of date we'll build it. # if [ "${reuseLibexe}" = "n" ]; then make -f Makefile.mayaosx clean >/dev/null 2>&1 fi echo "mkosx:status: building shaveLibAW.o for Maya ${maya}" make -f Makefile.mayaosx all checkFailure "shaveLibAW.o" cd ../mayaPlug make -f Makefile.osx Clean >/dev/null 2>&1 echo "mkosx:status: building Shave plugin for Maya ${maya}" make -f Makefile.osx -j 4 all >$log 2>&1 checkFailure "Shave plugin" # Build Arnold plugin & shaders. # cd ../arnold echo "mkosx:status: building Arnold plugin & shaders for Maya ${maya}" ./mkosx.sh ${maya} >$log 2>&1 checkFailure "Arnold plugin and shaders" cd .. # # Build V-Ray shaders. # cd vrayPlug echo "mkosx:status: building V-Ray plugins & shaders for Maya ${maya}" ./mkosx.sh ${maya} >$log 2>&1 checkFailure "V-Ray shaders" cd .. echo "mkosx:status: creating package & zip for Maya ${maya}" ./pkgosx.sh checkFailure "package" rm -f $log zipfile=`echo "${pkgName}.zip" | sed 's/\.mpkg\./.pkg./'` echo "mkosx:done: ${zipfile}" exit 0