Modify build system to automatically regenerate when templates are changed

Change-Id: I08e8181233dffd5baeb993b3bccb993e0ea821df