Changeset View
Changeset View
Standalone View
Standalone View
build/workspaces/update-workspaces.sh
Show All 32 Lines | * ) | ||||
MAKE=${MAKE:="make"} | MAKE=${MAKE:="make"} | ||||
;; | ;; | ||||
esac | esac | ||||
# Parse command-line options: | # Parse command-line options: | ||||
premake_args="" | premake_args="" | ||||
with_system_premake5=false | |||||
without_nvtt=false | without_nvtt=false | ||||
with_system_nvtt=false | with_system_nvtt=false | ||||
with_system_mozjs45=false | with_system_mozjs45=false | ||||
enable_atlas=true | enable_atlas=true | ||||
for i in "$@" | for i in "$@" | ||||
do | do | ||||
case $i in | case $i in | ||||
--with-system-premake5 ) with_system_premake5=true ;; | |||||
--without-nvtt ) without_nvtt=true; premake_args="${premake_args} --without-nvtt" ;; | --without-nvtt ) without_nvtt=true; premake_args="${premake_args} --without-nvtt" ;; | ||||
--with-system-nvtt ) with_system_nvtt=true; premake_args="${premake_args} --with-system-nvtt" ;; | --with-system-nvtt ) with_system_nvtt=true; premake_args="${premake_args} --with-system-nvtt" ;; | ||||
--with-system-mozjs45 ) with_system_mozjs45=true; premake_args="${premake_args} --with-system-mozjs45" ;; | --with-system-mozjs45 ) with_system_mozjs45=true; premake_args="${premake_args} --with-system-mozjs45" ;; | ||||
--enable-atlas ) enable_atlas=true ;; | --enable-atlas ) enable_atlas=true ;; | ||||
--disable-atlas ) enable_atlas=false ;; | --disable-atlas ) enable_atlas=false ;; | ||||
-j* ) JOBS=$i ;; | -j* ) JOBS=$i ;; | ||||
# Assume any other --options are for Premake | # Assume any other --options are for Premake | ||||
--* ) premake_args="${premake_args} $i" ;; | --* ) premake_args="${premake_args} $i" ;; | ||||
Show All 33 Lines | if [ "`uname -s`" != "Darwin" ]; then | ||||
fi | fi | ||||
echo | echo | ||||
if [ "$with_system_nvtt" = "false" ] && [ "$without_nvtt" = "false" ]; then | if [ "$with_system_nvtt" = "false" ] && [ "$without_nvtt" = "false" ]; then | ||||
(cd ../../libraries/source/nvtt && MAKE=${MAKE} JOBS=${JOBS} ./build.sh) || die "NVTT build failed" | (cd ../../libraries/source/nvtt && MAKE=${MAKE} JOBS=${JOBS} ./build.sh) || die "NVTT build failed" | ||||
fi | fi | ||||
echo | echo | ||||
fi | fi | ||||
# Now build premake and run it to create the makefiles | # Now run premake to create the makefiles | ||||
premake_command="premake5" | |||||
if [ "$with_system_premake5" = "false" ]; then | |||||
# Build bundled premake | |||||
cd ../premake/premake5 | cd ../premake/premake5 | ||||
PREMAKE_BUILD_DIR=build/gmake.unix | PREMAKE_BUILD_DIR=build/gmake.unix | ||||
# BSD and OS X need different Makefiles | # BSD and OS X need different Makefiles | ||||
case "`uname -s`" in | case "`uname -s`" in | ||||
"GNU/kFreeBSD" ) | "GNU/kFreeBSD" ) | ||||
# use default gmake.unix (needs -ldl as we have a GNU userland and libc) | # use default gmake.unix (needs -ldl as we have a GNU userland and libc) | ||||
;; | ;; | ||||
*"BSD" ) | *"BSD" ) | ||||
PREMAKE_BUILD_DIR=build/gmake.bsd | PREMAKE_BUILD_DIR=build/gmake.bsd | ||||
;; | ;; | ||||
"Darwin" ) | "Darwin" ) | ||||
PREMAKE_BUILD_DIR=build/gmake.macosx | PREMAKE_BUILD_DIR=build/gmake.macosx | ||||
;; | ;; | ||||
esac | esac | ||||
${MAKE} -C $PREMAKE_BUILD_DIR ${JOBS} || die "Premake build failed" | ${MAKE} -C $PREMAKE_BUILD_DIR ${JOBS} || die "Premake build failed" | ||||
premake_command="premake5/bin/release/premake5" | |||||
fi | |||||
echo | echo | ||||
cd .. | cd .. | ||||
# If we're in bash then make HOSTTYPE available to Premake, for primitive arch-detection | # If we're in bash then make HOSTTYPE available to Premake, for primitive arch-detection | ||||
export HOSTTYPE="$HOSTTYPE" | export HOSTTYPE="$HOSTTYPE" | ||||
echo "Premake args: ${premake_args}" | echo "Premake args: ${premake_args}" | ||||
if [ "`uname -s`" != "Darwin" ]; then | if [ "`uname -s`" != "Darwin" ]; then | ||||
premake5/bin/release/premake5 --file="premake5.lua" --outpath="../workspaces/gcc/" ${premake_args} gmake || die "Premake failed" | ${premake_command} --file="premake5.lua" --outpath="../workspaces/gcc/" ${premake_args} gmake || die "Premake failed" | ||||
else | else | ||||
premake5/bin/release/premake5 --file="premake5.lua" --outpath="../workspaces/gcc/" --macosx-version-min="${MIN_OSX_VERSION}" ${premake_args} gmake || die "Premake failed" | ${premake_command} --file="premake5.lua" --outpath="../workspaces/gcc/" --macosx-version-min="${MIN_OSX_VERSION}" ${premake_args} gmake || die "Premake failed" | ||||
# Also generate xcode workspaces if on OS X | # Also generate xcode workspaces if on OS X | ||||
premake5/bin/release/premake5 --file="premake5.lua" --outpath="../workspaces/xcode4" --macosx-version-min="${MIN_OSX_VERSION}" ${premake_args} xcode4 || die "Premake failed" | ${premake_command} --file="premake5.lua" --outpath="../workspaces/xcode4" --macosx-version-min="${MIN_OSX_VERSION}" ${premake_args} xcode4 || die "Premake failed" | ||||
fi | fi | ||||
# test_root.cpp gets generated by cxxtestgen and passing different arguments to premake could require a regeneration of this file. | # test_root.cpp gets generated by cxxtestgen and passing different arguments to premake could require a regeneration of this file. | ||||
# It doesn't depend on anything in the makefiles, so make won't notice that the prebuild command for creating test_root.cpp needs to be triggered. | # It doesn't depend on anything in the makefiles, so make won't notice that the prebuild command for creating test_root.cpp needs to be triggered. | ||||
# We force this by deleting the file. | # We force this by deleting the file. | ||||
rm -f ../../source/test_root.cpp | rm -f ../../source/test_root.cpp |
Wildfire Games · Phabricator