makefile.test 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. #
  2. # LUFA Library
  3. # Copyright (C) Dean Camera, 2018.
  4. #
  5. # dean [at] fourwalledcubicle [dot] com
  6. # www.lufa-lib.org
  7. #
  8. # --------------------------------------
  9. # LUFA Project Makefile.
  10. # --------------------------------------
  11. # Run "make help" for target help.
  12. MCU =
  13. ARCH =
  14. BOARD = NONE
  15. F_CPU = $(F_USB)
  16. OPTIMIZATION = 1
  17. TARGET = Test
  18. SRC = $(TARGET)_C.c $(TARGET)_CPP.cpp Dummy.S $(LUFA_SRC_USB)
  19. LUFA_PATH = ../../LUFA
  20. DEBUG_LEVEL = 0
  21. ifeq ($(ARCH), AVR8)
  22. F_USB = 8000000
  23. else ifeq ($(ARCH), XMEGA)
  24. F_USB = 48000000
  25. else ifeq ($(ARCH), UC3)
  26. F_USB = 48000000
  27. endif
  28. # Generic C/C++ compiler flags
  29. CC_FLAGS = -Wextra
  30. CC_FLAGS += -Werror
  31. CC_FLAGS += -Wformat=2
  32. CC_FLAGS += -Winit-self
  33. CC_FLAGS += -Wswitch-enum
  34. CC_FLAGS += -Wunused
  35. CC_FLAGS += -Wundef
  36. CC_FLAGS += -Wpointer-arith
  37. CC_FLAGS += -Wcast-align
  38. CC_FLAGS += -Wwrite-strings
  39. CC_FLAGS += -Wlogical-op
  40. CC_FLAGS += -Wmissing-declarations
  41. CC_FLAGS += -Wmissing-field-initializers
  42. CC_FLAGS += -Wmissing-format-attribute
  43. CC_FLAGS += -Woverlength-strings
  44. CC_FLAGS += -Wswitch-default
  45. CC_FLAGS += -Wfloat-equal
  46. CC_FLAGS += -Waggregate-return
  47. CC_FLAGS += -Wmissing-include-dirs
  48. # Disable warnings not supported by the version of GCC used for UC3 targets (FIXME)
  49. ifneq ($(ARCH), UC3)
  50. CC_FLAGS += -Wdouble-promotion
  51. endif
  52. # Only enable redundant declaration warnings for AVR8 target (FIXME)
  53. ifeq ($(ARCH), AVR8)
  54. CC_FLAGS += -Wredundant-decls
  55. endif
  56. # C compiler only flags
  57. C_FLAGS += -Wmissing-parameter-type
  58. C_FLAGS += -Wmissing-prototypes
  59. C_FLAGS += -Wnested-externs
  60. C_FLAGS += -Wbad-function-cast
  61. C_FLAGS += -Wstrict-prototypes
  62. C_FLAGS += -Wold-style-definition
  63. # Disable warnings not supported by the version of GCC used for UC3 targets (FIXME)
  64. ifneq ($(ARCH), UC3)
  65. C_FLAGS += -Wunsuffixed-float-constants
  66. C_FLAGS += -Wjump-misses-init
  67. endif
  68. # Only check C++ compatibility on the build files, to ensure headers are C++ compatible
  69. Test_C.c Test_CPP.cpp: CC_FLAGS += -Wc++-compat
  70. # Potential additional warnings to enable in the future (FIXME)
  71. #CC_FLAGS += -Wcast-qual
  72. #CC_FLAGS += -Wconversion
  73. #CC_FLAGS += -Wsign-conversion
  74. #CC_FLAGS += -pedantic
  75. # Include LUFA-specific DMBS extension modules
  76. DMBS_LUFA_PATH ?= $(LUFA_PATH)/Build/LUFA
  77. include $(DMBS_LUFA_PATH)/lufa-sources.mk
  78. include $(DMBS_LUFA_PATH)/lufa-gcc.mk
  79. # Include common DMBS build system modules
  80. DMBS_PATH ?= $(LUFA_PATH)/Build/DMBS/DMBS
  81. include $(DMBS_PATH)/core.mk
  82. include $(DMBS_PATH)/gcc.mk