##########################################################################
#   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:
#    10/04 originated by Dan Jones (danjones@us.ibm.com)
#
##########################################################################
TOPDIR		= ../..

LOG		= OpenSSL.run.log
SUB_DIRS	= tests

all:: subdirs
	mkdir -p ./bin
	ln -f openssl01 ./bin
	ln -f tests/destest ./bin
	ln -f tests/rsa_test ./bin
	ln -f tests/dsatest ./bin
	ln -f tests/dhtest ./bin
	ln -f tests/sha1test ./bin
	ln -f tests/randtest ./bin
	ln -f tests/rc4test ./bin
	ln -f tests/stunnel_rsa.sh ./bin
	ln -f tests/stunnel_dsa.sh ./bin
	ln -f tests/client ./bin
	ln -f tests/server ./bin
	ln -f tests/password_auth.sh ./bin
	ln -f tests/rsa_auth.sh ./bin
	ln -f tests/send_new_rsa_key.sh ./bin
	ln -f tests/rsa_login.sh ./bin
	ln -f tests/dsa_auth.sh ./bin
	ln -f tests/send_new_dsa_key.sh ./bin
	ln -f tests/dsa_login.sh ./bin
	ln -f tests/setup_accounts.sh ./bin
	ln -f tests/delete_accounts.sh ./bin
	ln -f tests/setup_date.sh ./bin
	ln -f tests/restore_date.sh ./bin
	chmod 755 ./bin/*
 
run:: all
	./install.sh -a
	./openssl01 &> $(LOG)
	echo "TEST PASSED = " `grep "PASS" $(LOG) | wc -l` ", FAILED = " `grep "FAIL" $(LOG) | wc -l` >> $(LOG)

rmlogs::
	rm -rf *run.log

clean:: subdirs
	rm -fr ./bin

include $(TOPDIR)/rules.mk


