make
developmentLinux/Unix
The make command is one of the most frequently used commands in Linux/Unix-like operating systems. make Build automation tool
Quick Reference
Command Name:
make
Category:
development
Platform:
Linux/Unix
Basic Usage:
make [options] [arguments]
Common Use Cases
Syntax
make [options] [target...]
Options
Option | Description |
---|---|
-j [N], --jobs[=N] |
Allow N jobs at once; infinite jobs with no arg |
-k, --keep-going |
Keep going when some targets can't be made |
-f FILE, --file=FILE, --makefile=FILE |
Read FILE as a makefile |
-C DIR, --directory=DIR |
Change to directory DIR before reading makefile |
-B, --always-make |
Unconditionally make all targets |
-n, --just-print, --dry-run |
Don't actually run any commands; just print them |
-s, --silent, --quiet |
Don't echo commands |
-d, --debug |
Print lots of debugging information |
-p, --print-data-base |
Print make's internal database |
-v, --version |
Print the version number of make and exit |
-w, --print-directory |
Print the current directory |
--no-print-directory |
Turn off -w, even if it was turned on implicitly |
-I DIR, --include-dir=DIR |
Search DIR for included makefiles |
-L, --check-symlink-times |
Use the latest mtime between symlinks and target |
-o FILE, --old-file=FILE, --assume-old=FILE |
Consider FILE to be very old and don't remake it |
-W FILE, --what-if=FILE, --new-file=FILE, --assume-new=FILE |
Consider FILE to be infinitely new |
--warn-undefined-variables |
Warn when an undefined variable is referenced |
Examples
How to Use These Examples
The examples below show common ways to use the make
command. Try them in your terminal to see the results. You can copy any example by clicking on the code block.
# Basic Examples Basic
make