From: Ævar Arnfjörð Bjarmason Date: Tue, 28 Sep 2010 14:54:49 GMT Subject: Re: [PATCH] Makefile: implement help target Message-ID: In-Reply-To: On Tue, Sep 28, 2010 at 14:44, Michael J Gruber wrote: > +#H# Check test coverage and create HTMl report HTML, not HTMl >  cover_db_html: cover_db >        cover -report html -outputdir cover_db_html cover_db > + > +#H# Show help for main make targets How about something less opaque, like "# Help: Show help [...]" or "# About:". It would serve the same purpose as #H#, without the reader wondering what that odd string means. > +help: > +       @sed -n  -e '/^#H#/ {N'\ > +               -e 's/^#H# \(.*\)\n\([a-z0-9_-]*\):.*/\2 \1/p'\ > +               -e '}' +       do \ > +               printf "%-20s: %s\n" "$$target" "$$txt"; \ > +       done Looks good, but --key=2 isn't in POSIX.