diff options
author | HampusM <hampus@hampusmat.com> | 2022-02-14 11:47:36 +0100 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2022-02-14 11:47:36 +0100 |
commit | cb7a167c7dee2fa1a19bd09ede3bae8b140e79da (patch) | |
tree | 3bc9443f0d988273a78f4654030ab65b3c580509 /Makefile | |
parent | 7892ef9d248c189be68ce7faf63230ec0a318b67 (diff) |
build: use PlatformIO
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 50 |
1 files changed, 13 insertions, 37 deletions
@@ -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 |