|
-
-
- TARGET = main
-
-
- ARDUINOPATH ?= ../../../..
-
-
- OPTIONS = -DF_CPU=48000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH
-
-
- OPTIONS += -D__MK20DX128__ -DARDUIO=105 -DTEENSYDUINO=118
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- TOOLSPATH = $(ARDUINOPATH)/hardware/tools
-
-
-
- LIBRARYPATH = $(ARDUINOPATH)/libraries
-
-
- COMPILERPATH = $(ARDUINOPATH)/hardware/tools/arm-none-eabi/bin
-
-
-
-
-
-
- CPPFLAGS = -Wall -g -Os -mcpu=cortex-m4 -mthumb -nostdlib -MMD $(OPTIONS) -I.
-
-
- CXXFLAGS = -std=gnu++0x -felide-constructors -fno-exceptions -fno-rtti
-
-
- CFLAGS =
-
-
- LDFLAGS = -Os -Wl,--gc-sections -mcpu=cortex-m4 -mthumb -Tmk20dx128.ld
-
-
- LIBS = -lm
-
-
-
- CC = $(abspath $(COMPILERPATH))/arm-none-eabi-gcc
- CXX = $(abspath $(COMPILERPATH))/arm-none-eabi-g++
- OBJCOPY = $(abspath $(COMPILERPATH))/arm-none-eabi-objcopy
- SIZE = $(abspath $(COMPILERPATH))/arm-none-eabi-size
-
-
-
- C_FILES := $(wildcard *.c)
- CPP_FILES := $(wildcard *.cpp)
- OBJS := $(C_FILES:.c=.o) $(CPP_FILES:.cpp=.o)
-
-
-
-
- all: $(TARGET).hex
-
- $(TARGET).elf: $(OBJS) mk20dx128.ld
- $(CC) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)
-
- %.hex: %.elf
- $(SIZE) $<
- $(OBJCOPY) -O ihex -R .eeprom $< $@
- $(abspath $(TOOLSPATH))/teensy_post_compile -file=$(basename $@) -path=$(shell pwd) -tools=$(abspath $(TOOLSPATH))
- -$(abspath $(TOOLSPATH))/teensy_reboot
-
-
-
- -include $(OBJS:.o=.d)
-
- clean:
- rm -f *.o *.d $(TARGET).elf $(TARGET).hex
-
|