at91bootstrap3.mk 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. ################################################################################
  2. #
  3. # at91bootstrap3
  4. #
  5. ################################################################################
  6. AT91BOOTSTRAP3_VERSION = $(call qstrip,$(BR2_TARGET_AT91BOOTSTRAP3_VERSION))
  7. ifeq ($(BR2_TARGET_AT91BOOTSTRAP3_CUSTOM_TARBALL),y)
  8. AT91BOOTSTRAP3_TARBALL = $(call qstrip,$(BR2_TARGET_AT91BOOTSTRAP3_CUSTOM_TARBALL_LOCATION))
  9. AT91BOOTSTRAP3_SITE = $(patsubst %/,%,$(dir $(AT91BOOTSTRAP3_TARBALL)))
  10. AT91BOOTSTRAP3_SOURCE = $(notdir $(AT91BOOTSTRAP3_TARBALL))
  11. BR_NO_CHECK_HASH_FOR += $(AT91BOOTSTRAP3_SOURCE)
  12. else ifeq ($(BR2_TARGET_AT91BOOTSTRAP3_CUSTOM_GIT),y)
  13. AT91BOOTSTRAP3_SITE = $(call qstrip,$(BR2_TARGET_AT91BOOTSTRAP3_CUSTOM_REPO_URL))
  14. AT91BOOTSTRAP3_SITE_METHOD = git
  15. BR_NO_CHECK_HASH_FOR += $(AT91BOOTSTRAP3_SOURCE)
  16. else
  17. AT91BOOTSTRAP3_SITE = $(call github,linux4sam,at91bootstrap,$(AT91BOOTSTRAP3_VERSION))
  18. endif
  19. AT91BOOTSTRAP3_LICENSE = Atmel License
  20. ifeq ($(BR2_TARGET_AT91BOOTSTRAP3_LATEST_VERSION),y)
  21. AT91BOOTSTRAP3_LICENSE_FILES = main.c
  22. endif
  23. AT91BOOTSTRAP3_INSTALL_IMAGES = YES
  24. AT91BOOTSTRAP3_INSTALL_TARGET = NO
  25. AT91BOOTSTRAP3_CUSTOM_PATCH_DIR = \
  26. $(call qstrip,$(BR2_TARGET_AT91BOOTSTRAP3_CUSTOM_PATCH_DIR))
  27. AT91BOOTSTRAP3_MAKE_OPTS = CROSS_COMPILE=$(TARGET_CROSS) DESTDIR=$(BINARIES_DIR)
  28. ifneq ($(AT91BOOTSTRAP3_CUSTOM_PATCH_DIR),)
  29. define AT91BOOTSTRAP3_APPLY_CUSTOM_PATCHES
  30. $(APPLY_PATCHES) $(@D) $(AT91BOOTSTRAP3_CUSTOM_PATCH_DIR) \*.patch
  31. endef
  32. AT91BOOTSTRAP3_POST_PATCH_HOOKS += AT91BOOTSTRAP3_APPLY_CUSTOM_PATCHES
  33. endif
  34. define AT91BOOTSTRAP3_BUILD_CMDS
  35. $(MAKE) $(AT91BOOTSTRAP3_MAKE_OPTS) -C $(@D)
  36. endef
  37. define AT91BOOTSTRAP3_INSTALL_IMAGES_CMDS
  38. cp $(@D)/binaries/*.bin $(BINARIES_DIR)
  39. endef
  40. ifeq ($(BR2_TARGET_AT91BOOTSTRAP3_USE_DEFCONFIG),y)
  41. AT91BOOTSTRAP3_KCONFIG_DEFCONFIG = $(call qstrip,$(BR2_TARGET_AT91BOOTSTRAP3_DEFCONFIG))_defconfig
  42. else ifeq ($(BR2_TARGET_AT91BOOTSTRAP3_USE_CUSTOM_CONFIG),y)
  43. AT91BOOTSTRAP3_KCONFIG_FILE = $(call qstrip,$(BR2_TARGET_AT91BOOTSTRAP3_CUSTOM_CONFIG_FILE))
  44. endif
  45. AT91BOOTSTRAP3_KCONFIG_EDITORS = menuconfig xconfig gconfig
  46. AT91BOOTSTRAP3_KCONFIG_OPTS = $(AT91BOOTSTRAP3_MAKE_OPTS)
  47. # Checks to give errors that the user can understand
  48. # Must be before we call to kconfig-package
  49. ifeq ($(BR_BUILDING),y)
  50. ifeq ($(BR2_TARGET_AT91BOOTSTRAP3_USE_DEFCONFIG),y)
  51. # We must use the user-supplied kconfig value, because
  52. # AT91BOOTSTRAP3_KCONFIG_DEFCONFIG will at least contain
  53. # the trailing _defconfig
  54. ifeq ($(call qstrip,$(BR2_TARGET_AT91BOOTSTRAP3_DEFCONFIG)),)
  55. $(error No at91bootstrap3 defconfig name specified, check your BR2_TARGET_AT91BOOTSTRAP3_DEFCONFIG setting)
  56. endif
  57. endif
  58. ifeq ($(BR2_TARGET_AT91BOOTSTRAP3_USE_CUSTOM_CONFIG),y)
  59. ifeq ($(AT91BOOTSTRAP3_KCONFIG_FILE),)
  60. $(error No at91bootstrap3 configuration file specified, check your BR2_TARGET_AT91BOOTSTRAP3_CUSTOM_CONFIG_FILE setting)
  61. endif
  62. endif
  63. ifeq ($(BR2_TARGET_AT91BOOTSTRAP3_CUSTOM_GIT),y)
  64. ifeq ($(call qstrip,$(BR2_TARGET_AT91BOOTSTRAP3_CUSTOM_REPO_URL)),)
  65. $(error No custom at91bootstrap3 repository URL specified. Check your BR2_TARGET_AT91BOOTSTRAP3_CUSTOM_REPO_URL setting)
  66. endif
  67. ifeq ($(call qstrip,$(BR2_TARGET_AT91BOOTSTRAP3_CUSTOM_REPO_VERSION)),)
  68. $(error No custom at91bootstrap3 repository version specified. Check your BR2_TARGET_AT91BOOTSTRAP3_CUSTOM_REPO_VERSION setting)
  69. endif
  70. endif
  71. ifeq ($(BR2_TARGET_AT91BOOTSTRAP3_CUSTOM_TARBALL),y)
  72. ifeq ($(call qstrip,$(BR2_TARGET_AT91BOOTSTRAP3_CUSTOM_TARBALL_LOCATION)),)
  73. $(error No custom AT91Bootstrap3 tarball specified. Check your BR2_TARGET_AT91BOOTSTRAP3_CUSTOM_TARBALL_LOCATION setting)
  74. endif # qstrip BR2_TARGET_AT91BOOTSTRAP3_CUSTOM_TARBALL_LOCATION
  75. endif # BR2_TARGET_AT91BOOTSTRAP3_CUSTOM_TARBALL
  76. endif # BR_BUILDING
  77. $(eval $(kconfig-package))