## $Id: Makefile-files,v 1.13 2006/01/04 17:28:42 ensc Exp $		--*- makefile -*--

## Copyright (C) 2003 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
##  
## 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; version 2 of the License.
##  
## 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.

src_testsuite_check_active_PRGS =	src/testsuite/vunify-functest \
					src/testsuite/chcontext-test \
					src/testsuite/chbind-test

src_testsuite_check_passive_PRGS =	src/testsuite/rpm-fake-test

if ENSC_HAVE_C99_COMPILER
if ENSC_HAVE_BEECRYPT
src_testsuite_check_passive_PRGS +=	src/testsuite/hashcalc		\
					src/testsuite/hashcalc-plain
endif
endif

check_PROGRAMS +=			$(src_testsuite_check_passive_PRGS) \
					$(src_testsuite_check_active_PRGS)

if ENSC_HAVE_C99_COMPILER
src_testsuite_check_src_C99_SCRPTS =	src/testsuite/vunify-test.sh
if ENSC_HAVE_BEECRYPT
src_testsuite_check_src_C99_SCRPTS +=	src/testsuite/hashcalc-plain.sh		\
					src/testsuite/hashcalc.sh
endif
else
src_testsuite_check_src_C99_SCRPTS =
endif

src_testsuite_check_src_SCRPTS =	$(src_testsuite_check_src_C99_SCRPTS)
src_testsuite_check_gen_SCRPTS =

check_SCRIPTS +=			$(src_testsuite_check_src_SCRPTS) \
					$(src_testsuite_check_gen_SCRPTS)

TESTS +=				$(src_testsuite_check_active_PRGS) \
					$(src_testsuite_check_src_SCRPTS) \
					$(src_testsuite_check_gen_SCRPTS)

EXTRA_DIST +=				$(src_testsuite_check_src_SCRPTS) \
					src/testsuite/vunify-test.sh \
					src/testsuite/hashcalc.sh \
					src/testsuite/hashcalc-plain.sh \
					src/testsuite/vwait-test.sh

src_testsuite_rpm_fake_test_SOURCES =	src/testsuite/rpm-fake-test.c

src_testsuite_vunify_functest_SOURCES =	src/testsuite/vunify-functest.c
src_testsuite_vunify_functest_LDADD =	$(LIBINTERNAL)
src_testsuite_vunify_functest_CPPFLAGS=	$(AM_CPPFLAGS) $(src_testsuite_CPPFLAGS)


src_testsuite_chcontext_test_SOURCES =	src/testsuite/chcontext-test.c
src_testsuite_chcontext_test_LDADD =	lib/libvserver.la $(LIBINTERNAL)


src_testsuite_chbind_test_SOURCES =	src/testsuite/chbind-test.c
src_testsuite_chbind_test_LDADD =	lib/libvserver.la

src_testsuite_hashcalc_SOURCES =	src/testsuite/hashcalc.c
src_testsuite_hashcalc_plain_SOURCES =	src/testsuite/hashcalc-plain.c
if ENSC_CAN_BEECRYPT_WITH_DIETLIBC
src_testsuite_hashcalc_LDADD =		$(LIBINTERNAL) $(LIBENSCVECTOR) -lbeecrypt $(VSERVER_LDADDS)
src_testsuite_hashcalc_LDFLAGS =	$(VSERVER_LDFLGS)

src_testsuite_hashcalc_plain_LDADD =	$(LIBINTERNAL) $(LIBENSCVECTOR) -lbeecrypt $(VSERVER_LDADDS)
src_testsuite_hashcalc_plain_LDFLAGS =	$(VSERVER_LDFLGS)
else
src_testsuite_hashcalc_LDADD =		$(LIBINTERNAL_GLIBC) $(LIBENSCVECTOR_GLIBC) $(LIBVSERVER_GLIBC) -lbeecrypt
src_testsuite_hashcalc_LDFLAGS =

src_testsuite_hashcalc_plain_LDADD =	$(LIBINTERNAL_GLIBC) $(LIBENSCVECTOR_GLIBC) $(LIBVSERVER_GLIBC) -lbeecrypt
src_testsuite_hashcalc_plain_LDFLAGS =
endif

src_testsuite_CPPFLAGS =		-I $(top_srcdir)/src -D ENSC_TESTSUITE


clean-local:		clean-testsuite

clean-testsuite:
			rm -rf src/testsuite/.libs src/testsuite/_libs
