Makefile 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. #
  2. # Copyright (C) 2012-2013 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. PKG_NAME:=u-boot
  9. PKG_VERSION:=2015.10
  10. PKG_RELEASE:=1
  11. PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
  12. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
  13. PKG_SOURCE_URL:= \
  14. http://mirror2.openwrt.org/sources \
  15. ftp://ftp.denx.de/pub/u-boot
  16. PKG_MD5SUM:=7c203b0fc3390a122d8e8b75f147eac5
  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/omap4_panda
  26. TITLE:=U-Boot for the Pandaboard
  27. endef
  28. define uboot/am335x_evm
  29. TITLE:=U-Boot for the AM335x EVM
  30. endef
  31. define uboot/omap3_overo
  32. TITLE:=U-Boot for the Gumstix Overo
  33. endef
  34. define uboot/omap3_beagle
  35. TITLE:=U-Boot for the BeagleBoard
  36. endef
  37. UBOOTS:=omap4_panda am335x_evm omap3_overo omap3_beagle
  38. define Package/uboot/template
  39. define Package/uboot-omap-$(1)
  40. SECTION:=boot
  41. CATEGORY:=Boot Loaders
  42. DEPENDS:=@TARGET_omap
  43. TITLE:=$(2)
  44. URL:=http://www.denx.de/wiki/U-Boot
  45. VARIANT:=$(1)
  46. HIDDEN:=1
  47. endef
  48. endef
  49. define BuildUBootPackage
  50. $(eval $(uboot/Default))
  51. $(eval $(uboot/$(1)))
  52. $(call Package/uboot/template,$(1),$(TITLE))
  53. endef
  54. ifdef BUILD_VARIANT
  55. $(eval $(call uboot/$(BUILD_VARIANT)))
  56. UBOOT_CONFIG:=$(if $(CONFIG),$(CONFIG),$(BUILD_VARIANT))
  57. UBOOT_IMAGE:=$(if $(IMAGE),$(IMAGE),openwrt-$(BOARD)-$(BUILD_VARIANT)-u-boot.img)
  58. endif
  59. define Build/Configure
  60. $(MAKE) -C $(PKG_BUILD_DIR) \
  61. USE_PRIVATE_LIBGCC=yes $(UBOOT_CONFIG)_config
  62. endef
  63. define Build/Compile
  64. $(MAKE) -C $(PKG_BUILD_DIR) \
  65. CROSS_COMPILE=$(TARGET_CROSS)
  66. endef
  67. define Package/uboot/install/default
  68. $(INSTALL_DIR) $(BIN_DIR)/uboot-$(BOARD)-$(1)
  69. $(CP) $(PKG_BUILD_DIR)/u-boot.img $(BIN_DIR)/uboot-$(BOARD)-$(1)/u-boot.img
  70. $(CP) $(PKG_BUILD_DIR)/MLO $(BIN_DIR)/uboot-$(BOARD)-$(1)/MLO
  71. endef
  72. define Package/uboot/install/template
  73. define Package/uboot-omap-$(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-omap-$(u))) \
  83. )