Preheat the oven to 425°F.
Roast the bones for 45 minutes. Turn them and roast 30 to 45 minutes more until deeply browned.
Char the onions cut side down in a dry skillet until very dark.
Transfer bones to a large stockpot. Add onions, carrots, celery, tomatoes, mushrooms, bay leaves, thyme, and rosemary if using lamb.
Cover with 4 to 5 quarts cold water, or enough to cover by about 1 inch.
Deglaze the roasting pans with a little water, scrape up the browned bits, and add that liquid to the pot.
Bring slowly to a bare simmer. Skim the surface as needed. Do not boil hard.
Simmer gently for about 5 hours.
Strain once through a colander, then again through a fine sieve lined with cheesecloth.
For brown stock, chill and store as is.
For demi-glace, return to the pot and reduce gently until lightly syrupy.
For meat glaze, reduce further until thick, glossy, and highly concentrated.
Cool quickly, transfer to containers, label, and refrigerate or freeze.