skip to content
Ivan's wiki
Site Tools
Search
Tools
Show pagesource
Backlinks
Recent Changes
Media Manager
Sitemap
>
Recent Changes
Media Manager
Sitemap
makefile
This page is read only. You can view the source, but not change it.
# Makefile **Make** is a build automation tool that tracks dependencies and rebuilds only what changed. Define targets (build products), prerequisites (source files), and recipes (compile commands). Make avoids expensive recompilation by detecting what's out of date and rebuilding the minimum necessary. Instead of typing compilation commands by hand or writing fragile shell scripts, write a Makefile. `make` reads it, identifies which files changed, and runs the appropriate recipes. On the next build, unchanged files are skipped—critical for large projects where recompiling everything takes minutes. ```makefile app: main.o util.o gcc -o app main.o util.o main.o: main.c gcc -c -o main.o main.c util.o: util.c gcc -c -o util.o util.c clean: rm -f *.o app ``` Run `make` to build, `make clean` to delete build artifacts. Make automatically detects which `.c` files changed and recompiles only those object files and the final executable. ## Concepts 1. [Basics](/makefile-basics) 2. [Variables](/makefile-variables) 3. [Patterns](/makefile-patterns) 4. [Functions](/makefile-functions) 5. [Phony targets](/makefile-phony) 6. [Dependencies](/makefile-dependencies) 7. [Conditionals](/makefile-conditionals) 8. [Advanced](/makefile-advanced) 9. [Performance](/makefile-performance) 10. [Debugging](/makefile-debugging)
Page Tools
Show pagesource
Backlinks
Back to top