ISO 14067 defines how to calculate it. It can cover the whole life cycle or only part of it, such as cradle-to-gate, and it requires declaring the unit, the system boundary and the data used. Two footprints are only comparable if they share all three.
Official sources: ISO 14067:2018 (opens in a new tab)