2
0

Makefile 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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:=2010.03
  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_HASH:=902d1b2c15787df55186fae4033685fb0c5a5a12755a08383e97c4a3e255925b
  15. PKG_SOURCE_URL:= \
  16. http://mirror2.openwrt.org/sources \
  17. ftp://ftp.denx.de/pub/u-boot
  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/nbg460n_550n_550nh
  28. TITLE:=U-boot for the NBG460N/550N/550NH routers
  29. DEFAULT:=y if (TARGET_ar71xx_generic_DEVICE_NBG_460N_550N_550NH || TARGET_DEVICE_ar71xx_generic_DEVICE_NBG_460N_550N_550NH || TARGET_ar71xx_generic_Default)
  30. endef
  31. UBOOTS:=nbg460n_550n_550nh
  32. define Package/uboot/template
  33. define Package/uboot-ar71xx-$(1)
  34. SECTION:=boot
  35. CATEGORY:=Boot Loaders
  36. TITLE:=$(2)
  37. DEPENDS:=@TARGET_ar71xx_generic
  38. URL:=http://www.denx.de/wiki/U-Boot
  39. VARIANT:=$(1)
  40. endef
  41. endef
  42. define BuildUbootPackage
  43. $(eval $(uboot/Default))
  44. $(eval $(uboot/$(1)))
  45. $(call Package/uboot/template,$(1),$(TITLE))
  46. endef
  47. ifdef BUILD_VARIANT
  48. $(eval $(call uboot/$(BUILD_VARIANT)))
  49. UBOOT_CONFIG:=$(if $(CONFIG),$(CONFIG),$(BUILD_VARIANT))
  50. UBOOT_IMAGE:=$(if $(IMAGE),$(IMAGE),openwrt-$(BOARD)-$(BUILD_VARIANT)-u-boot.bin)
  51. endif
  52. define Build/Prepare
  53. $(call Build/Prepare/Default)
  54. $(CP) ./files/* $(PKG_BUILD_DIR)
  55. find $(PKG_BUILD_DIR) -name .svn | $(XARGS) rm -rf
  56. endef
  57. define Build/Configure
  58. $(MAKE) -C $(PKG_BUILD_DIR) \
  59. $(UBOOT_CONFIG)_config
  60. endef
  61. define Build/Compile
  62. $(MAKE) -C $(PKG_BUILD_DIR) \
  63. CROSS_COMPILE=$(TARGET_CROSS)
  64. endef
  65. define Package/uboot/install/template
  66. define Package/uboot-ar71xx-$(1)/install
  67. $(INSTALL_DIR) $$(1)
  68. $(CP) $(PKG_BUILD_DIR)/u-boot.bin $(BIN_DIR)/$(2)
  69. endef
  70. endef
  71. $(foreach u,$(UBOOTS), \
  72. $(eval $(call Package/uboot/install/template,$(u),openwrt-$(BOARD)-$(SUBTARGET)-$(u)-u-boot.bin)) \
  73. )
  74. $(foreach u,$(UBOOTS), \
  75. $(eval $(call BuildUbootPackage,$(u))) \
  76. $(eval $(call BuildPackage,uboot-ar71xx-$(u))) \
  77. )