Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

28 lines (22 sloc) 0.534 kb
# -*- shell-script -*-
# how many cores do we have? Useful for "make -j${CORES} "
# start with a safe guess.
CORES=1
if [ -f /proc/cpuinfo ];
then
# http://www.howtogeek.com/howto/ubuntu/display-number-of-processors-on-linux/
CORES=`grep -c ^processor /proc/cpuinfo`
elif [ -x /usr/sbin/sysctl ];
then
# mac
CORES=`sysctl -n hw.ncpu`
elif [ -x /usr/bin/mpstat ];
then
# aix
CORES=`mpstat | sed -n 's%^.*lcpu=\([0-9]*\).*$%\1%p'`
fi
if [ "$CORES" -lt 1 ];
then
CORES=1
fi
alias makep="make -j${CORES}"
Jump to Line
Something went wrong with that request. Please try again.