This paper presents a general method for defining the macroscopic free-energy density function and its complementary forms for a porous medium saturated by two non-miscible fluids, in the case of compressible fluid and solid constituents, non-isothermal conditions and negligible interfacial surface energy. The major advantage of the proposed approach is that no limitation or simplification is posed on the choice of the free energies of the fluid constituents. As a result, a fully non-linear equation of state for the pore fluids can be incorporated within the proposed framework. The method is presented under the assumption that interfacial surface energy terms are negligible, thus recovering a Bishop parameter chi coinciding with the degree of saturation, which is expected to be applicable mostly to non-plastic soils. Moreover, small strains of the solid skeleton are assumed, but the method can be easily extended to a large strain formulation as discussed below. The paper analyzes also some particular cases concerning the incompressibility of all constituents, the geometric linearization and the incompressibility only of the solid constituent. The knowledge of the free energy density function is the starting point for the evaluation of the dissipation function, of energy and entropy balance and, in general, for the formulation of thermodynamically consistent constitutive models.