Makefile 2.2 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_SOURCE_URL:= \
  15. http://mirror2.openwrt.org/sources \
  16. ftp://ftp.denx.de/pub/u-boot
  17. PKG_MD5SUM:=
  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. endef
  30. UBOOTS:=nbg460n_550n_550nh
  31. define Package/uboot/template
  32. define Package/uboot-ar71xx-$(1)
  33. SECTION:=boot
  34. CATEGORY:=Boot Loaders
  35. TITLE:=$(2)
  36. DEPENDS:=@TARGET_ar71xx_generic
  37. URL:=http://www.denx.de/wiki/U-Boot
  38. DEFAULT:=y if (TARGET_ar71xx_generic_NBG_460N_550N_550NH || TARGET_ar71xx_generic_Default || CONFIG_TARGET_ar71xx_generic_Minimal)
  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. )