File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33[ ![ CI] ( https://github.com/drdv/makefile-doc/actions/workflows/main.yml/badge.svg )] ( https://github.com/drdv/makefile-doc/actions/workflows/main.yml )
44
55The ` makefile-doc.awk ` script can be used to extract documentation from a Makefile. It
6- is simply a more elaborate, POSIX-compliant, version of [ this
7- gist ] ( https://gist.github.com/prwhite/8168133 ) one-liner. An example of the generated
6+ is simply a more elaborate, POSIX-compliant, version of
7+ [ this ] ( https://gist.github.com/prwhite/8168133 ) one-liner. An example of the generated
88documentation can be seen [ here] ( https://drdv.github.io/blog/202511-makefile-doc ) .
99
1010## How to use
Original file line number Diff line number Diff line change @@ -872,22 +872,8 @@ BEGIN {
872872
873873 RECIPEPREFIX = RECIPEPREFIX == 0 ? " ^\t " : RECIPEPREFIX
874874
875- # Names of variables:
876- # 1. may start with spaces
877- # 2. but not with a # or with a dot (in order to jump over e.g., .DEFAULT_GOAL)
878- # 3. can be followed by spaces and one of the assignment operators, see
879- # ASSIGNMENT_OPERATORS_PATTERN
880875 VARIABLES_REGEX = VARIABLES_REGEX == " " ? VARIABLES_REGEX_DEFAULT : VARIABLES_REGEX
881876
882- # Names of targets:
883- # 1. may start with spaces
884- # 2. but not with a # or with a dot (in order to jump over e.g., .PHONY)
885- # 3. and can have spaces before the final colon.
886- # 4. There can be multiple space-separated targets on one line (they are captured
887- # together).
888- # 5. Targets of the form $(TARGET-NAME) and ${TARGET-NAME} are detected.
889- # 6. FS = ":" is assumed.
890- #
891877 # Since we cannot use negative lookahead, (:|::)([^=:]|$)( *|.*;) simulates no = after
892878 # the last colon. We need to add a colon in the negative character class to prevent
893879 # matching e.g., x ::= 1
You can’t perform that action at this time.
0 commit comments