Makefile 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  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:=2009.11
  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:=ftp://ftp.denx.de/pub/u-boot
  15. PKG_MD5SUM:=
  16. PKG_TARGETS:=bin
  17. include $(INCLUDE_DIR)/package.mk
  18. define uboot/Default
  19. TITLE:=
  20. CONFIG:=
  21. IMAGE:=
  22. endef
  23. define uboot/qi_lb60
  24. TITLE:=U-boot for the qi_lb60 board
  25. endef
  26. define uboot/avt2
  27. TITLE:=U-boot for the avt2 board
  28. endef
  29. define uboot/sakc
  30. TITLE:=U-boot for the sakc board
  31. endef
  32. define uboot/n516
  33. TITLE:=U-boot for the N516 e-book reader
  34. CONFIG:=n516_nand
  35. endef
  36. UBOOTS:=qi_lb60 n516 avt2 sakc
  37. define Package/uboot/template
  38. define Package/uboot-xburst-$(1)
  39. SECTION:=boot
  40. CATEGORY:=Boot Loaders
  41. DEPENDS:=@TARGET_xburst
  42. TITLE:=$(2)
  43. URL:=http://www.denx.de/wiki/U-Boot
  44. VARIANT:=$(1)
  45. endef
  46. endef
  47. define BuildUbootPackage
  48. $(eval $(uboot/Default))
  49. $(eval $(uboot/$(1)))
  50. $(call Package/uboot/template,$(1),$(TITLE))
  51. endef
  52. ifdef BUILD_VARIANT
  53. $(eval $(call uboot/$(BUILD_VARIANT)))
  54. UBOOT_CONFIG:=$(if $(CONFIG),$(CONFIG),$(BUILD_VARIANT))
  55. UBOOT_IMAGE:=$(if $(IMAGE),$(IMAGE),openwrt-$(BOARD)-$(BUILD_VARIANT)-u-boot.bin)
  56. endif
  57. define Build/Prepare
  58. $(call Build/Prepare/Default)
  59. $(CP) ./files/* $(PKG_BUILD_DIR)
  60. find $(PKG_BUILD_DIR) -name .svn | $(XARGS) rm -rf
  61. endef
  62. define Build/Configure
  63. $(MAKE) -C $(PKG_BUILD_DIR) \
  64. $(UBOOT_CONFIG)_config
  65. endef
  66. define Build/Compile
  67. $(MAKE) -C $(PKG_BUILD_DIR) \
  68. CROSS_COMPILE=$(TARGET_CROSS)
  69. endef
  70. define Package/uboot/install/template
  71. define Package/uboot-xburst-$(1)/install
  72. $(INSTALL_DIR) $$(1)
  73. $(CP) $(PKG_BUILD_DIR)/u-boot-nand.bin $(BIN_DIR)/$(2)
  74. endef
  75. endef
  76. $(foreach u,$(UBOOTS), \
  77. $(eval $(call Package/uboot/install/template,$(u),openwrt-$(BOARD)-$(u)-u-boot.bin)) \
  78. )
  79. $(foreach u,$(UBOOTS), \
  80. $(eval $(call BuildUbootPackage,$(u))) \
  81. $(eval $(call BuildPackage,uboot-xburst-$(u))) \
  82. )