Bug 838146 part 3. Set up preprocessing of Navigator.webidl, since we want to make some stuff on Navigator build-time-conditional. r=khuey

This commit is contained in:
Boris Zbarsky 2013-07-12 10:35:53 -04:00
parent 0563b53628
commit adcfc869b5
2 changed files with 22 additions and 2 deletions

View File

@ -22,7 +22,7 @@ include $(topsrcdir)/dom/dom-config.mk
include $(topsrcdir)/dom/webidl/WebIDL.mk
binding_include_path := mozilla/dom
all_webidl_files = $(webidl_files) $(generated_webidl_files)
all_webidl_files = $(webidl_files) $(generated_webidl_files) $(preprocessed_webidl_files)
# Set exported_binding_headers before adding the test IDL to the mix
exported_binding_headers := $(subst .webidl,Binding.h,$(all_webidl_files))
# Set linked_binding_cpp_files before adding the test IDL to the mix
@ -142,6 +142,23 @@ $(webidl_files): %: $(webidl_base)/%
$(test_webidl_files): %: $(srcdir)/test/%
$(INSTALL) $(IFLAGS1) $(srcdir)/test/$* .
# 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 $@
# 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)/%: %
$(binding_header_files): .BindingGen
$(binding_cpp_files): .BindingGen

View File

@ -8,6 +8,10 @@ generated_webidl_files = \
CSS2Properties.webidl \
$(NULL)
preprocessed_webidl_files = \
Navigator.webidl \
$(NULL)
webidl_files = \
AnalyserNode.webidl \
AnimationEvent.webidl \
@ -191,7 +195,6 @@ webidl_files = \
MozTimeManager.webidl \
MutationEvent.webidl \
MutationObserver.webidl \
Navigator.webidl \
NetDashboard.webidl \
Node.webidl \
NodeFilter.webidl \