1
0

Makefile 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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-libre
  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/v1.2.1/ \
  16. ftp://ftp.denx.de/pub/u-boot
  17. PKG_MD5SUM:=526e01c8564ab8d1fd2c0e787a014b17
  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. )