• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Maintaining the build files
2
3This document explains how to maintain the build files in the codebase.
4
5## Overview
6
7On how to build the Node.js core, see [Building Node.js](../../../BUILDING.md).
8
9There are three main build files that may be directly run when building Node.js:
10
11* `configure`: A Python 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 (the main
15  Makefile mentioned below is maintained separately by humans). For a detailed
16  guide on this script, see [configure][].
17* `vcbuild.bat`: A Windows Batch Script that locates build tools, provides a
18  subset of the targets available in the [Makefile][], and a few
19  targets of its own. For a detailed guide on this script, see
20  [vcbuild.bat](#vcbuildbat).
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][].
25
26On Windows `vcbuild.bat` runs [configure][] before building the
27Node.js binary, on other systems `configure` must be run manually before running
28`make` on the `Makefile`.
29
30## vcbuild.bat
31
32To see the help text, run `.\vcbuild help`. Update this file when you need to
33update the build and testing process on Windows.
34
35## configure
36
37The `configure` script recognizes many CLI flags for special build formulas.
38Many are not represented by `vcbuild` shortcuts, and need to be passed
39either by:
40
41* Calling `python configure --XXX --YYY=PPPP` directly, followed by `vcbuild
42  noprojgen`
43* Setting `set config_flags=--XXX --YYY=PPPP` before calling `vcbuild`
44
45To see the help text, run `python configure --help`. Update this file when you
46need to update the configuration process.
47
48## Makefile
49
50To see the help text, run `make help`. This file is not generated, it is
51maintained by humans. This is not usually run on Windows, where
52[vcbuild.bat](#vcbuildbat) is used instead.
53
54### Options
55
56* `-j <n>`: number of threads used to build the binary. On the non-CI
57  targets, the parallel tests will take up all the available cores, regardless
58  of this option.
59
60[GYP]: https://gyp.gsrc.io/docs/UserDocumentation.md
61[Makefile]: #makefile
62[configure]: #configure
63