PageRenderTime 38ms CodeModel.GetById 12ms RepoModel.GetById 0ms app.codeStats 0ms

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

#
Autoconf | 83 lines | 62 code | 12 blank | 9 comment | 8 complexity | 30914bcc6b41ff401d98a0c7323fc15a MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
  1. #######################################################################
  2. # Makefile for ocaml test-suite
  3. #######################################################################
  4. LANGUAGE = ocaml
  5. OCAMLC = ocamlc
  6. VARIANT = _static
  7. SCRIPTSUFFIX = _runme.ml
  8. srcdir = @srcdir@
  9. top_srcdir = @top_srcdir@
  10. top_builddir = @top_builddir@
  11. C_TEST_CASES =
  12. run_testcase = \
  13. if [ -f $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) -a \
  14. -f $(top_srcdir)/Examples/test-suite/$*.list ] ; then \
  15. $(COMPILETOOL) $(OCAMLC) -c $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX); \
  16. $(COMPILETOOL) $(OCAMLC) swig.cmo -custom -g -cc '$(CXX)' -o runme `cat $(top_srcdir)/Examples/test-suite/$(*).list | sed -e 's/\(.*\)/\1_wrap.o \1.cmo/g'`&& $(RUNTOOL) ./runme; \
  17. elif [ -f $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then \
  18. $(COMPILETOOL) $(OCAMLC) -c $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX); \
  19. $(COMPILETOOL) $(OCAMLC) swig.cmo -custom -g -cc '$(CXX)' -o runme $(srcdir)/$(*).cmo $(srcdir)/$(*)_runme.cmo $(srcdir)/$(*)_wrap.o && \
  20. $(RUNTOOL) ./runme; \
  21. fi ;
  22. check_quant:
  23. cat /dev/null > testing
  24. cat /dev/null > success
  25. cat /dev/null > results
  26. $(MAKE) check
  27. echo "Failed:" >> results
  28. for element in `cat testing` ; do \
  29. if grep $$element success >/dev/null 2>/dev/null ; then \
  30. : ; \
  31. else \
  32. echo $$element >> results ; \
  33. fi ; \
  34. done
  35. echo "Success:" >> results
  36. cat success >> results
  37. include $(srcdir)/../common.mk
  38. # Overridden variables here
  39. # none!
  40. # Custom tests - tests with additional commandline options
  41. # none!
  42. # Rules for the different types of tests
  43. %.cpptest:
  44. echo $@ >> testing
  45. $(setup)
  46. +$(swig_and_compile_cpp)
  47. $(run_testcase)
  48. if [ -f $(@:%.cpptest=%_wrap.o) ] ; then \
  49. echo $@ >> success ; \
  50. fi
  51. %.ctest:
  52. echo $@ >> testing
  53. $(setup)
  54. +$(swig_and_compile_c)
  55. $(run_testcase)
  56. if [ -f $(@:%.ctest=%_wrap.o) ] ; then \
  57. echo $@ >> success ; \
  58. fi
  59. %.multicpptest:
  60. echo $@ >> testing
  61. +$(swig_and_compile_multi_cpp)
  62. $(setup)
  63. $(run_testcase)
  64. if [ -f $(@:%.multicpptest=%_runtime_wrap.o) ] ; then \
  65. echo $@ >> success ; \
  66. fi
  67. # Clean
  68. %.clean:
  69. @rm -f $*.ml $*.mli;
  70. clean:
  71. $(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile ocaml_clean