You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: recipes/make/help.md
+15-4
Original file line number
Diff line number
Diff line change
@@ -1,9 +1,9 @@
1
1
# Help
2
-
3
-
Printing help for target commands.
2
+
> Add a `help` target to your Makefile
4
3
5
4
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.
6
5
6
+
7
7
## Samples
8
8
9
9
### Basic
@@ -12,17 +12,28 @@ Find lines starting with lowercase letters or comments. This excludes `.HOOKS` a
12
12
13
13
-`Makefile`
14
14
```mk
15
-
help:
15
+
h help:
16
16
@grep ^[a-z#]' Makefile
17
17
```
18
18
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
+
19
30
### Not indented
20
31
21
32
Print lines that are not indented (targets and comments) or empty (so that empty lines add space between commands).
0 commit comments