#!/bin/bash COMMON_FLAGS="OFFICIAL_BUILD=1 SHARED=1 MONOLITHIC=0 USE_OPENGL=1" HYBRID_FLAGS="DEBUG_FLAG=1 CXXFLAGS=/D__NO_VC_CRTDBG__ WXDEBUGFLAG=h" MAKE_FLAGS=$COMMON_FLAGS # set flags based on build type if given if [ "$1" = "debug" ]; then MAKE_FLAGS="$COMMON_FLAGS BUILD=debug UNICODE=0 MSLU=0" shift elif [ "$1" = "hybrid" ]; then MAKE_FLAGS="$COMMON_FLAGS BUILD=release $HYBRID_FLAGS UNICODE=0 MSLU=0" shift elif [ "$1" = "release" ]; then MAKE_FLAGS="$COMMON_FLAGS BUILD=release UNICODE=0 MSLU=0" shift elif [ "$1" = "debug-uni" ]; then MAKE_FLAGS="$COMMON_FLAGS BUILD=debug UNICODE=1 MSLU=1" shift elif [ "$1" = "hybrid-uni" ]; then MAKE_FLAGS="$COMMON_FLAGS BUILD=release $HYBRID_FLAGS UNICODE=1 MSLU=1" shift elif [ "$1" = "release-uni" ]; then MAKE_FLAGS="$COMMON_FLAGS BUILD=release UNICODE=1 MSLU=1" shift else echo "----------------------------------------------" echo " Build type not specified" echo " debug" echo " hybrid" echo " release" echo " debug-uni" echo " hybrid-uni" echo " release-uni" echo "----------------------------------------------" fi # now run nmake, echoing the command-line first echo nmake -f makefile.vc $MAKE_FLAGS $@ nmake -f makefile.vc $MAKE_FLAGS $@ # quit with nmake's exit code exit $?