PageRenderTime 32ms CodeModel.GetById 20ms app.highlight 8ms RepoModel.GetById 1ms app.codeStats 0ms

/tags/ttn-post-libtool-1-4-3-upgrade/SWIG/Examples/test-suite/java/Makefile

#
Makefile | 68 lines | 44 code | 11 blank | 13 comment | 2 complexity | 84cab75b58a66490c4c0c4292cbf2f4d MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
 1#######################################################################
 2# $Header$
 3# Makefile for java test-suite
 4#######################################################################
 5
 6LANGUAGE   = java
 7SCRIPTSUFFIX = _runme.java
 8
 9CPP_TEST_CASES = \
10	java_constants \
11	java_pragmas \
12	java_throws \
13	java_typemaps_proxy \
14	java_typemaps_typewrapper
15
16include ../common.mk
17
18# Overridden variables here
19TOP        = ../../..
20SWIGOPT    = -I$(TOP)/$(TEST_SUITE) -package $*
21#Target prefix cannot be used on Windows
22#TARGETPREFIX = lib
23
24# Rules for the different types of tests
25%.cpptest: 
26	$(setup) \
27	(cd $*; $(swig_and_compile_cpp); ); \
28	$(run_testcase)
29
30%.ctest:
31	$(setup) \
32	(cd $*; $(swig_and_compile_c); ); \
33	$(run_testcase)
34
35%.multicpptest: 
36	$(setup) \
37	(cd $*; $(swig_and_compile_multi_cpp); ); \
38	$(run_testcase)
39
40# Makes a directory for the testcase if it does not exist
41setup = \
42	@if [ -f $(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then		  \
43	  echo "Checking testcase $* (with run test) under $(LANGUAGE)" ; \
44	else								  \
45	  echo "Checking testcase $* under $(LANGUAGE)" ;		  \
46	fi;								  \
47	if [ ! -d $* ]; then						  \
48		mkdir $*;						  \
49	fi;
50
51# Compiles java files then runs the testcase. A testcase is only run if
52# a file is found which has _runme.java appended after the testcase name.
53# Note Java uses LD_LIBRARY_PATH under Unix and PATH under cygwin.
54run_testcase = \
55	(cd $*; javac *.java; ); \
56	if [ -f $*\_runme.java ]; then ( \
57	  javac $*\_runme.java; \
58	  env LD_LIBRARY_PATH="$*:$$LD_LIBRARY_PATH" PATH="$*:$$PATH" java $*\_runme;) \
59	fi;
60
61# Clean: remove testcase directories
62%.clean:
63	@if [ -d $* ]; then \
64		rm -rf $*; \
65	fi;
66
67clean:
68	@rm -f *.class