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
|
||||
# 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)
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
SRCS = example.cxx
|
||||
|
||||
include ../js_example.mk
|
||||
include ../example.mk
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
SRCS =
|
||||
|
||||
include ../js_example.mk
|
||||
include ../example.mk
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
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.
|
||||
# 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))
|
||||
|
||||
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
|
||||
$(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:
|
||||
$(MAKE) -f $(EXAMPLES_TOP)/Makefile javascript_clean
|
||||
|
|
@ -1,3 +1,3 @@
|
|||
SRCS = example.cxx
|
||||
|
||||
include ../js_example.mk
|
||||
include ../example.mk
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
SRCS = example.cxx
|
||||
|
||||
include ../js_example.mk
|
||||
include ../example.mk
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
SRCS = example.cxx
|
||||
|
||||
include ../js_example.mk
|
||||
include ../example.mk
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
SRCS =
|
||||
|
||||
include ../js_example.mk
|
||||
include ../example.mk
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
SRCS =
|
||||
|
||||
include ../js_example.mk
|
||||
include ../example.mk
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
SRCS = example.cxx
|
||||
|
||||
include ../js_example.mk
|
||||
include ../example.mk
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
SRCS = example.cxx
|
||||
|
||||
include ../js_example.mk
|
||||
include ../example.mk
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
SRCS = example.cxx
|
||||
|
||||
include ../js_example.mk
|
||||
include ../example.mk
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
SRCS =
|
||||
|
||||
include ../js_example.mk
|
||||
include ../example.mk
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
SRCS = example.cxx
|
||||
|
||||
include ../js_example.mk
|
||||
include ../example.mk
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue