#! /bin/sh
# 
# This script builds the lint header for the directory given as the argument.
# The full format is:
# mklint toolsdirectory directorytoprocess
#
# It is intended that this is called by buildlnt; it is not user-friendly.
#
#echo $2
TOOLS="$1"
DIR="$2"
if [ -r "$DIR/comtype" ]; then 
EXT=`cat $DIR/comtype`
else
exit 0
fi
HASMAKE=`test -r $DIR/makefile`
if [ -r $DIR/makefile ]; then
    OK=dummy
else
    exit 0
fi

LINTHEAD=$TOOLS/lint/blinth
# Because sh doesn't discard patterns that don't match any file name,
# we do that here
FILE=`echo $DIR/*.[ch]`
if [ "$FILE" = "$DIR/*.[ch]" ]; then
    # did not expand the name
    OK=dummy
else
    $LINTHEAD $DIR/*.[ch] 
fi
