gecko/dom/bindings/Makefile.in
Gregory Szorc d53d3b5e5e Bug 928195 - Part 4: Rewrite WebIDL build system integration; r=bz, r=glandium
WebIDL build system integration has been rewritten from the ground up.
Changes:

* GlobalGen.py, BindingGen.py, and ExampleGen.py have been removed in
  favor of mozwebidl.py.

* Static .webidl files are now processed directly in their original location
  and aren't copied to the object directory.

* Generated events <stem>.cpp files are now compiled into the unified
  sources. Previously, only the <stem>Binding.cpp files were compiled
  into unified sources.

* Exported .h files are now generated directly into their final location.
  Previously, they were generated into the local directory then
  installed in their final location.

* The list of globalgen-generated files now lives in Python and isn't
  duplicated in 3 places.

* The make dependencies are much simpler as a result of using a single
  command to perform all code generation. The auto-generated .pp file from
  code generation sets up all dependencies necessary to reinvoke code
  generation and Python takes care of dependency management.

--HG--
extra : rebase_source : e4918878274b22a412329c7cb18cc7138daf5dc6
2013-12-12 16:26:38 +09:00

86 lines
2.4 KiB
Makefile

# 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/.
abs_dist := $(abspath $(DIST))
webidl_base := $(topsrcdir)/dom/webidl
# Generated by moz.build
include webidlsrcs.mk
ifdef GNU_CC
OS_CXXFLAGS += -Wno-uninitialized
endif
# These come from webidlsrcs.mk.
# TODO Write directly into backend.mk.
CPPSRCS += $(globalgen_sources) $(unified_binding_cpp_files)
# Generated bindings reference *Binding.h, not mozilla/dom/*Binding.h. And,
# since we generate exported bindings directly to $(DIST)/include, we need
# to add that path to the search list.
#
# Ideally, binding generation uses the prefixed header file names.
# Bug 932092 tracks.
LOCAL_INCLUDES += -I$(DIST)/include/mozilla/dom
PYTHON_UNIT_TESTS += $(srcdir)/mozwebidlcodegen/test/test_mozwebidlcodegen.py
include $(topsrcdir)/config/rules.mk
# TODO This list should be emitted to a .pp file via
# GenerateCSS2PropertiesWebIDL.py.
css2properties_dependencies = \
$(topsrcdir)/layout/style/nsCSSPropList.h \
$(topsrcdir)/layout/style/nsCSSPropAliasList.h \
$(webidl_base)/CSS2Properties.webidl.in \
$(webidl_base)/CSS2PropertiesProps.h \
$(srcdir)/GenerateCSS2PropertiesWebIDL.py \
$(GLOBAL_DEPS) \
$(NULL)
CSS2Properties.webidl: $(css2properties_dependencies)
$(CPP) $(DEFINES) $(ACDEFINES) -I$(topsrcdir)/layout/style \
$(webidl_base)/CSS2PropertiesProps.h | \
PYTHONDONTWRITEBYTECODE=1 $(PYTHON) \
$(srcdir)/GenerateCSS2PropertiesWebIDL.py \
$(webidl_base)/CSS2Properties.webidl.in > $@
# Most of the logic for dependencies lives inside Python so it can be
# used by multiple build backends. We simply have rules to generate
# and include the .pp file.
#
# The generated .pp file contains all the important dependencies such as
# changes to .webidl or .py files should result in code generation being
# performed.
codegen_dependencies := \
$(nonstatic_webidl_files) \
$(GLOBAL_DEPS) \
$(NULL)
$(call include_deps,codegen.pp)
codegen.pp: $(codegen_dependencies)
$(call py_action,webidl,$(srcdir))
@$(TOUCH) $@
.PHONY: compiletests
compiletests:
$(call SUBMAKE,libs,test)
GARBAGE += \
codegen.pp \
codegen.json \
parser.out \
WebIDLGrammar.pkl \
$(wildcard *.h) \
$(wildcard *Binding.cpp) \
$(wildcard *Event.cpp) \
$(wildcard *-event.cpp) \
$(wildcard *.webidl) \
$(NULL)
DIST_GARBAGE += \
file-lists.json \
$(NULL)