##########################################################################
#   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=\
	objreuse-brk \
	objreuse-ftruncate \
	objreuse-lseek \
	objreuse-shm \
	objreuse-msg \
	objreuse-sem \
	objreuse-mmap

all:: $(EXE)

run:: all
	-for i in $(EXE); do ./$$i &> ./$$i.$(LOG); done
	-for i in $(EXE); 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)

include $(TOPDIR)/rules.mk
