Re: [PATCHv2] Makefile: implement help target

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I'm sorry for duplicated post; I made mistake that made vger anti-SPAM
filter stop it.

Michael J Gruber <git@xxxxxxxxxxxxxxxxxxxx> writes:

> with automatic help text collection from lines starting with "# Help: " and
> preceding a make target.
> 
> Suggested-by: Stephen Boyd <bebarino@xxxxxxxxx>
> Helped-by: Andreas Ericsson <andreas.ericsson@xxxxxx>
> Signed-off-by: Michael J Gruber <git@xxxxxxxxxxxxxxxxxxxx>
> ---
> Now how's this for portability and such? New output:
> 
> Build targets:
>     all:                Build the Git suite
>     dist:               Build git-$(GIT_VERSION).tar.gz source
>     dist-doc:           Build $(manpages).tar.gz and $(htmldocs).tar.gz
>     doc:                Build man pages and HTML docs
>     html:               Build HTML doc
>     info:               Build info docs
>     man:                Build man pages
>     pdf:                Build PDF docs
>     rpm:                Build source and binary RPM packages
> Clean targets:
>     clean:              Remove generated files but keep the configure script
>     distclean:          Remove generated files and the configure script
[...]

Shouldn't some excerpt of this be put in the commit message as example
output fragment?


>  Makefile |   43 +++++++++++++++++++++++++++++++++++++++++--
>  1 files changed, 41 insertions(+), 2 deletions(-)
> 
> diff --git a/Makefile b/Makefile
> index db2efd6..497dd92 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -1,4 +1,5 @@
>  # The default target of this Makefile is...
> +# Help: Build: Build the Git suite
>  all::
[...]

>  ### Testing rules

Why can't you use existing headers in Makefile, like the one above, to
divide list of targets in "make help" output into categories of
targets?

> +
> +# Help: Help: Show help for main make targets
> +help:
> +	@awk '/^# Help:/ { l=substr($$0,8); \

Doesn't it need to be $(AWK) not awk?

> +		getline; \
> +		j=index(l,":"); \
> +		print substr(l,1,j-1), substr($$0,1,index($$0,":")), substr(l,j+2); \
> +		}' <Makefile | sort | while read category target text; \
> +	do \
> +		test "$$category" = "$$currcat" || printf "$$category targets:\n"; \
> +		currcat="$$category"; \
> +		printf "    %-20s%s\n" "$$target" "$$text"; \
> +	done
> -- 
> 1.7.3.98.g5ad7d
> 

-- 
Jakub Narebski
Poland
ShadeHawk on #git
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]