at91bootstrap3.mk 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. ################################################################################
  2. #
  3. # at91bootstrap3
  4. #
  5. ################################################################################
  6. AT91BOOTSTRAP3_VERSION = v3.6.2
  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. AT91BOOTSTRAP3_SOURCE_CONFIG = \
  26. $(@D)/board/*/$(AT91BOOTSTRAP3_DEFCONFIG)_defconfig
  27. else ifeq ($(BR2_TARGET_AT91BOOTSTRAP3_USE_CUSTOM_CONFIG),y)
  28. AT91BOOTSTRAP3_SOURCE_CONFIG = $(AT91BOOTSTRAP3_CUSTOM_CONFIG_FILE)
  29. endif
  30. define AT91BOOTSTRAP3_CONFIGURE_CMDS
  31. cp $(AT91BOOTSTRAP3_SOURCE_CONFIG) $(@D)/.config
  32. $(SED) 's/image.bin/uImage/' $(@D)/.config
  33. endef
  34. define AT91BOOTSTRAP3_BUILD_CMDS
  35. $(MAKE) $(AT91BOOTSTRAP3_MAKE_OPTS) -C $(@D) boot
  36. endef
  37. define AT91BOOTSTRAP3_INSTALL_IMAGES_CMDS
  38. cp $(@D)/binaries/*.bin $(BINARIES_DIR)
  39. endef
  40. $(eval $(generic-package))
  41. # Checks to give errors that the user can understand
  42. ifeq ($(filter source,$(MAKECMDGOALS)),)
  43. ifeq ($(BR2_TARGET_AT91BOOTSTRAP3_USE_DEFCONFIG),y)
  44. ifeq ($(AT91BOOTSTRAP3_DEFCONFIG),)
  45. $(error No at91bootstrap3 defconfig name specified, check your BR2_TARGET_AT91BOOTSTRAP3_DEFCONFIG setting)
  46. endif
  47. endif
  48. ifeq ($(BR2_TARGET_AT91BOOTSTRAP3_USE_CUSTOM_CONFIG),y)
  49. ifeq ($(AT91BOOTSTRAP3_CUSTOM_CONFIG_FILE),)
  50. $(error No at91bootstrap3 configuration file specified, check your BR2_TARGET_AT91BOOTSTRAP3_CUSTOM_CONFIG_FILE setting)
  51. endif
  52. endif
  53. endif