You need to sign in or sign up before continuing.
jmake 687 Bytes
Newer Older
Vitaly Lipatov's avatar
Vitaly Lipatov committed
1
#!/bin/bash
2 3 4 5

# load common functions, compatible with local and installed script
. `dirname $0`/../share/eterbuild/functions/common

6
if [ "$1" = "-h" ] || [ "$1" = "--help" ] ; then
7
	echo "jmake - make with ccache using and parallel build enabled"
8 9 10
	exit 0
fi

Vitaly Lipatov's avatar
Vitaly Lipatov committed
11
try_enable_ccache "$@"
12

13
# get number of available processors
14
[ -n "$NPROCS" ] || NPROCS=`/usr/bin/getconf _NPROCESSORS_ONLN`
15

16 17
# get rounded load average
LOADAVG=`cat /proc/loadavg | cut -f1 -d" " | sed -e "s/\..*//g"`
18 19 20 21

MAKEARG="-j$NPROCS"
# use only free CPUs
#[ "$(( $NPROCS - $LOADAVG ))" -gt 1 ] || MAKEARG=""
22

23
#make $MAKEARG "CC=$CC" "CXX=$CXX" "CPP=$CPP" "CXXCPP=$CXXCPP" $@
24
cd_to_realcwd
Vitaly Lipatov's avatar
Vitaly Lipatov committed
25
$NICE time -p make $MAKEARG "$@"