1
0

Makefile 1.9 KB

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