A machine tool with a first holder for a tool, a second holder for a workpiece to be manufactured by means of said tool, a positioning device with which the holders are displaceable relative to one another, and a control member for controlling the positioning device, the positioning device being controllable by the control member, for the purpose of measuring a reference position of the tool relative to the workpiece, in accordance with a control program according to which the tool applies a distinguishing mark to the workpiece in a previously determined reference position of the positioning device, and the positioning device subsequently displaces a sensor and the workpiece relative to one another, the reference position of the tool relative to the workpiece being determined from a position of the positioning device in which the sensor detects the distinguishing mark, characterized in that the tool and the sensor are fastened in fixed, permanent positions relative to one another and relative to the first holder during operation.