make help: show generate-Makefile.ci#20186
Conversation
Makefile.include
Outdated
|
|
||
| help: | ||
| @$(MAKE) -qp | sed -ne 's/\(^[a-z][a-z_-]*\):.*/\1/p' | sort | uniq | ||
| @$(MAKE) -qp | sed -ne 's/\(^[a-z][a-zA-Z._-]*\):.*/\1/p' | grep -Fv -e '.module' -e '.xml' | sort | uniq |
There was a problem hiding this comment.
Please add a comment as to what this incantation is good for.
There was a problem hiding this comment.
Added and force-pushed.
There was a problem hiding this comment.
you could move the grep as additional -e expression to sed. not sure that makes it more readable or measurably faster.
| @$(MAKE) -qp | sed -ne 's/\(^[a-z][a-zA-Z._-]*\):.*/\1/p' | grep -Fv -e '.module' -e '.xml' | sort | uniq | |
| @$(MAKE) -qp | sed -e '/\.module$/d' -e '/\.xml$/d' -ne 's/\(^[a-z][a-zA-Z._-]*\):.*/\1/p' | sort | uniq |
My sort has an -u flag that further allows removing uniq.
83c2dc6 to
ac3826b
Compare
|
Further thinking about it after @kaspar030's comment lead me to reconsider my choice of blacklisting specifically *.module and *.xml, I could imagine there to be more non-user targets for different configurations/applications. Maybe a whitelisting approach to include Something like |
|
Ideally we would have a map: target - description The target names alone are of little help unless you already know what they are doing. |
generate-Makefile.ci is the only target interesting to the user containing uppercase and a dot. Instead of matching all such targets with sed, generate-Makefile.ci is matched explicitly, to avoid showing internal targets.
ac3826b to
292393c
Compare
That's what I've changed it to now. Still feels a bit hacky, but probably cleaner than the former solution.
Very true, I second this! But until that is added, this PR still is an improvement over the current situation.
In this case I remembered there was a Makefile command for generating the |
Contribution description
generate-Makefile.ciis the only target interesting to the user containing uppercase and a dot, which wasn't matched by thesedcommand used inmake help. Changing that accordingly matches*.moduleand*.xmltargets, too, which still shouldn't be part of the user-visible targets. Therefore, those are filtered out withgrep.Testing procedure
master:make -C examples/hello-world help > beforemake -C examples/hello-world help > afterdiff before afterresults in:Issues/PRs references
generate-Makefile.ciwas added with #19244