def _get_obj_file(ctx, src):
  """Returns the obj file for the given src."""
  extension_index = src.short_path.rindex(".c")
  obj_file = src.short_path[0:extension_index] + ".o"
  return ctx.new_file(obj_file)