Files
FTL/build.sh
T
DL6ER 99c7688610 Add LUASCRIPT compatibility
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-07-22 18:51:56 +02:00

42 lines
997 B
Bash
Executable File

#!/bin/bash
# Pi-hole: A black hole for Internet advertisements
# (c) 2020 Pi-hole, LLC (https://pi-hole.net)
# Network-wide ad blocking via your own hardware.
#
# FTL Engine
# Build script for FTL
#
# This file is copyright under the latest version of the EUPL.
# Please see LICENSE file for your rights under this license.
# Abort script if one command returns a non-zero value
set -e
# Prepare build environment
if [[ "${1}" == "clean" ]]; then
rm -rf cmake/
exit 0
fi
# Configure build, pass CMake CACHE entries if present
# Wrap multiple options in "" as first argument to ./build.sh:
# ./build.sh "-DA=1 -DB=2" install
mkdir -p cmake
cd cmake
if [[ "${1}" == "-D"* ]]; then
cmake "${1}" ..
else
cmake ..
fi
# Build the sources
cmake --build . -- -j $(nproc)
# If we are asked to install, we do this here
# Otherwise, we simply copy the binary one level up
if [[ "${1}" == "install" || "${2}" == "install" ]]; then
sudo make install
else
cp pihole-FTL ../
fi