PageRenderTime 50ms CodeModel.GetById 19ms RepoModel.GetById 0ms app.codeStats 0ms

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

#
Autoconf | 80 lines | 57 code | 14 blank | 9 comment | 12 complexity | 2d28c8851cf9b3372d1b01c80cc5730d MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
  1. #######################################################################
  2. # Makefile for D test-suite
  3. #######################################################################
  4. LANGUAGE = d
  5. srcdir = @srcdir@
  6. top_srcdir = ../@top_srcdir@
  7. top_builddir = ../@top_builddir@
  8. ifeq (2,$(D_VERSION))
  9. VERSIONSUFFIX = .2
  10. else
  11. VERSIONSUFFIX = .1
  12. endif
  13. TESTSUFFIX = _runme$(VERSIONSUFFIX).d
  14. CPP_TEST_CASES = \
  15. d_nativepointers \
  16. exception_partial_info
  17. include $(srcdir)/../common.mk
  18. # Override some variables from common.mk:
  19. TARGETSUFFIX = _wrap
  20. SWIGOPT+=-splitproxy -package $*
  21. # Rules for the different types of tests
  22. %.cpptest:
  23. $(setup)
  24. +(cd $*$(VERSIONSUFFIX) && $(swig_and_compile_cpp))
  25. +$(run_testcase)
  26. %.ctest:
  27. $(setup)
  28. +(cd $*$(VERSIONSUFFIX) && $(swig_and_compile_c))
  29. +$(run_testcase)
  30. %.multicpptest:
  31. $(setup)
  32. +(cd $*$(VERSIONSUFFIX) && $(swig_and_compile_multi_cpp))
  33. +$(run_testcase)
  34. # Makes a directory for the testcase if it does not exist
  35. setup = \
  36. if [ -f $(srcdir)/$(TESTPREFIX)$*$(TESTSUFFIX) ]; then \
  37. echo "$(ACTION)ing testcase $* (with run test) under $(LANGUAGE)" ; \
  38. else \
  39. echo "$(ACTION)ing testcase $* under $(LANGUAGE)" ; \
  40. fi; \
  41. if [ ! -d $*$(VERSIONSUFFIX) ]; then \
  42. mkdir $*$(VERSIONSUFFIX); \
  43. fi; \
  44. if [ ! -d $*$(VERSIONSUFFIX)/$* ]; then \
  45. mkdir $*$(VERSIONSUFFIX)/$*; \
  46. fi
  47. # Compiles D files then runs the testcase. A testcase is only run if
  48. # a file is found which has _runme.d appended after the testcase name.
  49. run_testcase = \
  50. if [ -f $(srcdir)/$(TESTPREFIX)$*$(TESTSUFFIX) ]; then \
  51. cd $*$(VERSIONSUFFIX) && \
  52. $(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile \
  53. DFLAGS='-of$*_runme' \
  54. DSRCS='../$(srcdir)/$(TESTPREFIX)$*$(TESTSUFFIX) `find $* -name *.d`' d_compile && \
  55. env LD_LIBRARY_PATH=".:$$LD_LIBRARY_PATH" $(RUNTOOL) ./$*_runme; \
  56. else \
  57. cd $*$(VERSIONSUFFIX) && \
  58. $(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile \
  59. DFLAGS='-c' \
  60. DSRCS='`find $* -name *.d`' d_compile && cd .. ; \
  61. fi
  62. # Clean: remove testcase directories
  63. %.clean:
  64. @if [ -d $*$(VERSIONSUFFIX) ]; then \
  65. rm -rf $*$(VERSIONSUFFIX); \
  66. fi