Synthesis of ring-shaped macromolecules