Skip to content

Self-document the doc makefile - #12497

Open
philderbeast wants to merge 7 commits into
haskell:masterfrom
cabalism:doc/doc-makefile
Open

philderbeast wants to merge 7 commits into
haskell:masterfrom
cabalism:doc/doc-makefile

Conversation

@philderbeast

@philderbeast philderbeast commented Oct 29, 2026 •

Copy link
Copy Markdown
Collaborator

A follow on from #10608 but for adding help to the doc/Makefile, fixing #10596.

I'll squash commits before applying the merge label if this pull request is approved.


  • Patches conform to the coding conventions.
  • Is this a PR that fixes CI? If so, it will need to be backported to older cabal release branches (ask maintainers for directions).

@philderbeast
philderbeast force-pushed the doc/doc-makefile branch 2 times, most recently from 61f2145 to c7f3802 Compare November 4, 2026 13:10

@leana8959 leana8959 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think these ? quantifiers are redundant, otherwise lgtm :)

Comment thread Makefile Resolved
Comment thread doc/Makefile Resolved
@philderbeast

Copy link
Copy Markdown
Collaborator Author

I think these ? quantifiers are redundant, otherwise lgtm :)

Thanks @leana8959. Both grep -E and awk use POSIX extended regular expressions, so the ? works like optional rather than non-greedy.

Note, I copied the regex from the main Makefile into doc/Makefile but there we have rules with digits so had to account for that. I felt it better to have the same regex in both files so copied those changes back.

cabal/Makefile

Lines 343 to 346 in aca9bd4

.PHONY: help
help: ## Show the commented targets.
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | \
sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants