git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11928 626c5289-ae23-0410-ae9c-e8d60b6d4f22
88 lines
2.7 KiB
Makefile
88 lines
2.7 KiB
Makefile
#######################################################################
|
|
# Makefile for C# test-suite
|
|
#######################################################################
|
|
|
|
LANGUAGE = csharp
|
|
SCRIPTSUFFIX = _runme.cs
|
|
INTERPRETER = @CSHARPCILINTERPRETER@
|
|
CSHARPPATHSEPARATOR = "@CSHARPPATHSEPARATOR@"
|
|
CSHARPCYGPATH_W = @CSHARPCYGPATH_W@
|
|
srcdir = @srcdir@
|
|
top_srcdir = @top_srcdir@/..
|
|
top_builddir = @top_builddir@/..
|
|
|
|
CPP_TEST_CASES = \
|
|
csharp_attributes \
|
|
csharp_exceptions \
|
|
csharp_features \
|
|
csharp_lib_arrays \
|
|
csharp_prepost \
|
|
csharp_typemaps \
|
|
enum_thorough_simple \
|
|
enum_thorough_typesafe \
|
|
exception_partial_info \
|
|
intermediary_classname
|
|
|
|
include $(srcdir)/../common.mk
|
|
|
|
# Overridden variables here
|
|
SWIGOPT += -namespace $*Namespace
|
|
INTERFACEDIR = ../../
|
|
|
|
CSHARPFLAGSSPECIAL =
|
|
|
|
# Custom tests - tests with additional commandline options
|
|
intermediary_classname.cpptest: SWIGOPT += -dllimport intermediary_classname
|
|
csharp_lib_arrays.cpptest: CSHARPFLAGSSPECIAL = -unsafe
|
|
|
|
# Rules for the different types of tests
|
|
%.cpptest:
|
|
$(setup)
|
|
+(cd $* && $(swig_and_compile_cpp))
|
|
+$(run_testcase)
|
|
|
|
%.ctest:
|
|
$(setup)
|
|
+(cd $* && $(swig_and_compile_c))
|
|
+$(run_testcase)
|
|
|
|
%.multicpptest:
|
|
$(setup)
|
|
+(cd $* && $(swig_and_compile_multi_cpp))
|
|
+$(run_testcase)
|
|
|
|
# Makes a directory for the testcase if it does not exist
|
|
setup = \
|
|
if [ -f $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then \
|
|
echo "$(ACTION)ing testcase $* (with run test) under $(LANGUAGE)" ; \
|
|
else \
|
|
echo "$(ACTION)ing testcase $* under $(LANGUAGE)" ; \
|
|
fi; \
|
|
if [ ! -d $* ]; then \
|
|
mkdir $*; \
|
|
fi
|
|
|
|
# Compiles C# files then runs the testcase. A testcase is only run if
|
|
# a file is found which has _runme.cs appended after the testcase name.
|
|
# Note C# uses LD_LIBRARY_PATH under Unix, PATH under Cygwin/Windows and SHLIB_PATH on HPUX.
|
|
run_testcase = \
|
|
if [ -f $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then \
|
|
$(MAKE) -f $*/$(top_builddir)/$(EXAMPLES)/Makefile \
|
|
CSHARPFLAGS='-nologo $(CSHARPFLAGSSPECIAL) -out:$*_runme.exe' \
|
|
CSHARPSRCS='`$(CSHARPCYGPATH_W) $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX)` `find $* -name "*.cs" -exec $(CSHARPCYGPATH_W) "{}" \+`' csharp_compile && \
|
|
env LD_LIBRARY_PATH="$*:$$LD_LIBRARY_PATH" PATH="$*:$$PATH" SHLIB_PATH="$*:$$SHLIB_PATH" $(RUNTOOL) $(INTERPRETER) $*_runme.exe; \
|
|
else \
|
|
cd $* && \
|
|
$(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile \
|
|
CSHARPFLAGS='-nologo $(CSHARPFLAGSSPECIAL) -t:module -out:$*.netmodule' \
|
|
CSHARPSRCS='`find . -name "*.cs" -exec $(CSHARPCYGPATH_W) "{}" \+`' csharp_compile; \
|
|
fi
|
|
|
|
# Clean: remove testcase directories
|
|
%.clean:
|
|
@if [ -d $* ]; then \
|
|
rm -rf $*; \
|
|
fi
|
|
|
|
clean:
|
|
@rm -f *.exe *.exe.mdb
|