2012-03-30 21:42:20 -07:00
|
|
|
# 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/.
|
|
|
|
|
2012-05-23 09:44:48 -07:00
|
|
|
# Do NOT export this library. We don't actually want our test code
|
|
|
|
# being added to libxul or anything.
|
|
|
|
|
2013-04-09 15:39:44 -07:00
|
|
|
# pymake can't handle descending into dom/bindings several times simultaneously
|
|
|
|
ifdef .PYMAKE
|
|
|
|
.NOTPARALLEL:
|
|
|
|
endif
|
|
|
|
|
2012-05-23 09:44:48 -07:00
|
|
|
# Need this to find all our DOM source files.
|
|
|
|
include $(topsrcdir)/dom/dom-config.mk
|
|
|
|
|
2013-09-25 21:05:00 -07:00
|
|
|
# And need this for $(test_webidl_files) and $(preprocessed_test_webidl_files)
|
2013-09-05 08:20:26 -07:00
|
|
|
include ../webidlsrcs.mk
|
2012-05-23 09:44:48 -07:00
|
|
|
|
|
|
|
# But the webidl actually lives in our parent dir
|
|
|
|
test_webidl_files := $(addprefix ../,$(test_webidl_files))
|
2013-09-25 21:05:00 -07:00
|
|
|
# Store the actual locations of our source preprocessed files, so we
|
|
|
|
# can depend on them sanely.
|
|
|
|
source_preprocessed_test_webidl_files := $(addprefix $(srcdir)/,$(preprocessed_test_webidl_files))
|
|
|
|
preprocessed_test_webidl_files := $(addprefix ../,$(preprocessed_test_webidl_files))
|
2012-05-23 09:44:48 -07:00
|
|
|
|
|
|
|
LOCAL_INCLUDES += \
|
|
|
|
-I$(topsrcdir)/js/xpconnect/src \
|
|
|
|
-I$(topsrcdir)/js/xpconnect/wrappers \
|
2012-06-11 13:04:34 -07:00
|
|
|
-I$(topsrcdir)/dom/bindings \
|
2012-05-23 09:44:48 -07:00
|
|
|
$(NULL)
|
|
|
|
|
2013-10-03 00:10:00 -07:00
|
|
|
CPPSRCS += \
|
|
|
|
$(subst .webidl,Binding.cpp,$(test_webidl_files)) \
|
|
|
|
$(subst .webidl,Binding.cpp,$(preprocessed_test_webidl_files)) \
|
|
|
|
$(NULL)
|
2012-03-30 21:42:20 -07:00
|
|
|
|
2012-05-23 09:44:48 -07:00
|
|
|
# If you change bindinggen_dependencies here, change it in
|
|
|
|
# dom/bindings/Makefile.in too. But note that we include ../Makefile
|
|
|
|
# here manually, since $(GLOBAL_DEPS) won't cover it.
|
|
|
|
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-05-23 09:44:48 -07:00
|
|
|
../Makefile \
|
|
|
|
$(GLOBAL_DEPS) \
|
|
|
|
$(NULL)
|
|
|
|
|
2013-03-09 23:58:21 -08:00
|
|
|
ifdef GNU_CC
|
|
|
|
CXXFLAGS += -Wno-uninitialized
|
|
|
|
endif
|
|
|
|
|
2012-07-26 09:38:03 -07:00
|
|
|
# Include rules.mk before any of our targets so our first target is coming from
|
|
|
|
# rules.mk and running make with no target in this dir does the right thing.
|
|
|
|
include $(topsrcdir)/config/rules.mk
|
|
|
|
|
2013-05-09 10:05:33 -07:00
|
|
|
$(CPPSRCS): .BindingGen
|
2012-05-23 09:44:48 -07:00
|
|
|
|
2013-05-09 10:05:33 -07:00
|
|
|
.BindingGen: $(bindinggen_dependencies) \
|
|
|
|
$(test_webidl_files) \
|
2013-09-25 21:05:00 -07:00
|
|
|
$(source_preprocessed_test_webidl_files) \
|
2013-05-09 10:05:33 -07:00
|
|
|
$(NULL)
|
|
|
|
# The export phase in dom/bindings is what actually looks at
|
|
|
|
# dependencies and regenerates things as needed, so just go ahead and
|
|
|
|
# make that phase here. Also make our example interface files. If the
|
|
|
|
# target used here ever changes, change the conditional around
|
|
|
|
# $(CPPSRCS) in dom/bindings/Makefile.in.
|
|
|
|
$(MAKE) -C .. export TestExampleInterface-example TestExampleProxyInterface-example
|
|
|
|
@$(TOUCH) $@
|
2012-11-09 08:24:32 -08:00
|
|
|
|
2012-06-10 16:44:50 -07:00
|
|
|
check::
|
2012-07-02 13:32:42 -07:00
|
|
|
PYTHONDONTWRITEBYTECODE=1 $(PYTHON) $(topsrcdir)/config/pythonpath.py \
|
|
|
|
$(PLY_INCLUDE) $(srcdir)/../parser/runtests.py
|
2012-06-22 13:18:50 -07:00
|
|
|
|
|
|
|
check-interactive:
|
2012-07-02 13:32:42 -07:00
|
|
|
PYTHONDONTWRITEBYTECODE=1 $(PYTHON) $(topsrcdir)/config/pythonpath.py \
|
|
|
|
$(PLY_INCLUDE) $(srcdir)/../parser/runtests.py -q
|
2013-05-09 10:05:33 -07:00
|
|
|
|
|
|
|
# Since we define MOCHITEST_FILES, config/makefiles/mochitest.mk goes ahead and
|
|
|
|
# sets up a rule with libs:: in itm which makes our .DEFAULT_TARGET be "libs".
|
|
|
|
# Then ruls.mk does |.DEFAULT_TARGET ?= default| which leaves it as "libs". So
|
|
|
|
# if we make without an explicit target in this directory, we try to make
|
|
|
|
# "libs", but with a $(MAKECMDGOALS) of empty string. And then rules.mk
|
|
|
|
# helpfully does not include our *.o.pp files, since it includes them only if
|
|
|
|
# filtering some stuff out from $(MAKECMDGOALS) leaves it nonempty. The upshot
|
|
|
|
# is that if some headers change and we run make in this dir without an explicit
|
|
|
|
# target things don't get rebuilt.
|
|
|
|
#
|
|
|
|
# On the other hand, if we set .DEFAULT_TARGET to "default" explicitly here,
|
|
|
|
# then rules.mk will reinvoke make with "export" and "libs" but this time hey
|
|
|
|
# will be passed as explicit targets, show up in $(MAKECMDGOALS), and things
|
|
|
|
# will work. Do this at the end of our Makefile so the rest of the build system
|
|
|
|
# does not get a chance to muck with it after we set it.
|
|
|
|
.DEFAULT_GOAL := default
|
|
|
|
|
|
|
|
# Make sure to add .BindingGen to GARBAGE so we'll rebuild our example
|
|
|
|
# files if someone goes through and deletes GARBAGE all over, which
|
|
|
|
# will delete example files from our parent dir.
|
|
|
|
GARBAGE += \
|
|
|
|
.BindingGen \
|
|
|
|
$(NULL)
|