The invention describes a machine (1, 1b) for making ice-cream which comprises a holding tank (3) and a cooling and/or heating circuit (6) for a liquid or semiliquid foodstuff (2) to be treated, a detection apparatus (10,110) capable of detecting a characteristic parameter (P1) of this product (2), and a control unit (50) capable of recognising the product (2) starting from this parameter (P1), and for setting operating parameters (P2) for the machine (1,1b) on the basis of the product (2) recognised.