We develop a mean-field theory of carrier-induced ferromagnetism in diluted magnetic semiconductors. Our approach represents an improvement over standard RKKY model allowing spatial inhomogeneity of the system, free-carrier spin polarization, finite temperature, and free-carrier exchange and correlation to be accounted for self-consistently. As an example, we calculate the electronic structure of a Mn$_x$Ga$_{1-x}$As/GaAs superlattice with alternating ferromagnetic and paramagnetic layers and demonstrate the possibility of semiconductor magnetoresistance systems with designed properties.