Install base flashing under shingles or over metal roofing material.
How to attach a metal roof to a wall.
Here is an attempt though maybe not a very good one to make the roof flashing serve also as a through the wall flashing with a tile roof.
Before you install metal roofing repair any damage to the wood under the shingles.
The flat roofing material must go up the wall a minimum of 12 or up the wall and over the top of the wall if the wall is less than 12 high.
Follow the photo for illustrated instructions.
Installation using exposed fasteners.
Then cover the entire roof with a layer of insulation and secure it with a staple gun.
Next use 1 inch nails to secure some metal edging to the perimeter of the roof.
Apply the sealant tape along the center of the entire eave and remove the tape backing.
Lay the starter row of metal shingles at the drip edge and affix to the roof with metal roofing nails.
Work up from the initial row starting at the lower corner in a diagonal pattern staggering the shingles to prevent gaps.
If the roof runs flat up against the brick wall you must install the roof side of the flashing either under the last layer of shingles or over the roof material if it is metal.
Metal roofing is also available in the form of shingles.
Remember sealant tape goes between all layers of metal.