at91bootstrap3.mk 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. ################################################################################
  2. #
  3. # at91bootstrap3
  4. #
  5. ################################################################################
  6. AT91BOOTSTRAP3_VERSION = 3.2
  7. AT91BOOTSTRAP3_SITE = \
  8. ftp://www.at91.com/pub/at91bootstrap/AT91Bootstrap$(AT91BOOTSTRAP3_VERSION)
  9. AT91BOOTSTRAP3_SOURCE = at91bootstrap_9n12.tar.gz
  10. AT91BOOTSTRAP3_INSTALL_IMAGES = YES
  11. AT91BOOTSTRAP3_INSTALL_TARGET = NO
  12. AT91BOOTSTRAP3_DEFCONFIG = \
  13. $(call qstrip,$(BR2_TARGET_AT91BOOTSTRAP3_DEFCONFIG))
  14. AT91BOOTSTRAP3_CUSTOM_CONFIG_FILE = \
  15. $(call qstrip,$(BR2_TARGET_AT91BOOTSTRAP3_CUSTOM_CONFIG_FILE))
  16. AT91BOOTSTRAP3_CUSTOM_PATCH_DIR = \
  17. $(call qstrip,$(BR2_TARGET_AT91BOOTSTRAP3_CUSTOM_PATCH_DIR))
  18. AT91BOOTSTRAP3_MAKE_OPT = CROSS_COMPILE=$(TARGET_CROSS) DESTDIR=$(BINARIES_DIR)
  19. ifneq ($(AT91BOOTSTRAP3_CUSTOM_PATCH_DIR),)
  20. define AT91BOOTSTRAP3_APPLY_CUSTOM_PATCHES
  21. support/scripts/apply-patches.sh $(@D) $(AT91BOOTSTRAP3_CUSTOM_PATCH_DIR) \
  22. at91bootstrap3-\*.patch
  23. endef
  24. AT91BOOTSTRAP3_POST_PATCH_HOOKS += AT91BOOTSTRAP3_APPLY_CUSTOM_PATCHES
  25. endif
  26. ifeq ($(BR2_TARGET_AT91BOOTSTRAP3_USE_DEFCONFIG),y)
  27. AT91BOOTSTRAP3_SOURCE_CONFIG = \
  28. $(@D)/board/*/$(AT91BOOTSTRAP3_DEFCONFIG)_defconfig
  29. else ifeq ($(BR2_TARGET_AT91BOOTSTRAP3_USE_CUSTOM_CONFIG),y)
  30. AT91BOOTSTRAP3_SOURCE_CONFIG = $(AT91BOOTSTRAP3_CUSTOM_CONFIG_FILE)
  31. endif
  32. define AT91BOOTSTRAP3_CONFIGURE_CMDS
  33. cp $(AT91BOOTSTRAP3_SOURCE_CONFIG) $(@D)/.config
  34. $(SED) 's/image.bin/uImage/' $(@D)/.config
  35. endef
  36. define AT91BOOTSTRAP3_BUILD_CMDS
  37. $(MAKE) $(AT91BOOTSTRAP3_MAKE_OPT) -C $(@D) boot
  38. endef
  39. define AT91BOOTSTRAP3_INSTALL_IMAGES_CMDS
  40. $(MAKE) $(AT91BOOTSTRAP3_MAKE_OPT) -C $(@D) bootstrap
  41. endef
  42. $(eval $(generic-package))
  43. # Checks to give errors that the user can understand
  44. ifeq ($(filter source,$(MAKECMDGOALS)),)
  45. ifeq ($(BR2_TARGET_AT91BOOTSTRAP3_USE_DEFCONFIG),y)
  46. ifeq ($(AT91BOOTSTRAP3_DEFCONFIG),)
  47. $(error No at91bootstrap3 defconfig name specified, check your BR2_TARGET_AT91BOOTSTRAP3_DEFCONFIG setting)
  48. endif
  49. endif
  50. ifeq ($(BR2_TARGET_AT91BOOTSTRAP3_USE_CUSTOM_CONFIG),y)
  51. ifeq ($(AT91BOOTSTRAP3_CUSTOM_CONFIG_FILE),)
  52. $(error No at91bootstrap3 configuration file specified, check your BR2_TARGET_AT91BOOTSTRAP3_CUSTOM_CONFIG_FILE setting)
  53. endif
  54. endif
  55. endif