2018-02-05 22:23:00 -04:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -e
|
|
|
|
set -x
|
2018-03-01 20:20:13 -04:00
|
|
|
echo "---------- $0 start ----------"
|
2018-02-05 22:23:00 -04:00
|
|
|
|
2018-03-01 20:20:13 -04:00
|
|
|
# don't waste time rebuilding jsbsim if we already have a working copy of it
|
|
|
|
# this can save ~10 or minutes on some hardware
|
2019-03-07 19:46:03 -04:00
|
|
|
JSBBINARY=~/jsbsim/build/src/JSBSim
|
2018-03-01 20:20:13 -04:00
|
|
|
if [ -f $JSBBINARY ]; then
|
|
|
|
echo "$JSBBINARY exists, skipping build. (to force rebuild then remove this file and re-run) "
|
|
|
|
else
|
|
|
|
echo "$JSBBINARY does not exist, building it in your home folder:"
|
|
|
|
cd ~
|
|
|
|
rm -rf jsbsim
|
2019-03-07 19:46:03 -04:00
|
|
|
git clone git://github.com/JSBSim-Team/jsbsim.git
|
2018-03-01 20:20:13 -04:00
|
|
|
cd jsbsim
|
2019-03-07 19:46:03 -04:00
|
|
|
mkdir build
|
|
|
|
cd build
|
|
|
|
cmake -DCMAKE_CXX_FLAGS_RELEASE="-O3 -march=native -mtune=native" -DCMAKE_C_FLAGS_RELEASE="-O3 -march=native -mtune=native" -DCMAKE_BUILD_TYPE=Release ..
|
2018-03-01 20:20:13 -04:00
|
|
|
make -j2
|
|
|
|
fi
|
|
|
|
echo "---------- $0 end ----------"
|