Density-functional theory of a lattice-gas model with vapour, liquid, and solid phases