dom/bindings/Makefile.in
author Bobby Holley <bobbyholley@gmail.com>
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 http://mozilla.org/MPL/2.0/.

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

MODULE           = dom
LIBRARY_NAME     = dombindings_s
LIBXUL_LIBRARY   = 1
FORCE_STATIC_LIB = 1

include $(topsrcdir)/config/config.mk

include $(topsrcdir)/dom/webidl/WebIDL.mk

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

CPPSRCS = \
  $(BINDING_CPP_FILES) \
  $(NULL)

bindingsIncludePath := mozilla/dom/bindings

EXPORTS_NAMESPACES = $(bindingsIncludePath)

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

include $(topsrcdir)/config/rules.mk

$(BINDING_CPP_FILES): %Binding.cpp: BindingGen.py \
                      Bindings.conf \
                      PrototypeList.h \
                      Codegen.py \
                      $(WEBIDL_BASE)/%.webidl
	$(PYTHON) $(topsrcdir)/config/pythonpath.py -I$(topsrcdir)/other-licenses/ply -I$(srcdir)/parser \
		$(srcdir)/BindingGen.py $(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)

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

GARBAGE += \
  $(GLOBAL_PHASE_TARGETS) \
  $(BINDING_HEADER_FILES) \
  $(BINDING_CPP_FILES) \
  webidlyacc.py \
  parser.out \
  $(NULL)

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