Newer
Older
Micah Elizabeth Scott
committed
#######################################################
# Environment setup
# toolchain
DFU_SUFFIX = dfu-suffix
DFU_UTIL = dfu-util
Micah Elizabeth Scott
committed
CC = arm-none-eabi-gcc
CXX = arm-none-eabi-g++
OBJCOPY = arm-none-eabi-objcopy
OBJDUMP = arm-none-eabi-objdump
SIZE = arm-none-eabi-size
#######################################################
# The name of your project (used to name the compiled .dfu file)
pins_teensy.c \
usb_desc.c \
usb_dev.c \
fadecandy.cpp \
fc_usb.cpp \
Micah Elizabeth Scott
committed
OctoWS2811z.cpp
# CPPFLAGS = compiler options for C and C++
CPPFLAGS = -Wall -Wno-sign-compare -Wno-strict-aliasing -g -Os -mcpu=cortex-m4 -mthumb -nostdlib -MMD $(OPTIONS) $(INCLUDES)
# compiler options for C++ only
CXXFLAGS = -std=gnu++0x -felide-constructors -fno-exceptions -fno-rtti
# compiler options for C only
CFLAGS =
# linker script
# linker options
LDFLAGS = -Os -Wl,--gc-sections -mcpu=cortex-m4 -mthumb -T$(LDSCRIPT)
# additional libraries to link
LIBS = -lm
OBJS := $(C_FILES:.c=.o) $(CPP_FILES:.cpp=.o)
all: $(TARGET).dfu $(TARGET).hex
$(TARGET).elf: $(OBJS) $(LDSCRIPT)
$(CC) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)
$(OBJCOPY) -O binary $< $@
$(DFU_SUFFIX) -a $@
%.hex: %.elf
$(OBJCOPY) -O ihex $< $@
# compiler generated dependency info
-include $(OBJS:.o=.d)
clean:
rm -f *.d *.o $(TARGET).elf $(TARGET).dfu
Micah Elizabeth Scott
committed
objdump: $(TARGET).elf
$(OBJDUMP) -d $<