##########################################################################
#   Copyright (C) International Business Machines  Corp., 2003
#
#   This program is free software;  you can redistribute it and/or modify
#   it under the terms of the GNU General Public License as published by
#   the Free Software Foundation; either version 2 of the License, or
#   (at your option) any later version.
#
#   This program is distributed in the hope that it will be useful,
#   but WITHOUT ANY WARRANTY;  without even the implied warranty of
#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
#   the GNU General Public License for more details.
#
#   You should have received a copy of the GNU General Public License
#   along with this program;  if not, write to the Free Software
#   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
#
#
#  FILE   : Makefile
#
#  PURPOSE: The default "all" target uses the gcc compiler to compile all
#           test files in the current directory.
#
#           The "clean" target removes all files the end in ".o" (object
#           files).
#
#
#  HISTORY:
#    06/04 originated by Dustin Kirkland (k1rkland@us.ibm.com
#
##########################################################################

TOPDIR=../..
LOG=run.log
CC=gcc 
EXE=checkaccess
MODULE_DIR="/lib/modules/`uname -r`"
TESTS=modules.conf01 \
	modules.conf02 \
	hosts01 \
	init.d01 \
	sysconfig01 \
	ld.so.conf01 \
	ssh04

all:: $(EXE)

run:: all
	./$(EXE) $(MODULE_DIR) &> modules.conf01.$(LOG)
	./$(EXE) /etc/modules.conf &> modules.conf02.$(LOG)
	./$(EXE) /etc/hosts &> hosts01.$(LOG)
	./$(EXE) /etc/init.d &> init.d01.$(LOG)
	./$(EXE) /etc/sysconfig &> sysconfig01.$(LOG)
	./ld.so.conf01 &> ld.so.conf01.$(LOG)  
	./ssh04 &> ssh04.$(LOG)
	-for i in $(TESTS); do echo "TEST PASSED = " `grep "PASS" $$i.$(LOG) | wc -l` ", FAILED = " `grep "FAIL" $$i.$(LOG) | wc -l` >> $$i.$(LOG); done

rmlogs::
	rm -rf *run.log

clean::
	rm -rf $(EXE)

