Skip to content

Commit 7f4e563

Browse files
committed
Linux script updates
1 parent 3444c51 commit 7f4e563

File tree

7 files changed

+73
-26
lines changed

7 files changed

+73
-26
lines changed

scripts/linux/buildAllExamples.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,13 @@
22

33
export LC_ALL=C
44

5-
for category in $( find ../../examples/ -maxdepth 1 -type d )
5+
OFDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
6+
OFDIR="$(realpath "$OF_DIR/../..")"
7+
OFCORE_EXAMPLES_DIR="$(realpath "$OF_DIR/examples")"
8+
9+
for category in $( find "${OFCORE_EXAMPLES_DIR}/" -maxdepth 1 -type d )
610
do
7-
if [ "$category" = "../../examples/android" -o "$category" = "../../examples/ios" -o "$category" = "../../examples/" -o "$category" = "../../examples/tvOS" ]; then
11+
if [ "$category" = "${OFCORE_EXAMPLES_DIR}/android" -o "$category" = "${OFCORE_EXAMPLES_DIR}/ios" -o "$category" = "${OFCORE_EXAMPLES_DIR}/" -o "$category" = "${OFCORE_EXAMPLES_DIR}/tvOS" ]; then
812
continue
913
fi
1014

scripts/linux/buildAllRPIExamples.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
22
PARENT_DIR="$(dirname "$DIR")"
3+
4+
OFDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
5+
OFDIR="$(realpath "$OF_DIR/../..")"
6+
OFCORE_EXAMPLES_DIR="$(realpath "$OF_DIR/examples")"
7+
38
MAKEFILE_PATH=$PARENT_DIR/templates/linuxarmv6l/Makefile
4-
cd ${DIR}/../../examples
9+
cd ${OFCORE_EXAMPLES_DIR}
510

611
for category in $(ls -1d *)
712
do

scripts/linux/cleanAllExamples.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
#!/bin/bash
22

3+
OFDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
4+
OFDIR="$(realpath "$OF_DIR/../..")"
5+
OFCORE_EXAMPLES_DIR="$(realpath "$OF_DIR/examples")"
6+
37
for category in $( find ../../examples/ -maxdepth 1 -type d )
48
do
5-
if [ "$category" = "../../examples/android" -o "$category" = "../../examples/ios" -o "$category" = "../../examples/" ]; then
9+
if [ "$category" = "${OFCORE_EXAMPLES_DIR}/android" -o "$category" = "${OFCORE_EXAMPLES_DIR}/ios" -o "$category" = "${OFCORE_EXAMPLES_DIR}/" ]; then
610
continue
711
fi
812

scripts/linux/compileOF.sh

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,20 @@
11
#!/usr/bin/env bash
22

33
export LC_ALL=C
4+
OFDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
5+
OFDIR="$(realpath "$OF_DIR/../..")"
46

57
ARCH=$(uname -m)
6-
if [ "$ARCH" = "x86_64" ]; then
7-
LIBSPATH=linux64
8-
else
9-
LIBSPATH=linux
8+
if [ "$ARCH" == "" ]; then
9+
if [ "$ARCH" = "x86_64" ]; then
10+
LIBSPATH=linux/64
11+
elif [ "$ARCH" = "arm64" ]; then
12+
LIBSPATH=linux/arm64
13+
elif [ "$ARCH" = "jetson" ]; then
14+
LIBSPATH=linux/jetson
15+
else
16+
LIBSPATH=linux
17+
fi
1018
fi
1119

1220
pushd `dirname $0` > /dev/null
@@ -18,13 +26,13 @@ JOBS=1
1826
while getopts tj: opt ; do
1927
case "$opt" in
2028
t) # testing, only build Debug
21-
BUILD="test" ;;
29+
BUILD="test" ;;
2230
j) # make job count for parallel build
23-
JOBS="$OPTARG"
31+
JOBS="$OPTARG"
2432
esac
2533
done
2634

27-
cd "${SCRIPTPATH}/../../libs/openFrameworksCompiled/project"
35+
cd "${OFDIR}/libs/openFrameworksCompiled/project"
2836
make -j$JOBS Debug
2937
exit_code=$?
3038
if [ $exit_code != 0 ]; then
@@ -34,11 +42,11 @@ if [ $exit_code != 0 ]; then
3442
fi
3543

3644
if [ "$BUILD" == "install" ]; then
37-
make -j$JOBS Release
38-
exit_code=$?
39-
if [ $exit_code != 0 ]; then
40-
echo "there has been a problem compiling Release OF library"
41-
echo "please report this problem in the forums"
42-
exit $exit_code
43-
fi
45+
make -j$JOBS Release
46+
exit_code=$?
47+
if [ $exit_code != 0 ]; then
48+
echo "there has been a problem compiling Release OF library"
49+
echo "please report this problem in the forums"
50+
exit $exit_code
51+
fi
4452
fi

scripts/linux/compilePG.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@
22

33
export LC_ALL=C
44

5-
OF_ROOT=$(cd $(dirname $0)/../..; pwd -P)
5+
OFDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
6+
OF_ROOT="$(realpath "$OF_DIR/../..")"
7+
OF_PG_DIR="$(realpath "$OF_DIR/apps/projectGenerator")"
68

7-
make Release -C ${OF_ROOT}/apps/projectGenerator/commandLine
9+
make Release -C ${OF_PG_DIR}/commandLine
810
ret=$?
911
if [ $ret -ne 0 ]; then
1012
echo "There has been a problem compiling the command line projectGenerator."
@@ -18,7 +20,7 @@ read -p "Do you want to install the command line project generator? [Y/n] " -r
1820
echo
1921
if [[ $REPLY =~ ^[Yy]$ ]]; then
2022
echo "To copy the command line project generator we need root permission."
21-
sudo cp ${OF_ROOT}/apps/projectGenerator/commandLine/bin/projectGenerator /usr/local/bin/projectGenerator
23+
sudo cp ${OF_PG_DIR}/commandLine/bin/projectGenerator /usr/local/bin/projectGenerator
2224
if [ ! $? -eq 0 ]; then
2325
echo "Failed to copy the projectGenerator file."
2426
exit

scripts/linux/removeFMOD.sh

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
1-
rm -r ../../libs/fmod
2-
rm ../../export/linux/libs/libfmod*
3-
rm ../../export/linux64/libs/libfmod*
1+
#!/bin/bash
2+
OFDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
3+
OFDIR="$(realpath "$OF_DIR/../..")"
4+
5+
if [ -d "${OFDIR}/libs/fmod" ]; then
6+
rm -r "${OFDIR}/libs/fmod"
7+
echo "Deleted ${OFDIR}/libs/fmod"
8+
fi
9+
10+
if [ -d "${OFDIR}/export/linux/libs" ]; then
11+
if ls ${OFDIR}/export/linux/libs/libfmod* 1> /dev/null 2>&1; then
12+
rm ${OFDIR}/export/linux/libs/libfmod*
13+
echo "Deleted files in ${OFDIR}/export/linux/libs/"
14+
fi
15+
fi
16+
17+
if [ -d "${OFDIR}/export/linux64/libs" ]; then
18+
if ls ${OFDIR}/export/linux64/libs/libfmod* 1> /dev/null 2>&1; then
19+
rm ${OFDIR}/export/linux64/libs/libfmod*
20+
echo "Deleted files in ${OFDIR}/export/linux64/libs/"
21+
fi
22+
fi

scripts/linux/testAllExamples.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
#!/bin/bash
22

33
export LC_ALL=C
4-
cd ../../examples
4+
OFDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
5+
OFDIR="$(realpath "$OF_DIR/../..")"
6+
OFCORE_EXAMPLES_DIR="$(realpath "$OF_DIR/examples")"
7+
8+
cd ${OFCORE_EXAMPLES_DIR}
59

610
for category in $( ls . )
711
do
@@ -16,7 +20,7 @@ do
1620
continue
1721
fi
1822
echo "-----------------------------------------------------------------"
19-
echo "building " + $example
23+
echo "building [" + $example "]"
2024
cd $example
2125
make Debug
2226
ret=$?
@@ -30,6 +34,7 @@ do
3034
echo error compiling $example
3135
exit
3236
fi
37+
echo "build success [" + $example "]"
3338
cd bin
3439
./$example
3540
cd ../../

0 commit comments

Comments
 (0)