Investors & landlords

Do you allocate the gain or loss proportionally? If the gross sales price is $300k, $200k is building, $100k is land you allocate the $200k to the various non land assets proportionally based on their origional cost?