Skip to content

Fix unclosed links #5052

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 19, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/build/reference/commands-in-a-makefile.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ A command preceded by a semicolon (**`;`**) can appear on a dependency line or i
project.obj : project.c project.h ; cl /c project.c
```

## <a name="command-modifiers"> Command modifiers
## <a name="command-modifiers" /> Command modifiers

You can specify one or more command modifiers preceding a command, optionally separated by spaces or tabs. As with commands, modifiers must be indented.

Expand All @@ -28,7 +28,7 @@ You can specify one or more command modifiers preceding a command, optionally se
| **`-`**\[*number*] *command* | Turns off error checking for *command*. By default, NMAKE halts when a command returns a nonzero exit code. If *-number* is used, NMAKE stops if the exit code exceeds *number*. Spaces or tabs can't appear between the dash and *number.* At least one space or tab must appear between *number* and *command*. Use **`/I`** to turn off error checking for the entire makefile; use **`.IGNORE`** to turn off error checking for part of the makefile. |
| **`!`** *command* | Executes *command* for each dependent file if *command* uses **`$**`** (all dependent files in the dependency) or **`$?`** (all dependent files in the dependency with a later timestamp than the target). |

## <a name="filename-parts-syntax"> Filename-parts syntax
## <a name="filename-parts-syntax" /> Filename-parts syntax

Filename-parts syntax in commands represents components of the first dependent filename (which may be an implied dependent). Filename components are the file's drive, path, base name, and extension as specified, not as it exists on disk. Use **`%s`** to represent the complete filename. Use **`%|`**\[*parts*]**`F`** (a vertical bar character follows the percent symbol) to represent parts of the filename, where *parts* can be zero or more of the following letters, in any order.

Expand Down
8 changes: 4 additions & 4 deletions docs/build/reference/contents-of-a-makefile.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,19 @@ For a sample, see [Sample makefile](sample-makefile.md).

NMAKE supports other features, such as wildcards, long filenames, comments, and escapes for special characters.

## <a name="wildcards-and-nmake"> Wildcards and NMAKE
## <a name="wildcards-and-nmake" /> Wildcards and NMAKE

NMAKE expands filename wildcards (**`*`** and **`?`**) in dependency lines. A wildcard specified in a command is passed to the command; NMAKE doesn't expand it.

## <a name="long-filenames-in-a-makefile"> Long filenames in a makefile
## <a name="long-filenames-in-a-makefile" /> Long filenames in a makefile

Enclose long filenames in double quotation marks, as follows:

```makefile
all : "VeryLongFileName.exe"
```

## <a name="comments-in-a-makefile"> Comments in a makefile
## <a name="comments-in-a-makefile" /> Comments in a makefile

Precede a comment with a number sign (**`#`**). NMAKE ignores text from the number sign to the next newline character.

Expand Down Expand Up @@ -66,7 +66,7 @@ To specify a literal number sign, precede it with a caret (**`^`**), as follows:
DEF = ^#define #Macro for a C preprocessing directive
```

## <a name="special-characters-in-a-makefile"> Special characters in a makefile
## <a name="special-characters-in-a-makefile" /> Special characters in a makefile

To use an NMAKE special character as a literal character, place a caret (**`^`**) in front of it as an escape. NMAKE ignores carets that precede other characters. The special characters are:

Expand Down
2 changes: 1 addition & 1 deletion docs/build/reference/creating-a-makefile-project.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ If you have an existing makefile project, you have these choices if you want to
- **Visual Studio 2017 and later**: Use the **Open Folder** feature to edit and build a makefile project as-is without any involvement of the MSBuild system. For more information, see [Open Folder projects for C++](../open-folder-projects-cpp.md).
- **Visual Studio 2019 and later**: Create a UNIX makefile project for Linux.

## <a name="create_a_makefile_project"> To create a makefile project with the makefile project template
## <a name="create_a_makefile_project" /> To create a makefile project with the makefile project template

In Visual Studio 2017 and later, the Makefile project template is available when the C++ Desktop Development workload is installed.

Expand Down
8 changes: 4 additions & 4 deletions docs/build/reference/defining-an-nmake-macro.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ The *macro_name* is a case-sensitive combination of letters, digits, and undersc

The *string* can be any sequence of zero or more characters. A *null* string contains zero characters or only spaces or tabs. The *string* can contain a macro invocation.

## <a name="special-characters-in-macros"> Special characters in macros
## <a name="special-characters-in-macros" /> Special characters in macros

A number sign (**`#`**) after a definition specifies a comment. To specify a literal number sign in a macro, use a caret (**`^`**) to escape it, as in **`^#`**.

Expand All @@ -31,19 +31,19 @@ CMDS = cls^
dir
```

## <a name="null-and-undefined-macros"> Null and undefined macros
## <a name="null-and-undefined-macros" /> Null and undefined macros

Both null and undefined macros expand to null strings, but a macro defined as a null string is considered defined in preprocessing expressions. To define a macro as a null string, specify no characters except spaces or tabs after the equal sign (**`=`**) in a command line or command file, and enclose the null string or definition in double quotation marks (**`" "`**). To undefine a macro, use **`!UNDEF`**. For more information, see [Makefile preprocessing directives](makefile-preprocessing.md#makefile-preprocessing-directives).

## <a name="where-to-define-macros"> Where to define macros
## <a name="where-to-define-macros" /> Where to define macros

Define macros in a command line, command file, makefile, or the *`Tools.ini`* file.

In a makefile or the *`Tools.ini`* file, each macro definition must appear on a separate line and can't start with a space or tab. Spaces or tabs around the equal sign are ignored. All *string* characters are literal, including surrounding quotation marks and embedded spaces.

In a command line or command file, spaces and tabs delimit arguments and can't surround the equal sign. If *string* has embedded spaces or tabs, enclose either the string itself or the entire macro in double quotation marks (**`" "`**).

## <a name="precedence-in-macro-definitions"> Precedence in macro definitions
## <a name="precedence-in-macro-definitions" /> Precedence in macro definitions

If a macro has multiple definitions, NMAKE uses the highest-precedence definition. The following list shows the order of precedence, from highest to lowest:

Expand Down
12 changes: 6 additions & 6 deletions docs/build/reference/inference-rules.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Inference rules in NMAKE supply commands to update targets and to infer dependen

If an out-of-date dependency has no commands, and if [`.SUFFIXES`](dot-directives.md) contains the dependent's extension, NMAKE uses a rule whose extensions match the target and an existing file in the current or specified directory. If more than one rule matches existing files, the **`.SUFFIXES`** list determines which to use; list priority descends from left to right. If a dependent file doesn't exist and isn't listed as a target in another description block, an inference rule can create the missing dependent from another file that has the same base name. If a description block's target has no dependents or commands, an inference rule can update the target. Inference rules can build a command-line target even if no description block exists. NMAKE may invoke a rule for an inferred dependent even if an explicit dependent is specified.

## <a name="defining-a-rule"> Defining a rule
## <a name="defining-a-rule" /> Defining a rule

The *from_ext* represents the extension of a dependent file, and *to_ext* represents the extension of a target file.

Expand All @@ -21,7 +21,7 @@ The *from_ext* represents the extension of a dependent file, and *to_ext* repres

Extensions aren't case-sensitive. Macros can be invoked to represent *from_ext* and *to_ext*; the macros are expanded during preprocessing. The period (**`.`**) that precedes *from_ext* must appear at the beginning of the line. The colon (**`:`**) is preceded by zero or more spaces or tabs. It can be followed only by spaces or tabs, a semicolon (**`;`**) to specify a command, a number sign (**`#`**) to specify a comment, or a newline character. No other spaces are allowed. Commands are specified as in description blocks.

## <a name="search-paths-in-rules"> Search paths in rules
## <a name="search-paths-in-rules" /> Search paths in rules

```makefile
{from_path}.from_ext{to_path}.to_ext:
Expand Down Expand Up @@ -61,7 +61,7 @@ An inference rule applies to a dependency only if paths specified in the depende
$(CC) $(CFLAGS) $<
```

## <a name="batch-mode-rules"> Batch-mode rules
## <a name="batch-mode-rules" /> Batch-mode rules

```makefile
{from_path}.from_ext{to_path}.to_ext::
Expand Down Expand Up @@ -135,7 +135,7 @@ foo4.cpp
Generating Code...
```

## <a name="predefined-rules"> Predefined rules
## <a name="predefined-rules" /> Predefined rules

Predefined inference rules use NMAKE-supplied command and options macros.

Expand All @@ -155,7 +155,7 @@ Predefined inference rules use NMAKE-supplied command and options macros.
| `.cxx.obj` | `$(CXX) $(CXXFLAGS) /c $<` | `cl /c $<` | yes | all |
| `.rc.res` | `$(RC) $(RFLAGS) /r $<` | `rc /r $<` | no | all |

## <a name="inferred-dependents-and-rules"> Inferred dependents and rules
## <a name="inferred-dependents-and-rules" /> Inferred dependents and rules

NMAKE assumes an inferred dependent for a target if an applicable inference rule exists. A rule applies if:

Expand All @@ -169,7 +169,7 @@ NMAKE assumes an inferred dependent for a target if an applicable inference rule

Inferred dependents can cause unexpected side effects. If the target's description block contains commands, NMAKE executes those commands instead of the commands in the rule.

## <a name="precedence-in-inference-rules"> Precedence in inference rules
## <a name="precedence-in-inference-rules" /> Precedence in inference rules

If an inference rule is defined more than once, NMAKE uses the highest-precedence definition. The following list shows the order of precedence from highest to lowest:

Expand Down
8 changes: 4 additions & 4 deletions docs/build/reference/inline-files-in-a-makefile.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ helpviewer_keywords: ["inline files [C++], in makefiles", "inline files [C++]",

An inline file contains text you specify in the makefile. Its name can be used in commands as input (for example, a LINK command file), or it can pass commands to the operating system. The file is created on disk when a command that creates the file is run.

## <a name="specifying-an-inline-file"> Specify an inline file
## <a name="specifying-an-inline-file" /> Specify an inline file

Specify two angle brackets (**`<<`**) in the command where *filename* is to appear. The angle brackets can't be a macro expansion. The *filename* is optional:

Expand All @@ -18,7 +18,7 @@ Specify two angle brackets (**`<<`**) in the command where *filename* is to appe

When the command is run, the angle brackets are replaced by *filename*, if specified, or by a unique NMAKE-generated name. If specified, *filename* must follow angle brackets without a space or tab. A path is permitted. No extension is required or assumed. If *filename* is specified, the file is created in the current or specified directory, overwriting any existing file by that name. Otherwise, it's created in the `TMP` directory (or the current directory, if the `TMP` environment variable isn't defined). If a previous *filename* is reused, NMAKE replaces the previous file.

## <a name="creating-inline-file-text"> Create inline file text
## <a name="creating-inline-file-text" /> Create inline file text

Inline files are temporary or permanent.

Expand All @@ -34,11 +34,11 @@ Specify your *inline_text* on the first line after the command. Mark the end wit

A temporary file exists for the duration of the session and can be reused by other commands. Specify **`KEEP`** after the closing angle brackets to retain the file after the NMAKE session; an unnamed file is preserved on disk with the generated filename. Specify **`NOKEEP`** or nothing for a temporary file. **`KEEP`** and **`NOKEEP`** are not case sensitive.

## <a name="reusing-inline-files"> Reuse inline files
## <a name="reusing-inline-files" /> Reuse inline files

To reuse an inline file, specify `<<filename` where the file is defined and first used, then reuse *filename* without `<<` later in the same or another command. The command to create the inline file must run before all commands that use the file.

## <a name="multiple-inline-files"> Multiple inline files
## <a name="multiple-inline-files" /> Multiple inline files

A command can create more than one inline file:

Expand Down
8 changes: 4 additions & 4 deletions docs/build/reference/makefile-preprocessing.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ helpviewer_keywords: ["preprocessing makefiles", "makefiles, preprocessing", "!C

You can control the NMAKE session by using preprocessing directives and expressions. Preprocessing instructions can be placed in the makefile or in *`Tools.ini`*. Using directives, you can conditionally process your makefile, display error messages, include other makefiles, undefine a macro, and turn certain options on or off.

## <a name="makefile-preprocessing-directives"> Makefile Preprocessing Directives
## <a name="makefile-preprocessing-directives" /> Makefile Preprocessing Directives

Preprocessing directives aren't case-sensitive. The initial exclamation point (**`!`**) must appear at the beginning of the line. Zero or more spaces or tabs can appear after the exclamation point, for indentation.

Expand Down Expand Up @@ -67,13 +67,13 @@ Preprocessing directives aren't case-sensitive. The initial exclamation point (*

Undefines *macro_name*.

## <a name="expressions-in-makefile-preprocessing"> Expressions in makefile preprocessing
## <a name="expressions-in-makefile-preprocessing" /> Expressions in makefile preprocessing

The **`!IF`** or **`!ELSE IF`** *constant_expression* consists of integer constants (in decimal or C-language notation), string constants, or commands. Use parentheses to group expressions. Expressions use C-style signed long integer arithmetic; numbers are in 32-bit two's-complement form in the range -2147483648 to 2147483647.

Expressions can use operators that act on constant values, exit codes from commands, strings, macros, and file-system paths.

## <a name="makefile-preprocessing-operators"> Makefile preprocessing operators
## <a name="makefile-preprocessing-operators" /> Makefile preprocessing operators

Makefile preprocessing expressions can use operators that act on constant values, exit codes from commands, strings, macros, and file-system paths. To evaluate the expression, the preprocessor first expands macros, and then executes commands, and then does the operations. It evaluates operations in order of explicit grouping in parentheses, and then in order of operator precedence. The result is a constant value.

Expand Down Expand Up @@ -125,7 +125,7 @@ Expressions can use the following operators. The operators of equal precedence a
> [!NOTE]
> The bitwise XOR operator (**`^`**) is the same as the escape character, and must be escaped (as **`^^`**) when it's used in an expression.

## <a name="executing-a-program-in-preprocessing"> Executing a program in preprocessing
## <a name="executing-a-program-in-preprocessing" /> Executing a program in preprocessing

To use a command's exit code during preprocessing, specify the command, with any arguments, within brackets (**`[ ]`**). Any macros are expanded before the command is executed. NMAKE replaces the command specification with the command's exit code, which can be used in an expression to control preprocessing.

Expand Down
8 changes: 4 additions & 4 deletions docs/build/reference/special-nmake-macros.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ no-loc: [AS, AFLAGS, CC, CFLAGS, CPP, CPPFLAGS, CXX, CXXFLAGS, RC, RFLAGS, ias,

NMAKE provides several special macros to represent various filenames and commands. One use for some of these macros is in the predefined inference rules. Like all macros, the macros provided by NMAKE are case sensitive.

## <a name="filename-macros"> Filename Macros
## <a name="filename-macros" /> Filename Macros

Filename macros are predefined as filenames specified in the dependency (not full filename specifications on disk). These macros don't need to be enclosed in parentheses when invoked; specify only a **`$`** as shown.

Expand All @@ -31,7 +31,7 @@ To specify part of a predefined filename macro, append a macro modifier and encl
| **`F`** | Base name plus extension |
| **`R`** | Drive plus directory plus base name |

## <a name="recursion-macros"> Recursion macros
## <a name="recursion-macros" /> Recursion macros

Use recursion macros to call NMAKE recursively. Recursive sessions inherit command-line and environment-variable macros and *`Tools.ini`* information. They don't inherit makefile-defined inference rules or `.SUFFIXES` and `.PRECIOUS` specifications. There are three ways to pass macros to a recursive NMAKE session:

Expand All @@ -45,7 +45,7 @@ Use recursion macros to call NMAKE recursively. Recursive sessions inherit comma
| **`MAKEDIR`** | Current directory when NMAKE was invoked. |
| **`MAKEFLAGS`** | Options currently in effect. Use as `/$(MAKEFLAGS)`. The **`/F`** option isn't included. |

## <a name="command-macros-and-options-macros"> Command macros and options macros
## <a name="command-macros-and-options-macros" /> Command macros and options macros

Command macros are predefined for Microsoft products. Options macros represent options to these products and are undefined by default. Both are used in predefined inference rules and can be used in description blocks or user-defined inference rules. Command macros can be redefined to represent part or all of a command line, including options. Options macros generate a null string if left undefined.

Expand All @@ -57,7 +57,7 @@ Command macros are predefined for Microsoft products. Options macros represent o
| C++ Compiler | **`CXX`** | `cl` | **`CXXFLAGS`** |
| Resource Compiler | **`RC`** | `rc` | **`RFLAGS`** |

## <a name="environment-variable-macros"> Environment-variable macros
## <a name="environment-variable-macros" /> Environment-variable macros

NMAKE inherits macro definitions for environment variables that exist before the start of the session. If a variable was set in the operating-system environment, it is available as an NMAKE macro. The inherited names are converted to uppercase. Inheritance occurs before preprocessing. Use the /E option to cause macros inherited from environment variables to override any macros with the same name in the makefile.

Expand Down
Loading