From a5ae433b7f12246adb709a57223a853bd2a948c1 Mon Sep 17 00:00:00 2001 From: lonkaars Date: Tue, 25 Apr 2023 20:55:35 +0200 Subject: WIP arduino + pololu libraries build system --- zumo/makefile | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'zumo/makefile') diff --git a/zumo/makefile b/zumo/makefile index aac11f4..1a7ad36 100644 --- a/zumo/makefile +++ b/zumo/makefile @@ -1,10 +1,13 @@ PORT = /dev/ttyUSB0 +C++ = avr-g++ CC = avr-gcc LD = avr-ld RM = rm -f -MCU=atmega32u4 +MCU = atmega32u4 +TARGET = main +SRCS += main.cpp CFLAGS += -mcall-prologues CFLAGS += -mmcu=$(MCU) @@ -13,14 +16,20 @@ CFLAGS += -g CFLAGS += -Wl,-gc-sections CFLAGS += -Wl,-relax -TARGET = main -SRCS += main.c +include zumo.mk + OBJS := $(patsubst %.c,%.o, $(SRCS)) +OBJS := $(patsubst %.cpp,%.o, $(OBJS)) + +MAKEFLAGS += -j4 .PHONY: all clean flash all: $(TARGET).hex +%.o: %.cpp + $(C++) -c $(CFLAGS) $< -o $@ + %.o: %.c $(CC) -c $(CFLAGS) $< -o $@ -- cgit v1.2.3