Files
pdtv26/make-help.awk
T
dckc 147bfdc55e feat(ir-pico): learn and send IR codes from a Pico on USB
CircuitPython on a Pico H drives an IR transceiver: it prints the code
for any remote button it hears, and sends a code it's given, NEC,
Samsung, or raw pulses for the rest. pico_tty.py drives it over USB
serial. wiring.md says how to put it together.

The flake starts here: a dev shell (nix develop --command make test)
and a check that runs the doctests.

Tested: make install, then make send turned on a Vizio TV.

Generated-by: Claude Opus 5.5
2026-12-02 15:01:57 -06:00

36 lines
873 B
Awk

# make-help.awk
#
# Purpose:
# Generate `make help` output by pairing:
# - a comment line: `## Description...`
# - the next target line: `target: ...`
#
# If you think in Python/JS terms:
# - `pending_doc` is a small state variable (like a closure var in a parser loop).
# - each input line is processed as a record.
# - when we see `## ...`, we store it.
# - when we see `target:`, we print `target -> stored description` and clear state.
BEGIN {
pending_doc = ""
}
# Capture human-facing docs from lines like:
# ## Build the image.
/^## / {
pending_doc = substr($0, 4)
next
}
# Match make targets like:
# build: deps...
# Ignore special targets (.PHONY etc.) and variable assignments.
/^[a-zA-Z0-9_.-]+:/ {
if (pending_doc != "") {
split($0, parts, ":")
target = parts[1]
printf " %-12s - %s\n", target, pending_doc
pending_doc = ""
}
}