Makefile 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. #
  2. # Copyright (C) 2012 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:=2014.10
  11. PKG_RELEASE:=1
  12. PKG_BUILD_DIR:=$(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:=3ddcaee2f05b7c464778112ec83664b5
  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/ox820
  27. TITLE:=U-Boot for the Oxford/PLX NAS7820
  28. endef
  29. UBOOTS:=ox820
  30. define Package/uboot/template
  31. define Package/uboot-oxnas-$(1)
  32. SECTION:=boot
  33. CATEGORY:=Boot Loaders
  34. DEPENDS:=@TARGET_oxnas
  35. TITLE:=$(2)
  36. URL:=http://www.denx.de/wiki/U-Boot
  37. VARIANT:=$(1)
  38. MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
  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. u-boot.bin \
  63. CROSS_COMPILE=$(TARGET_CROSS)
  64. endef
  65. define Package/uboot/install/default
  66. $(INSTALL_DIR) $(BIN_DIR)
  67. $(CP) $(PKG_BUILD_DIR)/u-boot.bin \
  68. $(BIN_DIR)/openwrt-$(BOARD)-$(1)-u-boot.bin
  69. $(CP) $(PKG_BUILD_DIR)/u-boot.bin \
  70. $(KERNEL_BUILD_DIR)/u-boot.bin
  71. endef
  72. define Package/uboot/install/template
  73. define Package/uboot-oxnas-$(1)/install
  74. $(call Package/uboot/install/default,$(2))
  75. endef
  76. endef
  77. $(foreach u,$(UBOOTS), \
  78. $(eval $(call Package/uboot/install/template,$(u),$(u))) \
  79. )
  80. $(foreach u,$(UBOOTS), \
  81. $(eval $(call BuildUBootPackage,$(u))) \
  82. $(eval $(call BuildPackage,uboot-oxnas-$(u))) \
  83. )