- Examples/Makefile.in rules use SRCDIR as the relative source directory - ./config.status replicates Examples/ source directory tree in build directory, and copies each Makefile to build directory, prefixed with a header which sets SRCDIR to source directory - Examples/test-suite/.../Makefile.in set SRCDIR from Autoconf-set srcdir - Examples/test-suite/errors/Makefile.in needs to filter out source directory from SWIG error messages - Lua: embedded interpreters are passed location of run-time test - Python: copy run-time scripts to build directory because of 2to3 conversion; import_packages example copies __init__.py from source directory; test-suite sets SCRIPTDIR to location of run-time tests - Javascript: binding.gyp renamed to binding.gyp.in so that $srcdir can be substituted with SRCDIR; removed './' from require() statements so that NODE_PATH can be used to point Node.js to build directory
64 lines
2.1 KiB
Makefile
64 lines
2.1 KiB
Makefile
# ----------------------------------------------------------------
|
|
# Compile a custom javascript interpreter
|
|
# ----------------------------------------------------------------
|
|
#
|
|
# Note:
|
|
# There is no common CLI Javascript interpreter.
|
|
# V8 comes with one 'd8' which however does not provide a means
|
|
# to load extensions. Therefore, by default we use nodejs as
|
|
# environment.
|
|
# For testing native v8 and jsc extensions we provide our own
|
|
# interpreter (see 'Tools/javascript').
|
|
#
|
|
# ----------------------------------------------------------------
|
|
all: javascript
|
|
|
|
CC = @CC@
|
|
# HACK: under OSX a g++ compiled interpreter is seg-faulting when loading module libraries
|
|
# with 'c++' it works... probably some missing flags?
|
|
JSCXX = @JSINTERPRETERCXX@
|
|
CFLAGS = @PLATCFLAGS@
|
|
CXXFLAGS = @BOOST_CPPFLAGS@ @PLATCXXFLAGS@
|
|
LINKFLAGS = @JSINTERPRETERLINKFLAGS@
|
|
|
|
ROOT_DIR = @ROOT_DIR@
|
|
JSINCLUDES = @JSCOREINC@ @JSV8INC@
|
|
JSDYNAMICLINKING = @JSCOREDYNAMICLINKING@ @JSV8DYNAMICLINKING@
|
|
JSLIBRARYPREFIX = @JSLIBRARYPREFIX@
|
|
JSSO =@JSSO@
|
|
JSLDSHARED = @JSLDSHARED@
|
|
JSCXXSHARED = @JSCXXSHARED@
|
|
JSV8ENABLED = @JSV8ENABLED@
|
|
JSCENABLED = @JSCENABLED@
|
|
|
|
srcdir = @srcdir@
|
|
|
|
# Regenerate Makefile if Makefile.in or config.status have changed.
|
|
Makefile: $(srcdir)/Makefile.in ../../config.status
|
|
cd ../.. && $(SHELL) ./config.status Tools/javascript/Makefile
|
|
|
|
# These settings are provided by 'configure' (see '/configure.in')
|
|
ifeq (1, $(JSV8ENABLED))
|
|
JS_INTERPRETER_SRC_V8 = v8_shell.cxx
|
|
JS_INTERPRETER_ENABLE_V8 = -DENABLE_V8
|
|
endif
|
|
|
|
ifeq (1, $(JSCENABLED))
|
|
JS_INTERPRETER_SRC_JSC = jsc_shell.cxx
|
|
JS_INTERPRETER_ENABLE_JSC = -DENABLE_JSC
|
|
endif
|
|
|
|
JS_INTERPRETER_DEFINES = $(JS_INTERPRETER_ENABLE_JSC) $(JS_INTERPRETER_ENABLE_V8)
|
|
JS_INTERPRETER_SRC = javascript.cxx js_shell.cxx $(JS_INTERPRETER_SRC_JSC) $(JS_INTERPRETER_SRC_V8)
|
|
|
|
JS_INTERPRETER_OBJS = $(JS_INTERPRETER_SRC:.cxx=.o)
|
|
|
|
%.o: $(srcdir)/%.cxx
|
|
$(JSCXX) $(JS_INTERPRETER_DEFINES) $(CXXFLAGS) $(JSINCLUDES) -o $@ -c $<
|
|
|
|
javascript: $(JS_INTERPRETER_OBJS)
|
|
$(JSCXX) $^ $(CXXFLAGS) -o javascript $(JSDYNAMICLINKING) $(LINKFLAGS)
|
|
|
|
clean:
|
|
rm -f *.o
|
|
rm -f javascript
|