1
0

config-gcc.mk 939 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. CC = $(TOOLCHAIN_PREFIX)gcc$(TOOLCHAIN_SUFFIX)
  2. CXX = $(TOOLCHAIN_PREFIX)g++$(TOOLCHAIN_SUFFIX)
  3. LD = $(TOOLCHAIN_PREFIX)g++($TOOLCHAIN_SUFFIX)
  4. AR = $(TOOLCHAIN_PREFIX)ar$(TOOLCHAIN_SUFFIX)
  5. ifneq ($(STDCXX),)
  6. CXXFLAGS_STDCXX = -std=$(STDCXX)
  7. else
  8. ifeq ($(shell printf '\n' > bin/empty.cpp ; if $(CXX) -std=c++17 -c bin/empty.cpp -o bin/empty.out > /dev/null 2>&1 ; then echo 'c++17' ; fi ), c++17)
  9. CXXFLAGS_STDCXX = -std=c++17
  10. endif
  11. endif
  12. CFLAGS_STDC = -std=c99
  13. CXXFLAGS += $(CXXFLAGS_STDCXX)
  14. CFLAGS += $(CFLAGS_STDC)
  15. CPPFLAGS +=
  16. CXXFLAGS += -fPIC
  17. CFLAGS += -fPIC
  18. LDFLAGS +=
  19. LDLIBS += -lm
  20. ARFLAGS := rcs
  21. ifeq ($(OPTIMIZE_LTO),1)
  22. CXXFLAGS += -flto
  23. CFLAGS += -flto
  24. endif
  25. ifeq ($(CHECKED_ADDRESS),1)
  26. CXXFLAGS += -fsanitize=address
  27. CFLAGS += -fsanitize=address
  28. endif
  29. ifeq ($(CHECKED_UNDEFINED),1)
  30. CXXFLAGS += -fsanitize=undefined
  31. CFLAGS += -fsanitize=undefined
  32. endif
  33. include build/make/warnings-gcc.mk
  34. EXESUFFIX=