Makefile 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  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/nitrogen6dl
  25. TITLE:=U-Boot for Nitrogen6x i.MX6Dual-Lite 1GB board
  26. endef
  27. define uboot/nitrogen6dl2g
  28. TITLE:=U-Boot for Nitrogen6x i.MX6Dual-Lite 2GB board
  29. endef
  30. define uboot/nitrogen6q
  31. TITLE:=U-Boot for Nitrogen6x/SABRE Lite (MX6Q/1GB)
  32. endef
  33. define uboot/nitrogen6q2g
  34. TITLE:=U-Boot for Nitrogen6x i.MX6Quad 2GB board
  35. endef
  36. define uboot/nitrogen6s
  37. TITLE:=U-Boot for Nitrogen6x i.MX6Solo 512MB board
  38. endef
  39. define uboot/nitrogen6s1g
  40. TITLE:=U-Boot for Nitrogen6x i.MX6Solo 1GB board
  41. endef
  42. define uboot/wandboard_dl
  43. TITLE:=U-Boot for the Wandboard Dual Lite
  44. endef
  45. define uboot/wandboard_quad
  46. TITLE:=U-Boot for the Wandboard Quad
  47. endef
  48. define uboot/wandboard_solo
  49. TITLE:=U-Boot for the Wandboard Solo
  50. endef
  51. UBOOTS := \
  52. nitrogen6dl \
  53. nitrogen6dl2g \
  54. nitrogen6q \
  55. nitrogen6q2g \
  56. nitrogen6s \
  57. nitrogen6s1g \
  58. wandboard_dl \
  59. wandboard_quad \
  60. wandboard_solo
  61. define Package/uboot/template
  62. define Package/uboot-imx6-$(1)
  63. SECTION:=boot
  64. CATEGORY:=Boot Loaders
  65. DEPENDS:=@TARGET_imx6
  66. TITLE:=$(2)
  67. URL:=http://www.denx.de/wiki/U-Boot
  68. VARIANT:=$(1)
  69. MAINTAINER:=Luka Perkov <luka@openwrt.org>
  70. endef
  71. endef
  72. define BuildUBootPackage
  73. $(eval $(uboot/Default))
  74. $(eval $(uboot/$(1)))
  75. $(call Package/uboot/template,$(1),$(TITLE))
  76. endef
  77. ifdef BUILD_VARIANT
  78. $(eval $(call uboot/$(BUILD_VARIANT)))
  79. UBOOT_CONFIG:=$(if $(CONFIG),$(CONFIG),$(BUILD_VARIANT))
  80. UBOOT_IMAGE:=$(if $(IMAGE),$(IMAGE),openwrt-$(BOARD)-$(BUILD_VARIANT)-u-boot.bin)
  81. endif
  82. define Build/Configure
  83. +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
  84. $(UBOOT_CONFIG)_config
  85. endef
  86. define Build/Compile
  87. +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
  88. CROSS_COMPILE=$(TARGET_CROSS)
  89. endef
  90. define Package/uboot/install/default
  91. $(INSTALL_DIR) $(BIN_DIR)/uboot-$(BOARD)-$(1)
  92. $(CP) \
  93. $(PKG_BUILD_DIR)/u-boot.imx \
  94. $(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-u-boot.imx
  95. endef
  96. define Package/uboot/install/template
  97. define Package/uboot-imx6-$(1)/install
  98. $(call Package/uboot/install/default,$(2))
  99. endef
  100. endef
  101. $(foreach u,$(UBOOTS), \
  102. $(eval $(call Package/uboot/install/template,$(u),$(u))) \
  103. )
  104. $(foreach u,$(UBOOTS), \
  105. $(eval $(call BuildUBootPackage,$(u))) \
  106. $(eval $(call BuildPackage,uboot-imx6-$(u))) \
  107. )