code: def makefile(graph):
      
      from renku.models.provenance.activities import ProcessRun, WorkflowRun
  
      for activity in graph.activities.values():
          if not isinstance(activity, ProcessRun):
              continue
          elif isinstance(activity, WorkflowRun):
              steps = activity.subprocesses.values()
          else:
              steps = [activity]
  
          for step in steps:
              click.echo(' '.join(step.outputs) + ': ' + ' '.join(step.inputs))
              tool = step.process
              click.echo(
                  '\t@' + ' '.join(tool.to_argv()) + ' ' + ' '.join(
                      tool.STD_STREAMS_REPR[key] + ' ' + str(path)
                      for key, path in tool._std_streams().items()
                  )
              )
docs: Format graph as Makefile.