author Gregory Szorc <>
Tue, 19 Nov 2013 10:16:51 -0800
changeset 170995 644408afbf21fe1f06cfa6693d5688ad15c8b337
parent 170990 608c663f691f39bba13ded313c89e8109c061d5c
child 176371 67fa1478308ebe2874cf965cd240d8aebf0ebde7
permissions -rw-r--r--
Backed out 4 changesets (c0e8f2c0465f::608c663f691f) (bug 928195) for landing prematurely

# 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

# Do NOT export this library.  We don't actually want our test code
# being added to libxul or anything.

# pymake can't handle descending into dom/bindings several times simultaneously
ifdef .PYMAKE

# Need this for $(test_webidl_files)
include ../

# But the webidl actually lives in our parent dir
test_webidl_files := $(addprefix ../,$(test_webidl_files))
# 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))

  $(subst .webidl,Binding.cpp,$(test_webidl_files)) \
  $(subst .webidl,Binding.cpp,$(preprocessed_test_webidl_files)) \

# If you change bindinggen_dependencies here, change it in
# dom/bindings/ too.  But note that we include ../Makefile
# here manually, since $(GLOBAL_DEPS) won't cover it.
bindinggen_dependencies := \
  ../ \
  ../Bindings.conf \
  ../ \
  ../ \
  ../ParserResults.pkl \
  ../parser/ \
  ../Makefile \

ifdef GNU_CC
CXXFLAGS += -Wno-uninitialized

# Include before any of our targets so our first target is coming from
# and running make with no target in this dir does the right thing.
include $(topsrcdir)/config/

$(CPPSRCS): .BindingGen

.BindingGen: $(bindinggen_dependencies) \
             $(test_webidl_files) \
             $(source_preprocessed_test_webidl_files) \
	# 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/
	$(MAKE) -C .. export TestExampleInterface-example TestExampleProxyInterface-example
	@$(TOUCH) $@

	PYTHONDONTWRITEBYTECODE=1 $(PYTHON) $(topsrcdir)/config/ \
	  $(PLY_INCLUDE) $(srcdir)/../parser/

# Since we define MOCHITEST_FILES, config/makefiles/ goes ahead and
# sets up a rule with libs:: in itm which makes our .DEFAULT_TARGET be "libs".
# Then 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
# 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 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.
  .BindingGen \