Or you can use the multi-language plugin to build a second set of pages and then symlink the webroot of mobile.foo.com over to foo.com/mobile.
If you will send me an email, we have a new custom plugin that might work for you. It can build pages to an admin-set folder on the server, as long as the permissions are set properly for the script to write to it. It's not an inexpensive route to take, but it does suit your requirements perfectly.
Gossamer Threads is a Vancouver-based company with over 18
years experience in web technology. From development to hosting, we
partner with leading organizations around the globe and help to build
their web presences, strategies and infrastructures.