parameters: (self, obj)
docstring: Write out build files necessary to build with recursive make.
docstring_summary: Write out build files necessary to build with recursive make.
docstring_tokens: Write out build files necessary to build with recursive make .
function: def consume_object(self, obj):
          """Write out build files necessary to build with recursive make."""
  
          if not isinstance(obj, ContextDerived):
              return
  
          if obj.objdir not in self._backend_files:
              self._backend_files[obj.objdir] = \
                  BackendMakeFile(obj.srcdir, obj.objdir, obj.config,
                      obj.topsrcdir, self.environment.topobjdir)
          backend_file = self._backend_files[obj.objdir]
  
          CommonBackend.consume_object(self, obj)
  
          # CommonBackend handles XPIDLFile and TestManifest, but we want to do
          # some extra things for them.
          if isinstance(obj, XPIDLFile):
              backend_file.idls.append(obj)
              backend_file.xpt_name = '%s.xpt' % obj.module
  
          elif isinstance(obj, TestManifest):
              self._process_test_manifest(obj, backend_file)
  
          # If CommonBackend acknowledged the object, we're done with it.
          if obj._ack:
              return
  
          if isinstance(obj, DirectoryTraversal):
              self._process_directory_traversal(obj, backend_file)
          elif isinstance(obj, ConfigFileSubstitution):
              # Other ConfigFileSubstitution should have been acked by
              # CommonBackend.
              assert os.path.basename(obj.output_path) == 'Makefile'
              self._create_makefile(obj)
          elif isinstance(obj, VariablePassthru):
              unified_suffixes = dict(
                  UNIFIED_CSRCS='c',
                  UNIFIED_CMMSRCS='mm',
                  UNIFIED_CPPSRCS='cpp',
              )
  
              files_per_unification = 16
              if 'FILES_PER_UNIFIED_FILE' in obj.variables.keys():
                  files_per_unification = obj.variables['FILES_PER_UNIFIED_FILE']
  
              do_unify = not self.environment.substs.get(
                  'MOZ_DISABLE_UNIFIED_COMPILATION') and files_per_unification > 1
  
              # Sorted so output is consistent and we don't bump mtimes.
              for k, v in sorted(obj.variables.items()):
                  if k in unified_suffixes:
                      if do_unify:
                          # On Windows, path names have a maximum length of 255 characters,
                          # so avoid creating extremely long path names.
                          unified_prefix = mozpath.relpath(backend_file.objdir,
                              backend_file.environment.topobjdir)
                          if len(unified_prefix) > 20:
                              unified_prefix = unified_prefix[-20:].split('/', 1)[-1]
                          unified_prefix = unified_prefix.replace('/', '_')
  
                          self._add_unified_build_rules(backend_file, v,
                              backend_file.objdir,
                              unified_prefix='Unified_%s_%s' % (
                                  unified_suffixes[k],
                                  unified_prefix),
                              unified_suffix=unified_suffixes[k],
                              unified_files_makefile_variable=k,
                              include_curdir_build_rules=False,
                              files_per_unified_file=files_per_unification)
                          backend_file.write('%s += $(%s)\n' % (k[len('UNIFIED_'):], k))
                      else:
                          backend_file.write('%s += %s\n' % (
                              k[len('UNIFIED_'):], ' '.join(sorted(v))))
                  elif isinstance(v, list):
                      for item in v:
                          backend_file.write('%s += %s\n' % (k, item))
                  elif isinstance(v, bool):
                      if v:
                          backend_file.write('%s := 1\n' % k)
                  else:
                      backend_file.write('%s := %s\n' % (k, v))
  
          elif isinstance(obj, Defines):
              defines = obj.get_defines()
              if defines:
                  backend_file.write('DEFINES +=')
                  for define in defines:
                      backend_file.write(' %s' % define)
                  backend_file.write('\n')
  
          elif isinstance(obj, Exports):
              self._process_exports(obj, obj.exports, backend_file)
  
          elif isinstance(obj, Resources):
              self._process_resources(obj, obj.resources, backend_file)
  
          elif isinstance(obj, JARManifest):
              backend_file.write('JAR_MANIFEST := %s\n' % obj.path)
  
          elif isinstance(obj, IPDLFile):
              self._ipdl_sources.add(mozpath.join(obj.srcdir, obj.basename))
  
          elif isinstance(obj, Program):
              self._process_program(obj.program, backend_file)
              self._process_linked_libraries(obj, backend_file)
  
          elif isinstance(obj, HostProgram):
              self._process_host_program(obj.program, backend_file)
              self._process_linked_libraries(obj, backend_file)
  
          elif isinstance(obj, SimpleProgram):
              self._process_simple_program(obj, backend_file)
              self._process_linked_libraries(obj, backend_file)
  
          elif isinstance(obj, HostSimpleProgram):
              self._process_host_simple_program(obj.program, backend_file)
              self._process_linked_libraries(obj, backend_file)
  
          elif isinstance(obj, LocalInclude):
              self._process_local_include(obj.path, backend_file)
  
          elif isinstance(obj, GeneratedInclude):
              self._process_generated_include(obj.path, backend_file)
  
          elif isinstance(obj, PerSourceFlag):
              self._process_per_source_flag(obj, backend_file)
  
          elif isinstance(obj, InstallationTarget):
              self._process_installation_target(obj, backend_file)
  
          elif isinstance(obj, JavaScriptModules):
              self._process_javascript_modules(obj, backend_file)
  
          elif isinstance(obj, ContextWrapped):
              # Process a rich build system object from the front-end
              # as-is.  Please follow precedent and handle CamelCaseData
              # in a function named _process_camel_case_data.  At some
              # point in the future, this unwrapping process may be
              # automated.
              if isinstance(obj.wrapped, JavaJarData):
                  self._process_java_jar_data(obj.wrapped, backend_file)
              elif isinstance(obj.wrapped, AndroidEclipseProjectData):
                  self._process_android_eclipse_project_data(obj.wrapped, backend_file)
              else:
                  return
  
          elif isinstance(obj, SharedLibrary):
              self._process_shared_library(obj, backend_file)
              self._process_linked_libraries(obj, backend_file)
  
          elif isinstance(obj, StaticLibrary):
              self._process_static_library(obj, backend_file)
              self._process_linked_libraries(obj, backend_file)
  
          elif isinstance(obj, HostLibrary):
              self._process_host_library(obj, backend_file)
              self._process_linked_libraries(obj, backend_file)
  
          else:
              return
          obj.ack()
function_tokens: def consume_object ( self , obj ) : if not isinstance ( obj , ContextDerived ) : return if obj . objdir not in self . _backend_files : self . _backend_files [ obj . objdir ] = BackendMakeFile ( obj . srcdir , obj . objdir , obj . config , obj . topsrcdir , self . environment . topobjdir ) backend_file = self . _backend_files [ obj . objdir ] CommonBackend . consume_object ( self , obj ) # CommonBackend handles XPIDLFile and TestManifest, but we want to do # some extra things for them. if isinstance ( obj , XPIDLFile ) : backend_file . idls . append ( obj ) backend_file . xpt_name = '%s.xpt' % obj . module elif isinstance ( obj , TestManifest ) : self . _process_test_manifest ( obj , backend_file ) # If CommonBackend acknowledged the object, we're done with it. if obj . _ack : return if isinstance ( obj , DirectoryTraversal ) : self . _process_directory_traversal ( obj , backend_file ) elif isinstance ( obj , ConfigFileSubstitution ) : # Other ConfigFileSubstitution should have been acked by # CommonBackend. assert os . path . basename ( obj . output_path ) == 'Makefile' self . _create_makefile ( obj ) elif isinstance ( obj , VariablePassthru ) : unified_suffixes = dict ( UNIFIED_CSRCS = 'c' , UNIFIED_CMMSRCS = 'mm' , UNIFIED_CPPSRCS = 'cpp' , ) files_per_unification = 16 if 'FILES_PER_UNIFIED_FILE' in obj . variables . keys ( ) : files_per_unification = obj . variables [ 'FILES_PER_UNIFIED_FILE' ] do_unify = not self . environment . substs . get ( 'MOZ_DISABLE_UNIFIED_COMPILATION' ) and files_per_unification > 1 # Sorted so output is consistent and we don't bump mtimes. for k , v in sorted ( obj . variables . items ( ) ) : if k in unified_suffixes : if do_unify : # On Windows, path names have a maximum length of 255 characters, # so avoid creating extremely long path names. unified_prefix = mozpath . relpath ( backend_file . objdir , backend_file . environment . topobjdir ) if len ( unified_prefix ) > 20 : unified_prefix = unified_prefix [ - 20 : ] . split ( '/' , 1 ) [ - 1 ] unified_prefix = unified_prefix . replace ( '/' , '_' ) self . _add_unified_build_rules ( backend_file , v , backend_file . objdir , unified_prefix = 'Unified_%s_%s' % ( unified_suffixes [ k ] , unified_prefix ) , unified_suffix = unified_suffixes [ k ] , unified_files_makefile_variable = k , include_curdir_build_rules = False , files_per_unified_file = files_per_unification ) backend_file . write ( '%s += $(%s)\n' % ( k [ len ( 'UNIFIED_' ) : ] , k ) ) else : backend_file . write ( '%s += %s\n' % ( k [ len ( 'UNIFIED_' ) : ] , ' ' . join ( sorted ( v ) ) ) ) elif isinstance ( v , list ) : for item in v : backend_file . write ( '%s += %s\n' % ( k , item ) ) elif isinstance ( v , bool ) : if v : backend_file . write ( '%s := 1\n' % k ) else : backend_file . write ( '%s := %s\n' % ( k , v ) ) elif isinstance ( obj , Defines ) : defines = obj . get_defines ( ) if defines : backend_file . write ( 'DEFINES +=' ) for define in defines : backend_file . write ( ' %s' % define ) backend_file . write ( '\n' ) elif isinstance ( obj , Exports ) : self . _process_exports ( obj , obj . exports , backend_file ) elif isinstance ( obj , Resources ) : self . _process_resources ( obj , obj . resources , backend_file ) elif isinstance ( obj , JARManifest ) : backend_file . write ( 'JAR_MANIFEST := %s\n' % obj . path ) elif isinstance ( obj , IPDLFile ) : self . _ipdl_sources . add ( mozpath . join ( obj . srcdir , obj . basename ) ) elif isinstance ( obj , Program ) : self . _process_program ( obj . program , backend_file ) self . _process_linked_libraries ( obj , backend_file ) elif isinstance ( obj , HostProgram ) : self . _process_host_program ( obj . program , backend_file ) self . _process_linked_libraries ( obj , backend_file ) elif isinstance ( obj , SimpleProgram ) : self . _process_simple_program ( obj , backend_file ) self . _process_linked_libraries ( obj , backend_file ) elif isinstance ( obj , HostSimpleProgram ) : self . _process_host_simple_program ( obj . program , backend_file ) self . _process_linked_libraries ( obj , backend_file ) elif isinstance ( obj , LocalInclude ) : self . _process_local_include ( obj . path , backend_file ) elif isinstance ( obj , GeneratedInclude ) : self . _process_generated_include ( obj . path , backend_file ) elif isinstance ( obj , PerSourceFlag ) : self . _process_per_source_flag ( obj , backend_file ) elif isinstance ( obj , InstallationTarget ) : self . _process_installation_target ( obj , backend_file ) elif isinstance ( obj , JavaScriptModules ) : self . _process_javascript_modules ( obj , backend_file ) elif isinstance ( obj , ContextWrapped ) : # Process a rich build system object from the front-end # as-is.  Please follow precedent and handle CamelCaseData # in a function named _process_camel_case_data.  At some # point in the future, this unwrapping process may be # automated. if isinstance ( obj . wrapped , JavaJarData ) : self . _process_java_jar_data ( obj . wrapped , backend_file ) elif isinstance ( obj . wrapped , AndroidEclipseProjectData ) : self . _process_android_eclipse_project_data ( obj . wrapped , backend_file ) else : return elif isinstance ( obj , SharedLibrary ) : self . _process_shared_library ( obj , backend_file ) self . _process_linked_libraries ( obj , backend_file ) elif isinstance ( obj , StaticLibrary ) : self . _process_static_library ( obj , backend_file ) self . _process_linked_libraries ( obj , backend_file ) elif isinstance ( obj , HostLibrary ) : self . _process_host_library ( obj , backend_file ) self . _process_linked_libraries ( obj , backend_file ) else : return obj . ack ( )