Makefile 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. #
  2. # Copyright (C) 2010-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.10
  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:=3ddcaee2f05b7c464778112ec83664b5
  17. PKG_TARGETS:=bin
  18. PKG_LICENSE:=GPL-2.0 GPL-2.0+
  19. PKG_LICENSE_FILES:=Licenses/README
  20. PKG_BUILD_PARALLEL:=1
  21. include $(INCLUDE_DIR)/package.mk
  22. define uboot/Default
  23. TITLE:=
  24. endef
  25. define uboot/dockstar
  26. TITLE:=U-Boot for Seagate DockStar
  27. endef
  28. define uboot/dockstar_second_stage
  29. TITLE:=second stage U-Boot for Seagate DockStar
  30. endef
  31. define uboot/goflexhome
  32. TITLE:=U-Boot for the Seagate GoFlexHome/GoFlexNet
  33. endef
  34. define uboot/ib62x0
  35. TITLE:=U-Boot for RaidSonic ICY BOX NAS6210 and NAS6220
  36. endef
  37. define uboot/ib62x0_second_stage
  38. TITLE:=second stage U-Boot for RaidSonic ICY BOX NAS6210 and NAS6220
  39. endef
  40. define uboot/iconnect
  41. TITLE:=U-Boot for Iomega iConnect Wireless
  42. endef
  43. define uboot/iconnect_second_stage
  44. TITLE:=second stage U-Boot for Iomega iConnect Wireless
  45. endef
  46. define uboot/pogo_e02
  47. TITLE:=U-Boot for Cloud Engines Pogoplug E02
  48. endef
  49. define uboot/pogo_e02_second_stage
  50. TITLE:=second stage U-Boot for Cloud Engines Pogoplug E02
  51. endef
  52. define uboot/sheevaplug
  53. TITLE:=U-Boot for SheevaPlug
  54. endef
  55. UBOOTS:= \
  56. dockstar dockstar_second_stage \
  57. goflexhome \
  58. ib62x0 ib62x0_second_stage \
  59. iconnect iconnect_second_stage \
  60. pogo_e02 pogo_e02_second_stage \
  61. sheevaplug
  62. define Package/uboot/template
  63. define Package/uboot-kirkwood-$(1)
  64. SECTION:=boot
  65. CATEGORY:=Boot Loaders
  66. DEPENDS:=@TARGET_kirkwood
  67. TITLE:=$(2)
  68. URL:=http://www.denx.de/wiki/U-Boot
  69. VARIANT:=$(1)
  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. define Build/Configure
  78. $(if $(findstring _second_stage,$(BUILD_VARIANT)),
  79. $(CP) \
  80. $(PKG_BUILD_DIR)/configs/$(subst _second_stage,,$(BUILD_VARIANT))_defconfig \
  81. $(PKG_BUILD_DIR)/configs/$(BUILD_VARIANT)_defconfig
  82. echo CONFIG_SECOND_STAGE=y >> $(PKG_BUILD_DIR)/configs/$(BUILD_VARIANT)_defconfig
  83. )
  84. +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
  85. $(BUILD_VARIANT)_config V=1
  86. endef
  87. define Build/Compile
  88. +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
  89. u-boot.kwb \
  90. CROSS_COMPILE=$(TARGET_CROSS)
  91. mkimage -A $(ARCH) -O linux -T kernel -C none \
  92. -a 0x600000 -e 0x600000 \
  93. -n 'OpenWrt Das U-Boot uImage' \
  94. -d $(PKG_BUILD_DIR)/u-boot.bin $(PKG_BUILD_DIR)/u-boot.img
  95. endef
  96. define Package/uboot/install/default
  97. $(INSTALL_DIR) $(BIN_DIR)/uboot-$(BOARD)-$(1)
  98. $(CP) $(PKG_BUILD_DIR)/u-boot.bin \
  99. $(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-u-boot.bin
  100. $(CP) $(PKG_BUILD_DIR)/u-boot.kwb \
  101. $(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-u-boot.kwb
  102. $(CP) $(PKG_BUILD_DIR)/u-boot.img \
  103. $(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-u-boot.img
  104. $(INSTALL_DIR) $(BIN_DIR)/u-boot-kwboot/
  105. $(CP) $(PKG_BUILD_DIR)/tools/kwboot \
  106. $(BIN_DIR)/u-boot-kwboot/
  107. endef
  108. define Package/uboot/install/template
  109. define Package/uboot-kirkwood-$(1)/install
  110. $(call Package/uboot/install/default,$(2))
  111. endef
  112. endef
  113. $(foreach u,$(UBOOTS), \
  114. $(eval $(call Package/uboot/install/template,$(u),$(u))) \
  115. )
  116. $(foreach u,$(UBOOTS), \
  117. $(eval $(call BuildUBootPackage,$(u))) \
  118. $(eval $(call BuildPackage,uboot-kirkwood-$(u))) \
  119. )