Skip to content

Commit dc084eb

Browse files
cl, lib, nmake: add pages (#18443)
Co-authored-by: Managor <[email protected]>
1 parent a5be46b commit dc084eb

File tree

3 files changed

+96
-0
lines changed

3 files changed

+96
-0
lines changed

pages/windows/cl.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# cl
2+
3+
> The Microsoft C/C++ compiler for compiling and linking source code files.
4+
> More information: <https://learn.microsoft.com/cpp/build/reference/compiler-command-line-syntax>.
5+
6+
- Compile a source file:
7+
8+
`cl {{path/to/source.c}}`
9+
10+
- Compile and create an executable with a custom name:
11+
12+
`cl /Fe {{path/to/output_executable}} {{path/to/source.c}}`
13+
14+
- Compile a source file with optimization enabled:
15+
16+
`cl /O2 {{path/to/source.c}}`
17+
18+
- Compile a source file and create a debug executable:
19+
20+
`cl /Zi {{path/to/source.c}}`
21+
22+
- Compile multiple source files:
23+
24+
`cl {{path/to/source1.c path/to/source2.c ...}}`
25+
26+
- Specify the output directory for compiled files:
27+
28+
`cl /Fo {{path/to/output_directory/}} {{path/to/source.c}}`
29+
30+
- Compile with warnings as errors:
31+
32+
`cl /WX {{path/to/source.c}}`

pages/windows/lib.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# lib
2+
3+
> The Microsoft Library Manager for creating and managing static libraries of object files.
4+
> More information: <https://learn.microsoft.com/cpp/build/reference/lib-reference>.
5+
6+
- Create a static library from object files:
7+
8+
`lib /OUT :{{path/to/library.lib}} {{path/to/file1.obj path/to/file2.obj ...}}`
9+
10+
- List the contents of a library:
11+
12+
`lib /LIST {{path/to/library.lib}}`
13+
14+
- Add an object file to an existing library:
15+
16+
`lib {{path/to/library.lib}} {{path/to/file.obj}}`
17+
18+
- Remove an object file from a library:
19+
20+
`lib /REMOVE :{{path/to/file.obj}} {{path/to/library.lib}}`
21+
22+
- Extract an object file from a library:
23+
24+
`lib /EXTRACT :{{path/to/file.obj}} {{path/to/library.lib}}`
25+
26+
- Create an import library from a DLL:
27+
28+
`lib /DEF :{{path/to/definition.def}} /OUT:{{path/to/import.lib}}`

pages/windows/nmake.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# nmake
2+
3+
> The Microsoft Program Maintenance Utility for building projects based on commands in a makefile.
4+
> More information: <https://learn.microsoft.com/cpp/build/reference/nmake-reference>.
5+
6+
- Build targets using the default makefile in the current directory:
7+
8+
`nmake`
9+
10+
- Build targets using a specific makefile:
11+
12+
`nmake /F {{path/to/makefile}}`
13+
14+
- Build a specific target:
15+
16+
`nmake {{target}}`
17+
18+
- Display commands without executing them:
19+
20+
`nmake /N`
21+
22+
- Display all macro definitions and target descriptions:
23+
24+
`nmake /P`
25+
26+
- Continue building unrelated targets on error:
27+
28+
`nmake /K`
29+
30+
- Build and ignore timestamp checks (force rebuild):
31+
32+
`nmake /A`
33+
34+
- Suppress copyright message:
35+
36+
`nmake /NOLOGO`

0 commit comments

Comments
 (0)