What is the Makefile ?
A Makefile is a specialized file used by the make
build automation tool to manage the compilation and build process of software projects. It defines a set of rules and dependencies, allowing developers to automate the building of executable programs from source code, particularly in projects with multiple files.
Structure
- Targets: they represent the output artifacts.
- Dependencies: these are artifacts that must be already done for the target to be executed.
- Commands: these are the actions executed to create or update the target.
Info
It is not necessary for the target to be a file, it could be just a name for the command set. We call these phony targets.