summaryrefslogtreecommitdiff
path: root/bin/gen_kscope.sh
blob: d88140cc58f191be70437f1441c91e05347ac94e (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
26
27
28
29
30
31
32
33
34
#!/bin/bash
#
# Simple script to invoke 'make cscope' with different arguments

usage(){
	echo "Should be executed withing kernel source dir:"
	echo " gen_kscope.sh <args>"
	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