|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145 |
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- MCU=IMXRT1062
-
-
- TARGET = main
-
-
- OPTIONS = -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH -DUSING_MAKEFILE
-
-
- OPTIONS += -D__$(MCU)__ -DARDUINO=10810 -DTEENSYDUINO=149 -DARDUINO_TEENSY40
-
-
- CPUOPTIONS = -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -mthumb
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- ifndef NO_ARDUINO
-
- ARDUINOPATH ?= ../../../../..
- endif
-
- ifdef ARDUINOPATH
-
-
- TOOLSPATH = $(abspath $(ARDUINOPATH)/hardware/tools)
-
-
- LIBRARYPATH = $(abspath $(ARDUINOPATH)/libraries)
-
-
- COMPILERPATH = $(abspath $(ARDUINOPATH)/hardware/tools/arm/bin)
-
- else
-
-
- COMPILERPATH ?= /usr/bin
-
- endif
-
-
-
-
-
-
- CPPFLAGS = -Wall -g -O2 $(CPUOPTIONS) -MMD $(OPTIONS) -I. -ffunction-sections -fdata-sections
-
-
- CXXFLAGS = -std=gnu++14 -felide-constructors -fno-exceptions -fpermissive -fno-rtti -Wno-error=narrowing
-
-
- CFLAGS =
-
-
- LDFLAGS = -Os -Wl,--gc-sections,--relax $(SPECS) $(CPUOPTIONS) -T$(MCU_LD)
-
-
- LIBS = -larm_cortexM7lfsp_math -lm -lstdc++
-
-
-
- CC = $(COMPILERPATH)/arm-none-eabi-gcc
- CXX = $(COMPILERPATH)/arm-none-eabi-g++
- OBJCOPY = $(COMPILERPATH)/arm-none-eabi-objcopy
- SIZE = $(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) $(MCU_LD)
- $(CC) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)
-
- %.hex: %.elf
- $(SIZE) $<
- $(OBJCOPY) -O ihex -R .eeprom $< $@
- ifneq (,$(wildcard $(TOOLSPATH)))
- $(TOOLSPATH)/teensy_post_compile -file=$(basename $@) -path=$(shell pwd) -tools=$(TOOLSPATH)
- -$(TOOLSPATH)/teensy_reboot
- endif
-
-
- -include $(OBJS:.o=.d)
-
-
- LOWER_MCU := $(subst A,a,$(subst B,b,$(subst C,c,$(subst D,d,$(subst E,e,$(subst F,f,$(subst G,g,$(subst H,h,$(subst I,i,$(subst J,j,$(subst K,k,$(subst L,l,$(subst M,m,$(subst N,n,$(subst O,o,$(subst P,p,$(subst Q,q,$(subst R,r,$(subst S,s,$(subst T,t,$(subst U,u,$(subst V,v,$(subst W,w,$(subst X,x,$(subst Y,y,$(subst Z,z,$(MCU)))))))))))))))))))))))))))
- MCU_LD = $(LOWER_MCU).ld
-
- clean:
- rm -f *.o *.d $(TARGET).elf $(TARGET).hex
|