The high metallicity of the intra-cluster medium (ICM) is generally interpreted on the base of the galactic wind scenario for elliptical galaxies. In this framework, we develop a toy-model to follow the chemical evolution of the ICM, formulated in analogy to chemical models for individual galaxies. The model computes the galaxy formation history (GFH) of cluster galaxies, connecting the final luminosity function (LF) to the corresponding metal enrichment history of the ICM. The observed LF can be reproduced with a smooth, Madau-plot like GFH peaking at z~ 1-2, plus a burst of formation of dwarf galaxies at high redshift. The model is used to test the response of the predicted metal content and abundance evolution of the ICM to varying input galactic models. The chemical enrichment is computed from galactic yields based on models of elliptical galaxies with a variable initial mass function (IMF), favouring the formation of massive stars at high redshift and/or in more massive galaxies. For a given final galactic luminosity, these model ellipticals eject into the ICM a larger quantity of gas and of metals than do standard models based on the Salpeter IMF. However, a scenario in which the IMF varies with redshift as a consequence of the effect of the the cosmic background temperature on the Jeans mass scale, appears to be too mild to account for the observed metal production in clusters. The high iron-mass-to-luminosity-ratio of the ICM can be reproduced only by assuming a more dramatic variation of the typical stellar mass, in line with other recent findings. The mass in the wind-ejected gas is predicted to exceed the mass in galaxies by a factor of 1.5-2 and to constitute roughly half of the intra-cluster gas.