Makefile 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. #
  2. # Copyright (C) 2013-2016 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:=2016.01
  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:=7d4f65fd43d4d706f5c5650e020d899d
  17. PKG_LICENSE:=GPL-2.0 GPL-2.0+
  18. PKG_LICENSE_FILES:=Licenses/README
  19. include $(INCLUDE_DIR)/package.mk
  20. define uboot/Default
  21. TITLE:=
  22. CONFIG:=
  23. IMAGE:=
  24. endef
  25. define uboot/mx23_olinuxino
  26. TITLE:=U-Boot 2016.01 for the Olinuxino i.MX233
  27. endef
  28. define uboot/duckbill
  29. TITLE:=U-Boot 2016.01 for the I2SE Duckbill
  30. endef
  31. UBOOTS := \
  32. mx23_olinuxino \
  33. duckbill
  34. define Package/uboot/template
  35. define Package/uboot-mxs-$(1)
  36. SECTION:=boot
  37. CATEGORY:=Boot Loaders
  38. DEPENDS:=@TARGET_mxs
  39. TITLE:=$(2)
  40. URL:=http://www.denx.de/wiki/U-Boot
  41. VARIANT:=$(1)
  42. MAINTAINER:=Zoltan HERPAI <wigyori@uid0.hu>
  43. endef
  44. endef
  45. define BuildUBootPackage
  46. $(eval $(uboot/Default))
  47. $(eval $(uboot/$(1)))
  48. $(call Package/uboot/template,$(1),$(TITLE))
  49. endef
  50. ifdef BUILD_VARIANT
  51. $(eval $(call uboot/$(BUILD_VARIANT)))
  52. UBOOT_CONFIG:=$(if $(CONFIG),$(CONFIG),$(BUILD_VARIANT))
  53. UBOOT_IMAGE:=$(if $(IMAGE),$(IMAGE),u-boot.sb)
  54. endif
  55. define Build/Configure
  56. $(MAKE) -C $(PKG_BUILD_DIR) \
  57. $(UBOOT_CONFIG)_config
  58. endef
  59. define Build/Compile
  60. $(MAKE) -C $(PKG_BUILD_DIR) \
  61. CROSS_COMPILE=$(TARGET_CROSS) $(UBOOT_IMAGE)
  62. endef
  63. define Package/uboot/install/default
  64. $(INSTALL_DIR) $(BIN_DIR)/uboot-$(BOARD)-$(1)
  65. $(CP) $(PKG_BUILD_DIR)/$(UBOOT_IMAGE) $(BIN_DIR)/uboot-$(BOARD)-$(1)/uboot-$(BOARD)-$(1).sb
  66. endef
  67. define Package/uboot/install/template
  68. define Package/uboot-mxs-$(1)/install
  69. $(call Package/uboot/install/default,$(2))
  70. endef
  71. endef
  72. $(foreach u,$(UBOOTS), \
  73. $(eval $(call Package/uboot/install/template,$(u),$(u))) \
  74. )
  75. $(foreach u,$(UBOOTS), \
  76. $(eval $(call BuildUBootPackage,$(u))) \
  77. $(eval $(call BuildPackage,uboot-mxs-$(u))) \
  78. )