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
# Bootloader to include in whole-chip .hex image
FCBOOT_IMAGE = ../bin/fc-boot-v101.hex
Micah Elizabeth Scott
committed
#######################################################
# The name of your project (used to name the compiled .dfu file)
# Temporary .hex file for application image only, without bootloader
APP_HEX = app-image.hex
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 -Werror $(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
LDFLAGS = -Os -Wl,--gc-sections -mcpu=cortex-m4 -mthumb -nostdlib -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 $@
$(OBJCOPY) -O ihex $< $(APP_HEX)
(grep -v :00000001FF $(FCBOOT_IMAGE); cat $(APP_HEX)) > $@
benchmark: install
../tools/benchmark.py
# compiler generated dependency info
-include $(OBJS:.o=.d)
clean:
rm -f *.d *.o $(TARGET).elf $(TARGET).dfu $(APP_HEX)
Micah Elizabeth Scott
committed
disassemble: $(TARGET).elf
$(OBJDUMP) -d $< | less
Micah Elizabeth Scott
committed
symbols: $(TARGET).elf
$(OBJDUMP) -t $< | sort | less
.PHONY: all clean install disassemble symbols benchmark