-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
make help: show generate-Makefile.ci #20186
Conversation
Makefile.include
Outdated
@@ -1031,7 +1031,7 @@ ifneq (, $(filter all flash, $(if $(MAKECMDGOALS), $(MAKECMDGOALS), all))) | |||
endif | |||
|
|||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a comment as to what this incantation is good for.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added and force-pushed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.ci
is the only target interesting to the user containing uppercase and a dot, which wasn't matched by thesed
command used inmake help
. Changing that accordingly matches*.module
and*.xml
targets, 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 > before
make -C examples/hello-world help > after
diff before after
results in:Issues/PRs references
generate-Makefile.ci
was added with #19244