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