Nucleosynthesis and chemical evolution of galaxies