Skip to content

Commit d0bc1fb

Browse files
farmergregmichal42
authored andcommitted
coccicheck: add M= option to control which dir is processed
Examples: make coccicheck M=drivers/net/wireless/ make coccicheck SUBDIRS=drivers/net/wireless/ Version 2: fix patch file names when using M= tell coccinelle where the include files are Version 3: Add second include option to support out of tree development Fix error message Signed-off-by: Greg Dietsche <Gregory.Dietsche@cuw.edu> Acked-by: Julia Lawall <julia.lawall@lip6.fr> Signed-off-by: Michal Marek <mmarek@suse.cz>
1 parent ff894e3 commit d0bc1fb

1 file changed

Lines changed: 14 additions & 5 deletions

File tree

‎scripts/coccicheck‎

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,23 @@ if [ "$C" = "1" -o "$C" = "2" ]; then
99
# FLAGS="-ignore_unknown_options -very_quiet"
1010
# OPTIONS=$*
1111

12-
# Workaround for Coccinelle < 0.2.3
13-
FLAGS="-I $srctree/include -very_quiet"
14-
shift $(( $# - 1 ))
15-
OPTIONS=$1
12+
if [ "$KBUILD_EXTMOD" = "" ] ; then
13+
# Workaround for Coccinelle < 0.2.3
14+
FLAGS="-I $srctree/include -very_quiet"
15+
shift $(( $# - 1 ))
16+
OPTIONS=$1
17+
else
18+
echo M= is not currently supported when C=1 or C=2
19+
exit 1
20+
fi
1621
else
1722
ONLINE=0
1823
FLAGS="-very_quiet"
19-
OPTIONS="-dir $srctree"
24+
if [ "$KBUILD_EXTMOD" = "" ] ; then
25+
OPTIONS="-dir $srctree"
26+
else
27+
OPTIONS="-dir $KBUILD_EXTMOD -patch $srctree -I $srctree/include -I $KBUILD_EXTMOD/include"
28+
fi
2029
fi
2130

2231
if [ ! -x "$SPATCH" ]; then

0 commit comments

Comments
 (0)