#######################################################################
# $Header: /cvsroot/swig/SWIG/Examples/test-suite/python/Makefile.in,v 1.10 2004/07/10 16:36:19 wsfulton Exp $
# Makefile for python test-suite
#######################################################################

LANGUAGE     = python
SCRIPTSUFFIX = _runme.py
srcdir       = .
top_srcdir   = ../../..
top_builddir = ../../../

CPP_TEST_CASES += \
	argcargvtest \
	attributetest \
	complextest \
	director_stl \
	file_test \
	implicittest \
	inplaceadd \
	lib_std_vectora \
	lib_std_map \
	lib_std_wstring \
	primitive_types \
	std_containers \

#
# This test only works with modern C compilers
#
#C_TEST_CASES += \
#	complextest

include $(srcdir)/../common.mk

# Overridden variables here
LIBS       = -L. -l_$*_runtime

# Rules for the different types of tests
%.cpptest: 
	$(setup) \
	($(swig_and_compile_cpp); ) &&\
	$(run_testcase)

%.ctest:
	$(setup) \
	($(swig_and_compile_c); ) &&\
	$(run_testcase)

%.multicpptest: 
	$(setup) \
	($(swig_and_compile_multi_cpp); ) &&\
	$(run_testcase)

# Runs the testcase. A testcase is only run if
# a file is found which has _runme.py appended after the testcase name.
run_testcase = \
	if [ -f $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then (	  \
	  env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH PYTHONPATH=$(srcdir):$$PYTHONPATH python $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX);) \
	fi;

# Clean: remove the generated .py file
%.clean:
	@rm -f $*.py;

clean:
	$(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile python_clean

