Thermodynamics of steady states