blob: 2468954dd6c3720def00308f982e1ec72a855832 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
#!/usr/bin/env bash
set -euo pipefail
repo=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd -P)
srcdir="$repo/src"
platform="$1"
shift
if [[ "$(pwd -P)" = "$repo" ]]; then
test ! -d build || rm -r build
mkdir build
cd build
fi
cat >config.mak <<EOF
CONFIGURED = 1
platform = $platform
srcdir = $srcdir
EOF
ln -s "$srcdir/Makefile"
n="$(nproc)"
watchexec -w "$srcdir" -- \
make "-j$n" "-l$n" "$@"
|