Makefile 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. #
  2. # Copyright (C) 2013-2014 OpenWrt.org
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. #
  7. include $(TOPDIR)/rules.mk
  8. PKG_NAME:=u-boot
  9. PKG_VERSION:=2014.04
  10. PKG_RELEASE:=1
  11. PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
  12. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
  13. PKG_SOURCE_URL:= \
  14. http://mirror2.openwrt.org/sources \
  15. ftp://ftp.denx.de/pub/u-boot
  16. PKG_MD5SUM:=6d2116d1385a66e9a59742caa9d62a54
  17. PKG_BUILD_PARALLEL:=1
  18. include $(INCLUDE_DIR)/package.mk
  19. define uboot/Default
  20. TITLE:=
  21. CONFIG:=
  22. IMAGE:=
  23. endef
  24. define uboot/mx6qsabresd
  25. TITLE:=U-Boot for SABRE i.MX6Quad board
  26. endef
  27. define uboot/nitrogen6dl
  28. TITLE:=U-Boot for Nitrogen6x i.MX6Dual-Lite 1GB board
  29. endef
  30. define uboot/nitrogen6dl2g
  31. TITLE:=U-Boot for Nitrogen6x i.MX6Dual-Lite 2GB board
  32. endef
  33. define uboot/nitrogen6q
  34. TITLE:=U-Boot for Nitrogen6x/SABRE Lite (MX6Q/1GB)
  35. endef
  36. define uboot/nitrogen6q2g
  37. TITLE:=U-Boot for Nitrogen6x i.MX6Quad 2GB board
  38. endef
  39. define uboot/nitrogen6s
  40. TITLE:=U-Boot for Nitrogen6x i.MX6Solo 512MB board
  41. endef
  42. define uboot/nitrogen6s1g
  43. TITLE:=U-Boot for Nitrogen6x i.MX6Solo 1GB board
  44. endef
  45. define uboot/wandboard_dl
  46. TITLE:=U-Boot for the Wandboard Dual Lite
  47. endef
  48. define uboot/wandboard_quad
  49. TITLE:=U-Boot for the Wandboard Quad
  50. endef
  51. define uboot/wandboard_solo
  52. TITLE:=U-Boot for the Wandboard Solo
  53. endef
  54. UBOOTS := \
  55. mx6qsabresd \
  56. nitrogen6dl \
  57. nitrogen6dl2g \
  58. nitrogen6q \
  59. nitrogen6q2g \
  60. nitrogen6s \
  61. nitrogen6s1g \
  62. wandboard_dl \
  63. wandboard_quad \
  64. wandboard_solo
  65. define Package/uboot/template
  66. define Package/uboot-imx6-$(1)
  67. SECTION:=boot
  68. CATEGORY:=Boot Loaders
  69. DEPENDS:=@TARGET_imx6
  70. TITLE:=$(2)
  71. URL:=http://www.denx.de/wiki/U-Boot
  72. VARIANT:=$(1)
  73. MAINTAINER:=Luka Perkov <luka@openwrt.org>
  74. endef
  75. endef
  76. define BuildUBootPackage
  77. $(eval $(uboot/Default))
  78. $(eval $(uboot/$(1)))
  79. $(call Package/uboot/template,$(1),$(TITLE))
  80. endef
  81. ifdef BUILD_VARIANT
  82. $(eval $(call uboot/$(BUILD_VARIANT)))
  83. UBOOT_CONFIG:=$(if $(CONFIG),$(CONFIG),$(BUILD_VARIANT))
  84. UBOOT_IMAGE:=$(if $(IMAGE),$(IMAGE),openwrt-$(BOARD)-$(BUILD_VARIANT)-u-boot.bin)
  85. endif
  86. define Build/Configure
  87. +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
  88. $(UBOOT_CONFIG)_config
  89. endef
  90. define Build/Compile
  91. +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
  92. CROSS_COMPILE=$(TARGET_CROSS)
  93. endef
  94. define Package/uboot/install/default
  95. $(INSTALL_DIR) $(BIN_DIR)/uboot-$(BOARD)-$(1)
  96. $(CP) \
  97. $(PKG_BUILD_DIR)/u-boot.imx \
  98. $(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-u-boot.imx
  99. endef
  100. define Package/uboot/install/template
  101. define Package/uboot-imx6-$(1)/install
  102. $(call Package/uboot/install/default,$(2))
  103. endef
  104. endef
  105. $(foreach u,$(UBOOTS), \
  106. $(eval $(call Package/uboot/install/template,$(u),$(u))) \
  107. )
  108. $(foreach u,$(UBOOTS), \
  109. $(eval $(call BuildUBootPackage,$(u))) \
  110. $(eval $(call BuildPackage,uboot-imx6-$(u))) \
  111. )