Design, fabrication and characterization of phase masks for astronomical applications