  An important test for models of galaxy formation lies in the metallicity
distribution functions (MDFs) of spheroid stars and their globular clusters
(GCs).We have compared the MDFs obtained from spectroscopy of the GCs and the
star-by-star photometry of red giants in the nearby elliptical NGC 5128, with
the predictions of a semi-analytic galaxy formation model. We have selected
model ellipticals comparable in luminosity and environment to NGC 5128, and
derived their MDFs. A direct comparison between models and data shows that the
MDFs are qualitatively similar, both have stellar components which are
predominantly metal-rich (0.8Z), with a small fraction of metal-poor stars
extending down to 0.002Z. The model MDFs show only small variations, whether
they are brightest cluster galaxies or low luminosity group ellipticals. Our
comparison also reveals that these model MDFs harbour a greater fraction of
stars above solar metallicity than the observations, producing generally more
metal-rich (by 0.1 dex) MDFs. One possibility is that the outer-bulge
observations are missing some of the highest metallicity stars. We find good
agreement between the model and observed GC MDFs, provided that the metal-poor
GC formation is halted early in the model. Under this proviso, both the models
and data are bimodal with peaks at 0.1Z and Z, and cover similar metallicity
ranges. This broad agreement for the stars and GCs suggests that the bulk of
the stellar population in NGC 5128 may have been built up in a hierarchical
fashion, involving both quiescent and merger-induced star formation. The
existence of age structure amongst the metal-rich GCs needs to be tested
against high-quality data for this galaxy.
