Files
userland/buildme
2015-04-27 17:11:06 +00:00

31 lines
685 B
Bash
Executable File

#!/bin/bash
if [ "armv6l" = `arch` ] || [ "armv7l" = `arch` ]; then
# Native compile on the Raspberry Pi
mkdir -p build/raspberry/release
pushd build/raspberry/release
cmake -DCMAKE_BUILD_TYPE=Release ../../..
if [ "armv6l" = `arch` ]; then
make
else
make -j4
fi
if [ "$1" != "" ]; then
sudo make install DESTDIR=$1
else
sudo make install
fi
else
# Cross compile on a more capable machine
mkdir -p build/arm-linux/release/
pushd build/arm-linux/release/
cmake -DCMAKE_TOOLCHAIN_FILE=../../../makefiles/cmake/toolchains/arm-linux-gnueabihf.cmake -DCMAKE_BUILD_TYPE=Release ../../..
make -j 6
if [ "$1" != "" ]; then
sudo make install DESTDIR=$1
fi
fi
popd