You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Makefile 1.3KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. CPUARCH = cortex-m7
  2. DEFS = -DUSB_SERIAL -D__IMXRT1052__ -DTEENSYDUINO=145 -DARDUINO=10808 -DF_CPU=396000000 -DLAYOUT_US_ENGLISH
  3. SECTIONS = -ffunction-sections -fdata-sections
  4. CPPFLAGS = -Wall -g -O2 $(SECTIONS) -mcpu=$(CPUARCH) -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -fsingle-precision-constant -I. $(DEFS)
  5. CXXFLAGS = -std=gnu++14 -felide-constructors -fno-exceptions -fno-rtti
  6. LDFLAGS = -Wl,--gc-sections,--print-gc-sections,--print-memory-usage --specs=nano.specs -nostdlib -nostartfiles -Timxrt.ld
  7. C_FILES := $(wildcard *.c)
  8. CPP_FILES := $(wildcard *.cpp)
  9. OBJS := $(C_FILES:.c=.o) $(CPP_FILES:.cpp=.o)
  10. ARDUINOPATH = /home/paul/teensy/arduino-1.8.8
  11. COMPILERPATH = $(abspath $(ARDUINOPATH)/hardware/tools/arm/bin)
  12. CC = $(COMPILERPATH)/arm-none-eabi-gcc
  13. CXX = $(COMPILERPATH)/arm-none-eabi-g++
  14. OBJCOPY = $(COMPILERPATH)/arm-none-eabi-objcopy
  15. OBJDUMP = $(COMPILERPATH)/arm-none-eabi-objdump
  16. SIZE = $(COMPILERPATH)/arm-none-eabi-size
  17. AR = $(COMPILERPATH)/arm-none-eabi-gcc-ar
  18. all: Blink.elf
  19. Blink.elf: Blink.o core.a
  20. $(CC) $(CPPFLAGS) $(LDFLAGS) -o $@ $^ -lm
  21. #$(CC) $(CPPFLAGS) $(LDFLAGS) -o $@ Blink.o $(OBJS) -lm
  22. $(OBJDUMP) -d -S -C $@ > Blink.lst
  23. $(OBJDUMP) -t -C $@ > Blink.sym
  24. $(OBJCOPY) -O ihex -R .eeprom $@ Blink.hex
  25. $(SIZE) $@
  26. core.a: $(OBJS)
  27. $(AR) rcs core.a $(OBJS)
  28. clean:
  29. rm -f *.o *.d core.a *.elf *.lst *.sym *.hex