add Makefile: implement build, clean, test, and install targets

This commit is contained in:
2026-03-27 15:13:53 -03:00
parent 628957af68
commit cc1f5d47ad

39
Makefile Normal file
View File

@@ -0,0 +1,39 @@
.PHONY: configure build clean test install
# Build directory
BUILD_DIR := build
# Default target
.DEFAULT_GOAL := help
# Help target
help:
@echo "Available targets:"
@echo " make configure - Configure the project with CMake"
@echo " make build - Build the project"
@echo " make clean - Clean build artifacts"
@echo " make test - Run tests"
@echo " make install - Install the library"
# Configure: Run CMake configuration
configure:
@mkdir -p $(BUILD_DIR)
cd $(BUILD_DIR) && cmake ..
# Build: Compile the project
build:
cd $(BUILD_DIR) && cmake --build .
# Clean: Remove build directory and artifacts
clean:
rm -rf $(BUILD_DIR)
# Test: Run the test suite
test: build
cd $(BUILD_DIR) && ctest --output-on-failure -V
# Install: Install the library
install: build
cd $(BUILD_DIR) && cmake --install .