aboutsummaryrefslogtreecommitdiff
path: root/zumo/makefile
diff options
context:
space:
mode:
authorlonkaars <loek@pipeframe.xyz>2023-04-25 20:55:35 +0200
committerlonkaars <loek@pipeframe.xyz>2023-04-25 20:55:35 +0200
commita5ae433b7f12246adb709a57223a853bd2a948c1 (patch)
tree9d82a347d34a4b1b8c71a54886999f6beb016953 /zumo/makefile
parent3a5c0f9bc2f9049114228e472826e31423dc5263 (diff)
WIP arduino + pololu libraries build system
Diffstat (limited to 'zumo/makefile')
-rw-r--r--zumo/makefile15
1 files changed, 12 insertions, 3 deletions
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 $@