2012-03-30 21:42:20 -07:00
|
|
|
# This Source Code Form is subject to the terms of the Mozilla Public
|
2012-04-06 11:06:52 -07:00
|
|
|
# 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/.
|
2012-03-30 21:42:20 -07:00
|
|
|
|
|
|
|
# Need this to find all our DOM source files.
|
|
|
|
include $(topsrcdir)/dom/dom-config.mk
|
|
|
|
|
2013-09-05 08:20:26 -07:00
|
|
|
webidl_base = $(topsrcdir)/dom/webidl
|
|
|
|
# Generated by moz.build
|
|
|
|
include webidlsrcs.mk
|
2012-03-30 21:42:20 -07:00
|
|
|
|
2012-05-02 21:35:38 -07:00
|
|
|
binding_include_path := mozilla/dom
|
2013-09-10 11:27:39 -07:00
|
|
|
webidl_files += $(generated_events_webidl_files)
|
2013-07-12 07:35:53 -07:00
|
|
|
all_webidl_files = $(webidl_files) $(generated_webidl_files) $(preprocessed_webidl_files)
|
2013-09-10 11:27:39 -07:00
|
|
|
|
2012-05-23 09:44:48 -07:00
|
|
|
# Set exported_binding_headers before adding the test IDL to the mix
|
|
|
|
exported_binding_headers := $(subst .webidl,Binding.h,$(all_webidl_files))
|
2013-09-10 11:27:39 -07:00
|
|
|
exported_generated_events_headers := $(subst .webidl,.h,$(generated_events_webidl_files))
|
|
|
|
|
2012-05-23 09:44:48 -07:00
|
|
|
# Set linked_binding_cpp_files before adding the test IDL to the mix
|
|
|
|
linked_binding_cpp_files := $(subst .webidl,Binding.cpp,$(all_webidl_files))
|
2013-09-10 11:27:39 -07:00
|
|
|
linked_generated_events_cpp_files := $(subst .webidl,.cpp,$(generated_events_webidl_files))
|
2012-05-23 09:44:48 -07:00
|
|
|
|
2013-09-25 21:05:00 -07:00
|
|
|
all_webidl_files += $(test_webidl_files) $(preprocessed_test_webidl_files)
|
2012-05-23 09:44:48 -07:00
|
|
|
|
2013-09-16 03:06:15 -07:00
|
|
|
generated_header_files := $(subst .webidl,Binding.h,$(all_webidl_files)) $(exported_generated_events_headers)
|
|
|
|
generated_cpp_files := $(subst .webidl,Binding.cpp,$(all_webidl_files)) $(linked_generated_events_cpp_files)
|
2012-03-30 21:42:20 -07:00
|
|
|
|
2013-05-09 10:05:33 -07:00
|
|
|
# We want to be able to only regenerate the .cpp and .h files that really need
|
|
|
|
# to change when a .webidl file changes. We do this by making the
|
|
|
|
# binding_dependency_trackers targets have dependencies on the right .webidl
|
|
|
|
# files via generated .pp files, having a .BindingGen target that depends on the
|
|
|
|
# binding_dependency_trackers and which has all the generated binding .h/.cpp
|
|
|
|
# depending on it, and then in the make commands for that target being able to
|
|
|
|
# check which exact binding_dependency_trackers changed.
|
|
|
|
binding_dependency_trackers := $(subst .webidl,Binding,$(all_webidl_files))
|
|
|
|
|
2012-03-30 21:42:20 -07:00
|
|
|
globalgen_targets := \
|
2013-08-22 22:17:09 -07:00
|
|
|
GeneratedAtomList.h \
|
2012-03-30 21:42:20 -07:00
|
|
|
PrototypeList.h \
|
2012-05-02 21:35:38 -07:00
|
|
|
RegisterBindings.h \
|
|
|
|
RegisterBindings.cpp \
|
2012-05-18 14:25:47 -07:00
|
|
|
UnionTypes.h \
|
2012-11-09 07:59:33 -08:00
|
|
|
UnionTypes.cpp \
|
2012-05-18 14:25:47 -07:00
|
|
|
UnionConversions.h \
|
2012-03-30 21:42:20 -07:00
|
|
|
$(NULL)
|
|
|
|
|
2013-05-09 10:05:33 -07:00
|
|
|
# Nasty hack: when the test/Makefile.in invokes us to do codegen, it
|
|
|
|
# uses a target of
|
|
|
|
# "export TestExampleInterface-example TestExampleProxyInterface-example".
|
|
|
|
# We don't actually need to load our .o.pp files in that case, so just
|
|
|
|
# pretend like we have no CPPSRCS if that's the target. It makes the
|
|
|
|
# test cycle much faster, which is why we're doing it.
|
|
|
|
#
|
|
|
|
# XXXbz We could try to cheat even more and only include our CPPSRCS
|
|
|
|
# when $(MAKECMDGOALS) contains libs, so that we can skip loading all
|
|
|
|
# those .o.pp when trying to make a single .cpp file too, but that
|
|
|
|
# would break |make FooBinding.o(bj)|. Ah, well.
|
|
|
|
ifneq (export TestExampleInterface-example TestExampleProxyInterface-example,$(MAKECMDGOALS))
|
2012-03-30 21:42:20 -07:00
|
|
|
CPPSRCS = \
|
2013-09-23 10:17:41 -07:00
|
|
|
$(unified_binding_cpp_files) \
|
2013-09-10 11:27:39 -07:00
|
|
|
$(linked_generated_events_cpp_files) \
|
2012-03-30 21:42:20 -07:00
|
|
|
$(filter %.cpp, $(globalgen_targets)) \
|
2012-05-02 21:35:38 -07:00
|
|
|
BindingUtils.cpp \
|
2013-01-28 05:34:30 -08:00
|
|
|
CallbackInterface.cpp \
|
2013-01-28 05:34:29 -08:00
|
|
|
CallbackObject.cpp \
|
2012-05-22 06:46:20 -07:00
|
|
|
DOMJSProxyHandler.cpp \
|
2013-08-21 23:30:38 -07:00
|
|
|
Date.cpp \
|
2013-09-08 20:28:50 -07:00
|
|
|
Exceptions.cpp \
|
2012-03-30 21:42:20 -07:00
|
|
|
$(NULL)
|
2013-05-09 10:05:33 -07:00
|
|
|
endif
|
2012-03-30 21:42:20 -07:00
|
|
|
|
|
|
|
LOCAL_INCLUDES += -I$(topsrcdir)/js/xpconnect/src \
|
2012-05-31 11:16:48 -07:00
|
|
|
-I$(topsrcdir)/js/xpconnect/wrappers \
|
2013-08-01 16:45:17 -07:00
|
|
|
-I$(topsrcdir)/js/ipc \
|
2012-06-13 08:14:15 -07:00
|
|
|
-I$(topsrcdir)/content/canvas/src \
|
2012-09-13 09:04:31 -07:00
|
|
|
-I$(topsrcdir)/content/html/content/src \
|
2012-10-15 08:09:10 -07:00
|
|
|
-I$(topsrcdir)/media/webrtc/signaling/src/peerconnection \
|
2013-10-14 09:53:56 -07:00
|
|
|
-I$(topsrcdir)/media/webrtc/signaling/src/common/time_profiling \
|
|
|
|
-I$(topsrcdir)/media/mtransport \
|
2012-10-14 00:40:11 -07:00
|
|
|
-I$(topsrcdir)/dom/base \
|
2013-02-05 04:54:49 -08:00
|
|
|
-I$(topsrcdir)/dom/battery \
|
2013-03-12 10:45:59 -07:00
|
|
|
-I$(topsrcdir)/dom/indexedDB \
|
2012-12-14 11:10:49 -08:00
|
|
|
-I$(topsrcdir)/content/xslt/src/base \
|
|
|
|
-I$(topsrcdir)/content/xslt/src/xpath \
|
2012-12-22 00:27:27 -08:00
|
|
|
-I$(topsrcdir)/content/xml/content/src \
|
2013-01-29 09:51:55 -08:00
|
|
|
-I$(topsrcdir)/content/xul/content/src \
|
2013-03-26 08:31:54 -07:00
|
|
|
-I$(topsrcdir)/content/xul/document/src \
|
2013-03-27 14:08:17 -07:00
|
|
|
-I$(topsrcdir)/content/media/webspeech/recognition \
|
2012-10-14 00:40:11 -07:00
|
|
|
$(NULL)
|
2012-03-30 21:42:20 -07:00
|
|
|
|
2013-02-08 08:34:47 -08:00
|
|
|
ifdef MOZ_AUDIO_CHANNEL_MANAGER
|
|
|
|
LOCAL_INCLUDES += \
|
|
|
|
-I$(topsrcdir)/dom/system/gonk \
|
|
|
|
$(NULL)
|
|
|
|
endif
|
2013-05-07 05:46:07 -07:00
|
|
|
|
2013-10-16 15:55:18 -07:00
|
|
|
ABS_DIST := $(abspath $(DIST))
|
|
|
|
|
2013-05-09 10:05:33 -07:00
|
|
|
EXTRA_EXPORT_MDDEPEND_FILES := $(addsuffix .pp,$(binding_dependency_trackers))
|
2013-02-24 12:36:44 -08:00
|
|
|
|
2013-09-10 11:27:39 -07:00
|
|
|
EXPORTS_GENERATED_FILES := $(exported_binding_headers) $(exported_generated_events_headers)
|
2013-10-16 15:55:18 -07:00
|
|
|
EXPORTS_GENERATED_DEST := $(ABS_DIST)/include/$(binding_include_path)
|
2013-05-09 10:05:33 -07:00
|
|
|
EXPORTS_GENERATED_TARGET := export
|
2013-02-24 12:36:44 -08:00
|
|
|
INSTALL_TARGETS += EXPORTS_GENERATED
|
|
|
|
|
2013-08-13 10:51:56 -07:00
|
|
|
# Install auto-generated GlobalGen files. The rules for the install must
|
|
|
|
# be in the same target/subtier as GlobalGen.py, otherwise the files will not
|
|
|
|
# get installed into the appropriate location as they are generated.
|
|
|
|
globalgen_headers_FILES := \
|
2013-09-03 20:28:05 -07:00
|
|
|
GeneratedAtomList.h \
|
2013-08-13 10:51:56 -07:00
|
|
|
PrototypeList.h \
|
|
|
|
RegisterBindings.h \
|
|
|
|
UnionConversions.h \
|
|
|
|
UnionTypes.h \
|
|
|
|
$(NULL)
|
2013-10-16 15:55:18 -07:00
|
|
|
globalgen_headers_DEST = $(ABS_DIST)/include/mozilla/dom
|
2013-09-26 16:05:10 -07:00
|
|
|
globalgen_headers_TARGET := export
|
2013-08-13 10:51:56 -07:00
|
|
|
INSTALL_TARGETS += globalgen_headers
|
|
|
|
|
2012-03-30 21:42:20 -07:00
|
|
|
include $(topsrcdir)/config/rules.mk
|
2013-07-04 05:28:43 -07:00
|
|
|
include $(topsrcdir)/ipc/chromium/chromium-config.mk
|
2012-03-30 21:42:20 -07:00
|
|
|
|
2013-08-21 07:49:45 -07:00
|
|
|
ifdef GNU_CC
|
|
|
|
CXXFLAGS += -Wno-uninitialized
|
|
|
|
endif
|
|
|
|
|
2012-05-23 09:44:48 -07:00
|
|
|
# If you change bindinggen_dependencies here, change it in
|
|
|
|
# dom/bindings/test/Makefile.in too.
|
2012-03-30 21:42:20 -07:00
|
|
|
bindinggen_dependencies := \
|
|
|
|
BindingGen.py \
|
|
|
|
Bindings.conf \
|
|
|
|
Configuration.py \
|
|
|
|
Codegen.py \
|
2013-05-09 10:05:33 -07:00
|
|
|
ParserResults.pkl \
|
2012-06-11 15:21:35 -07:00
|
|
|
parser/WebIDL.py \
|
2012-03-30 21:42:20 -07:00
|
|
|
$(GLOBAL_DEPS) \
|
|
|
|
$(NULL)
|
|
|
|
|
2012-08-23 21:08:09 -07:00
|
|
|
CSS2Properties.webidl: $(topsrcdir)/layout/style/nsCSSPropList.h \
|
|
|
|
$(topsrcdir)/layout/style/nsCSSPropAliasList.h \
|
|
|
|
$(webidl_base)/CSS2Properties.webidl.in \
|
|
|
|
$(webidl_base)/CSS2PropertiesProps.h \
|
|
|
|
$(srcdir)/GenerateCSS2PropertiesWebIDL.py \
|
|
|
|
$(GLOBAL_DEPS)
|
2012-08-28 11:14:53 -07:00
|
|
|
$(CPP) $(DEFINES) $(ACDEFINES) -I$(topsrcdir)/layout/style $(webidl_base)/CSS2PropertiesProps.h | \
|
2012-08-23 21:08:09 -07:00
|
|
|
PYTHONDONTWRITEBYTECODE=1 $(PYTHON) \
|
|
|
|
$(srcdir)/GenerateCSS2PropertiesWebIDL.py $(webidl_base)/CSS2Properties.webidl.in > CSS2Properties.webidl
|
|
|
|
|
2012-05-23 09:44:48 -07:00
|
|
|
$(webidl_files): %: $(webidl_base)/%
|
|
|
|
$(INSTALL) $(IFLAGS1) $(webidl_base)/$* .
|
|
|
|
|
|
|
|
$(test_webidl_files): %: $(srcdir)/test/%
|
|
|
|
$(INSTALL) $(IFLAGS1) $(srcdir)/test/$* .
|
|
|
|
|
2013-07-12 07:35:53 -07:00
|
|
|
# We can't easily use PP_TARGETS here because it insists on outputting targets
|
|
|
|
# that look like "$(CURDIR)/foo" whereas we want our target to just be "foo".
|
|
|
|
# Make sure to include $(GLOBAL_DEPS) so we pick up changes to what symbols are
|
|
|
|
# defined. Also make sure to remove $@ before writing to it, because otherwise
|
|
|
|
# if a file goes from non-preprocessed to preprocessed we can end up writing to
|
|
|
|
# a symlink, which will clobber files in the srcdir, which is bad.
|
|
|
|
$(preprocessed_webidl_files): %: $(webidl_base)/% $(GLOBAL_DEPS)
|
|
|
|
$(RM) $@
|
|
|
|
PYTHONDONTWRITEBYTECODE=1 $(PYTHON) \
|
|
|
|
$(topsrcdir)/config/Preprocessor.py $(DEFINES) $(ACDEFINES) $(XULPPFLAGS) $(webidl_base)/$* -o $@
|
|
|
|
|
2013-09-25 21:05:00 -07:00
|
|
|
# See the comment about PP_TARGETS for $(preprocessed_webidl_files)
|
|
|
|
$(preprocessed_test_webidl_files): %: $(srcdir)/test/% $(GLOBAL_DEPS)
|
|
|
|
$(RM) $@
|
|
|
|
PYTHONDONTWRITEBYTECODE=1 $(PYTHON) \
|
|
|
|
$(topsrcdir)/config/Preprocessor.py $(DEFINES) $(ACDEFINES) $(XULPPFLAGS) $(srcdir)/test/$* -o $@
|
|
|
|
|
2013-07-12 07:35:53 -07:00
|
|
|
# Make is dumb and can get confused between "foo" and "$(CURDIR)/foo". Make
|
|
|
|
# sure that the latter depends on the former, since the latter gets used in .pp
|
|
|
|
# files.
|
|
|
|
all_webidl_files_absolute = $(addprefix $(CURDIR)/,$(all_webidl_files))
|
|
|
|
$(all_webidl_files_absolute): $(CURDIR)/%: %
|
|
|
|
|
2013-09-16 03:06:15 -07:00
|
|
|
$(generated_header_files): .BindingGen
|
2013-05-09 10:05:33 -07:00
|
|
|
|
2013-09-16 03:06:15 -07:00
|
|
|
$(generated_cpp_files): .BindingGen
|
2013-05-09 10:05:33 -07:00
|
|
|
|
|
|
|
# $(binding_dependency_trackers) pick up additional dependencies via .pp files
|
2013-07-15 10:49:42 -07:00
|
|
|
# The rule: just brings the tracker up to date, if it's out of date, so that
|
|
|
|
# we'll know that we have to redo binding generation and flag this prerequisite
|
|
|
|
# there as being newer than the bindinggen target.
|
2013-05-09 10:05:33 -07:00
|
|
|
$(binding_dependency_trackers):
|
|
|
|
@$(TOUCH) $@
|
2012-03-30 21:42:20 -07:00
|
|
|
|
|
|
|
$(globalgen_targets): ParserResults.pkl
|
|
|
|
|
2013-05-09 10:05:33 -07:00
|
|
|
%-example: .BindingGen
|
2012-10-17 14:01:55 -07:00
|
|
|
PYTHONDONTWRITEBYTECODE=1 $(PYTHON) $(topsrcdir)/config/pythonpath.py \
|
|
|
|
$(PLY_INCLUDE) -I$(srcdir)/parser \
|
|
|
|
$(srcdir)/ExampleGen.py \
|
|
|
|
$(srcdir)/Bindings.conf $*
|
|
|
|
|
2012-03-30 21:42:20 -07:00
|
|
|
CACHE_DIR = _cache
|
|
|
|
|
|
|
|
globalgen_dependencies := \
|
|
|
|
GlobalGen.py \
|
|
|
|
Bindings.conf \
|
|
|
|
Configuration.py \
|
|
|
|
Codegen.py \
|
2012-06-11 15:21:35 -07:00
|
|
|
parser/WebIDL.py \
|
2013-09-05 08:20:26 -07:00
|
|
|
webidlsrcs.mk \
|
2013-03-04 11:08:24 -08:00
|
|
|
$(all_webidl_files) \
|
2012-03-30 21:42:20 -07:00
|
|
|
$(CACHE_DIR)/.done \
|
|
|
|
$(GLOBAL_DEPS) \
|
|
|
|
$(NULL)
|
|
|
|
|
|
|
|
$(CACHE_DIR)/.done:
|
|
|
|
$(MKDIR) -p $(CACHE_DIR)
|
|
|
|
@$(TOUCH) $@
|
|
|
|
|
2013-07-15 10:49:42 -07:00
|
|
|
# Running GlobalGen.py updates ParserResults.pkl as a side-effect
|
2013-03-04 11:08:24 -08:00
|
|
|
ParserResults.pkl: $(globalgen_dependencies)
|
2013-08-13 10:51:56 -07:00
|
|
|
$(info Generating global WebIDL files)
|
2012-06-10 16:03:23 -07:00
|
|
|
PYTHONDONTWRITEBYTECODE=1 $(PYTHON) $(topsrcdir)/config/pythonpath.py \
|
2013-07-15 10:49:42 -07:00
|
|
|
$(PLY_INCLUDE) -I$(srcdir)/parser \
|
|
|
|
$(srcdir)/GlobalGen.py $(srcdir)/Bindings.conf . \
|
|
|
|
--cachedir=$(CACHE_DIR) \
|
|
|
|
$(all_webidl_files)
|
|
|
|
|
2013-08-13 10:51:56 -07:00
|
|
|
$(globalgen_headers_FILES): ParserResults.pkl
|
|
|
|
|
2013-08-12 01:34:28 -07:00
|
|
|
# Make sure .deps actually exists, since we'll try to write to it from
|
2013-07-15 10:49:42 -07:00
|
|
|
# BindingGen.py but we're typically running in the export phase, which is
|
|
|
|
# before anyone has bothered creating .deps.
|
|
|
|
# Then, pass our long lists through files to try to avoid blowing out the
|
|
|
|
# command line.
|
|
|
|
# Next, BindingGen.py will examine the changed dependency list to figure out
|
|
|
|
# what it really needs to regenerate.
|
|
|
|
# Finally, touch the .BindingGen file so that we don't have to keep redoing
|
|
|
|
# all that until something else actually changes.
|
2013-05-09 10:05:33 -07:00
|
|
|
.BindingGen: $(bindinggen_dependencies) $(binding_dependency_trackers)
|
2013-08-13 10:51:56 -07:00
|
|
|
$(info Generating WebIDL bindings)
|
2013-05-09 10:05:33 -07:00
|
|
|
$(MKDIR) -p .deps
|
|
|
|
echo $(all_webidl_files) > .all-webidl-file-list
|
2013-09-10 11:27:39 -07:00
|
|
|
echo $(generated_events_webidl_files) > .generated-events-webidl-files
|
2013-05-09 10:05:33 -07:00
|
|
|
echo $? > .changed-dependency-list
|
2013-05-30 10:05:42 -07:00
|
|
|
PYTHONDONTWRITEBYTECODE=1 $(PYTHON) $(topsrcdir)/config/pythonpath.py \
|
2013-07-15 10:49:42 -07:00
|
|
|
$(PLY_INCLUDE) -I$(srcdir)/parser \
|
|
|
|
$(srcdir)/BindingGen.py \
|
|
|
|
$(srcdir)/Bindings.conf \
|
|
|
|
$(CURDIR) \
|
|
|
|
.all-webidl-file-list \
|
2013-09-10 11:27:39 -07:00
|
|
|
.generated-events-webidl-files \
|
2013-07-15 10:49:42 -07:00
|
|
|
.changed-dependency-list
|
2013-05-09 10:05:33 -07:00
|
|
|
@$(TOUCH) $@
|
|
|
|
|
2012-03-30 21:42:20 -07:00
|
|
|
GARBAGE += \
|
|
|
|
webidlyacc.py \
|
|
|
|
parser.out \
|
2012-10-17 14:01:55 -07:00
|
|
|
$(wildcard *-example.h) \
|
|
|
|
$(wildcard *-example.cpp) \
|
2013-09-23 10:17:41 -07:00
|
|
|
$(unified_binding_cpp_files) \
|
2013-05-09 10:05:33 -07:00
|
|
|
.BindingGen \
|
|
|
|
.all-webidl-file-list \
|
2013-09-10 11:27:39 -07:00
|
|
|
.generated-events-webidl-files \
|
2013-05-09 10:05:33 -07:00
|
|
|
.changed-dependency-list \
|
|
|
|
$(binding_dependency_trackers) \
|
2012-03-30 21:42:20 -07:00
|
|
|
$(NULL)
|
2012-06-12 07:22:05 -07:00
|
|
|
|
|
|
|
# Make sure all binding header files are created during the export stage, so we
|
|
|
|
# don't have issues with .cpp files being compiled before we've generated the
|
|
|
|
# headers they depend on. This is really only needed for the test files, since
|
2013-05-09 10:05:33 -07:00
|
|
|
# the non-test headers are all exported above anyway. Note that this means that
|
|
|
|
# we do all of our codegen during export.
|
2013-09-26 16:05:10 -07:00
|
|
|
export:: $(generated_header_files)
|
2013-02-24 12:36:44 -08:00
|
|
|
|
2013-03-26 10:02:41 -07:00
|
|
|
distclean::
|
|
|
|
-$(RM) \
|
2013-09-16 03:06:15 -07:00
|
|
|
$(generated_header_files) \
|
|
|
|
$(generated_cpp_files) \
|
2013-03-26 10:02:41 -07:00
|
|
|
$(all_webidl_files) \
|
|
|
|
$(globalgen_targets) \
|
2013-05-09 10:05:33 -07:00
|
|
|
ParserResults.pkl \
|
|
|
|
$(NULL)
|