Skip to content

Commit 34eb479

Browse files
Update help.md
1 parent 17bfb73 commit 34eb479

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

recipes/make/help.md

+15-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# Help
2-
3-
Printing help for target commands.
2+
> Add a `help` target to your Makefile
43
54
The focus here is on the `help` target and some other targets are covered so you can see what kind of format is works against in that file.
65

6+
77
## Samples
88

99
### Basic
@@ -12,17 +12,28 @@ Find lines starting with lowercase letters or comments. This excludes `.HOOKS` a
1212

1313
- `Makefile`
1414
```mk
15-
help:
15+
h help:
1616
@grep ^[a-z#]' Makefile
1717
```
1818

19+
You have an export like `export FOO := 'bar'` by requiring only lowercase letters, spaces or hyphens up to a colon. This pattern does not care if there is anything after the colon.
20+
21+
- `Makefile`
22+
```mk
23+
h help:
24+
@egrep '^[a-z -]+:' Makefile
25+
```
26+
27+
If you want non-indented comments as well, add this to the start: `^#|`.
28+
29+
1930
### Not indented
2031

2132
Print lines that are not indented (targets and comments) or empty (so that empty lines add space between commands).
2233

2334
- `Makefile`
2435
```mk
25-
help:
36+
h help:
2637
@egrep '^\S|^$$' Makefile
2738
```
2839

0 commit comments

Comments
 (0)