aboutsummaryrefslogtreecommitdiff
path: root/zumo/makefile
diff options
context:
space:
mode:
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 $@