DragonVM/compile

31 lines
No EOL
704 B
Bash
Executable file

#!/bin/bash
rm -r bin
if [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then
cmake -B bin -S ./
cd bin
make
if [ $? -eq 0 ]; then
cd ..
typeset -i build_number=$(cat build.nr)
((build_number++))
truncate -s 0 build.nr
echo $build_number >> build.nr
else
cd ..
fi
elif [ "$(expr substr $(uname -s) 1 10)" == "MINGW64_NT" ]; then
cmake -B bin -S ./ -G "MinGW Makefiles"
cd bin
mingw32-make.exe
if [ $? -eq 0 ]; then
cd ..
typeset -i build_number=$(cat build.nr)
((build_number++))
truncate -s 0 build.nr
echo $build_number >> build.nr
else
cd ..
fi
fi