at91bootstrap3.mk 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. ################################################################################
  2. #
  3. # at91bootstrap3
  4. #
  5. ################################################################################
  6. AT91BOOTSTRAP3_VERSION = v3.7.1
  7. AT91BOOTSTRAP3_SITE = $(call github,linux4sam,at91bootstrap,$(AT91BOOTSTRAP3_VERSION))
  8. AT91BOOTSTRAP3_INSTALL_IMAGES = YES
  9. AT91BOOTSTRAP3_INSTALL_TARGET = NO
  10. AT91BOOTSTRAP3_DEFCONFIG = \
  11. $(call qstrip,$(BR2_TARGET_AT91BOOTSTRAP3_DEFCONFIG))
  12. AT91BOOTSTRAP3_CUSTOM_CONFIG_FILE = \
  13. $(call qstrip,$(BR2_TARGET_AT91BOOTSTRAP3_CUSTOM_CONFIG_FILE))
  14. AT91BOOTSTRAP3_CUSTOM_PATCH_DIR = \
  15. $(call qstrip,$(BR2_TARGET_AT91BOOTSTRAP3_CUSTOM_PATCH_DIR))
  16. AT91BOOTSTRAP3_MAKE_OPTS = CROSS_COMPILE=$(TARGET_CROSS) DESTDIR=$(BINARIES_DIR)
  17. ifneq ($(AT91BOOTSTRAP3_CUSTOM_PATCH_DIR),)
  18. define AT91BOOTSTRAP3_APPLY_CUSTOM_PATCHES
  19. $(APPLY_PATCHES) $(@D) $(AT91BOOTSTRAP3_CUSTOM_PATCH_DIR) \
  20. at91bootstrap3-\*.patch
  21. endef
  22. AT91BOOTSTRAP3_POST_PATCH_HOOKS += AT91BOOTSTRAP3_APPLY_CUSTOM_PATCHES
  23. endif
  24. ifeq ($(BR2_TARGET_AT91BOOTSTRAP3_USE_DEFCONFIG),y)
  25. define AT91BOOTSTRAP3_CONFIGURE_CMDS
  26. $(MAKE) $(AT91BOOTSTRAP3_MAKE_OPTS) -C $(@D) $(AT91BOOTSTRAP3_DEFCONFIG)_defconfig
  27. endef
  28. else ifeq ($(BR2_TARGET_AT91BOOTSTRAP3_USE_CUSTOM_CONFIG),y)
  29. define AT91BOOTSTRAP3_CONFIGURE_CMDS
  30. cp $(BR2_TARGET_AT91BOOTSTRAP3_CUSTOM_CONFIG_FILE) $(@D)/.config
  31. endef
  32. endif
  33. define AT91BOOTSTRAP3_BUILD_CMDS
  34. $(MAKE) $(AT91BOOTSTRAP3_MAKE_OPTS) -C $(@D)
  35. endef
  36. define AT91BOOTSTRAP3_INSTALL_IMAGES_CMDS
  37. cp $(@D)/binaries/*.bin $(BINARIES_DIR)
  38. endef
  39. $(eval $(generic-package))
  40. # Checks to give errors that the user can understand
  41. ifeq ($(filter source,$(MAKECMDGOALS)),)
  42. ifeq ($(BR2_TARGET_AT91BOOTSTRAP3_USE_DEFCONFIG),y)
  43. ifeq ($(AT91BOOTSTRAP3_DEFCONFIG),)
  44. $(error No at91bootstrap3 defconfig name specified, check your BR2_TARGET_AT91BOOTSTRAP3_DEFCONFIG setting)
  45. endif
  46. endif
  47. ifeq ($(BR2_TARGET_AT91BOOTSTRAP3_USE_CUSTOM_CONFIG),y)
  48. ifeq ($(AT91BOOTSTRAP3_CUSTOM_CONFIG_FILE),)
  49. $(error No at91bootstrap3 configuration file specified, check your BR2_TARGET_AT91BOOTSTRAP3_CUSTOM_CONFIG_FILE setting)
  50. endif
  51. endif
  52. endif