buildscript: provide option to set number of threads during build #135
18
buildscript
18
buildscript
|
@ -237,13 +237,19 @@ build() {
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
"debug")
|
"debug")
|
||||||
make V=99
|
if [ -n "$2" ]; then
|
||||||
|
make V=99 -j $2
|
||||||
|
else
|
||||||
|
make V=99
|
||||||
|
fi
|
||||||
;;
|
;;
|
||||||
"fast")
|
"fast")
|
||||||
ionice -c 2 -- nice -n 1 -- make -j $((cpus*2))
|
[ -n "$2" ] && threads=$2 || threads=$((cpus*2))
|
||||||
|
ionice -c 2 -- nice -n 1 -- make -j $threads
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
ionice -c 3 -- nice -n 10 -- make -j $((cpus+1))
|
[ -n "$2" ] && threads=$2 || threads=$((cpus+1))
|
||||||
|
ionice -c 3 -- nice -n 10 -- make -j $threads
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
@ -468,13 +474,13 @@ case "$1" in
|
||||||
"build")
|
"build")
|
||||||
if [ "$2" = "help" ] || [ "$2" = "x" ]; then
|
if [ "$2" = "help" ] || [ "$2" = "x" ]; then
|
||||||
echo "This option compiles the firmware"
|
echo "This option compiles the firmware"
|
||||||
echo "Normaly the build uses lower IO and System priorities, "
|
echo "Normally the build uses lower IO and System priorities, "
|
||||||
echo "you can append \"fast\" option, to use normal user priorities"
|
echo "you can append \"fast\" option, to use normal user priorities"
|
||||||
echo
|
echo
|
||||||
echo "Usage: $0 $1 [fast|debug]"
|
echo "Usage: $0 $1 [fast|debug] [numthreads]"
|
||||||
echo
|
echo
|
||||||
else
|
else
|
||||||
build "$2"
|
build "$2" "$3"
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
"config")
|
"config")
|
||||||
|
|
Loading…
Reference in New Issue