#!/bin/bash # # Simple script to invoke 'make cscope' with different arguments usage(){ echo "Should be executed withing kernel source dir:" echo " gen_kscope.sh " echo "Args:" echo " -a: Ignore dirs: drivers sound tools net" echo " -c: Specify what to ignore within quotes" echo " Example: gen_kscope.sh -c \"mm fs\"" } CPUS=`lscpu -p=cpu|grep -v \#|wc -l` let JOBS=$CPUS*2 IGNORE_DIRS="" while getopts "ac:" opt; do case $opt in a) IGNORE_DIRS="drivers sound tools net" ;; c) # Ignore drivers IGNORE_DIRS="$OPTARG" ;; *) usage ;; esac done export IGNORE_DIRS echo "Ignoring: $IGNORE_DIRS" make -j$JOBS cscope