Makefile 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. #
  2. # Copyright (C) 2010 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. include $(INCLUDE_DIR)/kernel.mk
  9. PKG_NAME:=u-boot
  10. PKG_VERSION:=2012.10-rc2
  11. PKG_RELEASE:=1
  12. PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
  13. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
  14. PKG_SOURCE_URL:= \
  15. http://mirror2.openwrt.org/sources \
  16. ftp://ftp.denx.de/pub/u-boot
  17. PKG_HASH:=6d094cafa7ecea8b671fbdcd21130b6a4f5744fc47dd263e101ed5d3629dffd4
  18. PKG_TARGETS:=bin
  19. PKG_LICENSE:=GPL-2.0 GPL-2.0+
  20. PKG_LICENSE_FILES:=Licenses/README
  21. include $(INCLUDE_DIR)/package.mk
  22. define uboot/Default
  23. TITLE:=
  24. CONFIG:=
  25. IMAGE:=
  26. endef
  27. define uboot/qi_lb60
  28. TITLE:=U-boot for the qi_lb60 board
  29. endef
  30. UBOOTS:=qi_lb60
  31. define Package/uboot/template
  32. define Package/uboot-xburst-$(1)
  33. SECTION:=boot
  34. CATEGORY:=Boot Loaders
  35. DEPENDS:=@TARGET_xburst
  36. TITLE:=$(2)
  37. URL:=http://www.denx.de/wiki/UBoot/WebHome
  38. VARIANT:=$(1)
  39. endef
  40. endef
  41. define BuildUbootPackage
  42. $(eval $(uboot/Default))
  43. $(eval $(uboot/$(1)))
  44. $(call Package/uboot/template,$(1),$(TITLE))
  45. endef
  46. ifdef BUILD_VARIANT
  47. $(eval $(call uboot/$(BUILD_VARIANT)))
  48. UBOOT_CONFIG:=$(if $(CONFIG),$(CONFIG),$(BUILD_VARIANT))
  49. UBOOT_IMAGE:=$(if $(IMAGE),$(IMAGE),librecmc-$(BOARD)-$(BUILD_VARIANT)-u-boot.bin)
  50. endif
  51. define Build/Configure
  52. $(MAKE) -C $(PKG_BUILD_DIR) \
  53. $(UBOOT_CONFIG)_config
  54. endef
  55. define Build/Compile
  56. $(MAKE) -C $(PKG_BUILD_DIR) \
  57. CROSS_COMPILE=$(TARGET_CROSS)
  58. endef
  59. define Package/uboot/install/template
  60. define Package/uboot-xburst-$(1)/install
  61. $(CP) $(PKG_BUILD_DIR)/u-boot-xburst.bin $(BIN_DIR)/$(2)
  62. rmdir $$(1)
  63. endef
  64. endef
  65. $(foreach u,$(UBOOTS), \
  66. $(eval $(call Package/uboot/install/template,$(u),librecmc-$(BOARD)-$(u)-u-boot.bin)) \
  67. )
  68. $(foreach u,$(UBOOTS), \
  69. $(eval $(call BuildUbootPackage,$(u))) \
  70. $(eval $(call BuildPackage,uboot-xburst-$(u))) \
  71. )