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
makeis 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 aMakefilerecipe - 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
makesimply relays error codes from the commands it runs. If you geterror 1it doesn't mean anything until you tell us which precise command gave this error. - Make: how to continue after a command fails? -
makeabandons 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
makesyntax inside a recipe