Code: Select all
#!/bin/bash
# Script for PureBasic crosplatform build
# Path to PB compilers
# !!! CHANGE THIS PATH TO YOU PUREBASIC PATHES !!!
PureBasic_Path_Linux_x86="/home/jule/Soft/PureBasic/Linux86"
PureBasic_Path_Linux_x64="/home/jule/Soft/PureBasic/Linux64"
PureBasic_Path_Windows_x86="/home/jule/.wine/drive_c/Program Files (x86)/PureBasic"
PureBasic_Path_Windows_x64="/home/jule/.wine/drive_c/Program Files/PureBasic/Win64"
# Check arguments
if [ -n "$1" ]; then
{
src=$1
}
else
{
echo "Input source file name: "
read src
}
fi
if [ -n "$2" ]; then
{
executableName=$src
}
else
{
echo "Input executable file name: "
read executableName
}
fi
# Windows x86
echo
echo "Build Windows x86 binary"
wine "$PureBasic_Path_Windows_x86"/Compilers/pbcompiler.exe $src /exe $executableName.Win32.exe /QUIET
# Windows x64
echo
echo "Build Windows x64 binary"
wine64 "$PureBasic_Path_Windows_x64"/Compilers/pbcompiler.exe $src /exe $executableName.Win64.exe /QUIET
# Linux x86
echo
echo "Build Linux x86 binary"
export PUREBASIC_HOME=$PureBasic_Path_Linux_x86
export PATH=$PUREBASIC_HOME/compilers:$PATH
$PureBasic_Path_Linux_x86/compilers/pbcompiler $src -e $executableName.Lin86 -q
# Linux x64
echo
echo "Build Linux x64 binary"
export PUREBASIC_HOME=$PureBasic_Path_Linux_x64
export PATH=$PUREBASIC_HOME/compilers:$PATH
$PureBasic_Path_Linux_x64/compilers/pbcompiler $src -e $executableName.Lin64 -q
# Finish
echo
echo "******************************************"
echo "Done!"
./ScriptName SourceFileName ExecutableFileName
One command line for building Win32, Win64, Linux 32 and Linux 64 executables.
Feel Pure Power!)