Index: build/premake/build.sh =================================================================== --- build/premake/build.sh +++ build/premake/build.sh @@ -0,0 +1,34 @@ +#!/bin/sh +set -e +LIB_VERSION="premake-5+wildfiregames.1" +JOBS=${JOBS:="-j2"} +MAKE=${MAKE:="make"} +LDFLAGS=${LDFLAGS:=""} +CFLAGS=${CFLAGS:=""} +CXXFLAGS=${CXXFLAGS:=""} +OS="${OS:=$(uname -s)}" + +if [ -e .already-built ] && [ "$(cat .already-built)" = "${LIB_VERSION}" ] +then + echo "Premake 5 is already up to date." + exit +fi + +echo "Building Premake 5..." +echo + +cd "premake5/" +PREMAKE_BUILD_DIR=build/gmake2.unix +# BSD and OS X need different Makefiles +case $OS in +"GNU/kFreeBSD" ) + # use default gmake2.unix (needs -ldl as we have a GNU userland and libc) + ;; +*"BSD" ) + PREMAKE_BUILD_DIR=build/gmake2.bsd + ;; +"Darwin" ) + PREMAKE_BUILD_DIR=build/gmake2.macosx + ;; +esac +${MAKE} -C $PREMAKE_BUILD_DIR "${JOBS}" || die "Premake build failed" Index: build/workspaces/update-workspaces.sh =================================================================== --- build/workspaces/update-workspaces.sh +++ build/workspaces/update-workspaces.sh @@ -102,37 +102,22 @@ echo fi -# Now run premake to create the makefiles - +# Now build Premake or use system's. premake_command="premake5" if [ "$with_system_premake5" = "false" ]; then # Build bundled premake - cd ../premake/premake5 - PREMAKE_BUILD_DIR=build/gmake2.unix - # BSD and OS X need different Makefiles - case "`uname -s`" in - "GNU/kFreeBSD" ) - # use default gmake2.unix (needs -ldl as we have a GNU userland and libc) - ;; - *"BSD" ) - PREMAKE_BUILD_DIR=build/gmake2.bsd - ;; - "Darwin" ) - PREMAKE_BUILD_DIR=build/gmake2.macosx - ;; - esac - ${MAKE} -C $PREMAKE_BUILD_DIR ${JOBS} || die "Premake build failed" - + (cd ../premake && MAKE=${MAKE} JOBS=${JOBS} ./build.sh) || die "Premake 5 build failed" premake_command="premake5/bin/release/premake5" fi echo cd .. # If we're in bash then make HOSTTYPE available to Premake, for primitive arch-detection export HOSTTYPE="$HOSTTYPE" +# Now run Premake to create the makefiles echo "Premake args: ${premake_args}" if [ "`uname -s`" != "Darwin" ]; then ${premake_command} --file="premake5.lua" --outpath="../workspaces/gcc/" ${premake_args} gmake || die "Premake failed"