3 ms·
This is a good point. One big problem with solutions that match the text of the makefile is that they don't catch dynamically-generated targets. I have makefi
by mturmon 6y ago
This is a good point. One big problem with solutions that match the text of the makefile is that they don't catch dynamically-generated targets.
I have makefiles used for data-crunching that are parametrically-generated using $foreach in gnu make. One typical use case is "make these plots for all the data, for 10% of the data, or for just one example" - with targets generated by a $foreach(...) construct.
Asking make to regurgitate the targets it knows about catches these guys, grep doesn't.
There are many other examples of dynamically-generated rules, such as using macros that create rules via gnu make's "define".