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
@@ -19,7 +19,7 @@ A *dependency line* specifies one or more targets, and zero or more dependents.
19
19
20
20
`hi_bye.exe : hello.obj goodbye.obj helper.lib`
21
21
22
-
In this example, `hi_bye.exe` is the target. Its dependencies are `hello.obj`, `goodbye.obj`, and `helper.lib`. This dependency line tells NMAKE to build the target whenever `hello.obj`, `goodbye.obj`, or `helper.lib` has changed more recently than `hi_bye.exe`.
22
+
In this dependency line, `hi_bye.exe` is the target. Its dependencies are `hello.obj`, `goodbye.obj`, and `helper.lib`. The dependency line tells NMAKE to build the target whenever `hello.obj`, `goodbye.obj`, or `helper.lib` has changed more recently than `hi_bye.exe`.
23
23
24
24
A target must be at the start of the line. It can't be indented with any spaces or tabs. Use a colon (`:`) to separate targets from dependents. Spaces or tabs are allowed between targets, the colon separator (`:`), and dependents. To split the dependency line, use a backslash (`\`) after a target or dependent.
Multiple targets in multiple dependency lines in a single description block are evaluated as if each were specified in a separate description block, but targets that aren't in the last dependency line don't use the commands block. NMAKE attempts to use an inference rule for such targets.
72
+
When you have multiple targets in multiple dependency lines in a single description block, NMAKE evaluates them as if each were specified in a separate description block. However, only targets in the last dependency line use the commands block. NMAKE attempts to use an inference rule for the other targets.
72
73
73
74
For example, this set of rules,
74
75
@@ -78,13 +79,15 @@ bounce.exe climb.exe : up.obj
78
79
echo Building bounce.exe...
79
80
```
80
81
81
-
is evaluated as this:
82
+
is evaluated as:
82
83
83
84
```makefile
84
85
leap.exe : jump.obj
85
86
# invokes an inference rule
87
+
86
88
bounce.exe : jump.obj up.obj
87
89
echo Building bounce.exe...
90
+
88
91
climb.exe : up.obj
89
92
echo Building bounce.exe...
90
93
```
@@ -104,7 +107,7 @@ target.lib :: four.c five.c
104
107
105
108
### <aname="dependency-side-effects"></a> Dependency side effects
106
109
107
-
If a target is specified with a colon (:) in two dependency lines in different locations, and if commands appear after only one of the lines, NMAKE interprets the dependencies as if adjacent or combined. It doesn't invoke an inference rule for the dependency that has no commands, but instead assumes that the dependencies belong to one description block and executes the commands specified with the other dependency. For example, this set of rules:
110
+
You might specify a target with a colon (:) in two dependency lines in different locations. If commands appear after only one of the lines, NMAKE interprets the dependencies as if the lines were adjacent or combined. It doesn't invoke an inference rule for the dependency that has no commands. Instead, NMAKE assumes the dependencies belong to one description block, and executes the commands specified with the other dependency. Consider this set of rules:
108
111
109
112
```makefile
110
113
bounce.exe : jump.obj
@@ -113,7 +116,7 @@ bounce.exe : jump.obj
113
116
bounce.exe : up.obj
114
117
```
115
118
116
-
isevaluatedasthis:
119
+
isevaluatedas:
117
120
118
121
```makefile
119
122
bounce.exe : jump.obj up.obj
@@ -129,7 +132,7 @@ bounce.exe :: jump.obj
129
132
bounce.exe :: up.obj
130
133
```
131
134
132
-
isevaluatedasthis:
135
+
isevaluatedas:
133
136
134
137
```makefile
135
138
bounce.exe : jump.obj
@@ -177,7 +180,7 @@ In a dependency line, specify zero or more dependents after the colon (`:`) or d
Along with dependents you explicitly list in the dependency line, NMAKE can assume an *inferred dependent*. An inferred dependent is derived from an inference rule, and is evaluated before explicit dependents. If an inferred dependent is out-of-date compared to its target, NMAKE invokes the command block for the dependency. If an inferred dependent doesn't exist, or is out-of-date compared to its own dependents, NMAKE first updates the inferred dependent. For more information about inferred dependents, see [Inference rules](inference-rules.md).
183
+
Along with dependents you explicitly list in the dependency line, NMAKE can assume an *inferred dependent*. An inferred dependent is derived from an inference rule, and is evaluated before explicit dependents. When an inferred dependent is out-of-date compared to its target, NMAKE invokes the command block for the dependency. If an inferred dependent doesn't exist, or is out-of-date compared to its own dependents, NMAKE first updates the inferred dependent. For more information about inferred dependents, see [Inference rules](inference-rules.md).
181
184
182
185
### <aname="search-paths-for-dependents"></a> Search paths for dependents
NMAKE builds only specified *targets* or, when none is specified, the first target in the makefile. The first makefile target can be a [pseudotarget](pseudotargets.md) that builds other targets. NMAKE uses makefiles specified with **/F**, or if **/F** isn't specified, the Makefile file in the current directory. If no makefile is specified, it uses inference rules to build command-line *targets*.
15
+
NMAKE builds only specified *targets* or, when none is specified, the first target in the makefile. The first makefile target can be a [pseudotarget](description-blocks.md#pseudotargets) that builds other targets. NMAKE uses makefiles specified with **/F**, or if **/F** isn't specified, the Makefile file in the current directory. If no makefile is specified, it uses inference rules to build command-line *targets*.
16
16
17
17
The *command-file* text file (or response file) contains command-line input. Other input can precede or follow \@*command-file*. A path is permitted. In *command-file*, line breaks are treated as spaces. Enclose macro definitions in quotation marks if they contain spaces.
18
18
@@ -23,7 +23,7 @@ NMAKE options are described in the following table. Options are preceded by eith
23
23
| Option | Purpose |
24
24
| ------------ | ------------- |
25
25
|**/A**| Forces build of all evaluated targets, even if not out-of-date compared to dependents. Doesn't force builds of unrelated targets. |
26
-
|**/B**| Forces build even if timestamps are equal. Recommended only for very fast systems (resolution of two seconds or less). |
26
+
|**/B**| Forces build even if timestamps are equal. Recommended only for fast systems (resolution of two seconds or less). |
27
27
|**/C**| Suppresses default output, including nonfatal NMAKE errors or warnings, timestamps, and NMAKE copyright message. Suppresses warnings issued by **/K**. |
28
28
|**/D**| Displays timestamps of each evaluated target and dependent and a message when a target doesn't exist. Useful with **/P** for debugging a makefile. Use `!CMDSWITCHES` to set or clear **/D** for part of a makefile. |
29
29
|**/E**| Causes environment variables to override makefile macro definitions. |
0 commit comments