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-librecmc
  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. https://librecmc.org/librecmc/downloads/sources/archive/
  15. PKG_HASH:=35aa6ad931c9474578ae01c7b565753d9d28059bc4d5444eea923840342f1e86
  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/omap4_panda
  25. TITLE:=U-Boot for the Pandaboard
  26. endef
  27. define uboot/am335x_evm
  28. TITLE:=U-Boot for the AM335x EVM
  29. endef
  30. define uboot/omap3_overo
  31. TITLE:=U-Boot for the Gumstix Overo
  32. endef
  33. define uboot/omap3_beagle
  34. TITLE:=U-Boot for the BeagleBoard
  35. endef
  36. UBOOTS:=omap4_panda am335x_evm omap3_overo omap3_beagle
  37. define Package/uboot/template
  38. define Package/uboot-omap-$(1)
  39. SECTION:=boot
  40. CATEGORY:=Boot Loaders
  41. DEPENDS:=@TARGET_omap
  42. TITLE:=$(2)
  43. URL:=http://www.denx.de/wiki/U-Boot
  44. VARIANT:=$(1)
  45. HIDDEN:=1
  46. endef
  47. endef
  48. define BuildUBootPackage
  49. $(eval $(uboot/Default))
  50. $(eval $(uboot/$(1)))
  51. $(call Package/uboot/template,$(1),$(TITLE))
  52. endef
  53. ifdef BUILD_VARIANT
  54. $(eval $(call uboot/$(BUILD_VARIANT)))
  55. UBOOT_CONFIG:=$(if $(CONFIG),$(CONFIG),$(BUILD_VARIANT))
  56. UBOOT_IMAGE:=$(if $(IMAGE),$(IMAGE),openwrt-$(BOARD)-$(BUILD_VARIANT)-u-boot.img)
  57. endif
  58. define Build/Configure
  59. $(MAKE) -C $(PKG_BUILD_DIR) \
  60. USE_PRIVATE_LIBGCC=yes $(UBOOT_CONFIG)_config
  61. endef
  62. define Build/Compile
  63. $(MAKE) -C $(PKG_BUILD_DIR) \
  64. CROSS_COMPILE=$(TARGET_CROSS)
  65. endef
  66. define Package/uboot/install/default
  67. $(INSTALL_DIR) $(BIN_DIR)/uboot-$(BOARD)-$(1)
  68. $(CP) $(PKG_BUILD_DIR)/u-boot.img $(BIN_DIR)/uboot-$(BOARD)-$(1)/u-boot.img
  69. $(CP) $(PKG_BUILD_DIR)/MLO $(BIN_DIR)/uboot-$(BOARD)-$(1)/MLO
  70. endef
  71. define Package/uboot/install/template
  72. define Package/uboot-omap-$(1)/install
  73. $(call Package/uboot/install/default,$(2))
  74. endef
  75. endef
  76. $(foreach u,$(UBOOTS), \
  77. $(eval $(call Package/uboot/install/template,$(u),$(u))) \
  78. )
  79. $(foreach u,$(UBOOTS), \
  80. $(eval $(call BuildUBootPackage,$(u))) \
  81. $(eval $(call BuildPackage,uboot-omap-$(u))) \
  82. )