Thermodynamic approach to segregation at the interface of two condensed phases