improve doxygen build logic

Doxygen will only be called when the 'doc' target is built
and one of its input files has changed.