fb515a4b28
Extend the linux-tools package to also build the userspace USB tools, which currently include testusb and ffs-test. These tools are in the kernel tree since a long time, and althogh a Makefile had been present since kernel 2.6.39, it has been entirely rewritten (with an install rule) back with kernel 5.9, to allow building the same way as other tools provided with the kernel. We make use of the Makefile install rule, thus version >= 5.9 is required. Support for older kernels may be added later if needed, and is left as an exercise for the motivated party. Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Reviewed-by: Herve Codina <herve.codina@bootlin.com> [yann.morin.1998@free.fr: fix history of Makefile] Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
35 lines
1014 B
Makefile
35 lines
1014 B
Makefile
################################################################################
|
|
#
|
|
# usbtools
|
|
#
|
|
################################################################################
|
|
|
|
LINUX_TOOLS += usbtools
|
|
|
|
USBTOOLS_MAKE_OPTS = $(LINUX_MAKE_FLAGS) LDFLAGS="$(TARGET_LDFLAGS)"
|
|
|
|
LINUX_TOOLS_USBTOOLS_LIST = \
|
|
$(if $(BR2_PACKAGE_LINUX_TOOLS_USBTOOLS_TESTUSB),testusb) \
|
|
$(if $(BR2_PACKAGE_LINUX_TOOLS_USBTOOLS_FFSTEST),ffs-test)
|
|
|
|
define USBTOOLS_BUILD_CMDS
|
|
$(Q)if ! grep install $(LINUX_DIR)/tools/usb/Makefile >/dev/null 2>&1 ; then \
|
|
echo "Your kernel version is too old to build the USB tools." ; \
|
|
echo "At least kernel 5.9 must be used." ; \
|
|
exit 1 ; \
|
|
fi
|
|
|
|
$(TARGET_MAKE_ENV) $(MAKE) -C $(LINUX_DIR)/tools/usb \
|
|
ALL_TARGETS="$(LINUX_TOOLS_USBTOOLS_LIST)" \
|
|
$(USBTOOLS_MAKE_OPTS) \
|
|
all
|
|
endef
|
|
|
|
define USBTOOLS_INSTALL_TARGET_CMDS
|
|
$(TARGET_MAKE_ENV) $(MAKE) -C $(LINUX_DIR)/tools/usb \
|
|
ALL_TARGETS="$(LINUX_TOOLS_USBTOOLS_LIST)" \
|
|
$(USBTOOLS_MAKE_OPTS) \
|
|
DESTDIR=$(TARGET_DIR) \
|
|
install
|
|
endef
|