docs: def generate_source_files( self ):
          """
          Genertate source files to be used during the compile process of the
          extension module.
          This is better than just hardcoding the values on python files because
          header definitions might change along differente Binutils versions and
          we'll be able to catch the changes and keep the correct values.
  
          """
          from pybfd.gen_supported_disasm import get_supported_architectures, \
                                                 get_supported_machines, \
                                                 generate_supported_architectures_source, \
                                                 generate_supported_disassembler_header, \
                                                 gen_supported_archs
  
          #
          # Step 1 . Get the patch to libopcodes and nm utility for further
          # usage.
          #
          libs_dirs = [os.path.dirname(lib) for lib in self.libs]
  
          libopcodes = [lib for lib in self.libs if os.path.basename(lib).startswith("libopcodes")][0]
          print "[+] Detecting libbfd/libopcodes compiled architectures"
  
          if self.with_static_binutils: # use the nm from the binutils distro
  
              nms = [
                  os.path.join( libs_dir, "..", "bin", "nm" ), # default name of nm
                  os.path.join( libs_dir, "..", "bin", "gnm" ) # in OSX brew install binutils's nm as gnm.
              ]
              path_to_nm = None
              for nm_fullpath in nms:
                  if os.path.isfile( nm_fullpath ):
                      path_to_nm = nm_fullpath
                      break
              if path_to_nm == None:
                  raise Exception("no suitable 'nm' found.")
          else:
              path_to_nm = "nm"  # Use the nm in the $PATH (TODO: its assume that nm exists)
          #
          # Step 2 .
          #
          # Prepare the libs to be used as option of the compiler.
  
          path_to_bfd_header = os.path.join( self.includes, "bfd.h")
          supported_machines = get_supported_machines(path_to_bfd_header)
  
          supported_archs = get_supported_architectures(
              path_to_nm,
              libopcodes,
              supported_machines,
              self.with_static_binutils == None)
  
          source_bfd_archs_c = generate_supported_architectures_source(supported_archs, supported_machines)
          print "[+] Generating .C files..."
          gen_file = os.path.join(PACKAGE_DIR, "gen_bfd_archs.c")
          with open(gen_file, "w+") as fd:
              fd.write(source_bfd_archs_c)
          print "[+]   %s" % gen_file
  
          if self.with_static_binutils:
             link_to_libs = [] # ...
          else:
             link_to_libs = [self.prepare_libs_for_cc(os.path.basename(lib)) for lib in self.libs]
  
          c_compiler = new_compiler()
          objects = c_compiler.compile(
              [os.path.join(PACKAGE_DIR, "gen_bfd_archs.c"), ],
              include_dirs = [self.includes,]
              )
          program = c_compiler.link_executable(
              objects,
              libraries = link_to_libs,
              library_dirs = libs_dirs,
              output_progname = "gen_bfd_archs",
              output_dir = PACKAGE_DIR
          )
          gen_tool = os.path.join(PACKAGE_DIR, "gen_bfd_archs")
          gen_file = os.path.join(self.build_lib, PACKAGE_DIR, "bfd_archs.py")
          cmd = "%s > %s" % (
                      gen_tool,
                      gen_file  )
  
          print "[+] Generating .py files..."
          # generate C dependent definitions
          os.system( cmd )
          # generate python specific data
          with open(gen_file, "a") as f:
              f.write( gen_supported_archs(supported_archs) )
  
          # Remove unused files.
          for obj in objects:
              os.unlink(obj)
          os.unlink(gen_tool)
  
          print "[+]   %s" % gen_file
  
          #
          # Step 3 . Generate header file to be used by the PyBFD extension
          #           modules bfd.c and opcodes.c.
          #
          gen_source = generate_supported_disassembler_header(supported_archs)
  
          if len(supported_archs) == 0:
              raise Exception("Unable to determine libopcodes' supported " \
                  "platforms from '%s'" % libopcodes)
  
          print "[+] Generating .h files..."
          gen_file = os.path.join(PACKAGE_DIR, "supported_disasm.h")
          with open(gen_file, "w+") as fd:
              fd.write(gen_source)
          print "[+]   %s" % gen_file
  
          return supported_archs