A makefile is an input file for the build control language/tool make. It specifies targets and dependencies along with associated commands to perform (a.k.a. recipes) to update the targets.
A makefile is usually an input file for the build control language/tool make.
The make
utility and the corresponding makefile format is standardized by POSIX.
Common newbie mistakes:
- Make error: missing separator - not realizing that
make
is very particular about requiring a tab character on each line of a recipe - How do I properly escape data for a Makefile? - how to embed literal dollar signs (
$
) or hash signs (#
) in aMakefile
recipe - Make / gcc cryptic error 2: how to have more information? - hiding the output of
make
, then wondering what went wrong - Make threw out an error but no detailed error message - not realizing that
make
simply relays error codes from the commands it runs. If you geterror 1
it doesn't mean anything until you tell us which precise command gave this error. - Make: how to continue after a command fails? -
make
abandons the current target if there is a failure; this explains how to work with this feature, or work around it
Makefile variable assignment error in echo - running two distinct commands in a recipe and not realizing the shell from the first will exit and lose any changes to the environment.
- How to use shell commands in Makefile - attempting to use
make
syntax inside a recipe