What is the difference between Make and CMake?
Short answer: Make is a build tool that executes rules from a Makefile: targets, their dependencies and the commands to build them, rebuilding only what changed. CMake is a build-system generator: you describe targets, sources, include paths and options in CMakeLists.txt, and CMake generates Makefiles or Ninja files (or IDE projects) for the chosen toolchain. CMake handles cross-platform details, dependencies and configuration better, so most modern embedded projects (Zephyr, Pico SDK, ESP-IDF, STM32 CMake projects) use it, often with Ninja for speed.
Minimal cross-compilation setup
# arm-gcc-toolchain.cmake
set(CMAKE_SYSTEM_NAME Generic)
set(CMAKE_SYSTEM_PROCESSOR arm)
set(CMAKE_C_COMPILER arm-none-eabi-gcc)
set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)
# CMakeLists.txt
cmake_minimum_required(VERSION 3.20)
project(blinky C ASM)
add_executable(blinky.elf src/main.c src/startup_stm32f4.s)
target_compile_options(blinky.elf PRIVATE -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16
-Os -ffunction-sections -fdata-sections -Wall -Wextra)
target_link_options(blinky.elf PRIVATE -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16
-T${CMAKE_SOURCE_DIR}/stm32f4.ld -Wl,--gc-sections -Wl,-Map=blinky.map --specs=nano.specs)
add_custom_command(TARGET blinky.elf POST_BUILD
COMMAND arm-none-eabi-objcopy -O binary blinky.elf blinky.bin
COMMAND arm-none-eabi-size blinky.elf)
cmake -B build -G Ninja -DCMAKE_TOOLCHAIN_FILE=arm-gcc-toolchain.cmake
cmake --build build
Make basics interviewers ask: targets, prerequisites, recipes (tab-indented), automatic variables ($@ target, $< first prerequisite, $^ all prerequisites), pattern rules (%.o: %.c), .PHONY, and dependency generation with -MMD -MP so header changes trigger rebuilds.
Other build systems: Meson, Bazel, SCons; Kbuild/Kconfig for the Linux kernel; Yocto/BitBake and Buildroot for whole Linux distributions; vendor IDE projects (convertible to CMake for CI).