Makefile Targets Reference¶
The EmbSec Kit provides a convenient Makefile wrapper around CMake commands. This reference documents all available Make targets.
Quick Start Targets¶
setup¶
One-time setup for development environment. Checks dependencies and configures for both hardware and QEMU.
This target:
- Verifies all required tools are installed
- Runs
make configurefor hardware - Runs
make configure-qemufor emulation - Provides next steps guidance
help¶
Shows comprehensive help with all available targets (default target).
info¶
Displays current build configuration and CMake settings.
Configuration Targets¶
configure¶
Configures the project for TM4C123GH6PM hardware using the embedded preset.
configure-qemu¶
Configures the project for QEMU LM3S6965 emulation.
Build Targets¶
build¶
Builds all configured targets.
sdk¶
Builds only the EmbSec SDK library.
labs¶
Builds all lab exercises.
qemu-build¶
Configures (if needed) and builds labs for QEMU emulation.
Lab Execution Targets¶
qemu-<lab-name>¶
Runs a specific lab in QEMU emulator.
debug-<lab-name>¶
Debugs a lab with GDB.
exploit-<lab-name>¶
Debugs a lab with exploit development helpers.
flash-<lab-name>¶
Flashes a lab to hardware device.
Testing Targets¶
test¶
Runs all unit tests (alias for unittest-labs).
test-labs¶
Tests all labs in QEMU environment.
unittest-labs¶
Runs unit tests for all labs.
unittest-lab¶
Runs unit tests for a specific lab.
Packaging Targets¶
package-labs¶
Creates zip packages for all labs. Packages are placed in build/packages/.
package-lab¶
Creates a zip package for a specific lab.
package¶
Creates distribution packages using CPack.
Documentation Targets¶
docs¶
Builds documentation using MkDocs.
docs-serve¶
Serves documentation locally at http://localhost:8000.
docs-deploy¶
Deploys documentation to GitLab Pages.
Maintenance Targets¶
clean¶
Cleans build artifacts.
distclean¶
Removes entire build directory.
format¶
Formats all C source and header files using clang-format.
install¶
Installs SDK and headers.
Environment Variables¶
Build Configuration¶
BUILD_DIR¶
Specifies the build directory for hardware builds.
Default:build BUILD_QEMU_DIR¶
Specifies the build directory for QEMU builds.
Default:build-qemu BUILD_TYPE¶
Sets the CMake build type.
Default:Debug Target Patterns¶
The Makefile uses pattern rules for lab-specific targets:
qemu-%- Run any lab in QEMUdebug-%- Debug any lab with GDBexploit-%- Debug any lab with exploit helpersflash-%- Flash any lab to hardware
Color Output¶
The Makefile uses color codes for better readability:
- Yellow: Information and progress messages
- Green: Success messages
- Red: Error messages
To disable colors, you can pipe output through cat:
Common Workflows¶
Initial Setup and Build¶
QEMU Development Workflow¶
Hardware Development Workflow¶
Testing Workflow¶
Package Distribution¶
Error Handling¶
The Makefile includes error checking for:
- Missing dependencies (cmake, arm-none-eabi-gcc, qemu-system-arm, python3)
- Missing build directories
- Invalid lab names
- Missing required variables
Error messages are displayed in red with helpful suggestions.
Tips and Tricks¶
Parallel Builds¶
The underlying CMake build system supports parallel compilation. The Makefile will use CMake's default parallelism.
Verbose Output¶
For debugging build issues, use CMake directly with verbose flags:
Custom CMake Options¶
For advanced configuration, use CMake directly:
See Also¶
- CMake Targets - Direct CMake target reference
- Project Structure - Directory layout
- Configuration - Build configuration options