xref: /freebsd/contrib/byacc/test/run_lint.sh (revision 924226fba12cc9a228c73b956e1b7fa24c60b055)
1#!/bin/sh
2# $Id: run_lint.sh,v 1.3 2014/03/28 23:40:27 tom Exp $
3# vi:ts=4 sw=4:
4
5# run lint on each of the ".c" files in the test directory
6
7if test $# = 1
8then
9	PROG_DIR=`pwd`
10	TEST_DIR=$1
11else
12	PROG_DIR=..
13	TEST_DIR=.
14fi
15
16ifBTYACC=`fgrep -l 'define YYBTYACC' config.h > /dev/null; test $? != 0; echo $?`
17
18if test $ifBTYACC = 0; then
19	REF_DIR=${TEST_DIR}/yacc
20else
21	REF_DIR=${TEST_DIR}/btyacc
22fi
23
24echo '** '`date`
25for i in ${REF_DIR}/*.c
26do
27	make -f $PROG_DIR/makefile lint C_FILES=$i srcdir=$PROG_DIR
28done
29