4 ms·
> If your project sports auto-generated code, or any sort of > build targets that depend on inputs only known after > generation -- Make simply cannot handle th
by gyepi 14y ago
> If your project sports auto-generated code, or any sort of > build targets that depend on inputs only known after
> generation -- Make simply cannot handle this.
> There are ugly workarounds but they don't work well.
Hmm. I write a lot of generated code and have not found this to be true at all. Many of my projects have multiple levels of code generation that and make handles them just fine.
The key is to play to make's strengths and define pattern rules so you can hook into rules engine. Nothing like typing make and having it know to run a script to generate a text file that is further processed by another tool to generate more files that eventually get compiled to produce what you want.
- Peaker 14y agoCan you should an example Makefile that does this correctly? How do you get make to do a multi-phase build, that generates code, then scans it to add to the dependency tree, then generates more, and so forth?