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.

34 lines
688 B

  1. SYSTEM_TYPE := $(shell gcc -dumpmachine)
  2. GCC_VERSION := $(shell gcc --version 2>/dev/null)
  3. CC = gcc
  4. OBJCOPY =
  5. OBJDUMP =
  6. SIZE =
  7. AR =
  8. NM =
  9. HEX =
  10. EEP =
  11. BIN =
  12. COMPILEFLAGS += -funsigned-char
  13. ifeq ($(findstring clang, ${GCC_VERSION}),)
  14. COMPILEFLAGS += -funsigned-bitfields
  15. endif
  16. COMPILEFLAGS += -ffunction-sections
  17. COMPILEFLAGS += -fdata-sections
  18. COMPILEFLAGS += -fshort-enums
  19. ifneq ($(findstring mingw, ${SYSTEM_TYPE}),)
  20. COMPILEFLAGS += -mno-ms-bitfields
  21. endif
  22. CFLAGS += $(COMPILEFLAGS)
  23. ifeq ($(findstring clang, ${GCC_VERSION}),)
  24. CFLAGS += -fno-inline-small-functions
  25. endif
  26. CFLAGS += -fno-strict-aliasing
  27. CXXFLAGS += $(COMPILEFLAGS)
  28. CXXFLAGS += -fno-exceptions
  29. CXXFLAGS += -std=gnu++11