I improved on the idea and skip even running yacc if there are generated files already. Since it is extremely rare that these files are changed, this is OK.