Makefile.configs 833 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. MAKEFILE_CONFIGS_DIR := $(dir $(lastword $(MAKEFILE_LIST)))
  2. ifeq ($(origin CC),default)
  3. CC = gcc
  4. endif
  5. ifeq ($(origin AS),default)
  6. AS = gcc
  7. endif
  8. ifeq ($(origin AR),default)
  9. AR = ar
  10. endif
  11. ifeq ($(origin ARFLAGS),default)
  12. ARFLAGS = rcs
  13. endif
  14. ifeq ($(origin LD),default)
  15. LD = ld
  16. endif
  17. ifeq ($(origin CXX),default)
  18. CXX = g++
  19. endif
  20. OBJCOPY ?= objcopy
  21. SYS ?= $(shell $(CC) -dumpmachine)
  22. export SYS
  23. DEBUG ?=
  24. export DEBUG
  25. CFLAGS += -Wall -std=c11
  26. CXXFLAGS += -Wall -std=c++14
  27. ifeq ($(DEBUG),1)
  28. CFLAGS += -gdwarf-2 -g3
  29. CXXFLAGS += -gdwarf-2 -g3
  30. CFLAGS += -DDEBUG
  31. ASFLAGS += -DDEBUG
  32. endif
  33. ifeq ($(DEBUG),)
  34. CFLAGS += -O2
  35. CXXFLAGS += -O2
  36. endif
  37. ifeq ($(WERROR),1)
  38. CFLAGS += -Werror
  39. CXXFLAGS += -Werror
  40. endif
  41. ifeq ($(PROFILING),1)
  42. CFLAGS += -DPROFILING=1
  43. endif
  44. MAKEFILE_CONFIGS_INCLUDED = y
  45. include $(MAKEFILE_CONFIGS_DIR)/Makefile.Host