Makefile 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. #
  2. # Copyright (C) 2016 Jiang Yutang <jiangyutang1978@gmail.com>
  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)/image.mk
  9. PKG_NAME:=uboot-layerscape
  10. PKG_VERSION:=v1.0
  11. PKG_RELEASE:=1
  12. PKG_SOURCE_PROTO:=git
  13. PKG_MIRROR_HASH:=6aba7cb32d655dacb49bd188706bf1284159ae9b1fa69056df634b90070c3768
  14. PKG_SOURCE_URL:=https://github.com/fsl-jyt/u-boot.git
  15. PKG_SOURCE_VERSION:=aefcbf4c2bb36e1f0ead61181e5fe1119b5683ad
  16. PKG_BUILD_DIR=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
  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/ls1043ardb
  26. TITLE:=U-Boot $(PKG_NAME)-$(PKG_VERSION) for NXP ls1043ardb 64b Dev Board
  27. CONFIG=ls1043ardb
  28. endef
  29. define uboot/ls1046ardb
  30. TITLE:=U-Boot $(PKG_NAME)-$(PKG_VERSION) for NXP ls1046ardb 64b Dev Board
  31. CONFIG=ls1046ardb_qspi
  32. endef
  33. define uboot/ls1012ardb
  34. TITLE:=U-Boot $(PKG_NAME)-$(PKG_VERSION) for NXP ls1012ardb 64b Dev Board
  35. CONFIG=ls1012ardb_qspi
  36. IMAGE=u-boot-swap.bin
  37. endef
  38. UBOOTS := \
  39. ls1043ardb \
  40. ls1046ardb \
  41. ls1012ardb
  42. define Package/uboot/template
  43. define Package/uboot-layerscape-64b-$(1)
  44. SECTION:=boot
  45. CATEGORY:=Boot Loaders
  46. DEPENDS:= @TARGET_layerscape_64b
  47. TITLE:=$(2)
  48. URL:=http://git.freescale.com/git/cgit.cgi/ppc/sdk/u-boot.git/snapshot
  49. VARIANT:=$(1)
  50. MAINTAINER:=Jiang Yutang <jiangyutang1978@gmail.com>
  51. endef
  52. endef
  53. define BuildUBootPackage
  54. $(eval $(uboot/Default))
  55. $(eval $(uboot/$(1)))
  56. $(call Package/uboot/template,$(1),$(TITLE))
  57. endef
  58. ifdef BUILD_VARIANT
  59. $(eval $(call uboot/$(BUILD_VARIANT)))
  60. UBOOT_CONFIG:=$(if $(CONFIG),$(CONFIG),$(BUILD_VARIANT))
  61. UBOOT_IMAGE:=$(if $(IMAGE),$(IMAGE),u-boot-dtb.bin)
  62. endif
  63. define Build/Configure
  64. +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
  65. $(UBOOT_CONFIG)_config
  66. endef
  67. define Build/Compile
  68. +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
  69. CROSS_COMPILE=$(TARGET_CROSS) DTC=$(LINUX_DIR)/scripts/dtc/dtc
  70. endef
  71. define Package/uboot/install/default
  72. $(CP) $(PKG_BUILD_DIR)/$(UBOOT_IMAGE) $(KDIR)/$(1)-64b-uboot.bin
  73. endef
  74. define Package/uboot/install/template
  75. define Package/uboot-layerscape-64b-$(1)/install
  76. $(call Package/uboot/install/default,$(2))
  77. endef
  78. endef
  79. $(foreach u,$(UBOOTS), \
  80. $(eval $(call Package/uboot/install/template,$(u),$(u))) \
  81. )
  82. $(foreach u,$(UBOOTS), \
  83. $(eval $(call BuildUBootPackage,$(u))) \
  84. $(eval $(call BuildPackage,uboot-layerscape-64b-$(u))) \
  85. )