config/makefiles/xpidl/Makefile.in

Fri, 16 Jan 2015 18:13:44 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Fri, 16 Jan 2015 18:13:44 +0100
branch
TOR_BUG_9701
changeset 14
925c144e1f1f
permissions
-rw-r--r--

Integrate suggestion from review to improve consistency with existing code.

     1 # This Source Code Form is subject to the terms of the Mozilla Public
     2 # License, v. 2.0. If a copy of the MPL was not distributed with this
     3 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
     5 STANDALONE_MAKEFILE := 1
     7 include $(topsrcdir)/config/rules.mk
     9 # Building XPIDLs effectively consists of two steps:
    10 #
    11 #   1) Staging all .idl files to a common directory.
    12 #   2) Doing everything with the .idl files.
    13 #
    14 # Each .idl file is processed into a .h file and typelib information.
    15 # The .h file shares the same stem as the input file and is installed
    16 # in the common headers include directory.
    17 #
    18 # XPIDL files are logically grouped together by modules. The typelib
    19 # information for all XPIDLs in the same module is linked together into
    20 # an .xpt file having the name of the module.
    21 #
    22 # As an optimization to reduce overall CPU usage, we process all .idl
    23 # belonging to a module with a single command invocation. This prevents
    24 # redundant parsing of .idl files and significantly reduces CPU cycles.
    25 #
    26 # Future improvement: Headers are currently written to a local directory then
    27 # installed in the distribution directory. It is preferable to write headers
    28 # directly into the distribution directory. However, PGO builds remove the dist
    29 # directory via rm -rf (with no regards to manifests). Since the cost of
    30 # processing XPIDL files is not trivial, it is preferrable to cache the headers
    31 # and reinstall them rather than regenerate them. Ideally the dist pruning is
    32 # performed with manifests. At that time we can write headers directly to the
    33 # dist directory.
    35 # For dependency files.
    36 idl_deps_dir := .deps
    38 # Where we put our final, linked .xpt files.
    39 idl_xpt_dir := xpt
    41 dist_idl_dir := $(DIST)/idl
    42 dist_include_dir := $(DIST)/include
    43 process_py := $(topsrcdir)/python/mozbuild/mozbuild/action/xpidl-process.py
    45 # TODO we should use py_action, but that would require extra directories to be
    46 # in the virtualenv.
    47 idlprocess := $(PYTHON_PATH) $(PLY_INCLUDE) -I$(IDL_PARSER_DIR) -I$(IDL_PARSER_CACHE_DIR) \
    48     $(process_py) --cache-dir $(IDL_PARSER_CACHE_DIR) $(dist_idl_dir) \
    49         $(dist_include_dir) $(idl_xpt_dir) $(idl_deps_dir)
    51 ifdef LIBXUL_SDK
    52 idlprocess += -I$(LIBXUL_SDK)/idl
    53 endif
    55 xpidl_modules := @xpidl_modules@
    57 @xpidl_rules@
    59 linked_xpt_files := $(addprefix $(idl_xpt_dir)/,$(addsuffix .xpt,$(xpidl_modules)))
    60 depends_files := $(foreach root,$(xpidl_modules),$(idl_deps_dir)/$(root).pp)
    62 GARBAGE += $(linked_xpt_files) $(depends_files)
    64 xpidl:: $(linked_xpt_files)
    66 $(linked_xpt_files): $(process_py) $(call mkdir_deps,$(idl_deps_dir) $(dist_include_dir) $(idl_xpt_dir))
    68 $(call include_deps,$(depends_files))
    70 .PHONY: xpidl

mercurial