at91bootstrap3.mk 3.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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. AT91BOOTSTRAP3_LICENSE_FILES = main.c
  21. AT91BOOTSTRAP3_INSTALL_IMAGES = YES
  22. AT91BOOTSTRAP3_INSTALL_TARGET = NO
  23. AT91BOOTSTRAP3_CUSTOM_PATCH_DIR = \
  24. $(call qstrip,$(BR2_TARGET_AT91BOOTSTRAP3_CUSTOM_PATCH_DIR))
  25. AT91BOOTSTRAP3_MAKE_OPTS = CROSS_COMPILE=$(TARGET_CROSS) DESTDIR=$(BINARIES_DIR)
  26. ifneq ($(AT91BOOTSTRAP3_CUSTOM_PATCH_DIR),)
  27. define AT91BOOTSTRAP3_APPLY_CUSTOM_PATCHES
  28. $(APPLY_PATCHES) $(@D) $(AT91BOOTSTRAP3_CUSTOM_PATCH_DIR) \*.patch
  29. endef
  30. AT91BOOTSTRAP3_POST_PATCH_HOOKS += AT91BOOTSTRAP3_APPLY_CUSTOM_PATCHES
  31. endif
  32. define AT91BOOTSTRAP3_BUILD_CMDS
  33. $(MAKE) $(AT91BOOTSTRAP3_MAKE_OPTS) -C $(@D)
  34. endef
  35. define AT91BOOTSTRAP3_INSTALL_IMAGES_CMDS
  36. cp $(@D)/binaries/*.bin $(BINARIES_DIR)
  37. endef
  38. ifeq ($(BR2_TARGET_AT91BOOTSTRAP3_USE_DEFCONFIG),y)
  39. AT91BOOTSTRAP3_KCONFIG_DEFCONFIG = $(call qstrip,$(BR2_TARGET_AT91BOOTSTRAP3_DEFCONFIG))_defconfig
  40. else ifeq ($(BR2_TARGET_AT91BOOTSTRAP3_USE_CUSTOM_CONFIG),y)
  41. AT91BOOTSTRAP3_KCONFIG_FILE = $(call qstrip,$(BR2_TARGET_AT91BOOTSTRAP3_CUSTOM_CONFIG_FILE))
  42. endif
  43. AT91BOOTSTRAP3_KCONFIG_EDITORS = menuconfig xconfig gconfig
  44. AT91BOOTSTRAP3_KCONFIG_OPTS = $(AT91BOOTSTRAP3_MAKE_OPTS)
  45. # Checks to give errors that the user can understand
  46. # Must be before we call to kconfig-package
  47. ifeq ($(BR_BUILDING),y)
  48. ifeq ($(BR2_TARGET_AT91BOOTSTRAP3_USE_DEFCONFIG),y)
  49. # We must use the user-supplied kconfig value, because
  50. # AT91BOOTSTRAP3_KCONFIG_DEFCONFIG will at least contain
  51. # the trailing _defconfig
  52. ifeq ($(call qstrip,$(BR2_TARGET_AT91BOOTSTRAP3_DEFCONFIG)),)
  53. $(error No at91bootstrap3 defconfig name specified, check your BR2_TARGET_AT91BOOTSTRAP3_DEFCONFIG setting)
  54. endif
  55. endif
  56. ifeq ($(BR2_TARGET_AT91BOOTSTRAP3_USE_CUSTOM_CONFIG),y)
  57. ifeq ($(AT91BOOTSTRAP3_KCONFIG_FILE),)
  58. $(error No at91bootstrap3 configuration file specified, check your BR2_TARGET_AT91BOOTSTRAP3_CUSTOM_CONFIG_FILE setting)
  59. endif
  60. endif
  61. ifeq ($(BR2_TARGET_AT91BOOTSTRAP3_CUSTOM_GIT),y)
  62. ifeq ($(call qstrip,$(BR2_TARGET_AT91BOOTSTRAP3_CUSTOM_REPO_URL)),)
  63. $(error No custom at91bootstrap3 repository URL specified. Check your BR2_TARGET_AT91BOOTSTRAP3_CUSTOM_REPO_URL setting)
  64. endif
  65. ifeq ($(call qstrip,$(BR2_TARGET_AT91BOOTSTRAP3_CUSTOM_REPO_VERSION)),)
  66. $(error No custom at91bootstrap3 repository version specified. Check your BR2_TARGET_AT91BOOTSTRAP3_CUSTOM_REPO_VERSION setting)
  67. endif
  68. endif
  69. ifeq ($(BR2_TARGET_AT91BOOTSTRAP3_CUSTOM_TARBALL),y)
  70. ifeq ($(call qstrip,$(BR2_TARGET_AT91BOOTSTRAP3_CUSTOM_TARBALL_LOCATION)),)
  71. $(error No custom AT91Bootstrap3 tarball specified. Check your BR2_TARGET_AT91BOOTSTRAP3_CUSTOM_TARBALL_LOCATION setting)
  72. endif # qstrip BR2_TARGET_AT91BOOTSTRAP3_CUSTOM_TARBALL_LOCATION
  73. endif # BR2_TARGET_AT91BOOTSTRAP3_CUSTOM_TARBALL
  74. endif # BR_BUILDING
  75. $(eval $(kconfig-package))