summaryrefslogtreecommitdiff
path: root/Makefile.sources.javascript
blob: 48cd1cff44c3d1ef2a6132ea6d1e5269e75995cb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#
# NetSurf javascript source file inclusion
#
# Included by Makefile.sources 
#

# ----------------------------------------------------------------------------
# JSAPI binding
# ----------------------------------------------------------------------------

S_JSAPI_BINDING:=

JSAPI_BINDING_htmldocument := javascript/jsapi/bindings/htmldocument.bnd

# 1: input file
# 2: output file
# 3: binding name
define convert_jsapi_binding

S_JSAPI_BINDING += $(2)

$(2): $(1)
	$(Q)nsgenbind -I javascript/jsapi/WebIDL/ -o $(2) $(1)

endef

# Javascript sources
ifeq ($(NETSURF_USE_JS),YES)

S_JSAPI = window.c navigator.c console.c htmlelement.c
#htmldocument.c

S_JAVASCRIPT += content.c jsapi.c $(addprefix jsapi/,$(S_JSAPI))

$(eval $(foreach V,$(filter JSAPI_BINDING_%,$(.VARIABLES)),$(call convert_jsapi_binding,$($(V)),$(OBJROOT)/$(patsubst JSAPI_BINDING_%,%,$(V)).c,$(patsubst JSAPI_BINDING_%,%,$(V))_jsapi)))


else
S_JAVASCRIPT += none.c
endif