bmakelib icon indicating copy to clipboard operation
bmakelib copied to clipboard

Print the available targets and variables along w/ their docs

Open bahmanm opened this issue 2 years ago • 2 comments

bmakelib should contain a target to list all available targets along w/ their documentation.

For example:

$ make bmakelib.help
TARGETS
-------
foo:  foo inline docs
bar:  bar inline docs
baz:  no documentation available

VARIABLES
---------
X:  no documentation available
Y:  Y inline docs

bahmanm avatar Sep 30 '23 13:09 bahmanm

I would kill for this feature.

ACleverDisguise avatar Oct 05 '23 07:10 ACleverDisguise

It shouldn't be too difficult w/ a bit of Perl magic. However, we'd need to make a compromise and only support certain ways of documenting targets.

I'm not sure what could be considered a common style(s) of that.


I'm seen people do


foo:  ## lorem ipsum dolor

or

# lorem ipsum dolor
foo: 

and there's also my personal style using Markdown. for an example see https://github.com/bahmanm/bmakelib/blob/4108d438d54cfbfcdc422bddf4a62ffd5c8f84c4/src/bmakelib.mk#L17

#######################################################################
#>
#   # foo
#
#   Lorem ipsum dolor.
#   Aliquam diam sapien, suscipit ac ligula a, cursus tempus ante. 
#<
#######################################################################

foo :

For the first version, I think as soon as we choose which style is the preferred one, I can get started w/ this.

bahmanm avatar Oct 05 '23 08:10 bahmanm