makefile 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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 = at90usb1287
  13. ARCH = AVR8
  14. BOARD = USBKEY
  15. F_CPU = 8000000
  16. F_USB = $(F_CPU)
  17. OPTIMIZATION = s
  18. TARGET = BootloaderHID
  19. SRC = $(TARGET).c Descriptors.c $(LUFA_SRC_USB)
  20. LUFA_PATH = ../../LUFA
  21. CC_FLAGS = -DUSE_LUFA_CONFIG_HEADER -DBOOT_START_ADDR=$(BOOT_START_OFFSET) -IConfig/
  22. LD_FLAGS = -Wl,--section-start=.text=$(BOOT_START_OFFSET)
  23. # Flash size and bootloader section sizes of the target, in KB. These must
  24. # match the target's total FLASH size and the bootloader size set in the
  25. # device's fuses.
  26. FLASH_SIZE_KB := 128
  27. BOOT_SECTION_SIZE_KB := 8
  28. # Bootloader address calculation formulas
  29. # Do not modify these macros, but rather modify the dependent values above.
  30. CALC_ADDRESS_IN_HEX = $(shell printf "0x%X" $$(( $(1) )) )
  31. BOOT_START_OFFSET = $(call CALC_ADDRESS_IN_HEX, ($(FLASH_SIZE_KB) - $(BOOT_SECTION_SIZE_KB)) * 1024 )
  32. BOOT_SEC_OFFSET = $(call CALC_ADDRESS_IN_HEX, ($(FLASH_SIZE_KB) * 1024) - ($(strip $(1))) )
  33. # Default target
  34. all:
  35. # Include LUFA-specific DMBS extension modules
  36. DMBS_LUFA_PATH ?= $(LUFA_PATH)/Build/LUFA
  37. include $(DMBS_LUFA_PATH)/lufa-sources.mk
  38. include $(DMBS_LUFA_PATH)/lufa-gcc.mk
  39. # Include common DMBS build system modules
  40. DMBS_PATH ?= $(LUFA_PATH)/Build/DMBS/DMBS
  41. include $(DMBS_PATH)/core.mk
  42. include $(DMBS_PATH)/cppcheck.mk
  43. include $(DMBS_PATH)/doxygen.mk
  44. include $(DMBS_PATH)/dfu.mk
  45. include $(DMBS_PATH)/gcc.mk
  46. include $(DMBS_PATH)/hid.mk
  47. include $(DMBS_PATH)/avrdude.mk
  48. include $(DMBS_PATH)/atprogram.mk