Makefile 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. #
  2. # Copyright (C) 2015 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:=2016.05
  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:=3a8613d753dfa707c937991a35404510
  17. PKG_LICENSE:=GPL-2.0 GPL-2.0+
  18. PKG_LICENSE_FILES:=Licenses/README
  19. PKG_BUILD_PARALLEL:=1
  20. include $(INCLUDE_DIR)/package.mk
  21. define uboot/Default
  22. TITLE:=
  23. CONFIG:=
  24. IMAGE:=
  25. endef
  26. define uboot/socfpga_cyclone5_sockit
  27. TITLE := U-Boot for Terasic SoCkit board
  28. CONFIG := socfpga_sockit
  29. IMAGE := u-boot-with-spl.sfp
  30. endef
  31. UBOOTS := \
  32. socfpga_cyclone5_sockit
  33. define Package/uboot/template
  34. define Package/uboot-socfpga-$(1)
  35. SECTION:=boot
  36. CATEGORY:=Boot Loaders
  37. DEPENDS:=@TARGET_socfpga
  38. TITLE:=$(2)
  39. URL:=http://www.denx.de/wiki/U-Boot
  40. VARIANT:=$(1)
  41. MAINTAINER:=Marek Vasut <marex@denx.de>
  42. endef
  43. endef
  44. define BuildUBootPackage
  45. $(eval $(uboot/Default))
  46. $(eval $(uboot/$(1)))
  47. $(call Package/uboot/template,$(1),$(TITLE))
  48. endef
  49. ifdef BUILD_VARIANT
  50. $(eval $(call uboot/$(BUILD_VARIANT)))
  51. UBOOT_CONFIG:=$(if $(CONFIG),$(CONFIG),$(BUILD_VARIANT))
  52. UBOOT_IMAGE:=$(if $(IMAGE),$(IMAGE),openwrt-$(BOARD)-$(BUILD_VARIANT)-u-boot.bin)
  53. endif
  54. define Build/Configure
  55. +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) $(UBOOT_CONFIG)_config
  56. endef
  57. define Build/Compile
  58. +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) CROSS_COMPILE=$(TARGET_CROSS) $(IMAGE)
  59. endef
  60. define Package/uboot/install/default
  61. $(INSTALL_DIR) $(BIN_DIR)/uboot-$(BOARD)-$(1)
  62. $(CP) $(PKG_BUILD_DIR)/u-boot.bin \
  63. $(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-u-boot.bin
  64. $(CP) $(PKG_BUILD_DIR)/spl/u-boot-spl.bin \
  65. $(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-u-boot-spl.bin
  66. $(CP) $(PKG_BUILD_DIR)/u-boot-with-spl.sfp \
  67. $(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-u-boot-with-spl.sfp
  68. endef
  69. define Package/uboot/install/template
  70. define Package/uboot-socfpga-$(1)/install
  71. $(call Package/uboot/install/default,$(2))
  72. endef
  73. endef
  74. $(foreach u,$(UBOOTS), \
  75. $(eval $(call Package/uboot/install/template,$(u),$(u))) \
  76. )
  77. $(foreach u,$(UBOOTS), \
  78. $(eval $(call BuildUBootPackage,$(u))) \
  79. $(eval $(call BuildPackage,uboot-socfpga-$(u))) \
  80. )