29 lines
700 B
Makefile
29 lines
700 B
Makefile
# Name of your build directory
|
|
BUILD_DIR = build
|
|
|
|
# Name of the output file (Must match what is in CMakeLists.txt)
|
|
TARGET = EIS
|
|
|
|
# Default target: Build the project
|
|
all: $(BUILD_DIR)/Makefile
|
|
@$(MAKE) -C $(BUILD_DIR)
|
|
|
|
# Ensure the build directory exists and run CMake if needed
|
|
$(BUILD_DIR)/Makefile: CMakeLists.txt
|
|
@mkdir -p $(BUILD_DIR)
|
|
@cd $(BUILD_DIR) && cmake ..
|
|
|
|
# Clean up the build directory
|
|
clean:
|
|
@rm -rf $(BUILD_DIR)
|
|
|
|
# Helper to automatically flash (Mac specific path)
|
|
flash: all
|
|
@echo "Waiting for RPI-RP2 volume..."
|
|
@while [ ! -d /Volumes/RPI-RP2 ]; do sleep 0.1; done
|
|
@echo "Flashing..."
|
|
@cp $(BUILD_DIR)/$(TARGET).uf2 /Volumes/RPI-RP2/
|
|
@echo "Done."
|
|
|
|
.PHONY: all clean flash
|