I recommend mobile Web Design by Cameron Moll, it covers every aspect of mobile web design including a really comprehensive section on targeting a wide variety of mobile devices. I don’t normally recommend books because most information is available on the net – but I think this book is more comprehensive than anything I’ve found on the internet when it comes to mobile web design… so I suppose its well named ;)
SO I thoguht I would post where I have got to in this quest . . . not that far really BUT http://www.andymoore.info/php-to-detect-mobile-phones/ is a really simple option. Its a small PHP file and works a treat.
Using this and the link Edwin pulled up, it gives a nice lightweight option.