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