Makefile 2.0 KB

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