Determine the slope of the existing roof by putting a level on the roof at the low end or end farthest from the house. Measure the gap between the level and the roof at the 12-inch mark; it should be at least 2 inches. Decide on a type of new roof. A shed-style roof, for instance, which slopes only one direction, is easier to build over a flat roof, or choose a gable roof, with a peak and slopes on two sides. A hip roof or a gambrel roof are two other, more complex, roof styles.
Remove the old flat roof, using a prybar to pull nails. Rent a dumpster to hold all the remnants. Take off any roofing membrane, gravel or other roofing material, down to the plywood or oriented strand board decking. Remove any curbing or vertical edging at the edges of the roof. Remove the decking planks and any added caps on a wall end which provided a slope. Get the roof down to four walls with top caps.
Build a pitched shed-style roof by installing a horizontal ledger board on the wall of the house. Secure it to interior wall caps, studs or other framing members with long lag bolts, high enough to provide a slope of at least 4 inches per foot to the outer wall. Make rafters to connect the ledger and outer wall. Cut the angles with a circular saw and fasten the rafters with 16d framing nails and a hammer. Cover the rafters with roof decking and shingles, add metal edging to seal the edges
Make a gable-pitched roof to replace the flat roof by installing angled ledgers on the wall, cut to the pitch of the new roof, with space between the rafter ends at the peak for a ridge board. Fasten these with lag bolts to wall studs. Cut rafters to the desired pitch of the new roof and erect them the length of the roof. Nail the rafter ends to the wall caps with 16d framing nails and a hammer. Cover the roof with decking and shingles. Complete with metal edging.
Cut rafters for either style roof with a framing square, which has a thin tongue and a wide blade. Put the point of the square at the bottom of a rafter board. Align the 12-inch mark on the blade and the inch mark for the desired pitch, such as 4-inch for a roof that slopes 4 inches per foot, at the top of the board. Mark the angle alongside the tongue for a top cut, to fit against the horizontal ledger or to form a peak on a gable roof.