Skip to content

Commit 3623cf7

Browse files
joyeecheungMylesBorins
authored andcommitted
doc: add guide on maintaining build files
PR-URL: #16975 Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Rod Vagg <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]>
1 parent d93b476 commit 3623cf7

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed
+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Maintaining the Build files
2+
3+
This document explains how to maintain the build files in the codebase.
4+
5+
## Overview
6+
7+
On how to build the Node.js core, see [Building Node.js](../../BUILDING.md).
8+
9+
There are three main build files that may be directly run when building Node.js:
10+
11+
- `configure`: A Python 2 script that detects system capabilities and runs
12+
[GYP][]. It generates `config.gypi` which includes parameters used by GYP to
13+
create platform-dependent build files. Its output is usually in one of these
14+
formats: Makefile, MSbuild, ninja, or XCode project files. (Note: the main
15+
Makefile mentioned below is maintained separately by humans). For a detailed
16+
guide on this script, see [configure](#configure).
17+
- `vcbuild.bat`: A Windows Batch Script that locates build tools, provides a
18+
subset of the targets avilable in the [Makefile](#makefile), and a few targets
19+
of its own. For a detailed guide on this script, see
20+
[vcbuild.bat](#vcbuild.bat).
21+
- `Makefile`: A Makefile that can be run with GNU Make. It provides a set of
22+
targets that build and test the Node.js binary, produce releases and
23+
documentation, and interact with the CI to run benchmarks or tests. For a
24+
detailed guide on this file, see [Makefile](#makefile).
25+
26+
On Windows `vcbuild.bat` runs [configure](#configure) before building the
27+
Node.js binary, on other systems `configure` must be run manually before running
28+
`make` on the `Makefile`.
29+
30+
## vcbuild.bat
31+
32+
To see the help text, run `.\vcbuild help`. Update this file when you need to
33+
update the build and testing process on Windows.
34+
35+
## configure
36+
37+
To see the help text, run `python configure --help`. Update this file when you
38+
need to update the configuration process.
39+
40+
## Makefile
41+
42+
To see the help text, run `make help`. This file is not generated, it is
43+
maintained by humans. Note that this is not usually run on Windows, where
44+
[vcbuild.bat](#vcbuild.bat) is used instead.
45+
46+
### Options
47+
48+
- `-j <n>`: number of threads used to build the binary. Note that on the non-ci
49+
targets, the parallel tests will take up all the available cores, regardless
50+
of this option.
51+
52+
[GYP]: https://gyp.gsrc.io/docs/UserDocumentation.md

0 commit comments

Comments
 (0)