author Bobby Holley <>
Thu, 26 Jan 2012 17:18:43 +0100
changeset 85148 fdee219a75502a61e28f8d2990ec4d91385e4dbd
parent 85147 62e78467654014cce6d4e71913d6199483f0f864
child 85158 7ed92841def7b73f5eb6f740327755269d5100e3
permissions -rw-r--r--
Initial work on abstract method generation. Nothing hooked up yet.

# This Source Code Form is subject to the terms of the Mozilla Public
# # License, v. 2.0. If a copy of the MPL was not distributed with this file,
# # You can obtain one at

DEPTH            = ../..
topsrcdir        = @top_srcdir@
srcdir           = @srcdir@
VPATH            = @srcdir@

MODULE           = dom
LIBRARY_NAME     = dombindings_s

include $(topsrcdir)/config/

include $(topsrcdir)/dom/webidl/

BINDING_HEADER_FILES = $(subst .webidl,Binding.h,$(WEBIDL_FILES))
BINDING_CPP_FILES = $(subst .webidl,Binding.cpp,$(WEBIDL_FILES))


bindingsIncludePath := mozilla/dom/bindings

EXPORTS_NAMESPACES = $(bindingsIncludePath)

EXPORTS_$(bindingsIncludePath) = \
  DOMJSClass.h \
  Utils.h \

include $(topsrcdir)/config/

$(BINDING_CPP_FILES): %Binding.cpp: \
                      Bindings.conf \
                      PrototypeList.h \
	$(PYTHON) $(topsrcdir)/config/ -I$(topsrcdir)/other-licenses/ply -I$(srcdir)/parser \
		$(srcdir)/ $(srcdir)/Bindings.conf $*Binding $(WEBIDL_BASE)/$*.webidl

# The global phase generates PrototypeList.h, which is used in the per-file
# bindings phase. We need to re-run the global phase whenever any of the
# webIDL files change in order to keep PrototypeList.h up to date. But if
# the list itself doesn't change, we don't need to rebuild all of the
# bindings (we just need to rebuild the bindings for the modified interfaces).
# So the global phase checks to see if the new PrototypeList.h it creates is
# different from the old one. If it's not different, the file isn't modified.
# This does the trick for the bindings (the consumers of PrototypeList.h).
# However, if they depend on it directly, make will keep running the global
# phase, because its dependencies have changed yet its target is (seemingly)
# out of date.
# We solve this problem by using a dummy file (.GlobalPhaseIndicator) for the
# dependencies, and generating PrototypeList.h as a side effect. We're
# essentially lying to make here, which could get us in trouble with build
# parallelism. To avoid this, we do the global phase during the |export| make
# phase, so that it's guaranteed to happen first even with parallelism.
export:: .GlobalPhaseIndicator
	$(INSTALL) $(IFLAGS1) PrototypeList.h $(DIST)/include/$(bindingsIncludePath)

  PrototypeList.h \
  ParserResults.pkl \
  .GlobalPhaseIndicator \
.GlobalPhaseIndicator: \
                       $(addprefix $(WEBIDL_BASE)/, $(WEBIDL_FILES))
	$(PYTHON_PATH) -I$(topsrcdir)/other-licenses/ply -I$(srcdir)/parser \
    $(srcdir)/ $(srcdir)/Bindings.conf $(WEBIDL_BASE) $(WEBIDL_FILES)
	touch .GlobalPhaseIndicator

  parser.out \

LOCAL_INCLUDES += -I$(topsrcdir)/js/xpconnect/src