config-clang.mk 957 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. CC = $(TOOLCHAIN_PREFIX)clang$(TOOLCHAIN_SUFFIX)
  2. CXX = $(TOOLCHAIN_PREFIX)clang++$(TOOLCHAIN_SUFFIX)
  3. LD = $(TOOLCHAIN_PREFIX)clang++$(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=thin
  23. CFLAGS += -flto=thin
  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-clang.mk
  34. EXESUFFIX=