Teensy 4.1 core updated for C++20
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.

пре 11 година
пре 11 година
пре 11 година
пре 11 година
пре 11 година
пре 11 година
пре 11 година
пре 11 година
пре 11 година
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. # The name of your project (used to name the compiled .hex file)
  2. TARGET = main
  3. # Path to your arduino installation
  4. ARDUINOPATH ?= ../../../..
  5. # configurable options
  6. OPTIONS = -DF_CPU=48000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH
  7. # options needed by many Arduino libraries to configure for Teensy 3.0
  8. OPTIONS += -D__MK20DX128__ -DARDUIO=104
  9. #************************************************************************
  10. # Location of Teensyduino utilities, Toolchain, and Arduino Libraries.
  11. # To use this makefile without Arduino, copy the resources from these
  12. # locations and edit the pathnames. The rest of Arduino is not needed.
  13. #************************************************************************
  14. # path location for Teensy Loader, teensy_post_compile and teensy_reboot
  15. TOOLSPATH = $(ARDUINOPATH)/hardware/tools # on Linux
  16. #TOOLSPATH = $(ARDUINOPATH)/hardware/tools/tools/avr/bin # on Mac or Windows
  17. # path location for Arduino libraries (currently not used)
  18. LIBRARYPATH = $(ARDUINOPATH)/libraries
  19. # path location for the arm-none-eabi compiler
  20. COMPILERPATH = $(ARDUINOPATH)/hardware/tools/arm-none-eabi/bin
  21. #************************************************************************
  22. # Settings below this point usually do not need to be edited
  23. #************************************************************************
  24. # CPPFLAGS = compiler options for C and C++
  25. CPPFLAGS = -Wall -g -Os -mcpu=cortex-m4 -mthumb -nostdlib -MMD $(OPTIONS) -I.
  26. # compiler options for C++ only
  27. CXXFLAGS = -std=gnu++0x -felide-constructors -fno-exceptions -fno-rtti
  28. # compiler options for C only
  29. CFLAGS =
  30. # linker options
  31. LDFLAGS = -Os -Wl,--gc-sections -mcpu=cortex-m4 -mthumb -Tmk20dx128.ld
  32. # additional libraries to link
  33. LIBS = -lm
  34. # names for the compiler programs
  35. CC = $(abspath $(COMPILERPATH))/arm-none-eabi-gcc
  36. CXX = $(abspath $(COMPILERPATH))/arm-none-eabi-g++
  37. OBJCOPY = $(abspath $(COMPILERPATH))/arm-none-eabi-objcopy
  38. SIZE = $(abspath $(COMPILERPATH))/arm-none-eabi-size
  39. # automatically create lists of the sources and objects
  40. # TODO: this does not handle Arduino libraries yet...
  41. C_FILES := $(wildcard *.c)
  42. CPP_FILES := $(wildcard *.cpp)
  43. OBJS := $(C_FILES:.c=.o) $(CPP_FILES:.cpp=.o)
  44. # the actual makefile rules (all .o files built by GNU make's default implicit rules)
  45. all: $(TARGET).hex
  46. $(TARGET).elf: $(OBJS) mk20dx128.ld
  47. $(CC) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)
  48. %.hex: %.elf
  49. $(SIZE) $<
  50. $(OBJCOPY) -O ihex -R .eeprom $< $@
  51. $(abspath $(TOOLSPATH))/teensy_post_compile -file=$(basename $@) -path=$(shell pwd) -tools=$(abspath $(TOOLSPATH))
  52. -$(abspath $(TOOLSPATH))/teensy_reboot
  53. # compiler generated dependency info
  54. -include $(OBJS:.o=.d)
  55. clean:
  56. rm -f *.o *.d $(TARGET).elf $(TARGET).hex