1.allow the magma to cool, to get an igneous rock
2. expose the igneous rock to weathering agents
3. add humus and microbes and presto you've got soil
If the magma cools as intrusive rock (eg granite) then the time to become soil would be much greater than if it were extrusive lava (eg basalt), as you would need uplift and erosion before weathering. Hope it helps :]