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_HASH:=7bd134647ea27cc1fa08da66790e743d877a82751cf102584d241a2542f8232c
  15. PKG_SOURCE_URL:= \
  16. https://librecmc.org/librecmc/downloads/sources/v1.4 \
  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/nbg460n_550n_550nh
  27. TITLE:=U-boot for the NBG460N/550N/550NH routers
  28. DEFAULT:=y if (TARGET_ar71xx_generic_DEVICE_NBG_460N_550N_550NH || TARGET_DEVICE_ar71xx_generic_DEVICE_NBG_460N_550N_550NH || TARGET_ar71xx_generic_Default)
  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. VARIANT:=$(1)
  39. endef
  40. endef
  41. define BuildUbootPackage
  42. $(eval $(uboot/Default))
  43. $(eval $(uboot/$(1)))
  44. $(call Package/uboot/template,$(1),$(TITLE))
  45. endef
  46. ifdef BUILD_VARIANT
  47. $(eval $(call uboot/$(BUILD_VARIANT)))
  48. UBOOT_CONFIG:=$(if $(CONFIG),$(CONFIG),$(BUILD_VARIANT))
  49. UBOOT_IMAGE:=$(if $(IMAGE),$(IMAGE),openwrt-$(BOARD)-$(BUILD_VARIANT)-u-boot.bin)
  50. endif
  51. define Build/Prepare
  52. $(call Build/Prepare/Default)
  53. $(CP) ./files/* $(PKG_BUILD_DIR)
  54. find $(PKG_BUILD_DIR) -name .svn | $(XARGS) rm -rf
  55. endef
  56. define Build/Configure
  57. $(MAKE) -C $(PKG_BUILD_DIR) \
  58. $(UBOOT_CONFIG)_config
  59. endef
  60. define Build/Compile
  61. $(MAKE) -C $(PKG_BUILD_DIR) \
  62. CROSS_COMPILE=$(TARGET_CROSS)
  63. endef
  64. define Package/uboot/install/template
  65. define Package/uboot-ar71xx-$(1)/install
  66. $(INSTALL_DIR) $$(1)
  67. $(CP) $(PKG_BUILD_DIR)/u-boot.bin $(BIN_DIR)/$(2)
  68. endef
  69. endef
  70. $(foreach u,$(UBOOTS), \
  71. $(eval $(call Package/uboot/install/template,$(u),openwrt-$(BOARD)-$(SUBTARGET)-$(u)-u-boot.bin)) \
  72. )
  73. $(foreach u,$(UBOOTS), \
  74. $(eval $(call BuildUbootPackage,$(u))) \
  75. $(eval $(call BuildPackage,uboot-ar71xx-$(u))) \
  76. )