PageRenderTime 17ms CodeModel.GetById 1ms app.highlight 13ms RepoModel.GetById 1ms app.codeStats 0ms

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

#
Autoconf | 97 lines | 76 code | 16 blank | 5 comment | 12 complexity | 51e2453d8a22041354c14418b670ad48 MD5 | raw file
 1#######################################################################
 2# Makefile for Go test-suite
 3#######################################################################
 4
 5LANGUAGE	= go
 6GO		= @GO@
 7GOGCC		= @GOGCC@
 8GO1		= @GO1@
 9GOC		= @GOC@
10SCRIPTSUFFIX	= _runme.go
11
12GOCOMPILEARG = `if $(GOGCC) ; then echo -c -g; elif $(GO1) ; then echo tool $(GOC:c=g) ; fi`
13GOLD = $(GOC:c=l)
14GOTOOL = `if $(GO1) ; then echo go tool; fi`
15GOPACK = `if $(GO1) ; then echo go tool pack; else echo gopack; fi`
16
17GOOBJEXT = $(GOC:c=)
18
19SO = @SO@
20
21srcdir       = @srcdir@
22top_srcdir   = @top_srcdir@
23top_builddir = @top_builddir@
24
25include $(srcdir)/../common.mk
26
27.SUFFIXES: .cpptest .ctest .multicpptest
28
29# Rules for the different types of tests
30%.cpptest: 
31	$(setup)
32	+$(swig_and_compile_cpp)
33	$(run_testcase)
34
35%.ctest:
36	$(setup)
37	+$(swig_and_compile_c)
38	$(run_testcase)
39
40%.multicpptest: 
41	$(setup)
42	+$(swig_and_compile_multi_cpp)
43	$(run_multi_testcase)
44
45multi_import.multicpptest:
46	$(setup)
47	for f in multi_import_b multi_import_a; do \
48	  $(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile CXXSRCS="$(CXXSRCS)" \
49	  SWIG_LIB="$(SWIG_LIB)" SWIG="$(SWIG)" LIBS='$(LIBS)' \
50	  INCLUDES="$(INCLUDES)" SWIGOPT="$(SWIGOPT)" NOLINK=true \
51	  TARGET="$(TARGETPREFIX)$${f}$(TARGETSUFFIX)" INTERFACEDIR="$(INTERFACEDIR)" INTERFACE="$$f.i" \
52	  $(LANGUAGE)$(VARIANT)_cpp; \
53	done
54	$(run_multi_testcase)
55
56# Runs the testcase.
57run_testcase = \
58	if test -f $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX); then \
59	  $(COMPILETOOL) $(GO) $(GOCOMPILEARG) -I . $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) && \
60	  if $(GOGCC) ; then \
61	    $(COMPILETOOL) $(GO) -o $*_runme $(SCRIPTPREFIX)$*_runme.@OBJEXT@ $*.@OBJEXT@ $*$(SO); \
62	  else \
63	    $(COMPILETOOL) $(GOTOOL) $(GOLD) -L . -r $${GOROOT}/pkg/$${GOOS}_$${GOARCH}:. -o $*_runme $(SCRIPTPREFIX)$*_runme.$(GOOBJEXT); \
64	  fi && \
65	  env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH $(RUNTOOL) ./$*_runme; \
66	fi
67
68run_multi_testcase = \
69	if test -f $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX); then \
70	  $(COMPILETOOL) $(GO) $(GOCOMPILEARG) -I . $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) && \
71	  if $(GOGCC) ; then \
72	    files=`cat $(top_srcdir)/$(EXAMPLES)/$(TEST_SUITE)/$*.list`; \
73	    $(COMPILETOOL) $(GO) -o $*_runme $(SCRIPTPREFIX)$*_runme.@OBJEXT@ `for f in $$files; do echo $$f.@OBJEXT@ $$f$(SO); done`; \
74	  else \
75	    $(COMPILETOOL) $(GOTOOL) $(GOLD) -L . -r $${GOROOT}/pkg/$${GOOS}_$${GOARCH}:. -o $*_runme $(SCRIPTPREFIX)$*_runme.$(GOOBJEXT); \
76	  fi && \
77	  env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH $(RUNTOOL) ./$*_runme; \
78	fi
79
80%.clean:
81	@rm -f $*.go $*_gc.c $*_wrap.* $*_runme
82
83clean:
84	$(MAKE) -f $(top_builddir)/$(EXAMPLES)/Makefile go_clean
85	rm -f mod_a.go mod_b.go imports_a.go imports_b.go
86	rm -f clientdata_prop_a.go clientdata_prop_b.go
87	rm -f multi_import_a.go multi_import_b.go
88	rm -f packageoption_a.go packageoption_b.go packageoption_c.go
89
90cvsignore:
91	@echo '*_gc.c *_wrap.* *.so *.dll *.exp *.lib'
92	@echo Makefile
93	@echo mod_a.go mod_b.go imports_a.go imports_b.go
94	@echo clientdata_prop_a.go clientdata_prop_b.go
95	@echo multi_import_a.go multi_import_b.go
96	@echo packageoption_a.go packageoption_b.go packageoption_c.go
97	@for i in ${CPP_TEST_CASES} ${C_TEST_CASES}; do echo $$i.go; done