mk: allow renaming of build directories
[dpdk.git] / buildtools / check-experimental-syms.sh
index 7d21de3..7d1f3a5 100755 (executable)
@@ -5,6 +5,12 @@
 MAPFILE=$1
 OBJFILE=$2
 
+# added check for "make -C test/" usage
+if [ ! -e $MAPFILE ] || [ ! -f $OBJFILE ]
+then
+       exit 0
+fi
+
 if [ -d $MAPFILE ]
 then
        exit 0
@@ -16,15 +22,17 @@ for i in `awk 'BEGIN {found=0}
                /.*;/ {if (found == 1) print $1}' $MAPFILE`
 do
        SYM=`echo $i | sed -e"s/;//"`
-       objdump -t $OBJFILE | grep -q "\.text.*$SYM"
+       objdump -t $OBJFILE | grep -q "\.text.*$SYM$"
        IN_TEXT=$?
-       objdump -t $OBJFILE | grep -q "\.text\.experimental.*$SYM"
+       objdump -t $OBJFILE | grep -q "\.text\.experimental.*$SYM$"
        IN_EXP=$?
        if [ $IN_TEXT -eq 0 -a $IN_EXP -ne 0 ]
        then
-               echo "$SYM is not flagged as experimental"
-               echo "but is listed in version map"
-               echo "Please add __rte_experimental to the definition of $SYM"
+               cat >&2 <<- END_OF_MESSAGE
+               $SYM is not flagged as experimental
+               but is listed in version map
+               Please add __rte_experimental to the definition of $SYM
+               END_OF_MESSAGE
                exit 1
        fi
 done