2016-01-04 11:23:09 +01:00
|
|
|
# make
|
|
|
|
|
2016-09-15 20:13:05 +05:30
|
|
|
> Task runner for targets described in Makefile.
|
2016-01-04 11:23:09 +01:00
|
|
|
> Mostly used to control the compilation of an executable from source code.
|
2020-10-27 14:30:07 +01:00
|
|
|
> More information: <https://www.gnu.org/software/make/manual/make.html>.
|
2016-01-04 11:23:09 +01:00
|
|
|
|
2016-09-15 20:13:05 +05:30
|
|
|
- Call the first target specified in the Makefile (usually named "all"):
|
2016-01-04 11:23:09 +01:00
|
|
|
|
|
|
|
`make`
|
|
|
|
|
2016-09-15 20:13:05 +05:30
|
|
|
- Call a specific target:
|
2016-01-04 11:23:09 +01:00
|
|
|
|
2016-09-15 20:13:05 +05:30
|
|
|
`make {{target}}`
|
2016-01-04 11:23:09 +01:00
|
|
|
|
2017-06-06 19:56:14 +01:00
|
|
|
- Call a specific target, executing 4 jobs at a time in parallel:
|
|
|
|
|
2025-03-26 02:30:50 +02:00
|
|
|
`make {{[-j|--jobs]}} {{4}} {{target}}`
|
2017-06-06 19:56:14 +01:00
|
|
|
|
2016-09-15 20:13:05 +05:30
|
|
|
- Use a specific Makefile:
|
2016-01-04 11:23:09 +01:00
|
|
|
|
2025-03-26 02:30:50 +02:00
|
|
|
`make {{[-f|--file]}} {{path/to/file}}`
|
2016-01-04 11:23:09 +01:00
|
|
|
|
2016-01-07 18:31:27 +01:00
|
|
|
- Execute make from another directory:
|
2016-01-04 11:23:09 +01:00
|
|
|
|
2025-03-26 02:30:50 +02:00
|
|
|
`make {{[-C|--directory]}} {{path/to/directory}}`
|
2016-07-05 16:21:56 +02:00
|
|
|
|
2016-09-15 20:13:05 +05:30
|
|
|
- Force making of a target, even if source files are unchanged:
|
2016-07-05 16:21:56 +02:00
|
|
|
|
2025-03-26 02:30:50 +02:00
|
|
|
`make {{[-B|--always-make]}} {{target}}`
|
2020-10-26 23:36:54 +01:00
|
|
|
|
2022-07-28 11:57:54 -07:00
|
|
|
- Override a variable defined in the Makefile:
|
|
|
|
|
|
|
|
`make {{target}} {{variable}}={{new_value}}`
|
|
|
|
|
2020-10-26 23:36:54 +01:00
|
|
|
- Override variables defined in the Makefile by the environment:
|
|
|
|
|
2025-03-26 02:30:50 +02:00
|
|
|
`make {{[-e|--environment-overrides]}} {{target}}`
|