Here is something I wrote a while back in my diary concerning a thoughts for a shader that would handle one light casting shadows from any number of objects onto any number of objects, as it utilizes a depth buffer from the camera's perspective and a depth buffer from the lights perspective, and some linear algebra to determine if a given pixel on the screen should be in the shade or not.
Shadow Map:
Create
a dynamic environment depth buffer map from the light's perspective. The depth buffer of the screen is taken, and then for each point on the screen, the depth is
considered and a point in 3d space is derived, then that point's
location on the light's environment depth map is compared to the actual depth
of said point. If the point is deeper than the lights environment depth map,
the point is shaded, if it is equivalent (or closer just in case) it is lit. An occlusion map may
be provided to ensure that objects a given distance and or angles
from the light are shaded. If a point is lit it's normal is taken
into account relative to the light to derive the amount of lighting.
Multiple
lights can be used, their effect should be additive, such that no
pixel is shaded by a light when another light is lighting it. The
Light Map is a gray scale texture that is derived from all this, and is
overlaid onto the rendering providing dark where light is occluded.
Possible
alterations give a light distance map for the shaded pixels. If a
shaded area is far enough from the light and close enough to the
shadow's boundary the point could be lit a bit more to simulate the
curvature of light paths.
So there's this, I haven't gone into actually implementing it. But this is a good general solution. However you'll have to do a pass for each of these lights you want.