Makefile 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. #
  2. # Copyright (C) 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.01
  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:=7f08dc9e98a71652bd6968888ed6ec95
  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/mx23_olinuxino
  26. TITLE:=U-Boot 2015.01 for the Olinuxino i.MX233
  27. endef
  28. define uboot/duckbill
  29. TITLE:=U-Boot 2015.01 for the I2SE Duckbill
  30. endef
  31. UBOOTS := \
  32. mx23_olinuxino \
  33. duckbill
  34. define Package/uboot/template
  35. define Package/uboot-mxs-$(1)
  36. SECTION:=boot
  37. CATEGORY:=Boot Loaders
  38. DEPENDS:=@TARGET_mxs
  39. TITLE:=$(2)
  40. URL:=http://www.denx.de/wiki/U-Boot
  41. VARIANT:=$(1)
  42. MAINTAINER:=Zoltan HERPAI <wigyori@uid0.hu>
  43. endef
  44. endef
  45. define BuildUBootPackage
  46. $(eval $(uboot/Default))
  47. $(eval $(uboot/$(1)))
  48. $(call Package/uboot/template,$(1),$(TITLE))
  49. endef
  50. ifdef BUILD_VARIANT
  51. $(eval $(call uboot/$(BUILD_VARIANT)))
  52. UBOOT_CONFIG:=$(if $(CONFIG),$(CONFIG),$(BUILD_VARIANT))
  53. UBOOT_IMAGE:=$(if $(IMAGE),$(IMAGE),openwrt-$(BOARD)-$(BUILD_VARIANT)-u-boot.bin)
  54. endif
  55. define Build/Configure
  56. $(MAKE) -C $(PKG_BUILD_DIR) \
  57. $(UBOOT_CONFIG)_config
  58. endef
  59. define Build/Compile
  60. $(MAKE) -C $(PKG_BUILD_DIR) \
  61. CROSS_COMPILE=$(TARGET_CROSS) u-boot.sb
  62. endef
  63. define Package/uboot/install/default
  64. $(INSTALL_DIR) $(BIN_DIR)/uboot-$(BOARD)-$(1)
  65. dd if=$(PKG_BUILD_DIR)/u-boot.sb of=$(BIN_DIR)/uboot-$(BOARD)-$(1).sb bs=512 seek=4
  66. endef
  67. define Package/uboot/install/template
  68. define Package/uboot-mxs-$(1)/install
  69. $(call Package/uboot/install/default,$(2))
  70. endef
  71. endef
  72. $(foreach u,$(UBOOTS), \
  73. $(eval $(call Package/uboot/install/template,$(u),$(u))) \
  74. )
  75. $(foreach u,$(UBOOTS), \
  76. $(eval $(call BuildUBootPackage,$(u))) \
  77. $(eval $(call BuildPackage,uboot-mxs-$(u))) \
  78. )