2e20c29cc641ca6a778f8261be8861508d8d62cf
[openwrt/openwrt.git] / package / utils / dtc / Makefile
1 # SPDX-License-Identifier: GPL-2.0
2 #
3 # Copyright (C) 2016-2019 Yousong Zhou <yszhou4tech@gmail.com>
4
5 include $(TOPDIR)/rules.mk
6
7 PKG_NAME:=dtc
8 PKG_VERSION:=1.7.0
9 PKG_RELEASE:=1
10
11 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
12 PKG_HASH:=29edce3d302a15563d8663198bbc398c5a0554765c83830d0d4c0409d21a16c4
13 PKG_SOURCE_URL:=@KERNEL/software/utils/dtc
14
15 PKG_MAINTAINER:=Yousong Zhou <yszhou4tech@gmail.com>
16 PKG_LICENSE:=GPL-2.0-only
17 PKG_LICENSE_FILES:=GPL
18
19 PKG_INSTALL:=1
20
21 include $(INCLUDE_DIR)/package.mk
22 include $(INCLUDE_DIR)/meson.mk
23
24 define Package/dtc
25 SECTION:=utils
26 CATEGORY:=Utilities
27 TITLE:=Device Tree Compiler
28 URL:=https://git.kernel.org/pub/scm/utils/dtc/dtc.git
29 endef
30
31 define Package/dtc/description
32 Device Tree Compiler for Flat Device Trees Device Tree Compiler, dtc, takes
33 as input a device-tree in a given format and outputs a device-tree in another
34 format for booting kernels on embedded systems.
35 endef
36
37 define Package/dtc/install
38 $(INSTALL_DIR) $(1)/usr/bin
39 $(CP) $(PKG_INSTALL_DIR)/usr/bin/dtc $(1)/usr/bin
40 endef
41
42
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
52 define Package/fdt-utils/install
53 $(INSTALL_DIR) $(1)/usr/bin
54 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/convert-dtsv0 $(1)/usr/bin
55 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/fdtdump $(1)/usr/bin
56 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/fdtget $(1)/usr/bin
57 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/fdtput $(1)/usr/bin
58 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/fdtoverlay $(1)/usr/bin
59 endef
60
61
62 define Package/libfdt
63 SECTION:=libs
64 CATEGORY:=Libraries
65 TITLE:=a utility library for reading and manipulating dtb files
66 URL:=https://git.kernel.org/pub/scm/utils/dtc/dtc.git
67 endef
68
69 define Package/libfdt/description
70 This is a library containing functions for manipulating Flat Device Trees.
71 endef
72
73 define Package/libfdt/install
74 $(INSTALL_DIR) $(1)/usr/lib
75 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libfdt*.so* $(1)/usr/lib
76 endef
77
78 MESON_ARGS += \
79 -Dtools=true \
80 -Dyaml=disabled \
81 -Dvalgrind=disabled \
82 -Dpython=disabled
83
84 define Build/InstallDev
85 $(INSTALL_DIR) $(1)/usr/lib
86 $(INSTALL_DIR) $(1)/usr/include
87 $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include
88 $(CP) $(PKG_INSTALL_DIR)/usr/lib/* $(1)/usr/lib
89 endef
90
91 $(eval $(call BuildPackage,dtc))
92 $(eval $(call BuildPackage,fdt-utils))
93 $(eval $(call BuildPackage,libfdt))