Bug 1253431 part 3 - Move SDK_BINARY files in xpcom/idl-parser/xpidl to moz.build; r?gps
We can just generate xpidllex.py/xpidlyacc.py in the current directory
rather than one directory higher, and specify this directory as an
include path to xpidl-process.py
MozReview-Commit-ID: KLoGjudc4Y8
--- a/config/config.mk
+++ b/config/config.mk
@@ -366,20 +366,16 @@ endif
HOST_CFLAGS += $(HOST_DEFINES) $(MOZBUILD_HOST_CFLAGS)
HOST_CXXFLAGS += $(HOST_DEFINES) $(MOZBUILD_HOST_CXXFLAGS)
#
# Name of the binary code directories
#
# Override defaults
-# Default location of include files
-IDL_PARSER_DIR = $(topsrcdir)/xpcom/idl-parser
-IDL_PARSER_CACHE_DIR = $(DEPTH)/xpcom/idl-parser
-
SDK_LIB_DIR = $(DIST)/sdk/lib
SDK_BIN_DIR = $(DIST)/sdk/bin
DEPENDENCIES = .md
ifdef MACOSX_DEPLOYMENT_TARGET
export MACOSX_DEPLOYMENT_TARGET
endif # MACOSX_DEPLOYMENT_TARGET
--- a/config/makefiles/xpidl/Makefile.in
+++ b/config/makefiles/xpidl/Makefile.in
@@ -29,18 +29,18 @@ idl_deps_dir := .deps
dist_idl_dir := $(DIST)/idl
dist_include_dir := $(DIST)/include
process_py := $(topsrcdir)/python/mozbuild/mozbuild/action/xpidl-process.py
# TODO we should use py_action, but that would require extra directories to be
# in the virtualenv.
%.xpt:
@echo "$(@F)"
- $(PYTHON_PATH) $(PLY_INCLUDE) -I$(IDL_PARSER_DIR) -I$(IDL_PARSER_CACHE_DIR) \
- $(process_py) --cache-dir $(IDL_PARSER_CACHE_DIR) --depsdir $(idl_deps_dir) \
+ $(PYTHON_PATH) $(PLY_INCLUDE) -I$(topsrcdir)/xpcom/idl-parser -I$(DEPTH)/xpcom/idl-parser/xpidl \
+ $(process_py) --cache-dir $(DEPTH)/xpcom/idl-parser/xpidl --depsdir $(idl_deps_dir) \
$(dist_idl_dir) $(dist_include_dir) $(@D) $(libxul_sdk_includes) \
$(basename $(notdir $@)) $($(basename $(notdir $@))_deps)
# When some IDL is added or removed, if the actual IDL file was already, or
# still is, in the tree, simple dependencies can't detect that the XPT needs
# to be rebuilt.
# Add the current value of $($(xpidl_module)_deps) in the depend file, such that
# we can later check if the value has changed since last build, which will
# indicate whether IDLs were added or removed.
--- a/xpcom/idl-parser/xpidl/Makefile.in
+++ b/xpcom/idl-parser/xpidl/Makefile.in
@@ -4,42 +4,32 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
PARSER_SRCS = \
header.py \
typelib.py \
xpidl.py \
$(NULL)
-SDK_BINARY = \
- $(PARSER_SRCS) \
- $(IDL_PARSER_CACHE_DIR)/xpidllex.py \
- $(IDL_PARSER_CACHE_DIR)/xpidlyacc.py \
- $(NULL)
-
-SDK_BINARY_TARGET = xpidl-parser
-
PLY_FILES = \
$(topsrcdir)/other-licenses/ply/ply/__init__.py \
$(topsrcdir)/other-licenses/ply/ply/lex.py \
$(topsrcdir)/other-licenses/ply/ply/yacc.py \
$(NULL)
include $(topsrcdir)/config/rules.mk
# Generate the PLY lexer and parser.
-$(IDL_PARSER_CACHE_DIR)/xpidllex.py: $(PARSER_SRCS) $(PLY_FILES)
+xpidllex.py: $(PARSER_SRCS) $(PLY_FILES)
$(PYTHON_PATH) \
$(PLY_INCLUDE) \
- $(srcdir)/header.py --cachedir=$(IDL_PARSER_CACHE_DIR) --regen
+ $(srcdir)/header.py --cachedir=. --regen
# generating xpidllex.py generates xpidlyacc.py too
-$(IDL_PARSER_CACHE_DIR)/xpidlyacc.py: $(IDL_PARSER_CACHE_DIR)/xpidllex.py
+xpidlyacc.py: xpidllex.py
-garbage_files := \
+GARBAGE += \
xpidllex.py \
xpidllex.pyc \
xpidlyacc.py \
xpidlyacc.pyc \
xpidl_debug \
$(NULL)
-
-GARBAGE += $(addprefix $(IDL_PARSER_CACHE_DIR)/,$(garbage_files))
--- a/xpcom/idl-parser/xpidl/moz.build
+++ b/xpcom/idl-parser/xpidl/moz.build
@@ -3,13 +3,26 @@
# 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/.
PYTHON_UNIT_TESTS += [
'runtests.py',
]
+GENERATED_FILES += [
+ 'xpidllex.py',
+ 'xpidlyacc.py',
+]
+
+SDK_FILES.bin += [
+ '!xpidllex.py',
+ '!xpidlyacc.py',
+ 'header.py',
+ 'typelib.py',
+ 'xpidl.py',
+]
+
SDK_FILES.bin.ply += [
'/other-licenses/ply/ply/__init__.py',
'/other-licenses/ply/ply/lex.py',
'/other-licenses/ply/ply/yacc.py',
]
--- a/xpcom/xpidl/Makefile.in
+++ b/xpcom/xpidl/Makefile.in
@@ -1,11 +1,11 @@
# 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/.
export::
- $(call SUBMAKE,xpidl-parser,$(DEPTH)/xpcom/idl-parser/xpidl)
+ $(call SUBMAKE,xpidllex.py,$(DEPTH)/xpcom/idl-parser/xpidl)
$(call py_action,process_install_manifest,$(DIST)/idl $(DEPTH)/_build_manifests/install/dist_idl)
$(call SUBMAKE,xpidl,$(DEPTH)/config/makefiles/xpidl)
clean clobber realclean clobber_all distclean::
$(call SUBMAKE,$@,$(DEPTH)/config/makefiles/xpidl)