The treatment of an acyl halide of formula 7 with a primary amine of formula R6???NH2 in a suitable solvent, such as dichloromethane, tetrahydrofuran, or N,N-dimethylformamide, gives a N-substituted amide of formula 8, wherein R5 is a hydrogen atom, while a secondary amine of formula NHR5R6 gives a N,N-disubstituted amide of formula 8.