parameters: (self, copies, extra_outputs, part_of_all)
docstring: Write Makefile code for any 'copies' from the gyp input.
  
      extra_outputs: a list that will be filled in with any outputs of this action
                     (used to make other pieces dependent on this action)
      part_of_all: flag indicating this target is part of 'all'
docstring_summary: Write Makefile code for any 'copies' from the gyp input.
docstring_tokens: Write Makefile code for any copies from the gyp input .
function: def WriteCopies(self, copies, extra_outputs, part_of_all):
      """Write Makefile code for any 'copies' from the gyp input.
  
      extra_outputs: a list that will be filled in with any outputs of this action
                     (used to make other pieces dependent on this action)
      part_of_all: flag indicating this target is part of 'all'
      """
      self.WriteLn('### Generated for copy rule.')
  
      variable = StringToMakefileVariable(self.qualified_target + '_copies')
      outputs = []
      for copy in copies:
        for path in copy['files']:
          # Absolutify() may call normpath, and will strip trailing slashes.
          path = Sourceify(self.Absolutify(path))
          filename = os.path.split(path)[1]
          output = Sourceify(self.Absolutify(os.path.join(copy['destination'],
                                                          filename)))
  
          # If the output path has variables in it, which happens in practice for
          # 'copies', writing the environment as target-local doesn't work,
          # because the variables are already needed for the target name.
          # Copying the environment variables into global make variables doesn't
          # work either, because then the .d files will potentially contain spaces
          # after variable expansion, and .d file handling cannot handle spaces.
          # As a workaround, manually expand variables at gyp time. Since 'copies'
          # can't run scripts, there's no need to write the env then.
          # WriteDoCmd() will escape spaces for .d files.
          env = self.GetSortedXcodeEnv()
          output = gyp.xcode_emulation.ExpandEnvVars(output, env)
          path = gyp.xcode_emulation.ExpandEnvVars(path, env)
          self.WriteDoCmd([output], [path], 'copy', part_of_all)
          outputs.append(output)
      self.WriteLn('%s = %s' % (variable, ' '.join(map(QuoteSpaces, outputs))))
      extra_outputs.append('$(%s)' % variable)
      self.WriteLn()
function_tokens: def WriteCopies ( self , copies , extra_outputs , part_of_all ) : self . WriteLn ( '### Generated for copy rule.' ) variable = StringToMakefileVariable ( self . qualified_target + '_copies' ) outputs = [ ] for copy in copies : for path in copy [ 'files' ] : # Absolutify() may call normpath, and will strip trailing slashes. path = Sourceify ( self . Absolutify ( path ) ) filename = os . path . split ( path ) [ 1 ] output = Sourceify ( self . Absolutify ( os . path . join ( copy [ 'destination' ] , filename ) ) ) # If the output path has variables in it, which happens in practice for # 'copies', writing the environment as target-local doesn't work, # because the variables are already needed for the target name. # Copying the environment variables into global make variables doesn't # work either, because then the .d files will potentially contain spaces # after variable expansion, and .d file handling cannot handle spaces. # As a workaround, manually expand variables at gyp time. Since 'copies' # can't run scripts, there's no need to write the env then. # WriteDoCmd() will escape spaces for .d files. env = self . GetSortedXcodeEnv ( ) output = gyp . xcode_emulation . ExpandEnvVars ( output , env ) path = gyp . xcode_emulation . ExpandEnvVars ( path , env ) self . WriteDoCmd ( [ output ] , [ path ] , 'copy' , part_of_all ) outputs . append ( output ) self . WriteLn ( '%s = %s' % ( variable , ' ' . join ( map ( QuoteSpaces , outputs ) ) ) ) extra_outputs . append ( '$(%s)' % variable ) self . WriteLn ( )