Battery charger regulator question?

I've got a 40 amp 12 volt  RV power supply that I want turn into a battery charger.  Anyone got any ideas about how to regulate the current so it doesn't cook the batteries??

Thanks 

What's it charging ? You need more than 12V to charge a 12V battery.

Steve