Fix broken parsing build rule

After adding template parsing, the build rules of Makefile becomes more
complicated. When "cmm" codes are modified, they should be re-parsed.
For correct re-parsing, we need to save some information, such as the
template definitions and instances.