Makefile 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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_MD5SUM:=973c1d896be751321cc3aafa564f64b2
  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. endef
  28. UBOOTS:= \
  29. clearfog
  30. define Package/uboot/template
  31. define Package/uboot-mvebu-$(1)
  32. SECTION:=boot
  33. CATEGORY:=Boot Loaders
  34. DEPENDS:=@TARGET_mvebu
  35. TITLE:=$(2)
  36. URL:=http://www.denx.de/wiki/U-Boot
  37. VARIANT:=$(1)
  38. MAINTAINER:=Luka Perkov <luka@openwrt.org>
  39. endef
  40. endef
  41. define BuildUBootPackage
  42. $(eval $(uboot/Default))
  43. $(eval $(uboot/$(1)))
  44. $(call Package/uboot/template,$(1),$(TITLE))
  45. endef
  46. define Build/Configure
  47. +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
  48. $(BUILD_VARIANT)_config
  49. endef
  50. define Build/Compile
  51. +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
  52. CROSS_COMPILE=$(TARGET_CROSS) \
  53. DTC_DIR=$(LINUX_DIR)/scripts/dtc/
  54. endef
  55. define Package/uboot/install/default
  56. $(INSTALL_DIR) $(BIN_DIR)/uboot-$(BOARD)-$(1)
  57. $(CP) $(PKG_BUILD_DIR)/u-boot-spl.kwb \
  58. $(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-u-boot-spl.kwb
  59. $(INSTALL_DIR) $(BIN_DIR)/u-boot-kwboot/
  60. $(CP) $(PKG_BUILD_DIR)/tools/kwboot \
  61. $(BIN_DIR)/u-boot-kwboot/
  62. endef
  63. define Package/uboot/install/template
  64. define Package/uboot-mvebu-$(1)/install
  65. $(call Package/uboot/install/default,$(2))
  66. endef
  67. endef
  68. $(foreach u,$(UBOOTS), \
  69. $(eval $(call Package/uboot/install/template,$(u),$(u))) \
  70. )
  71. $(foreach u,$(UBOOTS), \
  72. $(eval $(call BuildUBootPackage,$(u))) \
  73. $(eval $(call BuildPackage,uboot-mvebu-$(u))) \
  74. )