/
spaceswimmer
/
perf-source
Обзор
Документация
Войти
/
spaceswimmer
/
perf-source
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
PerfSource/Makefile
71 строка
2 KB
spaceswimmer
master Is this finished?
10 мар 2026, 17:45
10 мар 2026, 17:45
a420a94
Код
Авторство
О чём код?
# Project directories WEBBOARD_DIR = webboard BUILD_DIR = ../build SRC_DIR = . # Arduino CLI configuration ARDUINO_CLI ?= arduino-cli # Build method: native or docker BUILD_METHOD ?= native PORT ?= /dev/ttyACM0 BOARD = esp32:esp32:esp32c3 FQBN = esp32:esp32:esp32c3 # Default target all: build-web compile upload # Build the web interface and generate WebPage.h build-web: ifeq ($(BUILD_METHOD),docker) @echo "Building web interface using Docker..." docker build -t perfsource-web-builder -f ../Dockerfile .. docker run --rm -v $(CURDIR):/output perfsource-web-builder else @echo "Building web interface..." cd $(WEBBOARD_DIR) && npm run build @echo "Copying WebPage.h to source directory..." cp $(WEBBOARD_DIR)/build/WebPage.h $(SRC_DIR)/ endif @echo "WebPage.h generated in $(SRC_DIR)" # Compile the Arduino project compile: build-web @echo "Compiling ESP32 project..." $(ARDUINO_CLI) compile -b $(FQBN) --build-path $(BUILD_DIR) $(SRC_DIR) # Upload to ESP32 upload: compile @echo "Uploading to ESP32..." $(ARDUINO_CLI) upload -b $(FQBN) -p $(PORT) --input-dir $(BUILD_DIR) $(SRC_DIR) # Clean build artifacts clean: @echo "Cleaning build artifacts..." rm -rf $(BUILD_DIR) rm -f $(SRC_DIR)/WebPage.h cd $(WEBBOARD_DIR) && npm run clean # Monitor serial output monitor: $(ARDUINO_CLI) monitor -p $(PORT) format: clang-format -style=file:../materials/.clang-format -i *.cpp *.h *.ino check: clang-format -style=file:../materials/.clang-format -n *.cpp *.h *.ino # Help help: @echo "Available targets:" @echo " make all - Build web interface and compile project (default)" @echo " make build-web - Build web interface only" @echo " make compile - Compile ESP32 project" @echo " make upload - Compile and upload to ESP32" @echo " make clean - Clean all build artifacts" @echo " make monitor - Monitor serial output" @echo " make format - Lint file" @echo " make check - check for lint errors" @echo " make help - Show this help" .PHONY: all build-web compile upload clean monitor install-deps help