[PATCH v2 0/2] kbuild: Show Kconfig fragments in "help"

Nicolas Schier nicolas at fjasle.eu
Mon Aug 28 23:16:52 PDT 2023


On Mon 28 Aug 2023 16:17:07 GMT, Michael Ellerman wrote:
> Masahiro Yamada <masahiroy at kernel.org> writes:
> > On Sat, Aug 26, 2023 at 4:55 AM Kees Cook <keescook at chromium.org> wrote:
> >>
> >> Hi,
> >>
> >> This is my series to show *.config targets in the "help" target so these
> >> various topics can be more easily discoverd.
> >>
> >> v2:
> >>  - split .fragment from .config to hide "internal" fragments
> >
> > Please do not do this churn.
> 
> That was my idea :}
> 
> > Like Randy, I did not get "why" part quiet well,
> > but if you are eager about this,
> > you can show help message only when the following
> > ("# Help:" prefix for example) is found in the first line.
> >
> > # Help: blah blah
> > # other comment
> 
> I did think of that, but wasn't sure how to do it in make.

Something like this should do it:

	@grep -Hnm1 -e '^# Help:' $(foreach f, $(sort $(notdir $(call configfiles,*.config))), $(firstword $(call configfiles,$(f)))) | \
	 while read loc dummy helptext; do \
		tmp="$${loc%:#}"; file="$${tmp%:*}"; line="$${tmp##*:}"; \
		[ "$${line}" = "1" ] && \
		  printf "  %-25s - %s\\n" "$${file##*/}" "$${helptext}"; \
	 done

but this neither beautiful nor elegant it likes to be improved.

Kind regards,
Nicolas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-riscv/attachments/20230829/b39c33c1/attachment.sig>


More information about the linux-riscv mailing list