How do you get to fight devil doom in shadow the hedgehog?

Beat every stage and boss to reach the final story, and beat it. Devil Doom is the final boss.