BUILD_DIR := build

.PHONY: all configure build clean run

all: build

configure:
	cmake -S . -B $(BUILD_DIR) -G Ninja \
	  -DCMAKE_BUILD_TYPE=Debug \
	  -DCMAKE_C_COMPILER=clang \
	  -DCMAKE_CXX_COMPILER=clang++
		-DBUILD_CLI_VIS=1

build: configure
	cmake --build $(BUILD_DIR)
	@# Symlink compile_commands.json to root so clangd picks it up
	@ln -sf $(BUILD_DIR)/compile_commands.json compile_commands.json

run: build
	./$(BUILD_DIR)/myapp

clean:
	rm -rf $(BUILD_DIR) compile_commands.json
