Thermodynamics of multiphase systems A treatment of closed systems with homogeneous free-energy functions