From cb7a167c7dee2fa1a19bd09ede3bae8b140e79da Mon Sep 17 00:00:00 2001 From: HampusM Date: Mon, 14 Feb 2022 11:47:36 +0100 Subject: build: use PlatformIO --- Makefile | 50 +++++++++++++------------------------------------- 1 file changed, 13 insertions(+), 37 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 3271857..016b2ae 100644 --- a/Makefile +++ b/Makefile @@ -1,44 +1,20 @@ -# Arduino specs -ARDUINO_VERSION = 184 -BOARD_TAG = leonardo -ARCHITECTURE = avr -ARDUINO_ARCH_FLAG = -DARDUINO_ARCH_AVR -ARDMK_VENDOR = arduino -ARDUINO_PORT=/dev/ttyACM0 -MONITOR_BAUDRATE = 9600 -OPTIMIZATION_LEVEL=s -DEBUG_FLAGS = -O0 -g -MCU_FLAG_NAME = mmcu +TARGET = gyronardo -# Flags -LOG_MONITOR = 0 +PIO = pio -# Functions -rwildcard=$(foreach d,$(wildcard $1*),$(call rwildcard,$d/,$2) $(filter $(subst *,%,$2),$d)) +all: $(TARGET) -ARDUINO_VERSION_FULL = 1.8.4 +.PHONY: $(TARGET) upload clean monitor -# Paths -ARDUINO_DIR = $(HOME)/.arduino15/packages/arduino -BOARDS_TXT = $(ARDUINO_DIR)/hardware/$(ARCHITECTURE)/$(ARDUINO_VERSION_FULL)/boards.txt -ARDUINO_CORE_PATH = $(ARDUINO_DIR)/hardware/$(ARCHITECTURE)/$(ARDUINO_VERSION_FULL)/cores/arduino -ARDUINO_PLATFORM_LIB_PATH = $(ARDUINO_DIR)/hardware/$(ARCHITECTURE)/$(ARDUINO_VERSION_FULL)/libraries -ARDUINO_VAR_PATH = $(ARDUINO_DIR)/hardware/$(ARCHITECTURE)/$(ARDUINO_VERSION_FULL)/variants +$(TARGET): + $(PIO) run + $(PIO) run --target compiledb -#ARDUINO_DIR = C:/Arduino -ARDMK_DIR = make-scripts -# AVRDUDE_CONF = /etc/avrdude.conf -OBJDIR = build -#LOCAL_SRCS = $(wildcard src/*.cpp) -LOCAL_CPP_SRCS = $(call rwildcard,src/,*.cpp) -# LOCAL_OBJ_FILES = $(LOCAL_SRCS:.cpp=.cpp.o) +upload: + $(PIO) run --target upload -# Libraries -ARDUINO_LIBS = Wire +clean: + $(PIO) run --target clean -# Target -space := -space += -TARGET = Gyronardo - -include $(ARDMK_DIR)/Arduino.mk +monitor: + $(PIO) run --target monitor -- cgit v1.2.3-18-g5258