Skip to main content
Once you have configured the build, you are ready to compile. The build system downloads all source archives automatically, so an internet connection is required for the first build.

Full build

make
This invokes the world target, which runs the complete build pipeline: tools → toolchain → kernel → packages → firmware images.

Parallel build

Pass -j to use multiple CPU cores and significantly reduce build time:
make -j$(nproc)
For the very first build, -j$(nproc) is safe. On subsequent builds with incremental changes, parallel builds can occasionally produce confusing error output because log lines from multiple jobs interleave. Use make -j$(nproc) V=s 2>&1 | tee build.log to capture everything.

Verbose output

Append V=s to see every compiler invocation:
make V=s

Capturing a build log

make V=s 2>&1 | tee build.log
Both stdout and stderr are captured. You can then search build.log for ERROR: or error: to find the root cause of a failure.

Individual component targets

Packages

You can build, install, or clean a single package without rebuilding everything:
# Compile a package
make package/<name>/compile

# Install (stage) a package
make package/<name>/install

# Clean a package's build directory
make package/<name>/clean
Replace <name> with the package’s directory name under package/ or package/feeds/. For example:
make package/curl/compile
make package/curl/install
make package/curl/clean

Kernel

make target/linux/compile

Toolchain

make toolchain/install

Build output

Completed firmware images are written to:
bin/targets/<target>/<subtarget>/
For example, a build for the ath79 target, generic subtarget produces files such as:
bin/targets/ath79/generic/
├── openwrt-ath79-generic-<profile>-squashfs-factory.bin
├── openwrt-ath79-generic-<profile>-squashfs-sysupgrade.bin
├── profiles.json
└── packages/
Package repositories (.ipk or .apk files) are placed under bin/packages/.

Cleaning

CommandWhat it removes
make cleanBuild output: build_dir/, staging_dir/ (except host tools), bin/, build logs
make dircleanEverything clean removes plus the host tools and toolchain (staging_dir/host/, staging_dir/toolchain-*/) and the temporary directory
make distcleanEverything dirclean removes, plus .config*, dl/ (downloaded sources), feeds/, and signing keys
# Remove build output but keep the toolchain (faster next build)
make clean

# Full clean including host tools and toolchain
make dirclean

# Complete reset: removes config, downloads, and feeds
make distclean
make dirclean removes the compiled toolchain. The next build will recompile tools and the toolchain from scratch, which can take 30–60 minutes. make distclean additionally removes your .config and all downloaded sources — back up your config first.

First-build considerations

The first build downloads a large number of source archives. Expect it to take 1–3 hours on modern hardware, depending on internet speed, CPU speed, and the number of selected packages. Subsequent builds reuse cached build artifacts and are much faster.
# 1. Update and install feeds
./scripts/feeds update -a
./scripts/feeds install -a

# 2. Configure target and packages
make menuconfig

# 3. Build (parallel)
make -j$(nproc) V=sc 2>&1 | tee build.log
V=sc shows compiler output (c) and skips duplicate status messages (s), giving a more readable log than V=s alone.