at91bootstrap3.mk 3.7 KB

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