Is there a clever way to cause the unix make command to run a tex variant as many times as are required to resolve all references? I've used tex for a long time, and I still don't know which of all those extra files (.aux, .log, etc) should be checked, so I usually just run (pdf)latex 3 times, but that is slow for a 400 page document. I am thinking that a fragment such as the line below might be a starting point ... maybe I should just string 3 or so of these together?
(pdflatex oar | grep -vq 'here were undefined references')