#! /bin/sh
# 
# This script runs lint for the directory given as the argument.
# The full format is:
# rnlint toolsdirectory directorytoprocess 
#
# It is intended that this is called by linttools; it is not user-friendly.
#
# Get the library type:
#echo $2 
TOOLS="$1"
DIR="$2"
shift
if [ -r "$DIR/mansec" ]; then 
    OK=dummy
else
exit 0
fi

HASMAKE=`test -r $DIR/makefile`
if [ -r $DIR/makefile ]; then
    OK=dummy
else
    exit 0
fi

COMMTYPE=""
if [ -r "$DIR/comtype" ] ; then
    if [ "`cat $DIR/comtype`" = "p" ] ; then 
        COMMTYPE="-Dp4"
    fi
fi
# Execute the rest of the command line
echo "[$DIR] about to: lint $COMMTYPE"
( cd $DIR ; \
lint -huz $COMMTYPE -I$TOOLS *.c $TOOLS/lint/tools.ln | grep -v 'multiply declared' | grep -v 'warning: possible pointer alignment problem' )
