xref: /btstack/test/btstack_util/Makefile (revision e54a3bca5d33ee0e65d314c9513f358064739602)
1# Makefile to build and run tests of CMake project
2# TODO: replace list of hard-coded tests with CMake call to run all tests
3
4# Variables
5BUILD_DIR = build
6TARGET = all  # Default build target
7
8# Default rule
9all: configure build
10
11# Step 1: Configure CMake
12configure:
13	@echo "Configuring project in $(BUILD_DIR)..."
14	@mkdir -p $(BUILD_DIR)
15	@cd ${BUILD_DIR} && cmake ..
16
17# Step 2: Build the project
18build: configure
19	@echo "Building project in $(BUILD_DIR)..."
20	@cmake --build $(BUILD_DIR) --target $(TARGET)
21
22# Step 3: Run the tests
23test: build
24	@echo "Running tests..."
25	$(BUILD_DIR)/btstack_util_test
26
27# Step 4: Clean the build
28clean:
29	@echo "Cleaning build directory..."
30	@rm -rf $(BUILD_DIR)
31
32coverage:
33	@echo "No coverage tests in btstack_util"
34
35.PHONY: all configure build clean test coverage
36