Makefile 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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-32bit
  10. PKG_VERSION:=v1.0
  11. PKG_RELEASE:=1
  12. PKG_SOURCE_PROTO:=git
  13. PKG_MIRROR_HASH:=b62f4a55882ffb6b57da24ad9eaa98237141941d273e06a2244220a3e6b82ce7
  14. PKG_SOURCE_URL:=https://github.com/fsl-jyt/uboot-ls-32b.git
  15. PKG_SOURCE_VERSION:=763de09cc7265e3147e2df2e15f91c73231907f4
  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. endef
  24. define uboot/ls1043ardb
  25. TITLE:=U-Boot binary $(PKG_NAME)-$(PKG_VERSION) for NXP ls1043ardb 32b Dev Board
  26. CONFIG=ls1043ardb-uboot.bin
  27. endef
  28. define uboot/ls1046ardb
  29. TITLE:=U-Boot binary $(PKG_NAME)-$(PKG_VERSION) for NXP ls1046ardb 32b Dev Board
  30. CONFIG=ls1046ardb-uboot.bin
  31. endef
  32. define uboot/ls1012ardb
  33. TITLE:=U-Boot binary $(PKG_NAME)-$(PKG_VERSION) for NXP ls1012ardb 32b Dev Board
  34. CONFIG=ls1012ardb-uboot.bin.swap
  35. endef
  36. UBOOTS := \
  37. ls1043ardb \
  38. ls1046ardb \
  39. ls1012ardb
  40. define Package/uboot/template
  41. define Package/uboot-layerscape-32b-$(1)
  42. SECTION:=boot
  43. CATEGORY:=Boot Loaders
  44. DEPENDS:= @TARGET_layerscape_32b
  45. TITLE:=$(2)
  46. URL:=https://github.com/fsl-jyt/uboot-ls-32b.git
  47. VARIANT:=$(1)
  48. MAINTAINER:=Jiang Yutang <jiangyutang1978@gmail.com>
  49. endef
  50. endef
  51. define BuildUBootPackage
  52. $(eval $(uboot/Default))
  53. $(eval $(uboot/$(1)))
  54. $(call Package/uboot/template,$(1),$(TITLE))
  55. endef
  56. ifdef BUILD_VARIANT
  57. $(eval $(call uboot/$(BUILD_VARIANT)))
  58. UBOOT_CONFIG:=$(if $(CONFIG),$(CONFIG),$(BUILD_VARIANT))
  59. endif
  60. define Build/Configure
  61. endef
  62. define Build/Compile
  63. endef
  64. define Package/uboot/install/default
  65. $(CP) $(PKG_BUILD_DIR)/$(UBOOT_CONFIG) $(KDIR)/$(1)-32b-uboot.bin
  66. endef
  67. define Package/uboot/install/template
  68. define Package/uboot-layerscape-32b-$(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-layerscape-32b-$(u))) \
  78. )