summaryrefslogtreecommitdiffstats
path: root/scripts/coccicheck
diff options
context:
space:
mode:
authorGreg Dietsche <Gregory.Dietsche@cuw.edu>2011-11-05 20:59:43 -0500
committerMichal Marek <mmarek@suse.cz>2012-01-14 22:25:40 +0100
commitd0bc1fb4672b978b608400a5112249cdbc28f9ae (patch)
tree5570ade8bf0919055925fce7a01832e942e53d38 /scripts/coccicheck
parentff894e396b4d0b5383127c1bcb2cd3879946526e (diff)
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>
Diffstat (limited to 'scripts/coccicheck')
-rwxr-xr-xscripts/coccicheck19
1 files changed, 14 insertions, 5 deletions
diff --git a/scripts/coccicheck b/scripts/coccicheck
index 1bb1a1bd2da..3c2776466d8 100755
--- a/scripts/coccicheck
+++ b/scripts/coccicheck
@@ -9,14 +9,23 @@ if [ "$C" = "1" -o "$C" = "2" ]; then
# FLAGS="-ignore_unknown_options -very_quiet"
# OPTIONS=$*
-# Workaround for Coccinelle < 0.2.3
- FLAGS="-I $srctree/include -very_quiet"
- shift $(( $# - 1 ))
- OPTIONS=$1
+ if [ "$KBUILD_EXTMOD" = "" ] ; then
+ # Workaround for Coccinelle < 0.2.3
+ FLAGS="-I $srctree/include -very_quiet"
+ shift $(( $# - 1 ))
+ OPTIONS=$1
+ else
+ echo M= is not currently supported when C=1 or C=2
+ exit 1
+ fi
else
ONLINE=0
FLAGS="-very_quiet"
- OPTIONS="-dir $srctree"
+ if [ "$KBUILD_EXTMOD" = "" ] ; then
+ OPTIONS="-dir $srctree"
+ else
+ OPTIONS="-dir $KBUILD_EXTMOD -patch $srctree -I $srctree/include -I $KBUILD_EXTMOD/include"
+ fi
fi
if [ ! -x "$SPATCH" ]; then