Makefile 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. #
  2. # Copyright (C) 2016 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:=2016.03
  11. PKG_RELEASE:=1
  12. PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
  13. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
  14. PKG_SOURCE_URL:=\
  15. http://mirror2.openwrt.org/sources \
  16. ftp://ftp.denx.de/pub/u-boot
  17. PKG_HASH:=e49337262ecac44dbdeac140f2c6ebd1eba345e0162b0464172e7f05583ed7bb
  18. PKG_LICENSE:=GPL-2.0 GPL-2.0+
  19. PKG_LICENSE_FILES:=Licenses/README
  20. PKG_BUILD_PARALLEL:=1
  21. include $(INCLUDE_DIR)/package.mk
  22. define uboot/Default
  23. TITLE:=
  24. endef
  25. define uboot/clearfog
  26. TITLE:=U-Boot for SolidRun ClearFog A1
  27. DEVICE:=armada-388-clearfog
  28. endef
  29. UBOOTS:= \
  30. clearfog
  31. define Package/uboot/template
  32. define Package/uboot-mvebu-$(1)
  33. SECTION:=boot
  34. CATEGORY:=Boot Loaders
  35. DEPENDS:=@(TARGET_DEVICE_mvebu_DEVICE_$(3)||TARGET_mvebu_DEVICE_$(3)||TARGET_mvebu_Default)
  36. DEFAULT:=m
  37. HIDDEN:=1
  38. TITLE:=$(2)
  39. URL:=http://www.denx.de/wiki/U-Boot
  40. VARIANT:=$(1)
  41. MAINTAINER:=Felix Fietkau <nbd@nbd.name>
  42. endef
  43. endef
  44. define BuildUBootPackage
  45. $(eval $(uboot/Default))
  46. $(eval $(uboot/$(1)))
  47. $(call Package/uboot/template,$(1),$(TITLE),$(DEVICE))
  48. endef
  49. define Build/Configure
  50. +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
  51. $(BUILD_VARIANT)_config
  52. endef
  53. define Build/Compile
  54. +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
  55. CROSS_COMPILE=$(TARGET_CROSS) \
  56. DTC_DIR=$(LINUX_DIR)/scripts/dtc/
  57. endef
  58. define Package/uboot/install/default
  59. $(INSTALL_DIR) $(BIN_DIR)/uboot-$(BOARD)-$(1)
  60. $(CP) $(PKG_BUILD_DIR)/u-boot-spl.kwb \
  61. $(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-u-boot-spl.kwb
  62. $(INSTALL_DIR) $(KERNEL_BUILD_DIR)/
  63. $(CP) $(PKG_BUILD_DIR)/u-boot-spl.kwb \
  64. $(KERNEL_BUILD_DIR)/openwrt-$(BOARD)-$(1)-u-boot-spl.kwb
  65. $(INSTALL_DIR) $(BIN_DIR)/u-boot-kwboot/
  66. $(CP) $(PKG_BUILD_DIR)/tools/kwboot \
  67. $(BIN_DIR)/u-boot-kwboot/
  68. endef
  69. define Package/uboot/install/template
  70. define Package/uboot-mvebu-$(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-mvebu-$(u))) \
  80. )