Reaction of tert-butyl cyanoacetate (I) with ethyl mercaptoacetate (II) in the presence of potassium carbonate, followed by N-methylation and ester cleavage affords the intermediate carboxylic acid (III). This compound, by POCl3 in dimethylformamide or by Br2/TPP, is converted to the corresponding acid halogenide (IV), which is finally condensed with 2-chloro-6-methylaniline (V).