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