makefile.test 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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. DEBUG_LEVEL = 0
  17. ifeq ($(ARCH), AVR8)
  18. F_USB = 8000000
  19. else ifeq ($(ARCH), XMEGA)
  20. F_USB = 48000000
  21. else ifeq ($(ARCH), UC3)
  22. F_USB = 48000000
  23. endif
  24. OPTIMIZATION = 1
  25. TARGET = Test
  26. SRC = Test.c Dummy.S $(LUFA_SRC_USB)
  27. LUFA_PATH = ../../LUFA
  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. # Only enable rendundant declaration warnings for AVR8 target (FIXME)
  45. ifeq ($(ARCH), AVR8)
  46. CC_FLAGS += -Wredundant-decls
  47. endif
  48. # C compiler only flags
  49. C_FLAGS += -Wmissing-parameter-type
  50. C_FLAGS += -Wnested-externs
  51. # Potential additional warnings to enable in the future (FIXME)
  52. #CC_FLAGS += -Wswitch-default
  53. #CC_FLAGS += -Wc++-compat
  54. #CC_FLAGS += -Wcast-qual
  55. #CC_FLAGS += -Wconversion
  56. #CC_FLAGS += -Wjump-misses-init
  57. #CC_FLAGS += -pedantic
  58. # Include LUFA-specific DMBS extension modules
  59. DMBS_LUFA_PATH ?= $(LUFA_PATH)/Build/LUFA
  60. include $(DMBS_LUFA_PATH)/lufa-sources.mk
  61. include $(DMBS_LUFA_PATH)/lufa-gcc.mk
  62. # Include common DMBS build system modules
  63. DMBS_PATH ?= $(LUFA_PATH)/Build/DMBS/DMBS
  64. include $(DMBS_PATH)/core.mk
  65. include $(DMBS_PATH)/gcc.mk