Makefile 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. # SPDX-License-Identifier: GPL-2.0
  2. #
  3. # Copyright (C) 2016-2019 Yousong Zhou <[email protected]>
  4. include $(TOPDIR)/rules.mk
  5. PKG_NAME:=dtc
  6. PKG_VERSION:=1.7.1
  7. PKG_RELEASE:=1
  8. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  9. PKG_HASH:=9532f10098455711a4da37816fd567dfc8523bb01f59ad6c44887a112e553d9e
  10. PKG_SOURCE_URL:=@KERNEL/software/utils/dtc
  11. PKG_MAINTAINER:=Yousong Zhou <[email protected]>
  12. PKG_LICENSE:=GPL-2.0-only
  13. PKG_LICENSE_FILES:=GPL
  14. PKG_CPE_ID:=cpe:/a:dtc_project:dtc
  15. PKG_INSTALL:=1
  16. include $(INCLUDE_DIR)/package.mk
  17. include $(INCLUDE_DIR)/meson.mk
  18. define Package/dtc
  19. SECTION:=utils
  20. CATEGORY:=Utilities
  21. TITLE:=Device Tree Compiler
  22. URL:=https://git.kernel.org/pub/scm/utils/dtc/dtc.git
  23. endef
  24. define Package/dtc/description
  25. Device Tree Compiler for Flat Device Trees Device Tree Compiler, dtc, takes
  26. as input a device-tree in a given format and outputs a device-tree in another
  27. format for booting kernels on embedded systems.
  28. endef
  29. define Package/dtc/config
  30. config DTC_STATIC_BUILD
  31. depends on PACKAGE_dtc
  32. bool "Build dtc as static binary"
  33. default n
  34. help
  35. Builds dtc as a static binary.
  36. This is usefull in order to export live DTS from a device running
  37. various vendor modified OpenWrt versions.
  38. endef
  39. define Package/dtc/install
  40. $(INSTALL_DIR) $(1)/usr/bin
  41. $(CP) $(PKG_INSTALL_DIR)/usr/bin/dtc $(1)/usr/bin
  42. endef
  43. # See Documentation/manual.txt for details about each utility
  44. define Package/fdt-utils
  45. SECTION:=utils
  46. CATEGORY:=Utilities
  47. TITLE:=Flat Device Tree Utilities
  48. URL:=https://git.kernel.org/pub/scm/utils/dtc/dtc.git
  49. DEPENDS:=+libfdt
  50. endef
  51. define Package/fdt-utils/install
  52. $(INSTALL_DIR) $(1)/usr/bin
  53. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/convert-dtsv0 $(1)/usr/bin
  54. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/fdtdump $(1)/usr/bin
  55. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/fdtget $(1)/usr/bin
  56. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/fdtput $(1)/usr/bin
  57. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/fdtoverlay $(1)/usr/bin
  58. endef
  59. define Package/libfdt
  60. SECTION:=libs
  61. CATEGORY:=Libraries
  62. TITLE:=a utility library for reading and manipulating dtb files
  63. URL:=https://git.kernel.org/pub/scm/utils/dtc/dtc.git
  64. endef
  65. define Package/libfdt/description
  66. This is a library containing functions for manipulating Flat Device Trees.
  67. endef
  68. define Package/libfdt/install
  69. $(INSTALL_DIR) $(1)/usr/lib
  70. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libfdt*.so* $(1)/usr/lib
  71. endef
  72. MESON_ARGS += \
  73. -Dtests=false \
  74. -Dtools=true \
  75. -Dyaml=disabled \
  76. -Dvalgrind=disabled \
  77. -Dpython=disabled \
  78. -Dstatic-build=$(if $(CONFIG_DTC_STATIC_BUILD),true,false)
  79. define Build/InstallDev
  80. $(INSTALL_DIR) $(1)/usr/lib
  81. $(INSTALL_DIR) $(1)/usr/include
  82. $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include
  83. $(CP) $(PKG_INSTALL_DIR)/usr/lib/* $(1)/usr/lib
  84. endef
  85. $(eval $(call BuildPackage,dtc))
  86. $(eval $(call BuildPackage,fdt-utils))
  87. $(eval $(call BuildPackage,libfdt))