File: Makefile.in

package info (click to toggle)
swig 3.0.2-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 34,980 kB
  • ctags: 16,742
  • sloc: cpp: 54,566; ansic: 26,563; java: 9,485; python: 7,204; cs: 6,106; makefile: 5,709; yacc: 5,571; sh: 4,988; ruby: 3,742; perl: 3,224; lisp: 1,825; php: 1,670; tcl: 968; ml: 747; xml: 115
file content (121 lines) | stat: -rw-r--r-- 3,170 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
#######################################################################
# Makefile for javascript test-suite
#######################################################################

LANGUAGE     = javascript
NODEGYP = @NODEGYP@
NODEJS = @NODEJS@
SCRIPTSUFFIX = _runme.js

srcdir       = @srcdir@
top_srcdir   = @top_srcdir@
top_builddir = @top_builddir@

SWIG  = $(top_builddir)/preinst_swig

ifneq (, $(ENGINE))
	JSENGINE=$(ENGINE)
else
	JSENGINE=node
endif

include $(srcdir)/../common.mk

_setup = \
	if [ -f $(SCRIPTDIR)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then	  \
	  echo "$(ACTION)ing $(LANGUAGE) ($(JSENGINE)) testcase $* (with run test)" ; \
	else								  \
	  echo "$(ACTION)ing $(LANGUAGE) ($(JSENGINE)) testcase $*" ;     \
	fi;

ifeq (node,$(JSENGINE))

  SWIGOPT += -v8 -DBUILDING_NODE_EXTENSION=1

  # shut up some warnings
  # contract macro has an empty 'else' at the end...
  aggregate.cpptest: GYP_CFLAGS = \"-Wno-empty-body\"
  contract.cpptest: GYP_CFLAGS = \"-Wno-empty-body\"

  # dunno... ignoring generously
  apply_signed_char.cpptest: GYP_CFLAGS = \"-Wno-ignored-qualifiers\"
  constant_pointers.cpptest: GYP_CFLAGS = \"-Wno-ignored-qualifiers\"
  enum_thorough.cpptest: GYP_CFLAGS = \"-Wno-ignored-qualifiers\"

	setup_node = \
		test -d $* || mkdir $*; \
		sed -e 's|$$testcase|$*|g; s|$$cflags|$(GYP_CFLAGS)|g; s|$$srcdir|$(srcdir)|g' \
			$(srcdir)/node_template/binding.gyp.in > $*/binding.gyp; \
		sed -e 's|$$testcase|$*|g;' \
			$(srcdir)/node_template/index.js.in > $*/index.js

	# Note: we need to use swig in C parse mode, but make node-gyp believe it is c++ (via file extension)
	swig_and_compile_c = \
		$(setup_node); \
		$(SWIG) -javascript $(SWIGOPT) -o $*_wrap.cxx $(srcdir)/../$*.i; \
		$(NODEGYP) --loglevel=silent --directory $* configure build 1>>/dev/null

	swig_and_compile_cpp = \
		$(setup_node); \
		$(SWIG) -c++ -javascript $(SWIGOPT) $(srcdir)/../$*.i; \
		$(NODEGYP) --loglevel=silent --directory $* configure build 1>>/dev/null

	run_testcase = \
		if [ -f $(srcdir)/$*$(SCRIPTSUFFIX) ]; then \
			env NODE_PATH=$$PWD:$(srcdir) $(NODEJS) $(srcdir)/$*$(SCRIPTSUFFIX); \
		fi


  %.ctest:
		$(_setup)
		$(swig_and_compile_c)
		$(run_testcase)

  %.cpptest:
		$(_setup)
		$(swig_and_compile_cpp)
		$(run_testcase)

  %.multicpptest:
		$(_setup)

else

  SWIGOPT += -$(JSENGINE)

	run_testcase = \
		if [ -f $(srcdir)/$*$(SCRIPTSUFFIX) ]; then \
		  $(RUNTOOL) $(top_builddir)/Tools/javascript/javascript -$(JSENGINE) $(srcdir)/$*$(SCRIPTSUFFIX); \
		fi

  %.ctest:
		$(_setup)
		+$(swig_and_compile_c)
		$(run_testcase)

  %.cpptest:
		$(_setup)
		+$(swig_and_compile_cpp)
		$(run_testcase)

  %.multicpptest:
		$(_setup)
		+$(swig_and_compile_multi_cpp)
		$(run_testcase)

endif


%.clean:
	@rm -rf $*
	@rm -f $*_wrap.* $*.so $*.o

clean:
	for ext in _wrap.cxx _wrap.o .so; do \
		rm -f clientdata_prop_a$${ext} clientdata_prop_b$${ext}; \
		rm -f imports_a$${ext} imports_b$${ext}; \
		rm -f import_stl_a$${ext} import_stl_b$${ext}; \
		rm -f mod_a$${ext} mod_b$${ext}; \
		rm -f multi_import_a$${ext} multi_import_b$${ext}; \
		rm -f packageoption_a$${ext} packageoption_b$${ext} packageoption_c$${ext}; \
	done