build(Makefile): make help produces usable output.

This commit is contained in:
Stephan Barth 2024-09-23 11:06:00 +02:00
parent 1a5564031d
commit bb57451cbc
2 changed files with 3 additions and 2 deletions

View File

@ -26,7 +26,7 @@ export DEV_PORT_HTTPS
.PHONY: help
# HELP: print out this help message
help:
@echo "Nothing to see here, go away"
@utils/makehelp.pl Makefile
.PHONY: all
# HELP: unfinished

View File

@ -5,6 +5,7 @@ use warnings;
my %msg = ();
my @start = ();
my %reorder = (help=>-1);
READ: while(<>) {
if(m/^# HELP HEADER START/) {
@ -34,7 +35,7 @@ READ: while(<>) {
print "$_\n" for @start;
print "\n" if @start;
for my $tar(sort keys %msg) {
for my $tar(sort {($reorder{$a}||0) <=> ($reorder{$b}||0) || $a cmp $b } keys %msg) {
print "$tar\n $msg{$tar}\n\n"
}