Entropy as a state function for irreversible paths
As it was taught to me, that at least from the phenomenological point of view, the entropy is more fundamental than temperature.
The first law of thermodynamics postulates the existance a state function $U$ that we call internal energy. Then the second law of thermodynamics postulates the existance a state function $S$ that we call entropy. They satisfy their specific laws.
The entropy is function of the internal energy and other state parameremters: $$S = S(U,V,N,\dots)$$ where dots represent other possible state parameters, like magnetizaion for example. We have $$dS = \frac{\partial S}{\partial U} dU + \frac{\partial S}{\partial V} dV + \frac{\partial S}{\partial N} dN + \dots $$
We can define new state functions: $$\frac{1}{T}:= \frac{\partial S}{\partial U}$$ $$p := T \frac{\partial S}{\partial V}$$ $$\mu := -T \frac{\partial S}{\partial N}$$ So the temperature, pressure, chemical potential etc. are calaculated from entropy, not the other way around. (In particular, we can read the defintion of temperature as the amount of energy required to increase the entropy by a single unit, while keepeing the other state parametrs constant.)
We have then $$dS = \frac{1}{T} dU + \frac{p}{T} dV - \frac{\mu}{T} dN + \dots $$ or $$dU = T dS - p dV + \mu dN + \dots $$
The mechanical work performed on the system is calculated from the formula $$W = -\int p dV$$ so if there is no matter transfer or changes in other state parameters we have $$\Delta U = W + \int T dS$$ We call the part equal to $\int T dS$ the heat transfer: $$ Q : = \int T dS$$
We then proceed to prove other, non-fundamental, laws of thermodynamics.