gecko-dev/dom/bindings/Makefile.in
Mike Shal 507bbb6ecb Bug 1455799 - Make an explicit webidl export target; r=bz,chmanchester
By including codegen.pp and having a target for codegen.pp, we were
relying on make to build out-of-date include files and re-exec itself
after they are built. However, make produces an error if the file does
not exist, which is why this include was changed to a -include in bug
1378965. Unfortunately this means that make ignores not only a
non-existent file, but also any errors in regenerating the target from
the webidl py_action.

Instead we can make a separate stub file target for webidl generation,
and include the codegen.pp that's generated as a side-effect of the
py_action. This way make will fail properly if the webidl generation
fails, and there is no error message about a missing codegen.pp on the
first build.

MozReview-Commit-ID: GjB8zDuMfnL

--HG--
extra : rebase_source : 560b3ae3e60986d7eb3bbabbac0acca67a3a4aff
2018-04-30 12:52:28 -04:00

62 lines
1.5 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/.
webidl_base := $(topsrcdir)/dom/webidl
ifdef COMPILE_ENVIRONMENT
# Generated by moz.build
include webidlsrcs.mk
# These come from webidlsrcs.mk.
# TODO Write directly into backend.mk (bug 1281618)
CPPSRCS += $(globalgen_sources) $(unified_binding_cpp_files)
include $(topsrcdir)/config/rules.mk
# 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. But we do pull in file-lists.jon to catch file additions.
codegen_dependencies := \
file-lists.json \
$(nonstatic_webidl_files) \
$(GLOBAL_DEPS) \
$(NULL)
export:: webidl.stub
# codegen.pp is created as a side-effect of the webidl action
-include codegen.pp
webidl.stub: $(codegen_dependencies)
$(call py_action,webidl,$(srcdir))
@$(TOUCH) $@
.PHONY: compiletests
compiletests:
$(call SUBMAKE,libs,test)
endif
GARBAGE += \
webidl.stub \
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)