You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
549 B
25 lines
549 B
BUILD_DIR := build
|
|
EXECUTABLE := modbus
|
|
|
|
.PHONY: all build run clean rebuild debug release help
|
|
all: build
|
|
|
|
# Configure and build the project
|
|
build:
|
|
@mkdir -p $(BUILD_DIR)
|
|
@cd $(BUILD_DIR) && cmake ..
|
|
@cmake --build $(BUILD_DIR)
|
|
@echo "Build complete. Executable: $(BUILD_DIR)/$(EXECUTABLE)"
|
|
|
|
# Run the built executable, build if needed
|
|
run: build
|
|
@echo "Running $(EXECUTABLE)..."
|
|
@./$(BUILD_DIR)/$(EXECUTABLE)
|
|
|
|
# Clean build artifacts
|
|
clean:
|
|
@rm -rf $(BUILD_DIR)
|
|
@echo "Build directory cleaned"
|
|
|
|
# Rebuild from scratch
|
|
rebuild: clean build
|
|
|