You should use rubber. It will do all the nasty stuff for you, and make the errors slightly less dumb. Admittedly somewhat poorly named for searching for help on it, but it works.
The last time I tried Rubber, it was way too buggy. So I usually prefer Latexmk:
:-) TBH, though, there's just no comparison for producing nicely-formatted research papers. Especially in that eye-straining, dual-column, 9pt ACM conference format.