Makefile Explained
What is a Makefile? A Makefile is a declarative build script used by the make tool to automate tasks like compiling code, running scripts, cleaning directories, or managing dependencies. It’s most useful when: You want to codify a repeatable workflow You want one-liner commands for multi-step processes You work across environments (e.g., Docker, EC2, CI/CD) Basic Syntax and Anatomy # Syntax: #target: dependency1, dependency2, … #<TAB>recipe (command 1) #<TAB>recipe (command 2) # ... # Example of Makefile entry train: data/processed.csv python src/train.py --input data/processed.csv --output model.pkl Key Concepts: target: The name of the file or alias you want to build (e.g. train) dependencies: Files that the target depends on, in the case above data/processed.csv is the dependency. recipe: Command(s) to run if dependencies are newer than target. in the example above recipe is python src/train.py --input data/processed.csv --output model.pkl Tab is required. Space will break it. ...