bootloader.mk 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. # Copyright 2017 Jack Humbert
  2. #
  3. # This program is free software: you can redistribute it and/or modify
  4. # it under the terms of the GNU General Public License as published by
  5. # the Free Software Foundation, either version 2 of the License, or
  6. # (at your option) any later version.
  7. #
  8. # This program is distributed in the hope that it will be useful,
  9. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. # GNU General Public License for more details.
  12. #
  13. # You should have received a copy of the GNU General Public License
  14. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  15. # If it's possible that multiple bootloaders can be used for one project,
  16. # you can leave this unset, and the correct size will be selected
  17. # automatically.
  18. #
  19. # Sets the bootloader defined in the keyboard's/keymap's rules.mk
  20. #
  21. # Current options for ARM (ATSAM):
  22. # md-boot Atmel SAM-BA (only used by Drop boards)
  23. #
  24. # If you need to provide your own implementation, you can set inside `rules.mk`
  25. # `BOOTLOADER = custom` -- you'll need to provide your own implementations. See
  26. # the respective file under `platforms/<PLATFORM>/bootloaders/custom.c` to see
  27. # which functions may be overridden.
  28. ifeq ($(strip $(BOOTLOADER)), custom)
  29. OPT_DEFS += -DBOOTLOADER_CUSTOM
  30. BOOTLOADER_TYPE = custom
  31. endif
  32. ifeq ($(strip $(BOOTLOADER)), md-boot)
  33. OPT_DEFS += -DBOOTLOADER_MD_BOOT
  34. BOOTLOADER_TYPE = md_boot
  35. endif
  36. ifeq ($(strip $(BOOTLOADER_TYPE)),)
  37. ifneq ($(strip $(BOOTLOADER)),)
  38. $(call CATASTROPHIC_ERROR,Invalid BOOTLOADER,Invalid bootloader specified. Please set an appropriate bootloader in your rules.mk or info.json.)
  39. else
  40. $(call CATASTROPHIC_ERROR,Invalid BOOTLOADER,No bootloader specified. Please set an appropriate bootloader in your rules.mk or info.json.)
  41. endif
  42. endif