Skip to content
This repository has been archived by the owner on Nov 26, 2022. It is now read-only.

Commit

Permalink
Improve Linux compile script
Browse files Browse the repository at this point in the history
For #29.
Accepts arguments and abort on error.
  • Loading branch information
pleonex authored and Benito Palacios Sanchez committed Mar 13, 2016
1 parent fcc5795 commit b35d2e0
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 19 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Build log
build.log

# Be.Windows.Forms.HexBox documentation
Be.Windows.Forms.HexBox/Be.Windows.Forms.HexBox.xml

Expand Down
64 changes: 45 additions & 19 deletions compile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,34 @@ TINKE_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
BUILD_DIR="$TINKE_DIR/build"

# Ask for release or debug configuration
echo "Choose the configuration. Press '1' for Release and '2' for Debug: "
select rd in "Release" "Debug"; do
case $rd in
Release) CONF="Release"; break;;
Debug) CONF="Debug"; break;;
esac
done
if [[ "$1" != "Release" && "$1" != "Debug" ]] ; then
echo "Choose the configuration. Press '1' for Release and '2' for Debug: "
select rd in "Release" "Debug"; do
case $rd in
Release) CONF="Release"; break;;
Debug) CONF="Debug"; break;;
esac
done
echo
else
echo "Using $1 configuration."
CONF=$1
fi

# Ask for 64 or 32 bits.
echo
echo "Choose the platform. Press '1' for x86 or '2' for x64: "
select pl in "x86" "x64"; do
case $pl in
x86) PLAT="x86"; break;;
x64) PLAT="x64"; break;;
esac
done
echo
if [[ "$2" != "x86" && "$2" != "x64" ]] ; then
echo "Choose the platform. Press '1' for x86 or '2' for x64: "
select pl in "x86" "x64"; do
case $pl in
x86) PLAT="x86"; break;;
x64) PLAT="x64"; break;;
esac
done
echo
else
echo "Compiling for platform $2."
PLAT=$2
fi

# Remove previous builds
if [ -d $BUILD_DIR ]; then
Expand All @@ -36,15 +46,30 @@ XBUILD_PLUGINS="$XBUILD;OutputPath=$BUILD_DIR/Plugins/"

# Compile program in standard directory, to allow plugins find Ekona
echo "Compiling base library..."
$XBUILD "/p:Platform=$PLAT" Tinke.sln > /dev/null
$XBUILD "/p:Platform=$PLAT" Tinke.sln > build.log
if [ $? -ne 0 ] ; then
echo "Error compiling Tinke into the default directory. Aborting."
cat build.log
exit -1
fi

# Compile Tinke
echo "Compiling Tinke..."
$XBUILD "/p:Platform=$PLAT;OutputPath=$BUILD_DIR/" Tinke.sln > /dev/null
$XBUILD "/p:Platform=$PLAT;OutputPath=$BUILD_DIR/" Tinke.sln > build.log
if [ $? -ne 0 ] ; then
echo "Error compiling Tinke into the build dir. Aborting."
cat build.log
exit -1
fi

function compile_plugin {
echo "Compiling plugin $1..."
$XBUILD_PLUGINS "$1" > /dev/null
$XBUILD_PLUGINS "$1" > build.log
if [ $? -ne 0 ] ; then
echo "Error compiling $1. Aborting."
cat build.log
exit -1
fi
}

# Compile game plugins
Expand Down Expand Up @@ -93,5 +118,6 @@ cp "$TINKE_DIR/Licence.txt" "$BUILD_DIR/"
# Delete debug files
rm "$BUILD_DIR"/*.mdb
rm "$BUILD_DIR"/Plugins/*.mdb
rm build.log

echo "Done!"

0 comments on commit b35d2e0

Please sign in to comment.