Skip to content

Convert the 'map' target in the Makefile to a native in-line, dropping the external script - #600

Merged
hannesa2 merged 1 commit into
gitx:masterfrom
goneng:converge-map-target
Sep 11, 2026
Merged

hannesa2 merged 1 commit into
gitx:masterfrom
goneng:converge-map-target

Conversation

@goneng

@goneng goneng commented Sep 11, 2026 •

Copy link
Copy Markdown
Collaborator

map lived in a helper script, which is not really required.
Folding it into the Makefile and makes the target travel with the file it describes.

  • Move the pipeline and the awk into the recipe, dropping the script
  • Name the makefile through MAKEFILE, so -f and the self-filter stop relying
    on the file happening to be called Makefile
  • Line the descriptions up at MAP_WIDTH instead of trailing them after a tab,
    and give the sections headers
  • Say nothing when nothing was read: make map now reports and fails rather
    than printing an empty map
  • Label the three aliases ## (alias), so help stops hiding them

Test plan:

  • make map output checked against gawk 5.2.1, mawk 1.3.4, busybox awk and the
    macOS awk: byte identical on all four
  • make map MAKEFILE=/dev/null, an empty file and a broken one each report
    map: no targets found in ... and exit non-zero
  • make help, make -n unit-test unchanged

Read the graph inline, so that the target travels with the Makefile it
describes and can be lifted into another project by copying two rules.

The script had drifted from the copy kept as a sample elsewhere, which
had meanwhile learned to name the makefile it reads rather than assume
it. Both now hold the same rules, and correctness no longer rests on the
file happening to be called Makefile.

- Move the pipeline and the awk into the recipe, dropping
  scripts/make-target-map.sh
- Add MAKEFILE, so `-f` and the self-filter both name the file make read
- Read the help text out of MAKEFILE_LIST, covering included fragments
- Separate a description from its target with a tab
@goneng goneng changed the title Keep the map target in the Makefile instead of a script Convert the 'map' target in the Makefile to a native in-line, dropping the external script Sep 11, 2026
@goneng
goneng marked this pull request as ready for review September 11, 2026 16:04
@hannesa2 hannesa2 added the pipeline CI pipeline label Sep 11, 2026
@hannesa2
hannesa2 merged commit 5b021fc into gitx:master Sep 11, 2026
3 checks passed
@goneng
goneng deleted the converge-map-target branch September 11, 2026 17:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pipeline CI pipeline

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants