Makefile 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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_RELEASE:=1
  11. PKG_SOURCE_PROTO:=git
  12. PKG_SOURCE_URL:=https://github.com/ashcharles/verdex-uboot.git
  13. PKG_SOURCE_DATE:=2011-08-25
  14. PKG_SOURCE_VERSION:=ca6bf3ef6ac5f5132a359b43dfa31e07076b74b7
  15. PKG_MIRROR_HASH:=7c92525b6c7bc0b6f065a9bfdf64d58a61583709cb44acb62a157ad3efc7c491
  16. PKG_LICENSE:=GPL-2.0 GPL-2.0+
  17. PKG_LICENSE_FILES:=Licenses/README
  18. include $(INCLUDE_DIR)/package.mk
  19. define uboot/Default
  20. TITLE:=
  21. CONFIG:=
  22. IMAGE:=
  23. endef
  24. define uboot/gumstix
  25. TITLE:=U-Boot for the Gumstix Verdex
  26. endef
  27. UBOOTS:=gumstix
  28. define Package/uboot/template
  29. define Package/uboot-pxa-$(1)
  30. SECTION:=boot
  31. CATEGORY:=Boot Loaders
  32. DEPENDS:=@TARGET_pxa
  33. TITLE:=$(2)
  34. URL:=http://www.denx.de/wiki/U-Boot
  35. VARIANT:=$(1)
  36. MAINTAINER:=Florian Fainelli <florian@openwrt.org>
  37. endef
  38. endef
  39. define BuildUBootPackage
  40. $(eval $(uboot/Default))
  41. $(eval $(uboot/$(1)))
  42. $(call Package/uboot/template,$(1),$(TITLE))
  43. endef
  44. ifdef BUILD_VARIANT
  45. $(eval $(call uboot/$(BUILD_VARIANT)))
  46. UBOOT_CONFIG:=$(if $(CONFIG),$(CONFIG),$(BUILD_VARIANT))
  47. UBOOT_IMAGE:=$(if $(IMAGE),$(IMAGE),openwrt-$(BOARD)-$(BUILD_VARIANT)-u-boot.bin)
  48. endif
  49. define Build/Configure
  50. $(MAKE) -C $(PKG_BUILD_DIR) \
  51. $(UBOOT_CONFIG)_config
  52. endef
  53. define Build/Compile
  54. $(MAKE) -C $(PKG_BUILD_DIR) \
  55. u-boot.bin \
  56. CROSS_COMPILE=$(TARGET_CROSS)
  57. endef
  58. define Package/uboot/install/default
  59. $(INSTALL_DIR) $(BIN_DIR)
  60. $(CP) $(PKG_BUILD_DIR)/u-boot.bin \
  61. $(BIN_DIR)/openwrt-$(BOARD)-$(1)-u-boot.bin
  62. endef
  63. define Package/uboot/install/template
  64. define Package/uboot-pxa-$(1)/install
  65. $(call Package/uboot/install/default,$(2))
  66. endef
  67. endef
  68. $(foreach u,$(UBOOTS), \
  69. $(eval $(call Package/uboot/install/template,$(u),$(u))) \
  70. )
  71. $(foreach u,$(UBOOTS), \
  72. $(eval $(call BuildUBootPackage,$(u))) \
  73. $(eval $(call BuildPackage,uboot-pxa-$(u))) \
  74. )