Javascript example Makefiles more consistent with other languages
This commit is contained in:
parent
a5e91f26a1
commit
dbf80cbaa5
15 changed files with 36 additions and 64 deletions
|
|
@ -597,7 +597,6 @@ java_clean:
|
||||||
# There is a common makefile, 'Examples/javascript/js_example.mk' to simplify
|
# There is a common makefile, 'Examples/javascript/js_example.mk' to simplify
|
||||||
# create a configuration for a new example.
|
# create a configuration for a new example.
|
||||||
|
|
||||||
|
|
||||||
ROOT_DIR = @ROOT_DIR@
|
ROOT_DIR = @ROOT_DIR@
|
||||||
JSINCLUDES = @JSCOREINC@ @JSV8INC@
|
JSINCLUDES = @JSCOREINC@ @JSV8INC@
|
||||||
JSDYNAMICLINKING = @JSCOREDYNAMICLINKING@ @JSV8DYNAMICLINKING@
|
JSDYNAMICLINKING = @JSCOREDYNAMICLINKING@ @JSV8DYNAMICLINKING@
|
||||||
|
|
@ -621,29 +620,25 @@ javascript_build: $(SRCS)
|
||||||
$(CC) -c $(CCSHARED) $(CFLAGS) $(ISRCS) $(SRCS) $(INCLUDES) $(JSINCLUDES)
|
$(CC) -c $(CCSHARED) $(CFLAGS) $(ISRCS) $(SRCS) $(INCLUDES) $(JSINCLUDES)
|
||||||
$(LDSHARED) $(CFLAGS) $(OBJS) $(IOBJS) $(JSDYNAMICLINKING) $(LIBS) -o $(LIBPREFIX)$(TARGET)$(SO)
|
$(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)
|
$(CXX) -c $(CCSHARED) $(CFLAGS) $(ICXXSRCS) $(SRCS) $(CXXSRCS) $(INCLUDES) $(JSINCLUDES)
|
||||||
$(CXXSHARED) $(CFLAGS) $(OBJS) $(IOBJS) $(JSDYNAMICLINKING) $(LIBS) $(CPP_DLLIBS) -o $(LIBPREFIX)$(TARGET)$(SO)
|
$(CXXSHARED) $(CFLAGS) $(OBJS) $(IOBJS) $(JSDYNAMICLINKING) $(LIBS) $(CPP_DLLIBS) -o $(LIBPREFIX)$(TARGET)$(SO)
|
||||||
|
|
||||||
javascript_build_node: $(SRCS)
|
endif
|
||||||
$(NODEGYP) --loglevel=silent configure build 1>>/dev/null
|
|
||||||
|
|
||||||
# These targets are used by the test-suite:
|
# These targets are used by the test-suite:
|
||||||
|
|
||||||
ifeq (jsc, $(ENGINE))
|
|
||||||
|
|
||||||
javascript: $(SRCS) javascript_custom_interpreter
|
javascript: $(SRCS) javascript_custom_interpreter
|
||||||
$(SWIG) -javascript $(SWIGOPT) $(INTERFACEPATH)
|
$(SWIG) -javascript $(SWIGOPT) $(INTERFACEPATH)
|
||||||
|
ifeq (jsc, $(ENGINE))
|
||||||
$(CC) -c $(CCSHARED) $(CFLAGS) $(ISRCS) $(SRCS) $(INCLUDES) $(JSINCLUDES)
|
$(CC) -c $(CCSHARED) $(CFLAGS) $(ISRCS) $(SRCS) $(INCLUDES) $(JSINCLUDES)
|
||||||
$(LDSHARED) $(CFLAGS) $(OBJS) $(IOBJS) $(JSDYNAMICLINKING) $(LIBS) -o $(LIBPREFIX)$(TARGET)$(SO)
|
$(LDSHARED) $(CFLAGS) $(OBJS) $(IOBJS) $(JSDYNAMICLINKING) $(LIBS) -o $(LIBPREFIX)$(TARGET)$(SO)
|
||||||
|
|
||||||
else # (v8 | node) # v8 and node must be compiled as c++
|
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)
|
$(CXX) -c $(CCSHARED) $(CFLAGS) $(ISRCS) $(SRCS) $(CXXSRCS) $(INCLUDES) $(JSINCLUDES)
|
||||||
$(CXXSHARED) $(CFLAGS) $(OBJS) $(IOBJS) $(JSDYNAMICLINKING) $(LIBS) $(CPP_DLLIBS) -o $(LIBPREFIX)$(TARGET)$(SO)
|
$(CXXSHARED) $(CFLAGS) $(OBJS) $(IOBJS) $(JSDYNAMICLINKING) $(LIBS) $(CPP_DLLIBS) -o $(LIBPREFIX)$(TARGET)$(SO)
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
javascript_cpp: $(SRCS) javascript_custom_interpreter
|
javascript_cpp: $(SRCS) javascript_custom_interpreter
|
||||||
|
|
@ -658,11 +653,13 @@ javascript_cpp: $(SRCS) javascript_custom_interpreter
|
||||||
javascript_custom_interpreter:
|
javascript_custom_interpreter:
|
||||||
(cd $(ROOT_DIR)/Tools/javascript && $(MAKE) JSENGINE='$(JSENGINE)')
|
(cd $(ROOT_DIR)/Tools/javascript && $(MAKE) JSENGINE='$(JSENGINE)')
|
||||||
|
|
||||||
|
ifeq (node,$(JSENGINE))
|
||||||
|
javascript_run:
|
||||||
|
$(RUNTOOL) $(NODEJS) $(RUNME).js $(RUNPIPE)
|
||||||
|
else
|
||||||
javascript_run: javascript_custom_interpreter
|
javascript_run: javascript_custom_interpreter
|
||||||
$(RUNTOOL) $(ROOT_DIR)/Tools/javascript/javascript -$(JSENGINE) -L $(TARGET) runme.js $(RUNPIPE)
|
$(RUNTOOL) $(ROOT_DIR)/Tools/javascript/javascript -$(JSENGINE) -L $(TARGET) $(RUNME).js $(RUNPIPE)
|
||||||
|
endif
|
||||||
javascript_run_node:
|
|
||||||
$(RUNTOOL) $(NODEJS) runme.js $(RUNPIPE)
|
|
||||||
|
|
||||||
# -----------------------------------------------------------------
|
# -----------------------------------------------------------------
|
||||||
# Version display
|
# Version display
|
||||||
|
|
@ -698,7 +695,7 @@ endif
|
||||||
|
|
||||||
javascript_clean:
|
javascript_clean:
|
||||||
rm -rf build
|
rm -rf build
|
||||||
rm -f *_wrap* runme
|
rm -f *_wrap* $(RUNME)
|
||||||
rm -f core @EXTRA_CLEAN@
|
rm -f core @EXTRA_CLEAN@
|
||||||
rm -f *.@OBJEXT@ *@JSSO@ *.$(SO)
|
rm -f *.@OBJEXT@ *@JSSO@ *.$(SO)
|
||||||
(cd $(ROOT_DIR)/Tools/javascript && $(MAKE) -s clean)
|
(cd $(ROOT_DIR)/Tools/javascript && $(MAKE) -s clean)
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,3 @@
|
||||||
SRCS = example.cxx
|
SRCS = example.cxx
|
||||||
|
|
||||||
include ../js_example.mk
|
include ../example.mk
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,3 @@
|
||||||
SRCS =
|
SRCS =
|
||||||
|
|
||||||
include ../js_example.mk
|
include ../example.mk
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,3 @@
|
||||||
SRCS = example.cxx
|
SRCS = example.cxx
|
||||||
|
|
||||||
include ../js_example.mk
|
include ../example.mk
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,5 @@
|
||||||
# Note: as a convention an example must be in a child directory of this.
|
# Note: as a convention an example must be in a child directory of this.
|
||||||
# These paths are relative to such an example directory
|
# 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))
|
ifneq (, $(ENGINE))
|
||||||
JSENGINE=$(ENGINE)
|
JSENGINE=$(ENGINE)
|
||||||
|
|
@ -16,37 +7,21 @@ else
|
||||||
JSENGINE=node
|
JSENGINE=node
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
EXAMPLES_TOP=../..
|
||||||
|
SWIG_TOP=../../..
|
||||||
|
SWIG = $(SWIG_TOP)/preinst-swig
|
||||||
|
TARGET = example
|
||||||
|
INTERFACE = example.i
|
||||||
SWIGOPT=-$(JSENGINE)
|
SWIGOPT=-$(JSENGINE)
|
||||||
|
|
||||||
ifeq (node,$(JSENGINE))
|
|
||||||
|
|
||||||
build: wrapper
|
|
||||||
$(MAKE) -f $(EXAMPLES_TOP)/Makefile CXXSRCS='$(SRCS)' SWIG='$(SWIG)' \
|
|
||||||
SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' JSENGINE='$(JSENGINE)' javascript_build_node
|
|
||||||
|
|
||||||
else
|
|
||||||
|
|
||||||
build: wrapper
|
|
||||||
$(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
|
check: build
|
||||||
$(MAKE) -f $(EXAMPLES_TOP)/Makefile JSENGINE='$(JSENGINE)' TARGET='$(TARGET)' javascript_run
|
$(MAKE) -f $(EXAMPLES_TOP)/Makefile JSENGINE='$(JSENGINE)' TARGET='$(TARGET)' javascript_run
|
||||||
|
|
||||||
endif
|
build:
|
||||||
|
$(MAKE) -f $(EXAMPLES_TOP)/Makefile CXXSRCS='$(SRCS)' SWIG='$(SWIG)' \
|
||||||
|
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
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
$(MAKE) -f $(EXAMPLES_TOP)/Makefile javascript_clean
|
$(MAKE) -f $(EXAMPLES_TOP)/Makefile javascript_clean
|
||||||
|
|
@ -1,3 +1,3 @@
|
||||||
SRCS = example.cxx
|
SRCS = example.cxx
|
||||||
|
|
||||||
include ../js_example.mk
|
include ../example.mk
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,3 @@
|
||||||
SRCS = example.cxx
|
SRCS = example.cxx
|
||||||
|
|
||||||
include ../js_example.mk
|
include ../example.mk
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,3 @@
|
||||||
SRCS = example.cxx
|
SRCS = example.cxx
|
||||||
|
|
||||||
include ../js_example.mk
|
include ../example.mk
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,3 @@
|
||||||
SRCS =
|
SRCS =
|
||||||
|
|
||||||
include ../js_example.mk
|
include ../example.mk
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,3 @@
|
||||||
SRCS =
|
SRCS =
|
||||||
|
|
||||||
include ../js_example.mk
|
include ../example.mk
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,3 @@
|
||||||
SRCS = example.cxx
|
SRCS = example.cxx
|
||||||
|
|
||||||
include ../js_example.mk
|
include ../example.mk
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,3 @@
|
||||||
SRCS = example.cxx
|
SRCS = example.cxx
|
||||||
|
|
||||||
include ../js_example.mk
|
include ../example.mk
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,3 @@
|
||||||
SRCS = example.cxx
|
SRCS = example.cxx
|
||||||
|
|
||||||
include ../js_example.mk
|
include ../example.mk
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,3 @@
|
||||||
SRCS =
|
SRCS =
|
||||||
|
|
||||||
include ../js_example.mk
|
include ../example.mk
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,3 @@
|
||||||
SRCS = example.cxx
|
SRCS = example.cxx
|
||||||
|
|
||||||
include ../js_example.mk
|
include ../example.mk
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue