c-dmitriy.icu/bin/compile
2020-07-28 11:43:21 +05:00

28 lines
402 B
Bash

#!/usr/bin/env bash
# bin/compile <build-dir> <cache-dir>
set -e
set -o pipefail
BUILD_DIR=$1
CACHE_DIR=$2
function indent() {
c='s/^/ /'
case $(uname) in
Darwin) sed -l "$c";;
*) sed -u "$c";;
esac
}
cd $BUILD_DIR
# configure
if [ -f configure ]; then
echo "-----> Configuring"
./configure 2>&1 | indent
fi
# make
echo "-----> Compiling with Make"
make 2>&1 | indent