Skip to content

Commit 670fd3f

Browse files
committed
Polish docs
1 parent a5017c8 commit 670fd3f

3 files changed

Lines changed: 16 additions & 17 deletions

File tree

Makefile

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ help: VFLAGS := \
4848
help: $(AWK_BIN)/$(AWK)
4949
@$< $(VFLAGS) $(AWK_FLAGS) -f $(MAKEFILE_DOC) $(MAKEFILE_LIST)
5050

51-
.PHONY: test
5251
## Run integration tests
52+
.PHONY: test
5353
test: $(INTEGRATION_TESTS)
5454

5555
## Run unit tests
@@ -66,13 +66,13 @@ utest: $(AWK_BIN)/$(AWK) $(MAKEFILE_DOC) $(UNIT_TESTS) $(UNIT_TEST_DIR)/unittest
6666
/dev/null
6767
@rm /tmp/.makefile-doc-stderr
6868

69-
.PHONY: test-all-awk
7069
## Run integration tests with all supported awk variants
70+
.PHONY: test-all-awk
7171
test-all:
7272
@$(foreach X,$(SUPPORTED_AWK_VARIANTS),$(MAKE) test AWK=$(X);)
7373

74-
.PHONY: utest-all-awk
7574
## Run unit tests with all supported awk variants
75+
.PHONY: utest-all-awk
7676
utest-all:
7777
@$(foreach X,$(SUPPORTED_AWK_VARIANTS),$(MAKE) utest AWK=$(X);)
7878

@@ -96,6 +96,7 @@ coverage-utests.html: utest
9696

9797
## Lint the code using `gawk`
9898
# Warnings to ignore have been stripped below
99+
.PHONY: lint
99100
lint: UNINIT := (|SUB|COLOR_.*|VARS|OFFSET|PADDING|DEPRECATED|RECIPEPREFIX|AWK|\
100101
|TARGETS_REGEX|VARIABLES_REGEX|OUTPUT_FORMAT|EXPORT_THEME|UNIT_TEST)
101102
lint: override AWK := awk
@@ -123,14 +124,13 @@ check-variables:
123124
clean-bin: ##! Remove all downloaded awk variants
124125
@rm -rf $(AWK_BIN)
125126

126-
## Remove coverage reports
127127
.PHONY: clean
128-
clean:
128+
clean: ## Remove coverage reports
129129
@rm -f $(COVER_FILE).all $(COVER_FILE).integration $(COVER_FILE).unit \
130130
coverage-tests.html coverage-utests.html coverage.html
131131

132-
.PHONY: release
133132
##! Create github release at latest tag
133+
.PHONY: release
134134
release: LATEST_TAG := $(shell git describe --tags)
135135
release: RELEASE_NOTES := release_notes.md
136136
release:
@@ -147,9 +147,9 @@ release:
147147
## Recipes:
148148
## ---------
149149

150-
# Now we redirect to actual files because making sure that stderr and stdout
150+
# We redirect to actual files because making sure that stderr and stdout
151151
# appear in the righ order with all AWK variants (in particular goawk) and on
152-
# CI was problematic
152+
# CI was problematic otherwise
153153
$(INTEGRATION_TESTS): FILE_CMD = /tmp/.makefile-doc_$@_command
154154
$(INTEGRATION_TESTS): FILE_EXPECTED = /tmp/.makefile-doc_$@_expected
155155
$(INTEGRATION_TESTS): FILE_ACTUAL = /tmp/.makefile-doc_$@_actual

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ We refer to targets / variables as anchors (for docs/sections).
6666
color and allows to filter it out, see the `DEPRECATED` flag below).
6767

6868
+ Multi-line docs can be added above an anchor, inline docs are ignored when top docs
69-
are present. Only the first line in a multi-line doc need to include a token with an
69+
are present. Only the first line of a multi-line doc needs to include a token with an
7070
emphasis (i.e., `##!` or `##%`).
7171

7272
+ Sections can be defined using `##@`. All lines in a multi-line section should start
@@ -209,4 +209,5 @@ Execute `make test utest` (this uses the system's default `awk`). To test with a
209209
+ `make test utest AWK=wak`
210210
+ `make test utest AWK=goawk`
211211

212-
You need a standard build environment.
212+
You need a standard build environment. To compile `nawk` ensure that `bison` is
213+
installed (`dnf install bison`). For `goawk` you need `golang` (`dnf install golang`).

makefile-doc.awk

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,7 @@
5858
# then passing -v SUB='AWK:$(SUPPORTED_AWK_VARIANTS)' would add the values of
5959
# SUPPORTED_AWK_VARIANTS to the documentation of the variable AWK. This mechanism is
6060
# also useful when documenting targets defined in terms of variables/expressions,
61-
# which we might want to rename in addition to adding a list of expanded targets to
62-
# the documentation. The format of a single substitution is
61+
# which we might want to rename. The format of a single substitution is
6362
# [<p1:v1,...>]NAME[:LABEL]:[VALUES]
6463
# + NAME is the name of the variable/target to substitute in the documentation
6564
# + LABEL is an optional label for renaming the variable/target
@@ -103,11 +102,11 @@
103102
# [recipe]
104103
#
105104
# where:
105+
# variable assignment: a single variable can be assigned per rule
106106
# prerequisits := normal-prerequisites | order-only-prerequisites
107107
# inline recipe := [command] [; command ...]
108108
# recipe := [command]
109109
# [...]
110-
# variable assignment: a single variable can be assigned per rule
111110
#
112111
# with normal-prerequisites and order-only-prerequisites being space separated lists
113112
# of target names.
@@ -122,11 +121,10 @@
122121
# + Target line: the top-line (the header) of a Makefile rule
123122
# + Target name: a (string) label for a target
124123
# + Description of a rule: comments starting with ##, ##! or ##% placed above the
125-
# target line of a rule or inline. Inline descriptions cannot be placed after an
126-
# inline recipe.
124+
# target line of a rule or inline. Inline descriptions placed after an inline recipe
125+
# are ignored.
127126
# + The last rule with a description defines the description of a normal target, while
128-
# every double-colon rule with a description defines a double-colon target with a
129-
# new ~index.
127+
# every double-colon rule with a description defines a new description.
130128

131129
function max(x, y) {
132130
return (x >= y) ? x : y

0 commit comments

Comments
 (0)