Skip to content

Commit 17bfb73

Browse files
Update help.md
1 parent 99efcae commit 17bfb73

File tree

1 file changed

+15
-12
lines changed

1 file changed

+15
-12
lines changed

recipes/make/help.md

+15-12
Original file line numberDiff line numberDiff line change
@@ -8,32 +8,36 @@ The focus here is on the `help` target and some other targets are covered so you
88

99
### Basic
1010

11-
My own.
11+
Find lines starting with lowercase letters or comments. This excludes `.HOOKS` and any constants (typicall set using uppercase). This excludes empty lines, so the output is tightly packed.
1212

1313
- `Makefile`
1414
```mk
15-
# Show summary of make targets.
1615
help:
17-
@echo 'Print lines that are not indented (targets and comments) or empty.'
18-
@egrep '^\S|^$$' Makefile
16+
@grep ^[a-z#]' Makefile
1917
```
2018

21-
### Extended
19+
### Not indented
2220

23-
If you use `@echo` within your targets:
21+
Print lines that are not indented (targets and comments) or empty (so that empty lines add space between commands).
2422

25-
My own.
23+
- `Makefile`
24+
```mk
25+
help:
26+
@egrep '^\S|^$$' Makefile
27+
```
28+
29+
### Include echo lines
30+
31+
If you use `@echo` within your targets, you can incldue them.
32+
33+
Includes left-aligned, empty lines and echo lines.
2634

2735
- `Makefile`
2836
```mk
29-
# Show summary of make targets.
3037
help:
31-
@echo 'Print lines that are not indented (targets and comments) or empty, plus any indented echo lines.'
3238
@egrep '(^\S)|(^$$)|\s+@echo' Makefile
3339
```
3440

35-
Alt echo: `@echo "Include left-aligned, empty lines and echo lines."`
36-
3741
### Detailed
3842

3943
Copied from Poetry's [Makefile](https://github.com/python-poetry/poetry/blob/master/Makefile).
@@ -42,7 +46,6 @@ This is complex - I don't know why. I haven't tested yet but maybe something her
4246

4347
- `Makefile`
4448
```makefile
45-
# lists all available targets
4649
list:
4750
@sh -c "$(MAKE) -p no_targets__ | \
4851
awk -F':' '/^[a-zA-Z0-9][^\$$#\/\\t=]*:([^=]|$$)/ {\

0 commit comments

Comments
 (0)