aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Examples/Makefile.in29
-rwxr-xr-xExamples/javascript/class/Makefile2
-rwxr-xr-xExamples/javascript/constant/Makefile2
-rwxr-xr-xExamples/javascript/enum/Makefile2
-rw-r--r--Examples/javascript/example.mk (renamed from Examples/javascript/js_example.mk)43
-rwxr-xr-xExamples/javascript/exception/Makefile2
-rwxr-xr-xExamples/javascript/functor/Makefile2
-rwxr-xr-xExamples/javascript/namespace/Makefile2
-rwxr-xr-xExamples/javascript/operator/Makefile2
-rwxr-xr-xExamples/javascript/overload/Makefile2
-rwxr-xr-xExamples/javascript/pointer/Makefile2
-rwxr-xr-xExamples/javascript/reference/Makefile2
-rwxr-xr-xExamples/javascript/simple/Makefile2
-rwxr-xr-xExamples/javascript/template/Makefile2
-rwxr-xr-xExamples/javascript/variables/Makefile2
15 files changed, 35 insertions, 63 deletions
diff --git a/Examples/Makefile.in b/Examples/Makefile.in
index dfd0ea9c9..01febf575 100644
--- a/Examples/Makefile.in
+++ b/Examples/Makefile.in
@@ -597,7 +597,6 @@ java_clean:
# There is a common makefile, 'Examples/javascript/js_example.mk' to simplify
# create a configuration for a new example.
-
ROOT_DIR = @ROOT_DIR@
JSINCLUDES = @JSCOREINC@ @JSV8INC@
JSDYNAMICLINKING = @JSCOREDYNAMICLINKING@ @JSV8DYNAMICLINKING@
@@ -621,29 +620,25 @@ javascript_build: $(SRCS)
$(CC) -c $(CCSHARED) $(CFLAGS) $(ISRCS) $(SRCS) $(INCLUDES) $(JSINCLUDES)
$(LDSHARED) $(CFLAGS) $(OBJS) $(IOBJS) $(JSDYNAMICLINKING) $(LIBS) -o $(LIBPREFIX)$(TARGET)$(SO)
-javascript_build_cpp:: $(SRCS)
+javascript_build_cpp: $(SRCS)
+ifeq (node,$(JSENGINE))
+ $(NODEGYP) --loglevel=silent configure build 1>>/dev/null
+else
$(CXX) -c $(CCSHARED) $(CFLAGS) $(ICXXSRCS) $(SRCS) $(CXXSRCS) $(INCLUDES) $(JSINCLUDES)
$(CXXSHARED) $(CFLAGS) $(OBJS) $(IOBJS) $(JSDYNAMICLINKING) $(LIBS) $(CPP_DLLIBS) -o $(LIBPREFIX)$(TARGET)$(SO)
-javascript_build_node: $(SRCS)
- $(NODEGYP) --loglevel=silent configure build 1>>/dev/null
+endif
# These targets are used by the test-suite:
-ifeq (jsc, $(ENGINE))
-
javascript: $(SRCS) javascript_custom_interpreter
$(SWIG) -javascript $(SWIGOPT) $(INTERFACEPATH)
+ifeq (jsc, $(ENGINE))
$(CC) -c $(CCSHARED) $(CFLAGS) $(ISRCS) $(SRCS) $(INCLUDES) $(JSINCLUDES)
$(LDSHARED) $(CFLAGS) $(OBJS) $(IOBJS) $(JSDYNAMICLINKING) $(LIBS) -o $(LIBPREFIX)$(TARGET)$(SO)
-
else # (v8 | node) # v8 and node must be compiled as c++
-
-javascript: $(SRCS) javascript_custom_interpreter
- $(SWIG) -javascript $(SWIGOPT) $(INTERFACEPATH)
$(CXX) -c $(CCSHARED) $(CFLAGS) $(ISRCS) $(SRCS) $(CXXSRCS) $(INCLUDES) $(JSINCLUDES)
$(CXXSHARED) $(CFLAGS) $(OBJS) $(IOBJS) $(JSDYNAMICLINKING) $(LIBS) $(CPP_DLLIBS) -o $(LIBPREFIX)$(TARGET)$(SO)
-
endif
javascript_cpp: $(SRCS) javascript_custom_interpreter
@@ -658,11 +653,13 @@ javascript_cpp: $(SRCS) javascript_custom_interpreter
javascript_custom_interpreter:
(cd $(ROOT_DIR)/Tools/javascript && $(MAKE) JSENGINE='$(JSENGINE)')
+ifeq (node,$(JSENGINE))
+javascript_run:
+ $(RUNTOOL) $(NODEJS) $(RUNME).js $(RUNPIPE)
+else
javascript_run: javascript_custom_interpreter
- $(RUNTOOL) $(ROOT_DIR)/Tools/javascript/javascript -$(JSENGINE) -L $(TARGET) runme.js $(RUNPIPE)
-
-javascript_run_node:
- $(RUNTOOL) $(NODEJS) runme.js $(RUNPIPE)
+ $(RUNTOOL) $(ROOT_DIR)/Tools/javascript/javascript -$(JSENGINE) -L $(TARGET) $(RUNME).js $(RUNPIPE)
+endif
# -----------------------------------------------------------------
# Version display
@@ -698,7 +695,7 @@ endif
javascript_clean:
rm -rf build
- rm -f *_wrap* runme
+ rm -f *_wrap* $(RUNME)
rm -f core @EXTRA_CLEAN@
rm -f *.@OBJEXT@ *@JSSO@ *.$(SO)
(cd $(ROOT_DIR)/Tools/javascript && $(MAKE) -s clean)
diff --git a/Examples/javascript/class/Makefile b/Examples/javascript/class/Makefile
index b0934786a..31846faae 100755
--- a/Examples/javascript/class/Makefile
+++ b/Examples/javascript/class/Makefile
@@ -1,3 +1,3 @@
SRCS = example.cxx
-include ../js_example.mk
+include ../example.mk
diff --git a/Examples/javascript/constant/Makefile b/Examples/javascript/constant/Makefile
index a2570636e..ea04c7df8 100755
--- a/Examples/javascript/constant/Makefile
+++ b/Examples/javascript/constant/Makefile
@@ -1,3 +1,3 @@
SRCS =
-include ../js_example.mk
+include ../example.mk
diff --git a/Examples/javascript/enum/Makefile b/Examples/javascript/enum/Makefile
index b0934786a..31846faae 100755
--- a/Examples/javascript/enum/Makefile
+++ b/Examples/javascript/enum/Makefile
@@ -1,3 +1,3 @@
SRCS = example.cxx
-include ../js_example.mk
+include ../example.mk
diff --git a/Examples/javascript/js_example.mk b/Examples/javascript/example.mk
index 6cb6eb113..274eff1a3 100644
--- a/Examples/javascript/js_example.mk
+++ b/Examples/javascript/example.mk
@@ -1,14 +1,5 @@
# Note: as a convention an example must be in a child directory of this.
# These paths are relative to such an example directory
-EXAMPLES_TOP=../..
-SWIG_TOP=../../..
-
-SWIG = $(SWIG_TOP)/preinst-swig
-
-# TODO: we could only set these only if not yet set...
-JS_SCRIPT = runme.js
-TARGET = example
-INTERFACE = example.i
ifneq (, $(ENGINE))
JSENGINE=$(ENGINE)
@@ -16,37 +7,21 @@ else
JSENGINE=node
endif
+EXAMPLES_TOP=../..
+SWIG_TOP=../../..
+SWIG = $(SWIG_TOP)/preinst-swig
+TARGET = example
+INTERFACE = example.i
SWIGOPT=-$(JSENGINE)
-ifeq (node,$(JSENGINE))
+check: build
+ $(MAKE) -f $(EXAMPLES_TOP)/Makefile JSENGINE='$(JSENGINE)' TARGET='$(TARGET)' javascript_run
-build: wrapper
+build:
$(MAKE) -f $(EXAMPLES_TOP)/Makefile CXXSRCS='$(SRCS)' SWIG='$(SWIG)' \
- SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' JSENGINE='$(JSENGINE)' javascript_build_node
-
-else
-
-build: wrapper
+ SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' javascript_wrapper_cpp
$(MAKE) -f $(EXAMPLES_TOP)/Makefile CXXSRCS='$(SRCS)' SWIG='$(SWIG)' \
SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' JSENGINE='$(JSENGINE)' javascript_build_cpp
-endif
-
-wrapper:
- $(MAKE) -f $(EXAMPLES_TOP)/Makefile CXXSRCS='$(SRCS)' SWIG='$(SWIG)' \
- SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' javascript_wrapper_cpp
-
-ifeq (node,$(JSENGINE))
-
-check: build
- $(MAKE) -f $(EXAMPLES_TOP)/Makefile JSENGINE='$(JSENGINE)' javascript_run_node
-
-else
-
-check: build
- $(MAKE) -f $(EXAMPLES_TOP)/Makefile JSENGINE='$(JSENGINE)' TARGET='$(TARGET)' javascript_run
-
-endif
-
clean:
$(MAKE) -f $(EXAMPLES_TOP)/Makefile javascript_clean
diff --git a/Examples/javascript/exception/Makefile b/Examples/javascript/exception/Makefile
index b0934786a..31846faae 100755
--- a/Examples/javascript/exception/Makefile
+++ b/Examples/javascript/exception/Makefile
@@ -1,3 +1,3 @@
SRCS = example.cxx
-include ../js_example.mk
+include ../example.mk
diff --git a/Examples/javascript/functor/Makefile b/Examples/javascript/functor/Makefile
index b0934786a..31846faae 100755
--- a/Examples/javascript/functor/Makefile
+++ b/Examples/javascript/functor/Makefile
@@ -1,3 +1,3 @@
SRCS = example.cxx
-include ../js_example.mk
+include ../example.mk
diff --git a/Examples/javascript/namespace/Makefile b/Examples/javascript/namespace/Makefile
index b0934786a..31846faae 100755
--- a/Examples/javascript/namespace/Makefile
+++ b/Examples/javascript/namespace/Makefile
@@ -1,3 +1,3 @@
SRCS = example.cxx
-include ../js_example.mk
+include ../example.mk
diff --git a/Examples/javascript/operator/Makefile b/Examples/javascript/operator/Makefile
index a2570636e..ea04c7df8 100755
--- a/Examples/javascript/operator/Makefile
+++ b/Examples/javascript/operator/Makefile
@@ -1,3 +1,3 @@
SRCS =
-include ../js_example.mk
+include ../example.mk
diff --git a/Examples/javascript/overload/Makefile b/Examples/javascript/overload/Makefile
index a2570636e..ea04c7df8 100755
--- a/Examples/javascript/overload/Makefile
+++ b/Examples/javascript/overload/Makefile
@@ -1,3 +1,3 @@
SRCS =
-include ../js_example.mk
+include ../example.mk
diff --git a/Examples/javascript/pointer/Makefile b/Examples/javascript/pointer/Makefile
index b0934786a..31846faae 100755
--- a/Examples/javascript/pointer/Makefile
+++ b/Examples/javascript/pointer/Makefile
@@ -1,3 +1,3 @@
SRCS = example.cxx
-include ../js_example.mk
+include ../example.mk
diff --git a/Examples/javascript/reference/Makefile b/Examples/javascript/reference/Makefile
index b0934786a..31846faae 100755
--- a/Examples/javascript/reference/Makefile
+++ b/Examples/javascript/reference/Makefile
@@ -1,3 +1,3 @@
SRCS = example.cxx
-include ../js_example.mk
+include ../example.mk
diff --git a/Examples/javascript/simple/Makefile b/Examples/javascript/simple/Makefile
index b0934786a..31846faae 100755
--- a/Examples/javascript/simple/Makefile
+++ b/Examples/javascript/simple/Makefile
@@ -1,3 +1,3 @@
SRCS = example.cxx
-include ../js_example.mk
+include ../example.mk
diff --git a/Examples/javascript/template/Makefile b/Examples/javascript/template/Makefile
index a2570636e..ea04c7df8 100755
--- a/Examples/javascript/template/Makefile
+++ b/Examples/javascript/template/Makefile
@@ -1,3 +1,3 @@
SRCS =
-include ../js_example.mk
+include ../example.mk
diff --git a/Examples/javascript/variables/Makefile b/Examples/javascript/variables/Makefile
index b0934786a..31846faae 100755
--- a/Examples/javascript/variables/Makefile
+++ b/Examples/javascript/variables/Makefile
@@ -1,3 +1,3 @@
SRCS = example.cxx
-include ../js_example.mk
+include ../example.mk