No detached barn, garage or other accessory building shall be placed closer to a side or rear property line than 10 feet, closer to the street line than 10 feet at the rear of the rear main wall of the principal building and, on a corner lot, closer to the street line of the side street than a distance equal to 1/2 the width of the lot up to a distance which need not exceed 75 feet. In relation to an attached garage or carport built as a structural part of a dwelling, with or without breezeway connection, the same side and front yards shall be required as for a dwelling, and such side yards shall be measured from the outer walls or roof lines of such garage or carport. An attached garage or carport may extend into a rear yard.