PageRenderTime 29ms CodeModel.GetById 18ms app.highlight 7ms RepoModel.GetById 1ms app.codeStats 0ms

/trunk/Examples/test-suite/csharp/Makefile.in

#
Autoconf | 90 lines | 65 code | 13 blank | 12 comment | 9 complexity | e7e11ec8ac01bb7ff9c2a6ffabd3a7cb MD5 | raw file
 1#######################################################################
 2# Makefile for C# test-suite
 3#######################################################################
 4
 5LANGUAGE     = csharp
 6SCRIPTSUFFIX = _runme.cs
 7INTERPRETER  = @CSHARPCILINTERPRETER@
 8INTERPRETER_FLAGS   = @CSHARPCILINTERPRETER_FLAGS@
 9CSHARPPATHSEPARATOR = "@CSHARPPATHSEPARATOR@"
10CSHARPCYGPATH_W     = @CSHARPCYGPATH_W@
11srcdir       = @srcdir@
12top_srcdir   = ../@top_srcdir@
13top_builddir = ../@top_builddir@
14
15CPP_TEST_CASES = \
16	csharp_attributes \
17	csharp_exceptions \
18	csharp_features \
19	csharp_lib_arrays \
20	csharp_prepost \
21	csharp_typemaps \
22	enum_thorough_simple \
23	enum_thorough_typesafe \
24	exception_partial_info \
25	intermediary_classname \
26	li_boost_intrusive_ptr
27
28include $(srcdir)/../common.mk
29
30# Overridden variables here
31SWIGOPT += -namespace $*Namespace
32
33CSHARPFLAGSSPECIAL =
34
35# Custom tests - tests with additional commandline options
36intermediary_classname.cpptest: SWIGOPT += -dllimport intermediary_classname
37csharp_lib_arrays.cpptest: CSHARPFLAGSSPECIAL = -unsafe
38
39# Rules for the different types of tests
40%.cpptest: 
41	$(setup)
42	+(cd $* && $(swig_and_compile_cpp))
43	+$(run_testcase)
44
45%.ctest:
46	$(setup)
47	+(cd $* && $(swig_and_compile_c))
48	+$(run_testcase)
49
50%.multicpptest: 
51	$(setup)
52	+(cd $* && $(swig_and_compile_multi_cpp))
53	+$(run_testcase)
54
55# Makes a directory for the testcase if it does not exist
56setup = \
57	if [ -f $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then	  \
58	  echo "$(ACTION)ing testcase $* (with run test) under $(LANGUAGE)" ; \
59	else								  \
60	  echo "$(ACTION)ing testcase $* under $(LANGUAGE)" ;		  \
61	fi;								  \
62	if [ ! -d $* ]; then						  \
63	  mkdir $*;							  \
64	fi
65
66# Compiles C# files then runs the testcase. A testcase is only run if
67# a file is found which has _runme.cs appended after the testcase name.
68# Note C# uses LD_LIBRARY_PATH under Unix, PATH under Cygwin/Windows and SHLIB_PATH on HPUX.
69# DYLD_FALLBACK_LIBRARY_PATH is cleared for MacOSX.
70run_testcase = \
71	if [ -f $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then \
72	  $(MAKE) -f $*/$(top_builddir)/$(EXAMPLES)/Makefile \
73	  CSHARPFLAGS='-nologo -debug+ $(CSHARPFLAGSSPECIAL) -out:$*_runme.exe' \
74	  CSHARPSRCS='`$(CSHARPCYGPATH_W) $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX)` `find $* -name "*.cs" -exec $(CSHARPCYGPATH_W) "{}" \+`' csharp_compile && \
75	  env LD_LIBRARY_PATH="$*:$$LD_LIBRARY_PATH" PATH="$*:$$PATH" SHLIB_PATH="$*:$$SHLIB_PATH" DYLD_FALLBACK_LIBRARY_PATH= $(RUNTOOL) $(INTERPRETER) $(INTERPRETER_FLAGS) $*_runme.exe; \
76	else \
77	  cd $* && \
78	  $(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile \
79	  CSHARPFLAGS='-nologo -debug+ $(CSHARPFLAGSSPECIAL) -t:module -out:$*.netmodule' \
80	  CSHARPSRCS='`find . -name "*.cs" -exec $(CSHARPCYGPATH_W) "{}" \+`' csharp_compile; \
81	fi
82
83# Clean: remove testcase directories
84%.clean:
85	@if [ -d $* ]; then \
86	  rm -rf $*; \
87	fi
88
89clean:
90	@rm -f *.exe *.exe.mdb