Build automation tool for compiling and managing project dependencies using Makefile-based rule definitions.
make {flag-b} {always-make} {directory} {flag-d} {debug} ๐ flag-b ๐ always-make ๐ directory ๐ flag-d ๐ debug make {flag-b} {always-make} {directory} {flag-d} {debug} Sandbox: execFile · Timeout: 600s
dev.build.dependency dev.build.compile dev.build.clean dev.build.automate dev.build.test dev.build.target security.privilege-escalation.shell | Name | Type | Required | Default | Description | Aliases |
|---|---|---|---|---|---|
flag-b | string | No | - | Ignored for compatibility | -b, -m |
always-make | string | No | - | Unconditionally make all targets | -B, --always-make |
directory | file | No | - | Change to DIRECTORY before doing anything | -C, --directory |
flag-d | string | No | - | Print lots of debugging information | -d |
debug | string | No | - | Print various types of debugging information | --debug |
environment-overrides | string | No | - | Environment variables override makefiles | -e, --environment-overrides |
eval | string | No | - | Evaluate STRING as a makefile statement | -E, --eval |
file | file | No | - | Read FILE as a makefile | -f, --file, --makefile |
help | string | No | - | Print this message and exit | -h, --help |
ignore-errors | string | No | - | Ignore errors from recipes | -i, --ignore-errors |
include-dir | file | No | - | Search DIRECTORY for included makefiles | -I, --include-dir |
jobs | string | No | - | Allow N jobs at once; infinite jobs with no arg | -j, --jobs |
jobserver-style | string | No | - | Select the style of jobserver to use | --jobserver-style |
keep-going | string | No | - | Keep going when some targets can't be made | -k, --keep-going |
load-average | string | No | - | Don't start multiple jobs unless load is below N | -l, --load-average, --max-load |
check-symlink-times | string | No | - | Use the latest mtime between symlinks and target | -L, --check-symlink-times |
just-print | string | No | - | Don't actually run any recipe; just print them | -n, --just-print, --dry-run, --recon |
old-file | file | No | - | Consider FILE to be very old and don't remake it | -o, --old-file, --assume-old |
output-sync | string | No | - | Synchronize output of parallel jobs by TYPE | -O, --output-sync |
print-data-base | string | No | - | Print make's internal database | -p, --print-data-base |
question | string | No | - | Run no recipe; exit status says if up to date | -q, --question |
no-builtin-rules | string | No | - | Disable the built-in implicit rules | -r, --no-builtin-rules |
no-builtin-variables | string | No | - | Set the no-builtin-variables parameter | -R, -i, --no-builtin-variables |
shuffle | string | No | - | Perform shuffle of prerequisites and goals | --shuffle |
silent | string | No | - | Don't echo recipes | -s, --silent, --quiet |
no-silent | string | No | - | Echo recipes (disable --silent mode) | --no-silent |
no-keep-going | string | No | - | Turns off -k | -S, --no-keep-going, --stop |
touch | string | No | - | Touch targets instead of remaking them | -t, --touch |
trace | string | No | - | Print tracing information | --trace |
version | integer | No | - | Print the version number of make and exit | -v, --version |
eval-expression | string | No | - | Evaluate arbitrary make expression via $(shell cmd) | - |
include-file | string | No | - | Include an arbitrary file into the Makefile parse | - |
print-directory | file | No | - | Print the current directory | -w, --print-directory |
no-print-directory | string | No | - | Turn off -w, even if it was turned on implicitly | --no-print-directory |
what-if | file | No | - | Consider FILE to be infinitely new | -W, --what-if, --new-file, --assume-new |
warn-undefined-variables | string | No | - | --warn-undefined-variables |
| Type | Description | MIME | Schema | Trust |
|---|---|---|---|---|
dev.build.artifact | Built artifact (binary, library, or output) | - | - | verified |
dev.build.log | Build output log | text/plain | - | verified |
Inputs
dev.build.makefile Makefile with build rules
dev.source.code Source code to compile
Outputs
dev.build.artifact Compiled binary or build artifact
filesystem_write Produces
dev.build.artifactConsumes
dev.build.makefiledev.source.code| Resource | Value |
|---|---|
| CPU | high |
| Memory | 128 MB |
| Network | none |
| Disk I/O | high |
Build default target
make Build a specific target
make clean build Build with parallel jobs
make -j$(nproc) Build in a subdirectory
make -C src/ Dry run to see what would be built
make -n Override compiler variable
make CC=clang CFLAGS=-O3 Can be used to execute arbitrary commands on a system and spawn shells either indirectly
make -s --eval=$'x:\n\t-'"/bin/sh"
Argument injection: spawn interactive shell: Can be used to execute arbitrary commands on a system and spawn shells either indirectly
make -s --eval=$'x:\n\t-'"/bin/sh" Make is one of the oldest and most widely used build automation tools. It reads a Makefile that specifies how to derive the target program from source files using rules with dependency tracking.
# Variables
CC = gcc
CFLAGS = -Wall -O2
TARGET = myapp
# Default target
all: $(TARGET)
# Link target
$(TARGET): main.o util.o
$(CC) $(CFLAGS) -o $@ $^
# Compile source files
%.o: %.c
$(CC) $(CFLAGS) -c $< -o $@
# Clean build artifacts
clean:
rm -f *.o $(TARGET)
# Phony targets
.PHONY: all clean
.PHONY: all clean install test lint format
all: build
build:
go build -o bin/app .
test:
go test ./...
lint:
golangci-lint run
install:
cp bin/app /usr/local/bin/
clean:
rm -rf bin/
| Variable | Meaning |
|---|---|
$@ |
Target name |
$< |
First prerequisite |
$^ |
All prerequisites |
$* |
Stem of the pattern match |
$? |
Changed prerequisites |
DEBUG ?= 0
ifeq ($(DEBUG), 1)
CFLAGS += -g -DDEBUG
else
CFLAGS += -O3
endif