PageRenderTime 39ms CodeModel.GetById 12ms RepoModel.GetById 0ms 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. LANGUAGE = java
  6. SCRIPTSUFFIX = _runme.java
  7. CPP_TEST_CASES = \
  8. java_constants \
  9. java_pragmas \
  10. java_throws \
  11. java_typemaps_proxy \
  12. java_typemaps_typewrapper
  13. include ../common.mk
  14. # Overridden variables here
  15. TOP = ../../..
  16. SWIGOPT = -I$(TOP)/$(TEST_SUITE) -package $*
  17. #Target prefix cannot be used on Windows
  18. #TARGETPREFIX = lib
  19. # Rules for the different types of tests
  20. %.cpptest:
  21. $(setup) \
  22. (cd $*; $(swig_and_compile_cpp); ); \
  23. $(run_testcase)
  24. %.ctest:
  25. $(setup) \
  26. (cd $*; $(swig_and_compile_c); ); \
  27. $(run_testcase)
  28. %.multicpptest:
  29. $(setup) \
  30. (cd $*; $(swig_and_compile_multi_cpp); ); \
  31. $(run_testcase)
  32. # Makes a directory for the testcase if it does not exist
  33. setup = \
  34. @if [ -f $(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then \
  35. echo "Checking testcase $* (with run test) under $(LANGUAGE)" ; \
  36. else \
  37. echo "Checking testcase $* under $(LANGUAGE)" ; \
  38. fi; \
  39. if [ ! -d $* ]; then \
  40. mkdir $*; \
  41. fi;
  42. # Compiles java files then runs the testcase. A testcase is only run if
  43. # a file is found which has _runme.java appended after the testcase name.
  44. # Note Java uses LD_LIBRARY_PATH under Unix and PATH under cygwin.
  45. run_testcase = \
  46. (cd $*; javac *.java; ); \
  47. if [ -f $*\_runme.java ]; then ( \
  48. javac $*\_runme.java; \
  49. env LD_LIBRARY_PATH="$*:$$LD_LIBRARY_PATH" PATH="$*:$$PATH" java $*\_runme;) \
  50. fi;
  51. # Clean: remove testcase directories
  52. %.clean:
  53. @if [ -d $* ]; then \
  54. rm -rf $*; \
  55. fi;
  56. clean:
  57. @rm -f *.class