2012-10-24 22:00:24 +04:00
|
|
|
#
|
|
|
|
# NetSurf javascript source file inclusion
|
|
|
|
#
|
|
|
|
# Included by Makefile.sources
|
|
|
|
#
|
|
|
|
|
|
|
|
# ----------------------------------------------------------------------------
|
|
|
|
# JSAPI binding
|
|
|
|
# ----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
S_JSAPI_BINDING:=
|
2012-11-04 20:57:41 +04:00
|
|
|
D_JSAPI_BINDING:=
|
2012-10-24 22:00:24 +04:00
|
|
|
|
2012-11-03 02:37:57 +04:00
|
|
|
JSAPI_BINDING_htmldocument := javascript/jsapi/htmldocument.bnd
|
|
|
|
JSAPI_BINDING_htmlelement := javascript/jsapi/htmlelement.bnd
|
|
|
|
JSAPI_BINDING_window := javascript/jsapi/window.bnd
|
|
|
|
JSAPI_BINDING_navigator := javascript/jsapi/navigator.bnd
|
|
|
|
JSAPI_BINDING_console := javascript/jsapi/console.bnd
|
|
|
|
JSAPI_BINDING_location := javascript/jsapi/location.bnd
|
2012-11-04 01:37:06 +04:00
|
|
|
JSAPI_BINDING_htmlcollection := javascript/jsapi/htmlcollection.bnd
|
|
|
|
JSAPI_BINDING_nodelist := javascript/jsapi/nodelist.bnd
|
2012-11-07 22:52:30 +04:00
|
|
|
JSAPI_BINDING_text := javascript/jsapi/text.bnd
|
2013-01-02 21:19:32 +04:00
|
|
|
JSAPI_BINDING_comment := javascript/jsapi/comment.bnd
|
2012-11-14 06:11:01 +04:00
|
|
|
JSAPI_BINDING_node := javascript/jsapi/node.bnd
|
2012-11-28 22:07:36 +04:00
|
|
|
JSAPI_BINDING_event := javascript/jsapi/event.bnd
|
2012-10-24 22:00:24 +04:00
|
|
|
|
2012-12-20 21:00:06 +04:00
|
|
|
# 1: input binding file
|
|
|
|
# 2: source output file
|
|
|
|
# 3: header output file
|
|
|
|
# 4: binding name
|
2012-10-24 22:00:24 +04:00
|
|
|
define convert_jsapi_binding
|
|
|
|
|
|
|
|
S_JSAPI_BINDING += $(2)
|
2012-11-04 20:57:41 +04:00
|
|
|
D_JSAPI_BINDING += $(patsubst %.c,%.d,$(2))
|
2012-10-24 22:00:24 +04:00
|
|
|
|
2012-11-04 21:04:43 +04:00
|
|
|
$(2): $(1) $(OBJROOT)/created
|
2012-10-30 17:49:02 +04:00
|
|
|
$$(VQ)echo " GENBIND: $(1)"
|
2013-06-03 18:16:38 +04:00
|
|
|
$(Q)nsgenbind -g -I javascript/WebIDL -d $(patsubst %.c,%.d,$(2)) -h $(3) -o $(2) $(1)
|
2012-12-20 21:00:06 +04:00
|
|
|
|
|
|
|
$(3): $(2)
|
2012-10-24 22:00:24 +04:00
|
|
|
|
|
|
|
endef
|
|
|
|
|
|
|
|
# Javascript sources
|
|
|
|
ifeq ($(NETSURF_USE_JS),YES)
|
2012-11-03 03:03:20 +04:00
|
|
|
WANT_JS_SOURCE := YES
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(NETSURF_USE_MOZJS),YES)
|
|
|
|
WANT_JS_SOURCE := YES
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(WANT_JS_SOURCE),YES)
|
2012-10-24 22:00:24 +04:00
|
|
|
|
2012-11-04 20:57:41 +04:00
|
|
|
S_JSAPI :=
|
2012-10-24 22:00:24 +04:00
|
|
|
|
2014-08-26 02:58:56 +04:00
|
|
|
S_JAVASCRIPT += content.c jsapi.c fetcher.c $(addprefix jsapi/,$(S_JSAPI))
|
2012-10-24 22:00:24 +04:00
|
|
|
|
2012-12-20 21:00:06 +04:00
|
|
|
$(eval $(foreach V,$(filter JSAPI_BINDING_%,$(.VARIABLES)),$(call convert_jsapi_binding,$($(V)),$(OBJROOT)/$(patsubst JSAPI_BINDING_%,%,$(V)).c,$(OBJROOT)/$(patsubst JSAPI_BINDING_%,%,$(V)).h,$(patsubst JSAPI_BINDING_%,%,$(V))_jsapi)))
|
2012-10-24 22:00:24 +04:00
|
|
|
|
2015-08-09 14:27:13 +03:00
|
|
|
ifeq ($(filter $(MAKECMDGOALS),clean test coverage),)
|
|
|
|
-include $(D_JSAPI_BINDING)
|
|
|
|
endif
|
|
|
|
|
|
|
|
else
|
|
|
|
ifeq ($(NETSURF_USE_DUKTAPE),YES)
|
|
|
|
|
|
|
|
javascript/dukky.c: $(OBJROOT)/duktape/binding.h
|
|
|
|
|
|
|
|
BINDINGS := $(wildcard javascript/duktape/*.bnd)
|
|
|
|
|
|
|
|
$(OBJROOT)/duktape/binding.h $(OBJROOT)/duktape/Makefile: javascript/duktape/netsurf.bnd $(BINDINGS)
|
|
|
|
$(Q)mkdir -p $(OBJROOT)/duktape
|
|
|
|
$(VQ)echo " GENBIND: $<"
|
|
|
|
$(Q)nsgenbind -I javascript/WebIDL $< $(OBJROOT)/duktape
|
|
|
|
|
|
|
|
ifeq ($(filter $(MAKECMDGOALS),clean test coverage),)
|
|
|
|
-include $(OBJROOT)/duktape/Makefile
|
|
|
|
endif
|
|
|
|
|
|
|
|
S_JSAPI_BINDING:=$(addprefix $(OBJROOT)/duktape/,$(NSGENBIND_SOURCES))
|
|
|
|
|
|
|
|
$(S_JSAPI_BINDING): $(BINDINGS)
|
|
|
|
|
|
|
|
S_JAVASCRIPT += dukky.c content.c fetcher.c duktape/duktape.c
|
|
|
|
|
2015-08-12 11:43:34 +03:00
|
|
|
CFLAGS += -DDUK_OPT_HAVE_CUSTOM_H
|
2012-10-24 22:00:24 +04:00
|
|
|
else
|
2014-08-26 02:58:56 +04:00
|
|
|
S_JAVASCRIPT += none.c fetcher.c
|
2012-10-24 22:00:24 +04:00
|
|
|
endif
|
2015-08-09 14:27:13 +03:00
|
|
|
endif
|
2013-03-11 21:50:12 +04:00
|
|
|
|
2015-08-09 14:27:13 +03:00
|
|
|
S_JAVASCRIPT := $(addprefix javascript/,$(S_JAVASCRIPT)) $(S_JSAPI_BINDING)
|