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 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 (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 available in the [Makefile](#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](#makefile).
25
26On Windows `vcbuild.bat` runs [configure](#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
37To see the help text, run `python configure --help`. Update this file when you
38need to update the configuration process.
39
40## Makefile
41
42To see the help text, run `make help`. This file is not generated, it is
43maintained by humans. Note that this is not usually run on Windows, where
44[vcbuild.bat](#vcbuildbat) 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
53