tools_config.mk 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #
  2. # Common global compiler configuration
  3. #
  4. # Common Compiler Flags ########################################################
  5. # CHRE requires C++11 and C99 support.
  6. COMMON_CXX_CFLAGS += -std=c++11
  7. COMMON_C_CFLAGS += -x c
  8. COMMON_C_CFLAGS += -std=c99
  9. # Configure 'all' and 'extra' warnings and promote warnings to errors.
  10. COMMON_CFLAGS += -Wall
  11. COMMON_CFLAGS += -Wextra
  12. COMMON_CFLAGS += -Werror
  13. # Disabled warnings. You better have a good reason to add more here.
  14. COMMON_CFLAGS += -Wno-unused-parameter
  15. # Additional warnings. Even more! :]
  16. COMMON_CFLAGS += -Wshadow
  17. COMMON_CFLAGS += -Wdouble-promotion
  18. # Disable exceptions and RTTI.
  19. COMMON_CXX_CFLAGS += -fno-exceptions
  20. COMMON_CXX_CFLAGS += -fno-rtti
  21. # Enable the linker to garbage collect unused code and variables.
  22. COMMON_CFLAGS += -fdata-sections
  23. COMMON_CFLAGS += -ffunction-sections
  24. # Enable debugging symbols for debug builds.
  25. COMMON_DEBUG_CFLAGS += -g
  26. # Dependency Resolution
  27. DEP_CFLAGS = -MM -MG -MP -MF $$(basename $$@).d
  28. # Compile with hidden visibility by default.
  29. COMMON_CFLAGS += -fvisibility=hidden
  30. # Common Archive Flags #########################################################
  31. COMMON_ARFLAGS += rsc