18cfd11c3SMatthias Ringwald# Makefile to build and run tests of CMake project 28cfd11c3SMatthias Ringwald# TODO: replace list of hard-coded tests with CMake call to run all tests 38cfd11c3SMatthias Ringwald 48cfd11c3SMatthias Ringwald# Variables 58cfd11c3SMatthias RingwaldBUILD_DIR = build 68cfd11c3SMatthias RingwaldTARGET = all # Default build target 78cfd11c3SMatthias Ringwald 88cfd11c3SMatthias Ringwald# Default rule 98cfd11c3SMatthias Ringwaldall: configure build 108cfd11c3SMatthias Ringwald 118cfd11c3SMatthias Ringwald# Step 1: Configure CMake 128cfd11c3SMatthias Ringwaldconfigure: 138cfd11c3SMatthias Ringwald @echo "Configuring project in $(BUILD_DIR)..." 148cfd11c3SMatthias Ringwald @mkdir -p $(BUILD_DIR) 158cfd11c3SMatthias Ringwald @cd ${BUILD_DIR} && cmake .. 168cfd11c3SMatthias Ringwald 178cfd11c3SMatthias Ringwald# Step 2: Build the project 188cfd11c3SMatthias Ringwaldbuild: configure 198cfd11c3SMatthias Ringwald @echo "Building project in $(BUILD_DIR)..." 208cfd11c3SMatthias Ringwald @cmake --build $(BUILD_DIR) --target $(TARGET) 218cfd11c3SMatthias Ringwald 228cfd11c3SMatthias Ringwald# Step 3: Run the tests 238cfd11c3SMatthias Ringwaldtest: build 248cfd11c3SMatthias Ringwald @echo "Running tests..." 258cfd11c3SMatthias Ringwald $(BUILD_DIR)/btstack_util_test 268cfd11c3SMatthias Ringwald 278cfd11c3SMatthias Ringwald# Step 4: Clean the build 288cfd11c3SMatthias Ringwaldclean: 298cfd11c3SMatthias Ringwald @echo "Cleaning build directory..." 308cfd11c3SMatthias Ringwald @rm -rf $(BUILD_DIR) 318cfd11c3SMatthias Ringwald 32*6d891d93SMatthias Ringwaldcoverage: 33*6d891d93SMatthias Ringwald @echo "No coverage tests in btstack_util" 348cfd11c3SMatthias Ringwald 35*6d891d93SMatthias Ringwald.PHONY: all configure build clean test coverage 36